<div class="col-md-3 aboutus-img">
                 <span class="filtertit">Filter</span>
                 
                 
                 <?                 
                 if($current == "")
                 {
                 ?>
                 <div class="subfiltercont">
                  <span class="subfiltertit">Design</span>
                   
           
                  <ul>
                      <?        
                        $catfilter = $this->session->userdata("catfilter");                      
                        foreach( $categories as $row)
                        {
                            $checked = "";                            
                            if($catfilter != ""){if(in_array($row->CategoryID, $catfilter))$checked = "checked='checked'";}
                            //else if($current == $row->slug) $checked = "checked='checked'";
                       ?>
                        <li>                             
                            <input type="checkbox" class="filterchoices" name="filchoices[]"  value="<?=$row->CategoryID?>" <?=$checked?> > <?=$row->CategoryName?>                            
                        </li>
                       <?
                       //<a href="<?=base_url()>categories/<$row->slug>"></a>
                        }
                       ?>                                            
                  </ul>      
                  
                      
                 </div>
                 <?}?>
                 
                 
                 <?
                 $checkedranges = $this->session->userdata("pricechoices");
                 ?>
                 
                 <div class="subfiltercont">
                  <span class="subfiltertit">Price <?if($checkedranges != "") echo "<input type='submit' name='clearprice' value='->Clear' >";?></span>
                  <ul>
                      <?                      
                      $pi=0;
                      $ptext = "";
                      $pvalues = "";                      
                      foreach($ranges as $priragnes)
                      {   
                          if($pi == 0)
                          {$ptext = "up to " . $priragnes["ranges"]["max"];}
                          else
                          {$ptext = $priragnes["ranges"]["min"] . " - " . $priragnes["ranges"]["max"];}
                          $pvalues = $priragnes["ranges"]["min"]."_".$priragnes["ranges"]["max"];
                           $checked = "";
                          if($checkedranges == $pvalues)
                              $checked = "checked='checked'";
                      ?>                                                                    
                        <li>                             
                            <input type="radio" class="filterchoices" name="filpricesranges[]"  value="<?=$pvalues?>" <?=$checked?> > <?=$ptext?>                           
                        </li>                        
                      <?
                      $pi++;
                      }
                      ?>                      
                  </ul>                      
                 </div>
                 
                 
                 
                 <?
                 if(isset($filteroptions))
                 {
                  $fieldlabel = "start";                       
                  $Allfill = $this->session->userdata("AllFilterChoicesValues");                 
                 foreach($filteroptions as $filchs)                     
                 {
                     $checked = "";
                     if($Allfill != "")
                     {
                      if(in_array($filchs->FieldID."_".$filchs->ChoiceID, $Allfill))
                        $checked = "checked='checked'";                      
                     }
                     
                     if($fieldlabel != $filchs->FieldLabel)
                     {                                 
                         if($fieldlabel != "start")
                         {
                             ?>
                                </ul>                      
                                </div>          
                              <?
                         }
                         $fieldlabel = $filchs->FieldLabel;
                        ?>
                        <div class="subfiltercont">
                            <span class="subfiltertit"><?=$filchs->FieldLabel ?> <?if(isset($Allfill["AllFilterChoices_".$filchs->FieldID])) echo "<input type='submit'  name='allclear_".$filchs->FieldID."' value='->Clear' >";?></span>
                         <ul>
                      <?                      
                     }                                          
                      ?>                                                                    
                        <li>                             
                            <input type="radio" class="filterchoices" name="AllFilterChoices_<?=$filchs->FieldID?>"  value="<?=$filchs->FieldID?>_<?=$filchs->ChoiceID?>" <?=$checked?> > <?=$filchs->Choice?>                           
                        </li>                        
                    <?
                     }
                    ?>
                    </ul>                      
                    </div>
                 <?}?>
                      
                                                                   

            </div>