<?php
ob_start();
include 'dbconnection.php';

$date = $_POST['date'];
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$s_person = $_POST['s_person'];
$lead_source = $_POST['lead_source'];
$state = $_POST['state'];
$district = $_POST['district'];

$school_name = $_POST['school_name'];
$school_type = $_POST['school_type'];
$establishment_year = $_POST['establishment_year'];
$school_address = $_POST['school_address'];
$affiliation = $_POST['affiliation'];

$udise = $_POST['udise'];
$students = $_POST['students'];
$potential = $_POST['potential'];
$lead_status = $_POST['lead_status'];
$products_signed = $_POST['products_signed'];

$total_signed = $_POST['total_signed'];
$remark = $_POST['remark'];
$payment_date = $_POST['payment_date'];
$signup_amount = $_POST['signup_amount'];
$payment_mode = $_POST['payment_mode'];

$payment_id = $_POST['payment_id'];
$payment_remark = $_POST['payment_remark'];
$school_wsu = $_POST['school_wsu'];
$implementation_fees = $_POST['implementation_fees'];
$customisation_fees = $_POST['customisation_fees'];

$subscription_fees = $_POST['subscription_fees'];
$gst = $_POST['gst'];
$training_fees = $_POST['training_fees'];

$source = $_POST['source'];
$assign_by = $_POST['assign_by'];
// $status = $_POST['status'];


$sql="INSERT INTO leads (date,name,mobile,email,s_person,lead_source,state,district,school_name,school_type,establishment_year,school_address,affiliation,udise,students,potential,lead_status,products_signed,total_signed,remark,payment_date,signup_amount,payment_mode,payment_id,payment_remark,school_wsu,implementation_fees,customisation_fees,subscription_fees,gst,training_fees,source,assign_by,time) 
VALUES 
( '{$date}','{$name}','{$mobile}','{$email}','{$s_person}','{$lead_source}','{$state}','{$district}','{$school_name}','{$school_type}','{$establishment_year}','{$school_address}','{$affiliation}','{$udise}','{$students}','{$potential}','{$lead_status}','{$products_signed}','{$total_signed}','{$remark}','{$payment_date}','{$signup_amount}','{$payment_mode}','{$payment_id}','{$payment_remark}','{$school_wsu}','{$implementation_fees}','{$customisation_fees}','{$subscription_fees}','{$gst}','{$training_fees}','{$source}','{$assign_by}',NOW())";


if (!mysqli_query($conn,$sql))
  {
  die('Error: ' . mysqli_error());
  }
else 
{
header("location:../view_leads");
}
mysqli_close($conn);
ob_end_flush();
?> 