Record deleted"; } ?>
Record updated"; } if(isset($_REQUEST['detail_id'])){ $detail_id = mysqli_escape_string($conn, $_REQUEST['detail_id']); $query1 = "SELECT * FROM logistic_shipment WHERE id = '$detail_id'"; $result1 = mysqli_query($conn,$query1) or die(mysqli_error($conn)); $info1 = mysqli_fetch_array($result1); $id=$info1['id']; $customer_name=$info1['customer_name']; $customer_address=$info1['customer_address']; $customer_phone=$info1['customer_phone']; $customer_email=$info1['customer_email']; $item_name=$info1['item_name']; $item_detail=$info1['item_detail']; $date_entry=$info1['date_entry']; $source_address=$info1['source_address']; $destination_address=$info1['destination_address']; $cost=$info1['cost']; $other_detail=$info1['other_detail']; $date_delivered=$info1['date_delivered']; $received_detail=$info1['received_detail']; $status1=$info1['status1']; $status2=$info1['status2']; $track_id=$info1['track_id']; if($status1=='delivered'){ $status1_color="$status1"; }elseif($status1=='not delivered'){ $status1_color="$status1"; } if(isset($msg)){ print $msg; } print '
Logistic Record ['.$detail_id.']
Id: '.$id.'
Track number: '.$track_id.'
Customer name: '.$customer_name.'
Customer address: '.$customer_address.'
Customer phone: '.$customer_phone.'
Customer email: '.$customer_email.'
Items name: '.$item_name.'
Items detail: '.$item_detail.'
Entry date: '.$date_entry.'
Source address: '.$source_address.'
Destination address: '.$destination_address.'
Shipment cost: =N='.number_format($cost).'
Other detail: '.$other_detail.'
Status: '.$status1_color.'
Received detail: '.$received_detail.'
Date delivered: '.$date_delivered.'
Change status to:
Reciever details:
delivered date:
'; } ?>
".strtoupper($status_type).""; if($status_type=='delivered'){ print "

Total cost: =N=".number_format($cost_delivered)."

"; }elseif($status_type=='not delivered'){ print "

Total cost: =N=".number_format($cost_not_delivered)."

"; } ?>
Logistic Record [not delivered=] [delivered=]
Id Track Num. Customer name Customer phone Items name Entry date Source Destination Cost Status Detail Manage "; // print the random numbers while($info = mysqli_fetch_array($result)) { $id=$info['id']; $customer_name=$info['customer_name']; $customer_address=$info['customer_address']; $customer_phone=$info['customer_phone']; $customer_email=$info['customer_email']; $item_name=$info['item_name']; $item_detail=$info['item_detail']; $date_entry=$info['date_entry']; $source_address=$info['source_address']; $destination_address=$info['destination_address']; $cost=$info['cost']; $other_detail=$info['other_detail']; $date_delivered=$info['date_delivered']; $received_detail=$info['received_detail']; $status1=$info['status1']; $status2=$info['status2']; $track_id=$info['track_id']; if($status1=='delivered'){ $status1_color="$status1"; }elseif($status1=='not delivered'){ $status1_color="$status1"; } print " $id $track_id $customer_name $customer_phone $item_name $date_entry $source_address $destination_address =N=".number_format($cost)." $status1_color Detail Edit "; if($status1=='not delivered'){ print " | Delete"; } print " "; } //close up ther table print "

"; // how many rows we have in database $query = "SELECT COUNT(id) AS numrows FROM logistic_shipment WHERE status1 = '$status_type'"; $result = mysqli_query($conn,$query) or die(mysqli_error($conn)); $row = mysqli_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " $page "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " [Prev] "; $first = " [First Page] "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " [Next] "; $last = " [Last Page] "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation link echo $first . $prev . $nav . $next . $last; // and close the database connection // include '../conn/closedb.php'; ?>