<?php session_start(); require_once 'administator.php'; require_once 'customer.php'; $admin = new Administator(); $customer = new Customer(); $category_id = 0; if (!empty($_GET['category_id'])) { $category_id = $_GET['category_id']; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>E Retail System</title> </head> <body> <div class="header"> <h2>E Retail Store</h2> </div> <div class="container"> <div class="main"> <?php if ($category_id == 0) { $result = $admin->getAllProduct(); while ($row = mysql_fetch_array($result)) {
<?php if (!isset($_COOKIE["email"])) { $newURL = "localhost:8888/eretail/admin_login.php"; header('Location: ' . $newURL); } include 'administator.php'; require_once 'header.php'; require_once 'category.php'; $error = "Please enter the category"; if (isset($_POST['submit'])) { $cat_name = $_POST['category']; if (!empty($cat_name)) { $admin = new Administator(); $admin->addCategory($cat_name); $error = "Successfully added:::add more"; } else { $error = "Please enter the category"; } } ?> <div class="container"> <div class="main" style="margin-top: 10px;"> <form action="admin_category_add.php" method="post" class="smart-green"> <h1>Add Category <span><?php echo $error; ?> </span> </h1>
<?php session_start(); require_once 'administator.php'; require_once 'customer.php'; $admin = new Administator(); $customer = new Customer(); $category_id = 0; if (!empty($_GET['category_id'])) { $category_id = $_GET['category_id']; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>E Retail System</title> </head> <body> <div class="header"> <h2>E Retail Store</h2> </div> <div class="container"> <div class="main"> <?php $result = $admin->getProductById($_GET['view_product_id']); while ($row = mysql_fetch_array($result)) { ?>
<?php if (!isset($_COOKIE["email"])) { $newURL = "localhost:8888/eretail/admin_login.php"; header('Location: ' . $newURL); } require_once 'header.php'; require_once 'product.php'; require_once 'category.php'; require_once 'administator.php'; $error = "Please fill all the texts in the fields."; $admin = new Administator(); if (isset($_POST['submit'])) { $name = $_POST['name']; $price = $_POST['price']; $description = $_POST['description']; $quantity = $_POST['quantity']; $category_id = $_POST['category_id']; $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION); // Check if image file is a actual image or fake image $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if ($check !== false) { $uploadOk = 1; } else { $error .= "File is not an image."; $uploadOk = 0; } // Check if file already exists
<?php if (!isset($_COOKIE["email"])) { $newURL = "http://localhost:8888/eretail/admin_login.php"; header('Location: ' . $newURL); } require_once 'header.php'; require_once 'product.php'; require_once 'category.php'; require_once 'administator.php'; require_once 'db.php'; $error = "Please fill all the texts in the fields."; $admin = new Administator(); ?> <div class="container"> <div class="main" style="margin-top: 10px;"> <?php $result1 = $admin->getAllOrder(); while ($row1 = mysql_fetch_array($result1)) { $result = $admin->getProductById($row1[4]); while ($row = mysql_fetch_array($result)) { ?> <div class="product_wide"> <div class="product_header"> <h3 class="left_head_1">Customer Name: <?php echo ucfirst($row1[1]); ?> </h3><h3 class="right_head_2">Phone No. <?php echo $row1[2]; ?>
<?php include 'administator.php'; require_once 'category.php'; $error = "Please enter the information"; if (isset($_COOKIE["email"])) { $newURL = "http://localhost:8888/eretail/admin.php"; header('Location: ' . $newURL); } else { if (isset($_POST['submit'])) { $email = $_POST['email']; $password = $_POST['password']; if (!empty($email) && !empty($password)) { $admin = new Administator(); if ($admin->checkUser($email, $password) == 1) { setcookie("email", $email, time() + 86400 * 30); $newURL = "http://localhost:8888/eretail/admin.php"; header('Location: ' . $newURL); } else { $error = "Wrong Password"; } } else { $error = "Please enter the required information"; } } } require_once 'header.php'; ?> <form action="admin_login.php" method="post" class="smart-green"> <h1>Admin Login <span><?php