<?php

session_start();
include_once '../include/onlineStoreUser.php';
$onlineStore = new onlineStoreUseer();
if ($onlineStore->get_session()) {
    //echo 'hallo session';
    //exit();
    //if($onlineStore->check_admin_login($username, $password))
    header("location: index.php");
    exit;
}
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" href="../css/adminStyle.css" rel="stylesheet"/>
        <title>Admin Log In</title>
    </head>
    <body>
        <div id="adminWrapper">
            <?php 
include_once "./admin_layout/admin_header_template.php";
?>
            
            <?php 
include_once './admin_layout/admin_nav_template.php';
?>
  
<?php

session_start();
require_once '../include/onlineStoreUser.php';
$onlineStore = new onlineStoreUseer();
if ($onlineStore->get_session()) {
    if ($onlineStore->check_admin_login()) {
        header("location: inventory_list.php");
        exit;
    }
}
//error report
$onlineStore->error_report();
?>

<?php 
//Gather this product full information for inserting automatically into the edit form below on page
if (isset($_GET['pid'])) {
    $targetID = $_GET['pid'];
    $product_list = "";
    $sql = mysql_query("SELECT * FROM products WHERE id = '{$targetID}' LIMIT 1");
    //ORDER BY $date_added DESC
    $productCount = mysql_num_rows($sql);
    //count the output amount
    //echo $productCount;
    //exit();
    if ($productCount > 0) {
        while ($row = mysql_fetch_array($sql)) {
            //$id = $row["id"];
            $product_name = $row["product_name"];
            $price = $row["price"];
Example #3
0
<?php

session_start();
require_once '../include/onlineStoreUser.php';
$onlineStore = new onlineStoreUseer();
if ($onlineStore->get_session()) {
    if ($onlineStore->check_admin_login()) {
        header("location: index.php");
        exit;
    }
} else {
    header("location: admin_login.php");
    exit;
}
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" href="../css/adminStyle.css" rel="stylesheet"/>
        <title>Store Admin Area</title>
    </head>
    <body>
        <div id="adminWrapper">
            
            <?php 
include_once "./admin_layout/admin_header_template.php";
?>
           
            <?php