<th width="12%">Device No.</th> <th width="13%">Start Time</th> <th width="12%">End Time</th> <th width="50%" >Destination</th> <th width="9%">Duration</th> </tr> <?php $sdate = $_POST[from_date]; //$edate = $_POST[to_date]; //$z = GetDays($sdate, $edate); $timediff1 = array(); $totalDistance = 0; $tripdata = "VehicleNo,Date,Start Time,End Time,Destination,Duration"; $tripdata .= "@"; $ct = 0; $timediff1 = getTripReport($sdate, $_POST[map_device_id]); if (count($timediff1) > 0) { for ($r = 0; $r < count($timediff1); $r++) { $tTdiff = explode("#", $timediff1[$r]); $tripdata .= $tTdiff[6] . ',' . $sdate . ',' . date("h:i:s A", strtotime($tTdiff[0])) . ',' . date("h:i:s A", strtotime($tTdiff[1])) . ',' . $tTdiff[3] . ',' . $tTdiff[2]; $tripdata .= "@"; ?> <tr <?php if ($r % 2 == 0) { echo 'class="odd_row"'; } else { echo 'class="even_row"'; } ?> >
$ct = 0; if ($_POST[from_date] == $_POST[to_date]) { $timediff4 = getTripReport($sdate, $srcData[0], $srcData[1], $strtTime, $endTime, 0); } else { $z = GetDays($sdate, $edate); for ($y = 0; $y < count($z); $y++) { if ($y == 0) { $timediff1 = getTripReport($z[$y], $srcData[0], $srcData[1], $strtTime, 1439, 1); } elseif ($y == count($z) - 1) { $strtTime1 = 0; $endTime1 = $endTime; $timediff3 = getTripReport($z[$y], $srcData[0], $srcData[1], 0, $endTime, 0); } elseif ($y < count($z) - 1) { $strtTime1 = 0; $endTime1 = 1439; $timediff2 = getTripReport($z[$y], $srcData[0], $srcData[1], 0, 1439, 1); } } $timediff4 = array_merge($timediff1, $timediff2, $timediff3); } if (count($timediff4) > 0) { for ($r = 0; $r < count($timediff4); $r++) { $tTdiff = explode("#", $timediff4[$r]); $tripdata .= $tTdiff[8] . "," . $tTdiff[0] . "," . date("h:i:s A", strtotime($tTdiff[1])) . "," . $tTdiff[2] . "," . date("h:i:s A", strtotime($tTdiff[3])) . "," . $tTdiff[4] . "," . $tTdiff[6] . "," . $tTdiff[5]; $tripdata .= "@"; ?> <tr <?php if ($r % 2 == 0) { echo 'class="odd_row"'; } else {