<?php 
session_start();
include 'dbc.php';



$userid=$_SESSION["userid"];
$today=date("d-m-Y");
$cost_rate=$_POST["cost_rate"];
$book_name=$_POST["book_name"];
$sale_rate=$_POST["sale_rate"];
$class_name=$_POST["class_name"];
$balbook=$_POST["balbook"];
$code=$_POST["code"];


$sql = "Insert into inventory (id,date,code,book_name,cost_rate,sale_rate,class_name,balbook,user_id) values (null,'$today','$code','$book_name','$cost_rate','$sale_rate','$class_name','$balbook','$userid')";
mysql_query($sql) or die("Error : " . mysql_error());



header("location:inventory.php");
/*$sql="Select * from agents where userid='$user_id'";
$data=mysql_query($sql) or die ("Error:" . mysql_error());
$userdata=mysql_fetch_array($data);
$email=$userdata["e_mail"];
mail($email . ",info@lalburj.com","Candidate Information","Candidate Data Posted Successfully","Passport No:" . $app_pp_no . " of " . $app_name . "Has been Posted Successfully By:" . $_SESSION["userid"]);*/
?>
