Hi friends
Please help me it is out of my head, I am pussing date and other variables value through url. Some time date is entering correctly in date field and some time entering 000-00-00.
Please help me out.
<?php
include '../require.php';
$date=mysql_real_escape_string($_REQUEST['id']);
$app_id=$_REQUEST['app'];
$branch=$_REQUEST['branch'];
$ins=$_REQUEST['ins'];
$ins=$ins+1;
//echo $app_id;
//$rr="select * from 013client where client_id='$app_id'";
//echo $rr;
$er=mysql_query("select * from 013client where client_id='$app_id'");
$re=mysql_fetch_array($er);
$prd_type=$re['prod_type_id'];
$prd_id=$re['product_id'];
if($prd_type==1)
{
$total_amount=$re['monthly_mis'];
$recpt_no="MIP".rand(1000000000,9999999999);
}
else
{
$total_amount=$re['amount'];
$recpt_no="MIPB".rand(1000000000,9999999999);
}
$ag_id=$re['agent_id'];
$dt_by=$date;
$duration=fetchreturn('duration','004add_product','id',$prd_id);
$rs=mysql_query("insert into 018renewal values('',$prd_type,$prd_id,'$app_id','$date',$total_amount,'paid','$dt_by','$branch',$ins)");
if($prd_type==1)
{
$tr=mysql_query("insert into print_details values('',$prd_type,$prd_id,'$app_id','cash','$branch','$recpt_no','$dt_by','$date','mipvoucher')");
}
else
{
$tr=mysql_query("insert into print_details values('',$prd_type,$prd_id,'$app_id','cash','$branch','$recpt_no','$dt_by','$date','renewal')");
}
?>