Advertisement
Guest User

Untitled

a guest
Jun 20th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.20 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(isset($_POST) && !empty(($_POST))){
  4.  
  5. //inlcude atau memasukkan file koneksi ke database
  6. include('database.php');
  7.  
  8.  
  9. $nama = $_POST['name'];
  10. $email = $_POST['email'];
  11. $phone = $_POST['phone'];
  12. $nokwitansi = $_POST['barang'];
  13. $tglkwitansi = $_POST['tgl'];
  14. $terima = $_POST['terima'];
  15. $jumlah = $_POST['jumlah'];
  16. $terbilang = $_POST['huruf'];
  17. $carabayar = $_POST['services'];
  18. $keterangan = $_POST['keterangan'];
  19.  
  20. //melakukan query dengan perintah INSERT INTO untuk memasukkan data ke database
  21. $input = mysqli_query($koneksi,"INSERT INTO jual VALUES(NULL, '".$nama."', '".$email."', '".$phone."', '".$nokwitansi."', '".$tglkwitansi."', '".$terima."', '".$jumlah."', '".$terbilang."','".$carabayar."', '".$keterangan."' )") or die(mysql_error());
  22. $id = mysqli_insert_id($koneksi);
  23. mysqli_close($koneksi);
  24. header('location: kwitansi.php?id='.$id);
  25.  
  26. }else{
  27.  
  28. //redirect atau dikembalikan ke halaman tambah
  29. }
  30. ?>
  31. <!DOCTYPE html>
  32. <html>
  33. <head>
  34. <link rel="shortcut icon" href="images/favicon.ico" type="image/ico">
  35. <link rel="stylesheet" href="css/style.css" type="text/css">
  36. <link rel="stylesheet" href="JS/jquery-ui.css" type="text/css"/>
  37. <script src="JS/jquery.js" type="text/javascript"></script>
  38. <script src="JS/jquery-ui.js" type="text/javascript"></script>
  39. <?php
  40. if ($_SESSION['justloggedin'] = true); {
  41. echo "<script>alert('Welcome Admin!')</script>";
  42. $_SESSION['justloggedin'] = false;
  43. }
  44. ?>
  45. <script>
  46. $(function() {
  47. $( "#datepicker" ).datepicker();
  48. });
  49. </script>
  50.  
  51. <script>
  52. $(document).ready(function(){
  53. $(".dor").hide();
  54. $(".ding").hide();
  55. $(".deng").hide();
  56. $("#dor").click(function(){
  57. $(".index").hide("slow", function(){
  58. $(".deng").hide("slow", function(){
  59. $(".ding").hide("slow", function(){
  60. $(".dor").show('slow');
  61. });
  62. });
  63. });
  64. });
  65. $("#index").click(function(){
  66. $(".dor").hide("slow", function(){
  67. $(".ding").hide("slow", function(){
  68. $(".deng").hide("slow", function(){
  69. $(".index").show('slow');
  70. });
  71. });
  72. });
  73. });
  74. $("#ding").click(function(){
  75. $(".dor").hide("slow", function(){
  76. $(".index").hide("slow", function(){
  77. $(".deng").hide("slow", function(){
  78. $(".ding").show('slow');
  79. });
  80. });
  81. });
  82. });
  83. $("#deng").click(function(){
  84. $(".dor").hide("slow", function(){
  85. $(".index").hide("slow", function(){
  86. $(".ding").hide("slow", function(){
  87. $(".deng").show('slow');
  88. });
  89. });
  90. });
  91. });
  92. });
  93. </script>
  94. <title> Testing web</title>
  95. </head>
  96. <body>
  97. <div id="isi">
  98. <header>
  99. <!--<h1><span class="gold">ODB</span> Testing Web</h1>
  100. <h2>OurDailyBread.org <span class="black-text"><a href="http://www.ourdailybread.org" target="blank">GO</a></span></h2>-->
  101. </header>
  102.  
  103. <nav id="menu">
  104. <ul>
  105. <li><a id="index" href="#" >Dashboard</a></li>
  106. <!-- <li><a href="about.html">About Us</a></li> -->
  107. <!-- <li><a href="contact.php">Make a Receipt</a></li> -->
  108. <!-- <li><button id="index">index</button></li>-->
  109. <li><a id="dor" href="#">Transaction</a></li>
  110. <!--<li><a id="ding" href="#">History</a></li>-->
  111. <div class="dropdown">
  112. <button onclick="myFunction()" class="dropbtn"><b>Record</b></button>
  113. <div id="myDropdown" class="dropdown-content">
  114. <a id="ding" href="#">Payment Record</a>
  115. <a id="deng" href="#">Member Record</a>
  116. </div>
  117. </div>
  118. <li style="float:right; padding-right:15px"><a href="logout.php">Logout</a></li>
  119. </ul>
  120.  
  121. <script>
  122. function myFunction() {
  123. document.getElementById("myDropdown").classList.toggle("show");
  124. }
  125. window.onclick = function(e) {
  126. if (!e.target.matches('.dropbtn')) {
  127.  
  128. var dropdowns = document.getElementsByClassName("dropdown-content");
  129. for (var d = 0; d < dropdowns.length; d++) {
  130. var openDropdown = dropdowns[d];
  131. if (openDropdown.classList.contains('show')) {
  132. openDropdown.classList.remove('show');
  133. }
  134. }
  135. }
  136. }
  137. </script>
  138.  
  139. </nav>
  140.  
  141. <section class="index">
  142. <h2>Hi, <?php
  143. echo $_SESSION['username'];
  144. ?></h2>
  145. <img class="float" src="images/ODB_logo.png" alt="logo">
  146. <h3>What web is this?</h3>
  147. <p>This site is build to ease the user, if you want to print the receipt online.</p>
  148. <h3>Our Story</h3>
  149. <p>It all started in 1938 with a small radio program called Detroit Bible Class. With his gravelly voice, Dr. M. R. DeHaan quickly captured the attention of listeners in the Detroit area, and eventually the nation. Since then, our audience has grown to millions of people around the world who use our Bible-based resources.</p>
  150. </section>
  151. <section class="index">
  152. <p><img src="images/wsk-logo-black.png" alt="wskamu">
  153. </p>
  154. <div class="wsk">
  155. <h4>Komunikasi yang Dimengerti</h4>
  156. <ul>
  157. <li><strong>Baca: </strong>Kisah Para Rasul</li>
  158. <li><b>Content: </b>2:1 Ketika tiba hari Pentakosta, semua orang percaya berkumpul di satu tempat </li>
  159. </ul>
  160. <a href="http://www.warungsatekamu.org/2016/06/komunikasi-yang-dimengerti/">View More</a>
  161. </div>
  162.  
  163. <div class="wsk">
  164. <h4>Hari biasa bersama Allah</h4>
  165. <ul>
  166. <li><strong>Baca: </strong> Kejadian 12:1-4</li>
  167. <li><b>Content: </b>Mendengarkan kesaksian orang-orang tentang karya luar biasa yang Allah perbuat </li>
  168. </ul>
  169. <a href="http://www.warungsatekamu.org/2016/06/hari-hari-biasa-bersama-allah/">View More</a>
  170. </div>
  171.  
  172. <div class="wsk">
  173. <h4>Ulangi perkataan saya</h4>
  174. <ul>
  175. <li><strong>Baca: </strong> Mazmur 141</li>
  176. <li><b>Content: </b>Ketika Rebecca berdiri di atas panggung untuk berbicara dalam sebuah konferensi, </li>
  177. </ul>
  178. <a href="http://www.warungsatekamu.org/2016/06/ulangi-perkataan-saya/">View More</a>
  179. </div>
  180.  
  181. <div class="wsk">
  182. <h4>Air mata dan tawa</h4>
  183. <ul>
  184. <li><strong>Baca: </strong>Ezra 3:7</li>
  185. <li><b>Content: </b>Tahun lalu di sebuah acara retret, saya bertemu dengan beberapa teman yang sudah </li>
  186. </ul>
  187. <a href="http://www.warungsatekamu.org/2016/06/air-mata-dan-tawa/">View More</a>
  188. </div>
  189. </section>
  190.  
  191. <section class="dor">
  192. <img class="float" src="images/ODB_logo.png" alt="logo">
  193. <h3>Transaction</h3>
  194. <p>
  195. <p>Please Complete this form to make a receipt</p>
  196. <form method="post" target="_blank">
  197. <p>
  198. <label for="name">Full Name:</label>
  199. <input type="text" name="name" required/>
  200. </p>
  201. <p>
  202. <label for="email">Email Address: </label>
  203. <input type="email" name="email" required/>
  204. </p>
  205. <p>
  206. <label for="phone">Phone Number: </label>
  207. <input type="number" name="phone" max="999999999999999">
  208. </p>
  209. <p>
  210.  
  211. <fieldset name="about">
  212. <legend><b>Form Kwitansi</b></legend>
  213. <label for="barang">Receipt Number </label>
  214. <input type="text" maxlength="10" name="barang" required/>
  215. </p>
  216. <p>
  217. <label for="tgl">Date</label>
  218. <input type="text" id="datepicker" name="tgl">
  219.  
  220.  
  221. </p>
  222. <p>
  223. <label for="terima">Received From</label>
  224. <input type="text" maxlength="35" name="terima" placeholder="Company name" required/>
  225. </p>
  226. <p>
  227.  
  228. <label for="budget">Amount</label>
  229. <select name="uang">
  230. <option value="1">IDR</option>
  231. <option value="1">USD</option>
  232. <option value="1">SGD</option>
  233. <option value="1">EUR</option>
  234. </select>
  235. <input type="text" maxlength="20" name="jumlah">
  236.  
  237. </p>
  238. <p>
  239. <label for="huruf">Spelled Out The Numbers</label>
  240. <input type="text" maxlength="70" name="huruf">
  241. </p>
  242.  
  243. <p>
  244. <label for="call">Payment Method</label>
  245. <table>
  246. <tr>
  247. <td><input type="radio" name="services" value="Cash">Cash</td>
  248. <td><input type="radio" name="services" value="Cheque">Cheque</td>
  249.  
  250. <td><input type="radio" name="services" value="Bilyet giro">Bilyet giro</td>
  251. <td><input type="radio" name="services" value="Bank transfer">Bank Transfer</td>
  252. </tr>
  253.  
  254. </table>
  255. </p>
  256.  
  257.  
  258. <p>
  259. <label style="float:left" for="keterangan">Description </label>
  260. <textarea name="keterangan"> </textarea>
  261. </p>
  262. <input id="clear" type="reset" name="reset" value="clear">
  263.  
  264. </fieldset>
  265. <p>
  266. <input type="submit" onclick="return confirm('Are you sure?')" target="blank" value="Submit">
  267.  
  268. </p>
  269.  
  270. </form>
  271. </section>
  272.  
  273. <section class="ding">
  274. <h3 style="text-align:center">Payment Record</h3>
  275. <table border="1px" cellpadding="2px" style="border-collapse:collapse; margin-top:10px">
  276. <tr style="background:grey">
  277. <th>ID</th>
  278. <th>Name</th>
  279. <th>Email</th>
  280. <th>Phone</th>
  281. <th>No.Receipt</th>
  282. <th>Date</th>
  283. <th>Received From</th>
  284. <th>Amount</th>
  285. <th>Payment</th>
  286. <th>Description</th>
  287. <th>Operation</th>
  288. </tr>
  289.  
  290. <?php
  291. $dbhost = 'localhost';
  292. $dbuser = 'root';
  293. $dbpassword = '';
  294. $dbname = 'dhd';
  295. $koneksi = mysql_connect($dbhost,$dbuser,$dbpassword);
  296. mysql_select_db($dbname,$koneksi);
  297.  
  298. $sql = "SELECT * FROM jual";
  299. $lihatdata = mysql_query($sql);
  300. while ($data = mysql_fetch_array($lihatdata)) {
  301. $id = $data[0];
  302. echo '<tr>';
  303. echo '<td>'.$data[0].'</td>';
  304. echo '<td>'.$data['name'].'</td>';
  305. echo '<td>'.$data['email'].'</td>';
  306. echo '<td>'.$data['nomer'].'</td>';
  307. echo '<td>'.$data['nokw'].'</td>';
  308. echo '<td>'.$data['tglkw'].'</td>';
  309. echo '<td>'.$data['namapt'].'</td>';
  310. echo '<td>'.$data['jumlah'].'</td>';
  311. echo '<td>'.$data['bayar'].'</td>';
  312. echo '<td>'.$data['keterangan'].'</td>';
  313. echo "<td><a href = 'delete.php?id=$id' onclick=\"return confirm('Are you sure want to delete this?');\">DELETE</a></td>";
  314. echo '</tr>';
  315. }
  316. echo '</table>';
  317.  
  318. mysql_close($koneksi);
  319. ?>
  320.  
  321. </table>
  322. </section>
  323.  
  324. </section>
  325.  
  326. <section class="deng">
  327. <h3>Member Record</h3>
  328. <table border="1px" cellpadding="2px" style="border-collapse:collapse">
  329. <tr style="background:grey">
  330. <th>ID</th>
  331. <th>Name</th>
  332. <th>Username</th>
  333. <th>Operation</th>
  334. </tr>
  335.  
  336. <?php
  337. $dbhost = 'localhost';
  338. $dbuser = 'root';
  339. $dbpassword = '';
  340. $dbname = 'dhd';
  341. $koneksi = mysql_connect($dbhost,$dbuser,$dbpassword);
  342. mysql_select_db($dbname,$koneksi);
  343.  
  344. $sql = "SELECT * FROM users WHERE username != 'admin'";
  345. $lihatdata = mysql_query($sql);
  346. while ($data = mysql_fetch_array($lihatdata)) {
  347. $id = $data[0];
  348. echo '<tr>';
  349. echo '<td>'.$data[0].'</td>';
  350. echo '<td>'.$data['nama'].'</td>';
  351. echo '<td>'.$data['username'].'</td>';
  352. echo "<td><a href = 'deleteuser.php?id=$id' onclick=\"return confirm('Are you sure want to delete this?');\">DELETE</a></td>";
  353. echo '</tr>';
  354. }
  355. echo '</table>';
  356.  
  357. mysql_close($koneksi);
  358. ?>
  359.  
  360. </table>
  361. </section>
  362.  
  363. </div>
  364. <div style="clear;both"></div>
  365. <footer>
  366. Copyright 2016, Our Daily Bread Ministries
  367. </footer>
  368. </body>
  369. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement