<div class="qfltr-grp courses">
<?php if($releated_courses) {$cor=[]; if(isset($_GET['courseid'])){$cor = explode('|',$_GET['courseid']);}
$sorted_array=[];
for($k=0; $k<count($releated_courses); $k++) in_array($releated_courses[$k]->subject_id,$cor)?$sorted_array[$k]= $releated_courses[$k]:'';
for($k=0; $k<count($releated_courses); $k++) !in_array($releated_courses[$k]->subject_id,$cor)? $sorted_array[$k]= $releated_courses[$k]:'';
$sorted_array=array_filter($sorted_array);
foreach($sorted_array as $R){?>
<div class="checkbox"><label><input name="qfltr-courses[]" class="qfltr-fee" value="<?=$R->subject_id?>" type="checkbox" <?php echo in_array($R->subject_id,$cor)?"checked":'';?>><?=$R->name;?></label></div>
<?php }}else {?>
<h6 style="text-align:center">No results</h6>
<?php }?>
<?php if($releated_courses) {$cor=[]; if(isset($_GET['courseid'])){$cor = explode('|',$_GET['courseid']);}
$sorted_array=[];
for($k=0; $k<count($releated_courses); $k++) in_array($releated_courses[$k]->subject_id,$cor)?$sorted_array[$k]= $releated_courses[$k]:'';
for($k=0; $k<count($releated_courses); $k++) !in_array($releated_courses[$k]->subject_id,$cor)? $sorted_array[$k]= $releated_courses[$k]:'';
$sorted_array=array_filter($sorted_array);
foreach($sorted_array as $R){?>
<div class="checkbox"><label><input name="qfltr-courses[]" class="qfltr-fee" value="<?=$R->subject_id?>" type="checkbox" <?php echo in_array($R->subject_id,$cor)?"checked":'';?>><?=$R->name;?></label></div>
<?php }}else {?>
<h6 style="text-align:center">No results</h6>
<?php }?>
0 comments:
Post a Comment