Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. <?php
  2.  
  3. //user session start from here that identify user
  4. session_start();
  5. if(!isset($_SESSION['user']) || !isset($_SESSION['password']) || !isset($_SESSION['id']) || ($_SESSION['id'])!=2){
  6. header("Location:loginpage.php");
  7. }
  8. ?>
  9.  
  10. //HTML start
  11. <!DOCTYPE html>
  12. <html>
  13. <title>W3.CSS Template</title>
  14. <meta charset="UTF-8">
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <link rel="stylesheet" href="w3style.css">
  17. <link rel="stylesheet" href="fontstyle.css">
  18.  
  19. <style>
  20. body,h1,h2,h3,h4,h5 {font-family: "Poppins", sans-serif}
  21. body {font-size:16px;}
  22. .w3-half img{margin-bottom:-6px;margin-top:16px;opacity:0.8;cursor:pointer}
  23. .w3-half img:hover{opacity:1}
  24.  
  25.  
  26.  
  27. .table-style-6{
  28. position:relative;
  29. top: 20%;
  30. transform: translateY(30%);
  31. font: 95% Arial, Helvetica, sans-serif;
  32. max-width:250px;
  33. margin: 10px auto;
  34. padding:16px;
  35. //background: #F7F7F7;
  36. }
  37. </style>
  38.  
  39.  
  40. <body>
  41.  
  42. <!-- Sidebar/menu -->
  43. <nav class="w3-sidebar w3-red w3-collapse w3-top w3-large w3-padding" style="z-index:3;width:300px;font-weight:bold;" id="mySidebar"><br>
  44. <a href="javascript:void(0)" onclick="w3_close()" class="w3-button w3-hide-large w3-display-topleft" style="width:100%;font-size:22px">Close Menu</a>
  45. <div class="w3-container">
  46. <h3 class="w3-padding-64"><b>Islam Store</b></h3>
  47. </div>
  48. <div class="w3-bar-block">
  49. <a href="mainpage.php" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">Home</a>
  50. <a href="cashin.php" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">bKash</a>
  51. <a href="easyload.php" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">FlexiLoad</a>
  52. <a href="#designers" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">History</a>
  53. <a href="#packages" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">Packages</a>
  54. <a href="#contact" onclick="w3_close()" class="w3-bar-item w3-button w3-hover-white">Contact</a>
  55. </div>
  56. </nav>
  57.  
  58. <!-- Top menu on small screens -->
  59. <header class="w3-container w3-top w3-hide-large w3-red w3-xlarge w3-padding">
  60. <a href="javascript:void(0)" class="w3-button w3-red w3-margin-right" onclick="w3_open()">☰</a>
  61. <span>Islam Store</span>
  62. </header>
  63.  
  64. <!-- Overlay effect when opening sidebar on small screens -->
  65. <div class="w3-overlay w3-hide-large" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>
  66.  
  67. <!-- !PAGE CONTENT! -->
  68.  
  69. <div class="w3-main" style="margin-left:100px; margin-right:150px">
  70.  
  71.  
  72.  
  73.  
  74. </div>
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. <?php
  88. //connect with database b_kash is database name
  89. $connect=mysqli_connect("localhost","root","","b_kash");
  90.  
  91.  
  92. // if something is wrong to connect with database die.
  93. if(mysqli_connect_errno())
  94. {
  95. die('Could not connect: ' . mysqli_connect_error());
  96. }
  97.  
  98. //select table from which we take data here saikot is table name.
  99. $result = mysqli_query($connect,"SELECT * FROM saikot WHERE Date>CURDATE()");
  100.  
  101.  
  102. //set timezone
  103. date_default_timezone_set('Asia/Dhaka');
  104.  
  105.  
  106. //displat tiday's date
  107. $today=date("d-m-Y");
  108. echo "<h2>"."Date: " .$today ."</h2>";
  109.  
  110.  
  111.  
  112. echo "<div class='w3-container' id='contact' style='margin-top:0px'>";
  113. echo"<div class='table-style-6'>";
  114. //Table show start from here
  115. echo "<table style='width:30%' border='1'>
  116.  
  117. <tr>
  118. <th>Time</th> <th>Mobile Number</th> <th>Amount</th> <th>Total</th>
  119. </tr>";
  120.  
  121.  
  122. $sum=0;
  123. while($row = mysqli_fetch_array($result))
  124.  
  125. {
  126.  
  127. echo "<tr>";
  128. echo "<td>".$row['Time']."</td>";
  129. echo "<td>" . $row['Number'] ."<div style="."float:right".">"."<font color=#807b7b>".$row['req']."</font>"."</div>"."</td>";
  130.  
  131. echo "<td>" . $row['Amount'] . "</td>";
  132. $sum=$sum+$row['Amount'];
  133. echo "<td> $sum </td>";
  134. echo "</tr>";
  135.  
  136. }
  137.  
  138. echo "</table>"; echo "</br>"; echo "</br>";
  139. echo "</div>";
  140. echo "</div>";
  141.  
  142.  
  143. // here show balance
  144. echo"<div class='table-style-6'>";
  145. $result = mysqli_query($connect,"SELECT * FROM saikot_credit WHERE balance");
  146. $row=mysqli_fetch_array($result);
  147. echo "<h4>"."Your Current Balance: ".$row['balance']."</h4>";
  148. echo "</div>";
  149.  
  150.  
  151.  
  152. mysqli_close($connect);
  153.  
  154. ?>
  155. <script>
  156. // Script to open and close sidebar
  157. function w3_open() {
  158. document.getElementById("mySidebar").style.display = "block";
  159. document.getElementById("myOverlay").style.display = "block";
  160. }
  161.  
  162. function w3_close() {
  163. document.getElementById("mySidebar").style.display = "none";
  164. document.getElementById("myOverlay").style.display = "none";
  165. }
  166.  
  167. // Modal Image Gallery
  168. function onClick(element) {
  169. document.getElementById("img01").src = element.src;
  170. document.getElementById("modal01").style.display = "block";
  171. var captionText = document.getElementById("caption");
  172. captionText.innerHTML = element.alt;
  173. }
  174. </script>
  175.  
  176.  
  177. <div style="float:right">
  178. <h5>see your record by date</h5>
  179. <form float:"right" action="prevday.php" method="post">
  180. Date <input type="text" name="date" value="2017-01-01"/>
  181. <input name="subject" type="submit" value="submit"></input>
  182. </form>
  183. </div>
  184.  
  185. </body>
  186. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement