$my_det = mysqli_fetch_assoc(mysqli_query($link,"SELECT * FROM `customers` where id='$c_id'"));
$plan_id = $my_det['plan_id'];
$plan_details = mysqli_fetch_assoc(mysqli_query($link,"select * from `plans` where id='$plan_id'"));
$plan_amount = $plan_details['plan_price'];
$plan_days = $plan_details['plan_days'];
?>
Days ₹ /-
$chk_due = mysqli_query($link,"select * from `payment_entry` where `c_id`=$c_id and status=0 order by id desc limit 1");
if(mysqli_num_rows($chk_due)){
$order_id = mysqli_fetch_assoc($chk_due)['order_id'];
?>
Pay Due
}
?>
Payment History
#
Refer ID
Amount
Date
Mode
Remarks
Status
Invoice
$all_payment_entry = mysqli_query($link,"select * from `payment_entry` where `c_id`=$c_id order by id desc");
$cnt = 1;
while($row_payment = mysqli_fetch_assoc($all_payment_entry)){
$row_order_id = $row_payment['order_id'];
$row_plan_amount = $row_payment['plan_amount'];
$row_entry_date = $row_payment['entry_date'];
$row_pay_mode = $row_payment['pay_mode'];
$row_remarks = $row_payment['remarks'];
$row_status = $row_payment['status'];
$newDate = date("d M Y", strtotime($row_entry_date));
$row_plan_gst_amount = $row_payment['plan_gst_amount'];
$row_pre_due = $row_payment['pre_due'];
$row_new_due = $row_payment['new_due'];
$row_discount = $row_payment['discount'];
$final_price = $row_plan_amount + $row_pre_due - $row_new_due - $row_discount;
if($row_status==1){
$invoice_id = mysqli_fetch_assoc(mysqli_query($link,"SELECT * FROM `invoice` where order_id='$row_order_id' and c_id='$c_id'"))['id'];
}
?>
Pending";}elseif($row_status==2){echo "In Process";}elseif($row_status==1){echo "Completed";}else{echo "Rejected";}?>