-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci_pe_db.php
26 lines (22 loc) · 807 Bytes
/
ci_pe_db.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
include "connection.php";
$uid =$_POST["UID"];
$size = $_POST["size"];
$gender = $_POST["gender"];
$pattern = $_POST["pattern"];
$marked = $_POST["marked"];
$purchase = $_POST["purchase"];
$pur_date = $_POST["pur_date"];
$maturity = $_POST["expiry"];
$expiry_date = date('Y-m-d', strtotime("+$maturity months", strtotime($pur_date)));
$sql="INSERT INTO ci_prod_entry (UID, SIZE, GENDER, PATTERN, MARKED_PRICE, PURCHASE_PRICE, PURCHASE_DATE, MATURITY, EXPIRY_DATE)
VALUES ('$uid', '$size', '$gender', '$pattern', $marked, $purchase, '$pur_date', '$maturity', '$expiry_date')";
if (!$conn->query($sql)){
die("Error :". $conn->error);
}
else{
echo "Entry Completed Successfully";
header('Refresh:5;url=http://localhost/ci/ci_pe.php');
die();
}
?>