Chocolat! Staff Login |
Copyright 2008-2009© Prairie Studio - All Rights Reserved - All Wrongs Righted
go to main site HOME PAGE
<?php
$title = "Chocolat! - Content Management - Main Page -";
$bodyid='"cmsContent"';
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "CMS Main Page";
//Include html header information
require_once("chocolatHeader.inc.php");
?>
<link href="cms.css" rel="stylesheet" type="text/css" />
<div id="main-content">
<h4>Manage Chocolat! Categories</h4>
<ul>
<li>
<p>Do you want to <span class="alert">add, edit or delete</span> a Chocolat! category? If so, go to the Category Administration workpage:
<br /><a href = "category.php">Category Admin</a> </p>
</li>
</ul>
<h4>Manage Chocolat! Products</h4>
<ul>
<li>
<p>Do you want to <span class="alert">add, edit or delete</span> a Chocolat! product? If so, go to the Product Administration workpage:
<br /><a href = "products.php">Product Admin</a> </p>
</li>
</ul>
<h4>Manage Chocolat! Shipping Methods</h4>
<ul>
<li>
<p>Do you want to <span class="alert">add, edit or delete</span> a Chocolat! shipping method? If so, go to the Shipping Method Administration workpage:
<br /><a href = "shipping.php">Shipping Admin</a> </p>
</li>
</ul>
<h4>Manage Chocolat! Administrative Users</h4>
<ul>
<li>
<p>Do you want to <span class="alert">add</span> a Chocolat! Administrative user? If so, go to the User Administration workpage:
<br /><a href = "new_admin.php">User Admin</a> </p>
</li>
</ul>
<h4>Manage People!</h4>
<ul>
<li>
<p>Do you want to <span class="alert">add, edit or delete</span> a friend, colleague, or family member? If so, go to the People Administration workpage:
<br />
oh, sorry, we can't do that for you here... </p>
</li>
</ul>
</div><!-- end #mainContent -->
<?php
//Include footer info and close page
require_once("footer.inc.php");
?>
<?php
$title = "Chocolat! - Content Management Area - Products Page";
$bodyid = "cmsProducts";
$nl = "\n";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>Products</strong> Administration Page-";
//Include html header information
require_once("chocolatHeader.inc.php");
$cols = getcolnames($MyConn, 'products');
$prods = get_all_products($MyConn);
/* $p = mysql_fetch_array($prods,MYSQL_ASSOC); */
echo '<div id="main-content">';
echo '<h2>Manage All Your Chocolat! Products</h2>';
echo '<h5> <strong>- Add Edit or Delete a Product-</strong> </h5>';
echo '<p id="add"><a href="addnew_product.php" > [+] Add New Product</a></p><br />';
echo '<table id="productEdit">';
echo '<tr>';
echo '<th>EDIT</th>';
echo '<th>DELETE</th>';
foreach($cols as $heading) {
echo "<th class=\"{$heading}\">{$heading}</th>";
}
echo '</tr>';
echo '<tr>';
while($p = mysql_fetch_array($prods))
{
echo '<tr>';
printf("<td><a href='edit_product.php?editProduct=%s'><img src='edit.gif' width='19' height='19' alt='' border='0'></a></td>", $p['productid']);
printf("<td><a href='delete_product.php?deleteProduct=%s'><img src='delete.gif' width='19' height='19' alt='' border='0'></a></td>", $p['productid']);
for ($i=0; $i <= mysql_num_fields($prods); $i++) {
echo '<td>' . $nl;
echo $p[$i];
echo $nl;
echo '</td>' . $nl;
}
echo '</tr>' . $nl;
}
echo '</tr>' . $nl;
echo '</table>' . $nl;
?>
</div><!-- end #mainContent -->
<?php require_once("footer.inc.php"); // Include footer info and close page ?>
<?php
$title = "Chocolat! - Content Management Area - Category Page";
$bodyid = "cmsProducts";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>Category</strong> Administration Page-";
//Include html header information
require_once("chocolatHeader.inc.php");
$cols = getcolnames($MyConn, 'categories');
$cats = get_all_cats($MyConn);
$c = mysql_fetch_array($cats,MYSQL_ASSOC);
$nl = "\n";
if (!$MyRows = getrows($MyConn, 'categories')) {
showerror("the attempt to get categories table-rows failed!");
}
echo '<div id="main-content">';
echo '<h2>Manage All Your Chocolat! Categories</h2>';
echo '<h5> <strong>- Add Edit or Delete a Category-</strong> </h5>';
echo '<p id="add"><a href="addnew_cat.php" > [+] Add New Category</a></p><br />';
echo '<table id="productEdit">' . $nl;
echo '<tr>' . $nl;
echo '<th>' . $nl;
echo 'EDIT' . $nl;
echo '</th>' . $nl;
echo '<th>' . $nl;
echo 'DELETE' . $nl;
echo '</th>' . $nl;
foreach($cols as $heading) {
echo '<th>' . $nl;
echo "{$heading}" . $nl;
echo '</th>' . $nl;
}
echo '</tr>' . $nl;
while ($row = mysql_fetch_array($MyRows)) {
echo '<tr>' . $nl;
echo '<td>' . $nl;
echo '<a href="edit_cat.php?editCat=$categoryid"><img src="edit.gif" width="19" height="19" alt="" border="0"></a>' . $nl;
echo '</td>' . $nl;
echo '<td>' . $nl;
echo '<a href="delete_cat.php?deleteCat=$categoryid"><img src="delete.gif" width="19" height="19" alt="" border="0"></a>' . $nl;
echo '</td>' . $nl;
for ($i=0; $i < mysql_num_fields($MyRows); $i++) {
echo '<td>' . $nl;
echo $row[$i] . $nl;
echo '</td>' . $nl;
}
echo '</tr>' . $nl;
}
echo '</tr>' . $nl;
echo '</table>' . $nl;
?>
</div>
<!-- end #mainContent -->
<?php
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php
$title = "Chocolat! - Content Management Area - Products Page";
$bodyid = "cmsProducts";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>EDIT Product</strong> Administration Page-";
//Include html header information
require_once("chocolatHeader.inc.php");
$cols = getcolnames($MyConn, 'products');
$result = getrows($MyConn, 'products');
$prods = get_all_products($MyConn);
$p = mysql_fetch_array($prods,MYSQL_ASSOC);
if(isset($_GET['editProduct']) && is_numeric($_GET['editProduct'])) {
$selectedProductId = $_GET['editProduct'];
} else {
echo "No value for selected product id!";
}
$queryEdit = "SELECT * FROM products WHERE productid=$selectedProductId";
$resultEdit = mysql_query($queryEdit, $MyConn);
$e = mysql_fetch_array($resultEdit,MYSQL_ASSOC);
$n= "\n";
echo '<h2>EDIT Selected Product</h2>' . $n;
echo '<div class="two_col_form">' . $n;
echo '<form action="act_edit_product.php" method="POST">' . $n;
?>
<div class="formsection">
<h3>You have selected the product listed below for editing</h3>
<ul class="message"> <!-- add class="message" to display the list - also add class "error" when displaying errors -->
<li>Each field of information for this product is listed in its own form input below</li>
<li>Choose which field or fields you want to modify and type in your changes</li>
<li>Click on the UPDATE button below to confirm your changes, or click on the CANCEL link to cancel any changes</li>
</ul>
</div>
<?php echo '<input type="hidden" name="productid" value=$selectedProductId>' . $n;
foreach($e as $key => $value) {
echo "<div class='formsection'>" . $n;
echo "<label for={$key}>{$key}:</label>" . $n;
echo "<textarea id='description' name={$key} rows='2' cols='54'>{$value}</textarea>" . $n;
echo "</div>" . $n;
} ?>
<div id="sub"> <!-- input must be wrapped in a block level element to validate -->
<input type="submit" id ="update" name="update" value="UPDATE!" />
<br />
<a href="products.php">Cancel changes</a>
</div>
</form>
</div>
<?php
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php
$title = "Chocolat! - Content Management Area - Confirm Product Edit";
$bodyid = "confirmProductEdit";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>Confirm Product Edit</strong> Administration Page-";
//Include html header information['selectedProductId']
require_once("chocolatHeader.inc.php");
if(isset($_POST['productid']) && is_numeric($_POST['productid'])) {
$productEdited = $_POST['productid'];
} else {
echo "<br />You have not selected a product to edit!";
}
if(isset($_POST['update'])) {
$productid= $_POST['productid'];
$categoryid = $_POST['categoryid'];
$productname = $_POST['productname'];
$productdescription = $_POST['productdescription'];
$productprice = $_POST['productprice'];
$productthumbnail = $_POST['productthumbnail'];
$productweight = $_POST['productweight'];
$query = "UPDATE products SET
productid= {$productid},
categoryid = {$categoryid},
productname = '{$productname}',
productdescription = '{$productdescription}',
productprice = {$productprice},
productthumbnail = '{$productthumbnail}',
productweight = {$productweight}
WHERE productid = {$productid}";
echo "<br /><h4 align='center'>Thank you, the product item <strong>" . $_POST['productname'] . " </strong> has been updated.</h4><br />";
} else {
echo "<br />Please select a product from the Edit Product page:";
}
$result = mysql_query($query);
// test to see if the update occurred
/* if (mysql_affected_rows() == 1) {
// Success!
$message = "The page was successfully updated.";
} else {
$message = "The page could not be updated.";
$message .= "<br />" . mysql_error();
} */
echo '<br /> <a href="products.php">Main Edit Product page</a> <br />';
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php
$title = "Chocolat! - Content Management Area - Shipping Page";
$bodyid = "cmsProducts";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>Shipping</strong> Administration Page-";
//Include html header information
require_once("chocolatHeader.inc.php");
$shipcols = getcolnames($MyConn, 'Shipmethods');
$ships = get_all_ships($MyConn);
$c = mysql_fetch_array($ships,MYSQL_ASSOC);
$nl = "\n";
if (!$MyRows = getrows($MyConn, 'Shipmethods')) {
showerror("the attempt to get Shipmethods table-rows failed!");
}
echo '<div id="main-content">';
echo '<h2>Manage All Your Chocolat! Shipping</h2>';
echo '<h5> <strong>- Add Edit or Delete a Shipping type-</strong> </h5>';
echo '<p id="add"><a href="addnew_ship.php" > [+] Add New Shipping type</a></p><br />';
echo '<table id="productEdit">' . $nl;
echo '<tr>' . $nl;
echo '<th>' . $nl;
echo 'EDIT' . $nl;
echo '</th>' . $nl;
echo '<th>' . $nl;
echo 'DELETE' . $nl;
echo '</th>' . $nl;
foreach($shipcols as $heading) {
echo '<th>' . $nl;
echo "{$heading}" . $nl;
echo '</th>' . $nl;
}
echo '</tr>' . $nl;
while ($row = mysql_fetch_array($MyRows)) {
echo '<tr>' . $nl;
echo '<td>' . $nl;
echo '<a href="edit_ship.php?editShipt=$shipmethodid"><img src="edit.gif" width="19" height="19" alt="" border="0"></a>' . $nl;
echo '</td>' . $nl;
echo '<td>' . $nl;
echo '<a href="delete_ship.php?deleteShip=$shipmethodid"><img src="delete.gif" width="19" height="19" alt="" border="0"></a>' . $nl;
echo '</td>' . $nl;
for ($i=0; $i <= 4; $i++) {
echo '<td>' . $nl;
echo $row[$i] . $nl;
echo '</td>' . $nl;
}
echo '</tr>' . $nl;
}
echo '</tr>' . $nl;
echo '</table>' . $nl;
?>
</div>
<!-- end #mainContent -->
<?php
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php
$title = "Chocolat! - Content Management Area -View DELETE Product Page";
$bodyid = "cmsProducts";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>View DELETE Product </strong> Administration Page";
//Include html header information
require_once("chocolatHeader.inc.php");
echo '<h5>Below is the Product that you have chosen to DELETE...double check that you really want to DELETE this product,
and then click the CONFIRM DELETE link to eliminate the product from the database.<h5>';
echo '<br />';
echo '<ul id = "deleteProduct">';
$deleteProductid = $_GET['deleteProduct'];
echo "Product ID Number " . $deleteProductid . ": ";
$query = "SELECT * FROM products WHERE productid = $deleteProductid";
//Perform database query
$result = mysql_query($query, $MyConn);
if (!$result) {
die("Database query failed: " . mysql_error());
}
//Use returned data
while ($row = mysql_fetch_array($result)) {
echo $row["productname"] . "<br />";
}
echo '<br />';
$_SESSION['productid'] = $_GET['productid'];
echo '<p class = "alert">Are you sure you want to delete this item? If so, click the link: <br /><a href= "confirmDelete.php"> CONFIRM Delete </a></p>';
echo '<br />';
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php
$title = "Chocolat! - Content Management Area - ADD NEW Product Page";
$bodyid = "addNewProduct";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>ADD New Product</strong> Administration Page-";
//Include html header information
require_once("chocolatHeader.inc.php");
$cols = getcolnames($MyConn, 'products');
$result = getrows($MyConn, 'products');
$prods = get_all_products($MyConn);
$p = mysql_fetch_array($prods,MYSQL_ASSOC);
$queryEdit = "SELECT * FROM products ";
$resultEdit = mysql_query($queryEdit, $MyConn);
$e = mysql_fetch_array($resultEdit,MYSQL_ASSOC);
$n= "\n";
echo '<h2>ADD New Product</h2>' . $n;
echo '<div class="two_col_form">' . $n;
echo '<form action="act_add_product.php" method="POST">' . $n;
?>
<div class="formsection">
<h3>Use this page to ADD new products to the Chocolat! database</h3>
<ul class="message">
<li>Each field of information for this product has its own empty form input below</li>
<li>Type the appropriate product infomation into each input</li>
<li>Click on the ADD Product button below to confirm your new product, or click on
the CANCEL link to cancel</li>
<li>To help you in adding new products correctly, please examine the field information
listings below and be sure to make your new product info conform to these database requirements</li>
</ul>
<div id = "dbFields"><?php getfieldinfo($databaseName, 'products'); ?>
</div>
</div>
<?php
foreach($e as $key => $value) {
echo "<div class='formsection'>" . $n;
echo "<label for={$key}>{$key}:</label>" . $n;
echo "<textarea id='description' name={$key} rows='2' cols='34'>";
if($key == 'productid') {
echo "Product ID will be added automatically!";
} else {
echo "ADD NEW Product {$key} value HERE";
}
echo "</textarea>" . $n;
echo "</div>" . $n;
} ?>
<div id="sub"> <!-- input must be wrapped in a block level element to validate -->
<input type="submit" id ="add" name="add" value="ADD Product!" />
<br />
<a href="products.php">Cancel changes</a>
</div>
</form>
</div>
<?php require_once("footer.inc.php"); //Include footer info and close page ?>
<?php
$title = "Chocolat! - Content Management Area -View NEW Product Details Page";
$bodyid = "cmsProducts";
//Include essential connection information
require_once("../functions.inc.choco.php");
$subtitle = "-<strong>View NEW Product Details </strong> Administration Page";
//Include html header information
require_once("chocolatHeader.inc.php");
echo '<h5>Below are the details for the New Product you have defined...double check that all information is correct
and then click the CONFIRM buttom to add the new product to the database. If you need to modify anything,
click on the RETURN to ADD NEW Page button and make your corrections there. Then repeat the process.<h5>';
echo '<br />';
echo '<ul id = "newProduct">';
$newProductArray = $_POST;
foreach($newProductArray as $field => $value) {
if($field == 'add' || $field == 'productid') {
echo "";
} else {
echo '<li>';
echo '<strong>' . $field . ': </strong>';
echo $value;
echo '</li>';
}
}
echo '</ul>';
$_SESSION['productname'] = $_POST['productname'];
echo '<a href= "testSession.php">go to testSession.php</a>';
//Include footer info and close page
require_once("footer.inc.php"); ?>
<?php ob_start(); ?>
<?php require_once("../../administration.inc.php"); //Include essential connection information ?>
<?php require_once("../functions.inc.choco.php"); ?>
<?php require_once("chocolatHeader.inc.php"); ?>
$title = "Chocolat! - Administrative Login Page-";
$bodyid = "cmsLogin";
$subtitle = "Administrative Login Page";
?>
<?php
// if (logged_in()) {
// redirect_to("content.php");
// }
// START FORM PROCESSING
if (isset($_POST['submit'])) { // Form has been submitted.
/* $errors = array();
// perform validations on the form data... see new_admin.php for similar code comments
$required_fields = array('username', 'password');
$errors = array_merge($errors, check_required_fields($required_fields, $_POST));
$fields_with_lengths = array('username' => 30, 'password' => 30);
$errors = array_merge($errors, check_max_field_lengths($fields_with_lengths, $_POST));
$username = trim(mysql_prep($_POST['username']));
$password = trim(mysql_prep($_POST['password']));
$hashed_password = sha1($password);
if ( empty($errors) ) {
// Check database to see if username and the hashed password exist there.
$query = "SELECT id, username ";
$query .= "FROM users ";
$query .= "WHERE username = '{$username}' ";
$query .= "AND hashed_password = '{$hashed_password}' ";
$query .= "LIMIT 1";
$result_set = mysql_query($query);
confirm_query($result_set);
if (mysql_num_rows($result_set) == 1) {
// username/password will be authenticated
// if there is only 1 match
$found_user = mysql_fetch_array($result_set);
$_SESSION['user_id'] = $found_user['id'];
$_SESSION['username'] = $found_user['username']; */
header("content.php");
} /*else {
// error, username/password combo was not found in the database, do error thing
$message = "Username/password combination incorrect.<br />
Please make sure your caps lock key is off and try again.";
}
} else {
if (count($errors) == 1) {
$message = "There was one error in the form.";
} else {
$message = "There were " . count($errors) . " errors in the form.";
}
}
} */ else { // Form has not been submitted.
if (isset($_GET['logout']) && $_GET['logout'] == 1) {
$message = "You are now logged out.";
}
$username = "";
$password = "";
}
?>
<title>Chocolat! Administration Login Page</title>
<table id="structure" align = "center">
<tr>
<td id="page">
<h2>Chocolat! Staff Login</h2>
<?php if (!empty($message)) {echo "<p class=\"message\">" . $message . "</p>";} ?>
<?php if (!empty($errors)) { display_errors($errors); } ?>
<form action="loginShop.php" method="post">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="username" maxlength="30" value="<?php echo htmlentities($username); ?>" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="password" maxlength="30" value="<?php echo htmlentities($password); ?>" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Login" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php include("footer.inc.php"); ?>
<?php echo ob_get_clean(); ?>
<?php require_once("../functions.inc.choco.php"); //Include essential connection information ?>
<?php require_once("chocolatHeader.inc.php"); ?>
<?php
#####################################################
// CREATE new table for administrative users...do only once!!!!!!!!!!!!!! It has been done!!!!! ***use username: john password: cool
/* $qCreate = "CREATE TABLE users";
$qCreate .= "( id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
hashed_password VARCHAR(40) NOT NULL,
username VARCHAR(50) NOT NULL
)";
$rCreate = mysql_query($qCreate, $MyConn); // do normal query stuff, create error message if something goes wrong
if ($rCreate) {
$message = "The user table was successfully created!.";
} else {
$message = "The user table could not be created.";
$message .= "<br />" . mysql_error();
}
// CREATE other tables ...DO ONLY ONCE!!!!! It has been done!!!
$qCreate2 = "CREATE TABLE Customers2
(
customerid INT UNSIGNED NOT NULL AUTO_INCREMENT,
customerfname VARCHAR(50) NOT NULL,
customerlname VARCHAR(50) NOT NULL,
customeraddress VARCHAR(100),
customeraddress2 VARCHAR(100),
customercity VARCHAR(50),
customerzip VARCHAR(8),
customerstate CHAR(2),
customerphone VARCHAR(20),
customeremail VARCHAR(100) NOT NULL,
customerpassword VARCHAR(32) NOT NULL,
customercell VARCHAR(20),
customercompany VARCHAR(100),
datecreated TIMESTAMP NOT NULL,
PRIMARY KEY ( customerid )
);
DROP TABLE IF EXISTS Orders;
CREATE TABLE Orders
(
orderid INT UNSIGNED NOT NULL AUTO_INCREMENT,
customerid INT NOT NULL,
orderdate TIMESTAMP NOT NULL,
ordertotal DECIMAL(6,2) NOT NULL,
shipmethodid SMALLINT NOT NULL,
shipcost DECIMAL(6,2) NOT NULL,
shipdate DATE,
orderstatus TINYINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY ( orderid )
);
DROP TABLE IF EXISTS Orderitems;
CREATE TABLE Orderitems
(
orderid INT NOT NULL,
productid INT NOT NULL,
productprice DECIMAL(6,2) NOT NULL DEFAULT 0,
quantity SMALLINT NOT NULL DEFAULT 0,
PRIMARY KEY ( orderid,productid )
)";
$rCreate2 = mysql_query($qCreate2, $MyConn); // do normal query stuff, create error message if something goes wrong
if ($rCreate2) {
$message = "The tables were successfully created!.";
} else {
$message = "The tables could not be created.";
$message .= "<br />" . mysql_error();
}
*/
#####################################################
?>
<?php
$title = "Chocolat! - Add New Admin User Page-";
$bodyid = "cmsNewAdminUser";
$subtitle = "Add New Admin User Page";
?>
<?php // confirm_logged_in(); ?>
<?php
// start form and variable validation stuff
if (isset($_POST['submit'])) { // Form has been submitted.
$errors = array(); // create an empty array to put any errors in
// perform validations on the form data
$required_fields = array('username', 'password'); // put required fields of form into an array, in this case just the two
$errors = array_merge($errors, check_required_fields($required_fields, $_POST)); // put both arrays together
// check_required_fields function sees if posts are set, are not empty, and are numeric..if not, gives an error
$fields_with_lengths = array('username' => 30, 'password' => 30); // put the field lengths for the form in an array
$errors = array_merge($errors, check_max_field_lengths($fields_with_lengths, $_POST)); //do same check, merge again
$username = trim(mysql_prep($_POST['username'])); // get rid of any spaces, do function that handles escape strings, magic quotes etc
$password = trim(mysql_prep($_POST['password']));
$hashed_password = sha1($password); // use sha1 hash algo to encrypt the given password before putting it into database
if ( empty($errors) ) { // I created a new table called users with id, hashed_password and username as fields...if no errors, insert data into table
$query = "INSERT INTO users (
username, hashed_password
) VALUES (
'{$username}', '{$hashed_password}'
)";
$result = mysql_query($query, $MyConn); // do normal query stuff, create error message if something goes wrong
if ($result) {
$message = "The new user was successfully added!.";
} else {
$message = "The new user could not be created.";
$message .= "<br />" . mysql_error();
}
} else {
if (count($errors) == 1) {
$message = "There was an error in the form.";
} else {
$message = "There were " . count($errors) . " errors in the form.";
}
}
} else { // Form has not been submitted...this page does double duty, input to the form, and submit action......
// below, create simple form...here I used htmlentities and added the username/password dynamically, after setting the default values to empty strings...
$username = "";
$password = "";
}
?>
<br />
<table id="structure" align = "center">
<tr>
<td id="page">
<h2>Create a New Chocolat! Administrative User</h2>
<?php if (!empty($message)) {echo "<p class=\"message\">" . $message . "</p>";} ?>
<?php if (!empty($errors)) { display_errors($errors); } ?>
<form action="new_admin.php" method="post">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="username" maxlength="30" value="<?php echo htmlentities($username); ?>" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" maxlength="30" value="<?php echo htmlentities($password); ?>" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Create user" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<br />
<?php include("footer.inc.php"); ?>
<table border="0" cellspacing="4" cellpadding="0" align="center">
<caption>
Chocolat! CMS Area Navigation:
</caption>
<tr>
<td><span class="navtable"><a href="content.php" class="navlist">Main CMS Page</a> | </span></td>
<td><span class="navtable"><a href="products.php" class="navlist">Products Page</a> | </span></td>
<td><span class="navtable"><a href="customers2.php" class="navlist">Customer Page</a> | </span></td>
<td><span class="navtable"><a href="category.php" class="navlist">Categories Page</a> | </span></td>
<td><span class="navtable"><a href="shipping.php" class="navlist">Shipping Page</a> | </span></td>
<td><span class="navtable"><a href="new_admin.php" class="navlist">New User Page</a></span></td>
</tr>
</table>
<!-- clearing element following #main-content div to contain all child floats -->
<br class="clearfloat" />
<div id="site-infoCMS">
<p>Copyright 2008-2009© Prairie Studio - All Rights Reserved - All Wrongs Righted
<p>go to main site <a href="../index.php">HOME PAGE</a></p>
</div><!-- end #site-info -->
</div><!-- end #wrapper -->
<br />
<hr>
<div id="source">
<?php
// an array with include/required files
$showsourceCMS = array("content.php", "products.php", "category.php", "edit_product.php",
"act_edit_product.php", "shipping.php", "delete_product.php", "addnew_product.php", "act_add_product.php", "loginShop.php", "new_admin.php","adminNav.inc.php", "footer.inc.php", "logoutShop.php", "cms.css");
// a function using above array to print out the source code for the included files in array -
// call showSource function
showSource($showsourceCMS);
?>
</div></body></html>
<?php require_once("functions.inc.choco.php"); // load connection info and functions including session_start() ?>
<?php
// logging out
// make sure there's a session started
session_start();
// zap all the session variables
$_SESSION = array();
// zap the session cookie
if(isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
// zap the session
session_destroy();
redirect_to("loginShop.php?logout=1");
?>
h3#cartItems {
font-size: 90%;
color: #FFFFFF;
background: #C08B4C;
text-align: center;
padding: 1px;
border: 1px solid #553800;
width: 70%;
height: 66px;
}
h3#cartItems a:link {
font-size: 80%;
color: #FFFFFF;
text-decoration: underline;
}
h3#cartItems a:visited {
font-size: 80%;
color: #FFFFFF;
text-decoration: underline;
}
h3#cartItems a:hover {
font-size: 80%;
color: #ffffff;
text-decoration: overline;
}
h3#cartItems img {
float: left;
padding-right: 5px;
}
h3#cartItems br {
clear: right;
}
.php {
font-weight: bold;
color: #CC0000;
}
h3 {
font-size: 110%;
}
h2 {
font-size: 120%;
}
body {
font: 100% "Lucida Grande CE";
background: #9E7340;
margin: 0; /* zero the margin and padding of the body element
to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers.
The text is then set to the left aligned default in the #container selector */
color: #553800;
}
#wrapper {
width: 970px; /* using 20px less than a full 800px width allows
for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width)
center the page */
border: 4px double #432820;
text-align: left;
}
.pagetitle {
font: bold 85% Verdana, Arial, Helvetica, sans-serif;
color: #B75B00;
}
a .pagetitle {
text-decoration: none;
}
#branding {
background: #EFE1C3 url(../images/180px-Hot_chocolate.jpg) no-repeat;
padding: 0 10px 0 20px; /* this padding matches the left alignment
of the elements in the divs that appear beneath it. If an image is used
in the #header instead of text, you may want to remove the padding. */
height: 130px;
}
#branding h1, h2, h3, h4, h5 {
margin: 0; /* zeroing the margin of the last element in the #header div will
avoid margin collapse - an unexplainable space between divs. If the div has
a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0;
text-align: center;
font-size: 120%;
font-weight: normal;
}
#secondary-info {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers,
or standards mode in Internet Explorer will include the padding and border
in addition to the width */
background: #CCBB9C; /* the background color will be displayed for the length
of the content in the column, but no further */
padding: 15px 10px 15px 20px;
font-size: 90%;
}
#main-content {
margin: 0; /* the left margin on this div element creates the column
down the left side of the page - no matter how much content the sidebar1 div contains,
the column space will remain. You can remove this margin if you want
the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0; /* remember that padding is the space inside the div box
and margin is the space outside the div box */
font-size: 88%;
}
#main-content li {
margin: 0px;
padding: 0px;
}
#main-content p {
margin: 0px;
padding: 0px;
}
#site-info {
padding: 0; /* this padding matches the left alignment of the elements
in the divs that appear above it. */
background:#FFEFC1;
border-top: 4px double #533028;
border-right: 4px none #533028;
border-bottom: 4px none #533028;
border-left: 4px none #533028;
}
#site-info p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid
the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as
the margin would have, without the margin collapse issue */
font-size: 85%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: normal;
text-align: center;
}
.fltrt { /* this class can be used to float an element right in page. The floated element
must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should
be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}#home #wrapper img {
border: 4px double #4B2E2F;
margin-right: 9px;
margin-top: 9px;
}
#branding #hot {
margin-left: 33px;
}
#secondary-info a {
display: block;
}
#secondary-info a:link {
font-weight: bold;
color: #840000;
text-decoration: none;
background: #FFFFFF;
border: 1px solid #5F3F00;
padding: 4px;
}
#secondary-info a:visited {
font-weight: bold;
color: #840000;
text-decoration: none;
padding: 4px;
border: 1px solid #624100;
}
#secondary-info a:hover {
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
background: #840101;
padding: 4px;
border: 1px solid #644300;
}
.odd {
background: #FFFFFF;
}
.even {
background: #FFFFCC;
}
body#category {
font: 100% "Lucida Grande CE";
}
body#category #main-content {
margin: 0 0 0 250px; /* the left margin on this div element
creates the column down the left side of the page - no matter
how much content the sidebar1 div contains, the column space
will remain. You can remove this margin if you want the
#mainContent div's text to fill the #sidebar1 space when
the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside
the div box and margin is the space outside the div box */
font-size: 70%;
}
body#category #wrapper {
width: 950px;
}
body#category #secondary-info {
width: 330px;
margin: 0px;
padding: 0px 0px 0px 20px;
float: none;
}
body#category #secondary-info a {
}
body#category #wrapper #main-content {
float: none;
width: 900px;
margin: 0px;
padding: 0px 0px 0px 20px;
}
.fltlftClearleft {
float: left;
margin-right: 8px;
clear: left;
}
body#home div#source, body#heredoc div#source {
background-color:#FFFFFF;
text-align: left;
padding-left: 20px;
}
body#home h1, body#heredoc h1 {
font-family: "Lucida Grande CE";
font-size: 135%;
margin-left: 100px;
}
#home #wrapper #main-content h2, #heredoc #wrapper #main-content h2 {
font-size: 125%;
margin-top: 2 em;
}
body div#source {
background-color:#FFFFFF;
text-align: left;
padding-left: 20px;
}
body h1 {
font-family: "Lucida Grande CE";
font-size: 135%;
margin-left: 100px;
}
#wrapper #main-content h2 {
font-size: 125%;
margin-top: 2 em;
}
#category #wrapper table#products {
border: 4px double #CC6600;
}
#category #wrapper td.add {
background: #FFCC00;
width: 8%;
border: 1px solid #CC6600;
font-size: 70%;
font-weight: bold;
text-align: center;
padding-left: 5px;
}
#category #wrapper td.cat {
width: 23%;
border: 1px none #CC6600;
font-size: 90%;
font-weight: bold;
text-align: left;
margin: 5px;
padding: 5px;
}
div#cartTitle img {
float: left;
padding-right: 5px;
padding-left: 5px;
}
div#cartTitle br {
clear: right;
}
div#cartTitle {
height: 75px;
}
p.grand {
font-size: 100%;
font-weight: bold;
text-align: right;
margin-right: 40px;
}
#cartTable th {
font: bold 75% "Lucida Grande CE";
}
#cartTable td {
font: normal 75% "Lucida Grande CE";
}
.alert {
font-weight: bold;
color: #CC0000;
}
#main-content h4 {
font-weight: bold;
text-align: left;
margin: 20px 0px 5px 40px;
padding: 0px;
}
#main-content ul {
margin-top: 0px;
margin-bottom: 0px;
padding-top: 0px;
padding-bottom: 0px;
}
#main-content p#add a {
text-decoration: none;
font: bold 100% "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #006600;
margin: 0px 0px 0px 5px;
padding: 0px;
}
.editV {
}
#sub a:link {
font-weight: bold;
color: #CC0000;
text-decoration: none;
}
#main-content #productEdit {
border: 4px double #996600;
font: 0.8em Verdana, Arial, Helvetica, sans-serif;
margin: 0px;
padding: 12px;
text-align: center;
width: 97%;
}
#main-content table#productEdit td {
margin: 0px;
padding: 5px;
border-top: 1px none #4B3200;
border-right: 1px solid #4B3200;
border-bottom: 1px solid #4B3200;
border-left: 1px none #4B3200;
}
#main-content table#productEdit tr {
margin: 0px;
padding: 0px;
border-top: 1px none #4B3200;
border-right: 1px none #4B3200;
border-bottom: 1px solid #4B3200;
border-left: 1px none #4B3200;
}
#main-content table#productEdit th {
margin: 0px;
padding: 5px;
border-top: 1px none #4B3200;
border-right: 1px solid #4B3200;
border-bottom: 1px solid #4B3200;
border-left: 1px none #4B3200;
}
#add {
font-weight: bold;
color: #009933;
}
.two_col_form form {
margin:20px 0 0 50px; /* moves form from T/L corner of page */
}
/* end temp styles */
/* -- a form with all form elements -- */
.two_col_form * { /* zeros margins and padding within the layout */
margin:0;
padding:0;
}
.two_col_form h3 {margin-top:.0em;}
.two_col_form form {
float:left;
width:38em;
padding:1em 0.75em 0.5em;
border:1px solid #AAA;
}
.two_col_form div.formsection {
float:left; /* enclose the form control and label */
width:100%; /* makes the floated element full width */
border-bottom:1px solid #AAA;
padding-bottom:0.4em;
margin-bottom: 6px;
}
.two_col_form div.formsection input {
font-size:.8em;
padding-bottom:.5em;
}
.two_col_form div.formsection label {
display:block;
clear:both;
font-size:85%;
font-weight:bold;
margin:.5em 0 0;
padding-bottom:.5em;
}
.two_col_form div input[type="submit"] { /*IDWIMIE 6, so the button is on the left in IE6 */
float:right;
margin:.5em .3em .5em 0;
}
/* styles for the checkbox and radio button sets */
.two_col_form div.formsection .buttongroup {
float:left; /* wraps contents */
}
.two_col_form div.formsection .buttongroup input {
float:left;
}
.two_col_form div.formsection .buttongroup label {
margin:0 5% 0 1.5em; /* creates spacing betwen adjacent c/boxes, and btw each c/box and its label */
font-weight:normal; /* reset the inherited value */
clear:none; /* reset the inherited value */
}
/* styles for the msgs/errors list */
.two_col_form div.formsection ul { /* add 'message' class to div to see this list */
display:none;
font-size:.8em;
padding:1em 2em;
}
.two_col_form div.formsection ul.message {display:block;} /* add 'message' class to ul to see this list */
.two_col_form div.formsection ul.error {color:red;}
.two_col_form div.formsection ul.message li {padding: .3em 0;}
#sub a:visited {
font-weight: bold;
color: #CC0000;
text-decoration: none;
}
#sub #update {
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
font-size: 100%;
background: #006600;
}
#dbFields {
font: bold 75% "Courier New", Courier, monospace;
color: #871F1D;
padding: 3px;
margin-left: 6em;
}
#adminNav a:link {
font-size: 80%;
font-weight: bold;
color: #990000;
text-decoration: none;
}
#adminNav a:visited {
font-size: 80%;
font-weight: bold;
color: #990000;
text-decoration: none;
}
#adminNav a:hover {
font-size: 80%;
font-weight: bold;
color: #990000;
text-decoration: underline;
}
#adminNav caption {
font-size: 90%;
font-weight: bold;
color: #6E432E;
text-decoration: none;
}
#adminNav {
padding: 4px 4px 0px;
border: 2px solid #5D2A17;
width: 90%;
margin: 3px auto 0px;
}
#main-content p#add a:link {
font-weight: bold;
color: #009933;
}
#main-content p#add a:visited {
font-weight: bold;
color: #009933;
}
#main-content p#add a:hover {
font-weight: bold;
color: #009933;
text-decoration: underline;
}
#site-infoCMS {
padding: 0; /* this padding matches the left alignment of the elements
in the divs that appear above it. */
background:#FFEFC1;
border-top: 4px double #533028;
border-right: 4px none #533028;
border-bottom: 4px none #533028;
border-left: 4px none #533028;
width: 100%;
}
#site-infoCMS p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid
the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as
the margin would have, without the margin collapse issue */
font-size: 85%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: normal;
text-align: center;
}
body#cmsContent #main-content ul a:link {
color:#FF6600;
font-size: 90%;
font-weight: bold;
text-decoration: underline;
}
body#cmsContent #main-content ul a:visited {
color:#FF6600;
font-size: 90%;
font-weight: bold;
text-decoration: underline;
}
body#cmsContent #main-content ul a:hover {
color:#990000;
font-size: 90%;
font-weight: bold;
}
body#cmsCustomers #wrapper {
width: 2350px;
margin: 0 0 0px 20px;
}
body#cmsCustomers #wrapper #main-content {
width: 2400px;
}
table#customerEdit td, table#customerEdit th {
font-size: 85%;
padding: 5px;
}
table#customerEdit th {
text-transform:capitalize;
text-decoration:underline;
}