<?php

 include("config.php");
 
if (isset($_POST['submit']))
{
$cname=$_POST['cname'];

$da= date('Y-m-d H:i:s', strtotime($_POST['bday']));
$show_date= date("F j, Y, g:i a", strtotime($_POST['bday']));
//$date=$_POST['date'];

//$smstext= mysqli_real_escape_string($_POST['smstext']);
$smstext= $_POST['smstext'];

$smstype=$_POST['smstype'];
$delivered=$_POST['delivered'];
$undelivered=$_POST['undelivered'];
$dnd=$_POST['dnd'];
$price_state=$_POST['state_type'];
$countryid=$_POST['countryid'];
$senderid=$_POST['senderid'];

 $price_state=$_POST['state_type'];
$operator=$_POST['yes'];
$charges=$_POST['charges'];
$total=$_POST['total'];
$mesch=($charges * $total);
$chargeforsms="AED ".$charges;
$charge="AED ".$mesch;
//$img_path = _BASE_PATH."images/bar.jpg";
$chargesdeduced = $_POST['chargesdeduced'];


$sql="INSERT INTO `Panel3Report` (
`clientname` ,
`senddate` ,
`smstext` ,
`smstype` ,
`delivered` ,
`subtooperator` ,
`dnd` ,
`chargeforsms`,
`totalsms`,
`pdf`,
`undelivered`,
`country`,
`senderid`,
`price_type`,
`chargesdeducted`
)
VALUES('$cname','$da', '$smstext', '$smstype', '$delivered', '$operator','$dnd','$charges','$total','$filename','$undelivered','$countryid','$senderid',$price_state,'$chargesdeduced')";
//echo $sql;

$result=mysqli_query($con,$sql);

// echo $result;
if($result)
{
$last_id = $con->insert_id;	
	header('Location:http://reports.imailfram.com/Panel3Report.php?id='.$last_id);exit;
 
	
 //	echo "<script>window.location='Panel3Report.php'</script>";
 //	echo "successfull insert";
 
}
else
{
	echo "error";
}
}
?>