<?php 
include '../Admin_config/connection.php';
include '../Admin_controllers/receipt.php';

if (isset($_POST['submit_rc'])) {
 //print_r($_POST);
	$rc_no = $_POST['rc_no'];
	$date = $_POST['rc_date'];
	$rc_type = $_POST['type'];
	$br_from = 'Mumbai';
	$br_to = $_POST['br_to'];
	$from = $_POST['rc_from'];
	$to = $_POST['rc_to'];
	$mob = $_POST['mob_no'];
	$gst = $_POST['gst'];
	$cour_total = $_POST['cour_charg'];
	$rc_total = $_POST['g_tot'];
	$particulars = $_POST['particulars'];
	$remarks = $_POST['remarks'];
	$kg = $_POST['kg'];
	$parcel_no = $_POST['no_par'];
	$mode = 'toPay';
	$cc_status = 'ToPay';
		$to_mobile = $_POST['to_mobile'];



	if ($rc_type == 'gst') {
		$gst_total = $_POST['gst_charge'];
		if ($mode == 'paid') {
			$vvp_status = '0';
			$status = 'done';	
 			$receipt_add = RECEIPT_ADD($rc_no,$rc_type,$br_from,$br_to,$date,$from,$to,$mob,$gst,$particulars,$kg,$parcel_no,$vvp_status,$cour_total,$gst_total,$rc_total,$remarks,$status,$cc_status,$to_mobile);
		}
		else if ($mode == 'toPay') {

			$vvp_status = $_POST['vvp_amount'];
			$vpp_charges = $_POST['vpp_charge'];
			$status = 'pending';
			$receipt_add = RECEIPT_ADD($rc_no,$rc_type,$br_from,$br_to,$date,$from,$to,$mob,$gst,$particulars,$kg,$parcel_no,$vvp_status,$cour_total,$gst_total,$rc_total,$remarks,$status,$cc_status,$vpp_charges,$to_mobile);
		}
	}
	/*else if($rc_type == 'nogst')
	{
		$gst_total = '--';
		if ($mode == 'paid') {
			$vvp_status = '0';
			$receipt_add = RECEIPT_ADD($rc_no,$rc_type,$br_from,$br_to,$date,$from,$to,$mob,$gst,$particulars,$kg,$parcel_no,$vvp_status,$cour_total,$gst_total,$rc_total,$remarks);
		}
		else if ($mode == 'toPay') {
			$vvp_status = $_POST['vvp_amount'];
			$receipt_add = RECEIPT_ADD($rc_no,$rc_type,$br_from,$br_to,$date,$from,$to,$mob,$gst,$particulars,$kg,$parcel_no,$vvp_status,$cour_total,$gst_total,$rc_total,$remarks);
		}
	}*/
	
	
}


?>