<html>
<?php include ('check_login.php');
include 'connectiondb.php';
$_SESSION['username'] = $_SESSION['username']; // Must be already set
?>
<?php
echo "<div style='text-align:right'><font color='blue'><p>You are now sign as ".$_SESSION['username']."!!</p></div></font>";
$name = $_SESSION['username'];
?>
<?php
$userid="";
if (loggedin())
{
$query = mysql_query("SELECT * FROM users WHERE username='$_SESSION[username]' ");
while ($row = mysql_fetch_assoc($query))
{
$username = $row ['username'];
}
}
else
{
header("Location:login.php");
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Product Graph Client</title>
<link rel="icon" type="images/png"
href="images/banner3.png" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" media="all" href="css/chat.css" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div id="header">
<img src="images/banner.png" alt="logo" width="100%" height="200"/>
<h2><a href="homeclient.php"><img src="images/house.png" style="vertical-align:top" alt="Homepage" title="Homepage" /></a> | <a href="contactusclient.php"> <img src="images/email.png" alt="Contact" /></a>| <a href="clientfaqs.php"> <img src="images/faq.jpg" alt="faqs" width="18" /></h2>
</div>
<div class="container">
<ul id="nav">
<li class="first"><a href="homeclient.php" accesskey="1" title="">Home</a></li>
<li><a href="aboutusclient.php" accesskey="2" title="">About Us</a></li>
<li><a href="contactusclient.php" accesskey="3" title="">Contact Us</a></li>
<li><a href="powercycle.php" accesskey="4" title="">Product Graph</a></li>
<li><a href="greetwall.php" accesskey="5" title="">Greetings Wall</a></li>
<li><a href="livestreamclient.php" accesskey="6" title="">Live Seminar</a></li>
<li><a href="livechat.php" accesskey="6" title="">Live Forum</a></li>
<li><a href="newsclient.php" accesskey="6" title="">News</a></li>
<li><a href="productclient.php" accesskey="6" title="">Ordering</a></li>
<li><a href="transactions.php" accesskey="6" title="">Transaction</a></li>
</td>
<td style="padding-right:20px;">
<li>
<a href="logout.php">Logout</a></td>
</ul>
</div>
<div align="right">
<a href="user.php">Your Shopping Cart<img src="images/cart.gif"/></a></div>
<div id="main_container">
<div align="left" style="float: right;">
<table align="right">
<tr>
<td>
Private Chat<br>
ADMIN<br>
<?php
include 'connectiondb.php';
$sql = mysql_query("SELECT * FROM account where description='admin' AND active='1'");//database filter DESC means from bottom to top, since you always adding a product is important to show it at a first line
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$user = $row['username'];
echo'
<a href="javascript:void(0)" onclick="javascript:chatWith(\''.$user.'\')"><img src="images/avatar.jpg" width="20"/> '.$user.'</a>
<br>
';
}
} else {
echo 'there are no online admins<br>';
}
?>
Users<br><?php
include 'connectiondb.php';
$sql = mysql_query("SELECT * FROM account where description='client' AND active='1'");//database filter DESC means from bottom to top, since you always adding a product is important to show it at a first line
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$user = $row['username'];
echo'<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/chat.js"></script>
<a href="javascript:void(0)" onclick="javascript:chatWith(\''.$user.'\')"><img src="images/avatar.jpg" width="20"/> '.$user.'</a>
<br>
';
}
} else {
echo 'there are no online users<br>';
}
?>
</td>
</tr>
</table>
</div>
<!-- YOUR BODY HERE -->
</div>
</body>
</html>
<body>
<html lang="en">
<head>
</head>
<script src="js1/jquery.js" type="text/javascript"></script>
<script type="application/javascript" src="js1/awesomechart.js"> </script>
<br>
<table width="610" border="0"><tr><td>
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="hero-unit-table">
<div class="charts_container">
<div class="chart_container">
<div class="alert alert-info" style='color: rgba(0, 0, 0, 1);
text-shadow: 0 1px 0 brown;
font-size: 20px;
font-family:"trebuchet ms", arial, "liberation sans"'> Product Statistic</div>
<canvas id="chartCanvas1" width="1100" height="400">
Your web-browser does not support the HTML 5 canvas element.
</canvas>
</div>
</div>
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="hero-unit-table">
<div class="charts_container">
<div class="chart_container">
<div class="alert alert-info" style='color: rgba(0, 0, 0, 1);
text-shadow: 0 1px 0 brown;
font-size: 20px;
font-family:"trebuchet ms", arial, "liberation sans"'></div>
<canvas id="chartCanvas1" width="1100" height="40">
Your web-browser does not support the HTML 5 canvas element.
</canvas>
</div>
</div>
</div>
<script type="application/javascript">
var chart1 = new AwesomeChart('chartCanvas1');
chart1.data = [
<?php
$query = mysql_query("select * from transactions") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$product_array = $row["product_id_array"];
$product_id_string = rtrim($product_array, ",");
$id_str_array = explode(",", $product_id_string);
foreach ($id_str_array as $key => $value) {
$id_quantity_pair = explode("-", $value); // Uses Hyphen(-) as delimiter to separate product ID from its quantity
$product_id = $id_quantity_pair[0]; // Get the product ID
$product_quantity = $id_quantity_pair[1]; // Get the quantity
}?>
<?php echo $product_quantity . ','; ?>
<?php }; ?>
];
chart1.labels = [
<?php
$query = mysql_query("select * from transactions") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$date = $row['payment_date'];
$product_array = $row["product_id_array"];
$product_id_string = rtrim($product_array, ",");
$id_str_array = explode(",", $product_id_string);
foreach ($id_str_array as $key => $value) {
$id_quantity_pair = explode("-", $value); // Uses Hyphen(-) as delimiter to separate product ID from its quantity
$product_id = $id_quantity_pair[0]; // Get the product ID
$product_quantity = $id_quantity_pair[1]; // Get the quantity
//
$pid = addslashes(strip_tags($_POST['id']));
$errors = array();
if ($stock)
{
if ($stock > 9097152)
{
$errors[] = "<div id='error'>Too many stocks</div>";
}
if (!empty($errors))
{
foreach ($errors as $error)
{
echo $error, '<br/>';
}
}
else
{
// include '../inc/connectdb.php';
$totalstock = $stock + $ustock;
$sql = mysql_query("UPDATE products SET
stock='$totalstock'
WHERE id='$pid'");
}
}
else
{
echo "<div id='error'>Please fill in all fields</div>";
}
}
$sql = mysql_query("SELECT pname FROM products WHERE id='$product_id' ");
while($row = mysql_fetch_array($sql)){
$product_name = $row["pname"];
}
} ?>
<?php echo "'" . $product_name . ' ' . $date . "'" . ','; ?>
<?php }; ?>
];
chart1.colors = ['red', 'blue', 'green', 'yellow', 'violet', 'brown'];
chart1.randomColors = true;
chart1.animate = true;
chart1.animationFrames = 30;
chart1.draw();
</script>
</div>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>
<script type="text/javascript" src="js/chat.js"></script>
<table border="0" align="right">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<img src="images/legend.png" width="20%" height="35%" align="right">
</table>
<table height="30px">
<td></td>
</table>
<table border=0 align="center" style="width:100%;" height="10%">
<td>
<p style = "font-size:12px;text-align:left;font-color:black;">2013 © New Horizon Infinity Global Solutions, Inc. ALL Rights Reserved. <a href="privacy.php">Privacy Policy</a> | <a href="terms.php">Terms of Service</a> | <a href="returnpolicy.php">Return Policy</a> </td>
<td align="right"><font style="font-size: 12px;">Developed and Designed by Jaylord & Ron</td>
</table>