Thank you for visiting-->
Your current cart is empty!
click here to see our products and services
";
}else{
print '
| Id |
Picture |
Item Name |
Price |
|
';
$sql = "SELECT * FROM cart_record WHERE user_id='$_SESSION[user_id]' AND cart_status1 = '' ORDER BY id DESC";
$result = mysqli_query($conn, $sql) or die(mysqli_error($conn));
//loop through the query result and print
$item_value_total = 0;
while($info = mysqli_fetch_array($result)){
$id=$info['id'];
$product_id=$info['product_id'];
$cart_id=$info['cart_id'];
$date_time =$info['date_time'];
$cart_status1 =$info['cart_status1'];
$query2 = "SELECT * FROM product_service WHERE id='$product_id'";
$result2 = mysqli_query($conn, $query2) or die(mysqli_error($conn));
$info2 = mysqli_fetch_array($result2);
$prd_id=$info2['id'];
$item_value=$info2['item_value'];
$item_category=$info2['item_category'];
$item_name=$info2['item_name'];
$item_detail=$info2['item_detail'];
$photo1 =$info2['photo1'];
$what_for=$info2['what_for'];
//$item_value1=(int)$item_value;
$num_format = number_format($item_value);
$item_value_format="N $num_format";
if($photo1 != ""){
$show_img = "
";
}else{
$show_img ="
";
}
print "
| $prd_id |
$show_img |
$item_name |
$item_value_format |
Remove |
";
$item_value_total = $item_value_total+$item_value;
$msg .= "($prd_id) $item_name N$item_value;";
}
$item_value_total_fomat = number_format($item_value_total);
$msg .= "[OrderId:$cart_id]_Total:N$item_value_total";
print "
|
|
Total |
N $item_value_total_fomat |
|
";
//$msg="GoflexRML - I am contacting you regarding: $item_name ($item_id)";
$msg = urlencode($msg);
$whatapp_link = 'Check Out';
print "
Total cost of your order is N $item_value_total_fomat pay to the account below and click the green checkout button to complete this transaction.
Account number: 2001040619
Account name: Goflex Route Masters Limited
Bank: FCMB Bank
$whatapp_link
";
}
?>
Your Transactions Record
';
if(isset($_REQUEST['edit_id'])){ //view detail
$edit_id = mysqli_escape_string($conn, $_REQUEST['edit_id']);
print '
|
Id |
Item Name |
Price |
';
$sql = "SELECT * FROM cart_record WHERE cart_id ='$edit_id' ORDER BY id DESC";
$result = mysqli_query($conn, $sql) or die(mysqli_error($conn));
//loop through the query result and print
$item_value_total = 0;
$counter=1;
while($info = mysqli_fetch_array($result)){
$id=$info['id'];
$product_id=$info['product_id'];
$cart_id=$info['cart_id'];
$date_time =$info['date_time'];
$cart_status1 =$info['cart_status1'];
$query2 = "SELECT * FROM product_service WHERE id='$product_id'";
$result2 = mysqli_query($conn, $query2) or die(mysqli_error($conn));
$info2 = mysqli_fetch_array($result2);
$prd_id=$info2['id'];
$item_value=$info2['item_value'];
$item_category=$info2['item_category'];
$item_name=$info2['item_name'];
$item_detail=$info2['item_detail'];
$photo1 =$info2['photo1'];
$what_for=$info2['what_for'];
//$item_value1=(int)$item_value;
$num_format = number_format($item_value);
$item_value_format="N $num_format";
print "
| $counter |
$prd_id |
$item_name |
$item_value_format |
";
$item_value_total = $item_value_total+$item_value;
$msg .= "($prd_id) $item_name N$item_value;";
$counter++;
}
$item_value_total_fomat = number_format($item_value_total);
$msg .= "[OrderId:$cart_id]_Total:N$item_value_total";
print "
|
|
Total |
N $item_value_total_fomat |
";
//$msg="GoflexRML - I am contacting you regarding: $item_name ($item_id)";
$msg = urlencode($msg);
$whatapp_link = 'Check Out';
print "
";
}
$query = "SELECT * FROM cart_record WHERE user_id='$_SESSION[user_id]' AND cart_status1 <> '' ORDER BY cart_id ASC";
$result = mysqli_query($conn, $query) or die(mysqli_error($conn));
if (mysqli_num_rows($result) > 0) {
print '
| Order Id |
Date |
Transaction Status |
Customer |
Detail |
';
//loop through the query result and print
$cart_id_last=0;
$count=1;
while($info = mysqli_fetch_array($result)){
$cart_id=$info['cart_id'];
$user_id=$info['user_id'];
$date_time=$info['date_time'];
$product_id=$info['product_id'];
$cart_status1=$info['cart_status1'];
$count++;
if($cart_id > $cart_id_last){
$cart_id_last=$cart_id;
$query3 = "SELECT * FROM user_register WHERE id='$user_id'";
$result3 = mysqli_query($conn, $query3) or die(mysqli_error($conn));
$info3 = mysqli_fetch_array($result3);
$fname=$info3['fname'];
$oname=$info3['oname'];
print "
| $cart_id |
$date_time |
$cart_status1 |
$fname $oname |
Detail |
";
$rec="";
}
}
print "
";
}
?>