<?php
error_reporting(0);
@session_start();
include("config.php");

$cname=$_POST[cname];
$mobile=$_POST[mobile];
$mobile2=$_POST[mobile2];$vehicletyp=$_POST[vehicletyp]; $routefrom=$_POST[routefrom]; $routeto=$_POST[routeto];

$baddress=$_POST[baddress];
$bdate=$_POST[bdate];
$flag = $_REQUEST[flag];
$mode = $_REQUEST[mode];
$dobmonth = substr($bdate, 5);
$cardtyp=$_POST[cardtyp];
$fueltyp=$_POST[fueltyp];
//$branch = $_SESSION[branch];

$companyname=$_POST[companyname];
$owner=$_POST[owner];
$ownermobile=$_POST[ownermobile];
$urea=$_POST[urea];

$rdte = date("Y/m/d");

$monthdte = date("m-Y");
$branch=$_POST[branch];

$vnumber=$_POST[vnumber];
/***********************************/
$id= $_POST[id];

           $query_up=sprintf("UPDATE customer SET 
		   cardtyp ='$cardtyp',
		    vehicle_number='$vnumber',vehicletyp='$vehicletyp',
                      customer_name='$cname',
		           	     customer_mobile='%s',   mobile2='$mobile2', 
				            dob='%s',
							dob_month='$dobmonth',routefrom='$routefrom', routeto='$routeto',urea='$urea', branch='$branch',
							companyname='$companyname',owner='$owner',ownermobile='$ownermobile' 
							WHERE id='%d' ",$mobile,$bdate,$id);
		   if(!($resu=mysql_query($query_up))){echo $query_up.mysql_error(); exit;}
   
		
		 $query=sprintf("UPDATE customer_product_point SET 

		          mobile='%s'
				  WHERE cid='%d' ",$mobile,$id);
		   if(!($re=mysql_query($query))){echo $query.mysql_error(); exit;}
		
		
	
		header("Location:customers-list.php?flag=up");
		exit;
		
	

?>
