-
Notifications
You must be signed in to change notification settings - Fork 0
/
addNewItem.php
27 lines (22 loc) · 869 Bytes
/
addNewItem.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
27
<?php
require_once("database/database.php");
// check to see if user is logged in, if not redirect to index.php
if(isset($_SESSION['is_logged_on'])!=true || $_SESSION['is_logged_on'] != 1){ // Redirect to index.php if user not logged in
header('Location: index.php');
}
//Fetching Values from URL
$iidcategory=$_POST['iidcategory1'];
$iiditem=$_POST['iiditem1'];
$iidescription=$_POST['idescription1'];
$ibrand=$_POST['ibrand1'];
$icolor=$_POST['icolor1'];
$iquantity=$_POST['iquantity1'];
$iseason=$_POST['iseason1'];
$imaterial=$_POST['imaterial1'];
if ($iidcategory!="") {
$iduser = $_SESSION['iduser'];
$query = persembleDB::getInstance()->add_item($iduser, $iidcategory, $iidescription, $ibrand, $icolor, $iquantity, $iseason, $imaterial);
} else {
header('Location: index.php');
}
?>