Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.22 KB | None | 0 0
  1.  
  2. <html>
  3. <?php include ('check_login.php');
  4. include 'connectiondb.php';
  5. $_SESSION['username'] = $_SESSION['username']; // Must be already set
  6. ?>
  7. <?php
  8. echo "<div style='text-align:right'><font color='blue'><p>You are now sign as ".$_SESSION['username']."!!</p></div></font>";
  9. $name = $_SESSION['username'];
  10. ?>
  11. <?php
  12.  
  13. $userid="";
  14. if (loggedin())
  15. {
  16. $query = mysql_query("SELECT * FROM users WHERE username='$_SESSION[username]' ");
  17. while ($row = mysql_fetch_assoc($query))
  18. {
  19. $username = $row ['username'];
  20. }
  21. }
  22. else
  23. {
  24. header("Location:login.php");
  25. exit();
  26. }
  27. ?>
  28. <html xmlns="http://www.w3.org/1999/xhtml">
  29. <head>
  30. <title>Product Graph Client</title>
  31. <link rel="icon" type="images/png"
  32. href="images/banner3.png" />
  33. <link href="style.css" rel="stylesheet" type="text/css" />
  34. <link type="text/css" rel="stylesheet" media="all" href="css/chat.css" />
  35.  
  36. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  37. </head>
  38. <body>
  39. <div id="header">
  40. <img src="images/banner.png" alt="logo" width="100%" height="200"/>
  41.  
  42. <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>
  43. </div>
  44. <div class="container">
  45. <ul id="nav">
  46. <li class="first"><a href="homeclient.php" accesskey="1" title="">Home</a></li>
  47. <li><a href="aboutusclient.php" accesskey="2" title="">About Us</a></li>
  48. <li><a href="contactusclient.php" accesskey="3" title="">Contact Us</a></li>
  49. <li><a href="powercycle.php" accesskey="4" title="">Product Graph</a></li>
  50. <li><a href="greetwall.php" accesskey="5" title="">Greetings Wall</a></li>
  51. <li><a href="livestreamclient.php" accesskey="6" title="">Live Seminar</a></li>
  52. <li><a href="livechat.php" accesskey="6" title="">Live Forum</a></li>
  53. <li><a href="newsclient.php" accesskey="6" title="">News</a></li>
  54. <li><a href="productclient.php" accesskey="6" title="">Ordering</a></li>
  55. <li><a href="transactions.php" accesskey="6" title="">Transaction</a></li>
  56. </td>
  57. <td style="padding-right:20px;">
  58. <li>
  59. <a href="logout.php">Logout</a></td>
  60. </ul>
  61. </div>
  62. <div align="right">
  63.  
  64. <a href="user.php">Your Shopping Cart<img src="images/cart.gif"/></a></div>
  65. <div id="main_container">
  66. <div align="left" style="float: right;">
  67. <table align="right">
  68. <tr>
  69. <td>
  70. Private Chat<br>
  71. ADMIN<br>
  72. <?php
  73. include 'connectiondb.php';
  74. $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
  75. $productCount = mysql_num_rows($sql); // count the output amount
  76. if ($productCount > 0) {
  77. while($row = mysql_fetch_array($sql)){
  78. $user = $row['username'];
  79.  
  80.  
  81. echo'
  82. <a href="javascript:void(0)" onclick="javascript:chatWith(\''.$user.'\')"><img src="images/avatar.jpg" width="20"/>&nbsp; '.$user.'</a>
  83. <br>
  84. ';
  85. }
  86. } else {
  87. echo 'there are no online admins<br>';
  88. }
  89.  
  90. ?>
  91. Users<br><?php
  92. include 'connectiondb.php';
  93. $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
  94. $productCount = mysql_num_rows($sql); // count the output amount
  95. if ($productCount > 0) {
  96. while($row = mysql_fetch_array($sql)){
  97. $user = $row['username'];
  98.  
  99.  
  100. echo'<script type="text/javascript" src="js/jquery.js"></script>
  101. <script type="text/javascript" src="js/chat.js"></script>
  102. <a href="javascript:void(0)" onclick="javascript:chatWith(\''.$user.'\')"><img src="images/avatar.jpg" width="20"/>&nbsp; '.$user.'</a>
  103. <br>
  104. ';
  105. }
  106. } else {
  107. echo 'there are no online users<br>';
  108. }
  109.  
  110. ?>
  111. </td>
  112. </tr>
  113. </table>
  114. </div>
  115. <!-- YOUR BODY HERE -->
  116.  
  117. </div>
  118. </body>
  119. </html>
  120. <body>
  121. <html lang="en">
  122. <head>
  123.  
  124.  
  125. </head>
  126. <script src="js1/jquery.js" type="text/javascript"></script>
  127.  
  128.  
  129. <script type="application/javascript" src="js1/awesomechart.js"> </script>
  130.  
  131. <br>
  132. <table width="610" border="0"><tr><td>
  133.  
  134. <div class="container">
  135.  
  136. <div class="row-fluid">
  137.  
  138. <div class="span12">
  139.  
  140. <div class="hero-unit-table">
  141.  
  142.  
  143. <div class="charts_container">
  144. <div class="chart_container">
  145. <div class="alert alert-info" style='color: rgba(0, 0, 0, 1);
  146. text-shadow: 0 1px 0 brown;
  147. font-size: 20px;
  148. font-family:"trebuchet ms", arial, "liberation sans"'>&nbsp;&nbsp;&nbsp;&nbsp;Product Statistic</div>
  149. <canvas id="chartCanvas1" width="1100" height="400">
  150. Your web-browser does not support the HTML 5 canvas element.
  151. </canvas>
  152.  
  153. </div>
  154. </div>
  155.  
  156.  
  157. <div class="container">
  158.  
  159. <div class="row-fluid">
  160.  
  161. <div class="span12">
  162.  
  163. <div class="hero-unit-table">
  164.  
  165.  
  166. <div class="charts_container">
  167. <div class="chart_container">
  168. <div class="alert alert-info" style='color: rgba(0, 0, 0, 1);
  169. text-shadow: 0 1px 0 brown;
  170. font-size: 20px;
  171. font-family:"trebuchet ms", arial, "liberation sans"'></div>
  172. <canvas id="chartCanvas1" width="1100" height="40">
  173. Your web-browser does not support the HTML 5 canvas element.
  174. </canvas>
  175.  
  176. </div>
  177. </div>
  178.  
  179.  
  180.  
  181.  
  182.  
  183. </div>
  184.  
  185.  
  186.  
  187.  
  188. <script type="application/javascript">
  189.  
  190. var chart1 = new AwesomeChart('chartCanvas1');
  191.  
  192.  
  193. chart1.data = [
  194. <?php
  195. $query = mysql_query("select * from transactions") or die(mysql_error());
  196. while ($row = mysql_fetch_array($query)) {
  197. $product_array = $row["product_id_array"];
  198. $product_id_string = rtrim($product_array, ",");
  199. $id_str_array = explode(",", $product_id_string);
  200. foreach ($id_str_array as $key => $value) {
  201. $id_quantity_pair = explode("-", $value); // Uses Hyphen(-) as delimiter to separate product ID from its quantity
  202. $product_id = $id_quantity_pair[0]; // Get the product ID
  203. $product_quantity = $id_quantity_pair[1]; // Get the quantity
  204. }?>
  205. <?php echo $product_quantity . ','; ?>
  206. <?php }; ?>
  207. ];
  208.  
  209. chart1.labels = [
  210. <?php
  211. $query = mysql_query("select * from transactions") or die(mysql_error());
  212. while ($row = mysql_fetch_array($query)) {
  213. $date = $row['payment_date'];
  214. $product_array = $row["product_id_array"];
  215. $product_id_string = rtrim($product_array, ",");
  216. $id_str_array = explode(",", $product_id_string);
  217. foreach ($id_str_array as $key => $value) {
  218. $id_quantity_pair = explode("-", $value); // Uses Hyphen(-) as delimiter to separate product ID from its quantity
  219. $product_id = $id_quantity_pair[0]; // Get the product ID
  220. $product_quantity = $id_quantity_pair[1]; // Get the quantity
  221.  
  222.  
  223. //
  224. $pid = addslashes(strip_tags($_POST['id']));
  225.  
  226. $errors = array();
  227. if ($stock)
  228. {
  229. if ($stock > 9097152)
  230. {
  231. $errors[] = "<div id='error'>Too many stocks</div>";
  232. }
  233. if (!empty($errors))
  234. {
  235. foreach ($errors as $error)
  236. {
  237. echo $error, '<br/>';
  238. }
  239. }
  240. else
  241. {
  242. // include '../inc/connectdb.php';
  243. $totalstock = $stock + $ustock;
  244. $sql = mysql_query("UPDATE products SET
  245. stock='$totalstock'
  246. WHERE id='$pid'");
  247. }
  248. }
  249. else
  250. {
  251. echo "<div id='error'>Please fill in all fields</div>";
  252. }
  253. }
  254.  
  255.  
  256.  
  257.  
  258.  
  259. $sql = mysql_query("SELECT pname FROM products WHERE id='$product_id' ");
  260. while($row = mysql_fetch_array($sql)){
  261. $product_name = $row["pname"];
  262. }
  263. } ?>
  264. <?php echo "'" . $product_name . ' ' . $date . "'" . ','; ?>
  265. <?php }; ?>
  266. ];
  267. chart1.colors = ['red', 'blue', 'green', 'yellow', 'violet', 'brown'];
  268. chart1.randomColors = true;
  269. chart1.animate = true;
  270. chart1.animationFrames = 30;
  271. chart1.draw();
  272.  
  273.  
  274.  
  275. </script>
  276.  
  277.  
  278. </div>
  279.  
  280. </div>
  281. </div>
  282. </td>
  283. </tr>
  284. </table>
  285. </body>
  286. </html>
  287.  
  288. <script type="text/javascript" src="js/chat.js"></script>
  289.  
  290.  
  291. <table border="0" align="right">
  292. <br />
  293. <br />
  294. <br />
  295. <br />
  296. <br />
  297. <br />
  298. <br />
  299. <br />
  300. <br />
  301. <br />
  302. <br />
  303. <br />
  304. <img src="images/legend.png" width="20%" height="35%" align="right">
  305. </table>
  306.  
  307. <table height="30px">
  308. <td></td>
  309. </table>
  310. <table border=0 align="center" style="width:100%;" height="10%">
  311. <td>
  312. <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>
  313. <td align="right"><font style="font-size: 12px;">Developed and Designed by Jaylord & Ron</td>
  314.  
  315. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement