FIlter out an entry

Permalink
I've a form that currently displays check boxes from a range in an attribute on concrete5.6. What I need to do is to take that list, but now filter out one item. I want to filter out mpdID of 81. The code used on the page is:

<div class="clearfix">
                    <strong><?php  echo t('Choose Day')?></strong>
                    <?php
                    if($price_dates){
                        foreach($price_dates->dates as $break){
                            ?>
                                <div class="input">
                                <input type="checkbox" name="mdpID[]" value="<?=$break['mdpID']?>" <?php if($ticketID['mdpID'] == $break['mdpID']){echo 'checked';}?>/> <?=date('D M jS',strtotime($break['date']))?> - £<?=$break['price']?>
                                </div>
                            <?php
                        }
                    }
                    ?>
                </div>

 
hutman replied on at Permalink Best Answer Reply
hutman
You should be able to just do

<div class="clearfix">
   <strong><?php  echo t('Choose Day')?></strong>
   <?php
   if($price_dates){
      foreach($price_dates->dates as $break){
         if($break['mpID'] != 81){
         ?>
            <div class="input">
            <input type="checkbox" name="mdpID[]" value="<?=$break['mdpID']?>" <?php if($ticketID['mdpID'] == $break['mdpID']){echo 'checked';}?>/> <?=date('D M jS',strtotime($break['date']))?> - £<?=$break['price']?>
            </div>
         <?php
         }
      }
   }
   ?>
justynpride replied on at Permalink Reply
Hi

Absolutely spot on. Thank you.

Justyn

> On 2 Mar 2018, at 00:34, concrete5 Community <discussions@concretecms.com> wrote:
justynpride replied on at Permalink Reply
Do you think it would be possible for it to filter out that entry if the number of counts of that mdpID value (81) on a related table (atTickets) reached a certain number (ie 250)?
hutman replied on at Permalink Reply
hutman
Yes, I'm sure that would be possible but I would need to see the rest of the code around this functionality to help you write something to do it, there is not enough information in this post.
justynpride replied on at Permalink Reply
Will DM you.