JezK
Edit File: trip_history.php
<?php session_start(); include("session_check.php"); include("menuheader.php"); include_once("school_admin_access_app.php"); $fun=new adminaccess(); $school_id=$_SESSION['child']['log_school_id']; //school_id $academic_id=$_SESSION['child']['choosen_academic_id'];// academic_year_id $user_id=$_SESSION['child']['auth_id']; $path='../mobapp_ver1api/uploads/'; $routes=$fun->school_students_routes($school_id,$academic_id); if($routes) { foreach($routes as $row) { if($_GET['rtid']==$row['route_id']) { $route_info .= "<option value='{$row['route_id']}' selected>{$row['route_name']}</option>"; } else { $route_info .="<option value='{$row['route_id']}' >{$row['route_name']}</option>"; } } } if($_GET['rtid']!='') { $results=$fun->get_routemaps_ofDriver($school_id,$academic_id,$_GET['rtid']); } ?> <style> .date { font-family:Arial,Helvetica, sans-serif; font-style:normal; font-size:12px; margin-left:-14px; margin-top:20px; } .time { font-family:Arial,Helvetica, sans-serif; font-style:normal; font-size:12px; margin-left:8px; margin-top:20px; } .name { font-family:Arial,Helvetica, sans-serif; font-style:normal; font-size:13px; margin-left:20px; margin-top:20px; } .img-circle { margin-top:20px; } .imgdrv { margin-left:-14px; height:390px; width:90%; } </style> <body style="overflow-x: hidden;"> <div class="row" style="margin-top: 30px;"> <div class="col-md-3 text-left" style="font:Arial, Helvetica, sans-serif;font-style:normal;font-size:24px;"> <img src="images/trip-history@2x.png" style="margin: 0px 0px 0px 21px;" />Trip History </div> </div> <div class="col-md-12" style="margin-top:20px;"> <div class="col-md-3 text-left"> <p style="font-family:Arial, Helvetica, sans-serif;font-style:normal;font-size:14px;font-weight:600;color:#666666; margin-left:-25px;" >Select Route</p> </div> <div class="col-md-2" style="margin-left:-130px; margin-top:-5px;"> <select class="form-control" id="Select Route" style="height:29px; width:327px;" onchange="changeRoute(this.value);"> <option value='0'>Select Route</option> <? echo $route_info;?> </select> <!-- if there is an error--> <div class="col-md-10" id="err_route" style="color:#990000;margin-left:-12px; display:none; width:200px;"></div> <!--- end error--> </div> </div> <div class="container"> <?php $even=0; if(!empty($results)) { foreach($results as $row) { if($row['map_img']=='') { $img="images/no_image.jpg"; $tm='<p class="time"></p>'; } else { $img=$path."".$row['map_img']; $tm='<p class="time">'.$row['start_time'].' to '.$row['end_time'].'</p>'; } if($even%2==0) {?> <div class="row"> <div class="col-md-6"> <div class="col-md-6"> <p class="date">Date :<?=date('d/m/Y',strtotime($row['Created_on']))?></p> </div> <div class="col-md-6"> <?=$tm;?> </div> <div class="col-md-12"> <img class="imgdrv" src="<?=$img?>" /> </div> <div class="col-md-12"> <img class="img-circle" src="<?if($row['staff_pic']!='') echo 'uploads/'.$row['staff_pic'];else echo 'images/person_hold.jpg';?>" style="width:100px;height:100px"> <span class="name"><?=$row['staff_name']?></span> </div> </div> <?}else{?> <div class="col-md-6"> <div class="col-md-6"> <p class="date">Date :<?=date('d/m/Y',strtotime($row['Created_on']))?></p> </div> <div class="col-md-6"> <?=$tm;?> </div> <div class="col-md-12"> <img class="imgdrv" src="<?=$img?>" /> </div> <div class="col-md-12"> <img class="img-circle" src="<?if($row['staff_pic']!='') echo 'uploads/'.$row['staff_pic'];else echo 'images/person_hold.jpg';?>" style="width:100px;height:100px"> <span class="name"><?=$row['staff_name']?></span> </div> </div> </div> <?php } $even++; } } else{ echo "<span style='margin-left:36%;padding-top:10%;'>No Data Found</span>"; } ?> </div> <script> function changeRoute(val) { $("#err_route").text(""); if(val==0) { $("#err_route").text("Please select Route"); $("#err_route").show(); } else { window.location.href="trip_history.php?rtid="+val; } } </script> </body> </html>