Advertisement
Guest User

Untitled

a guest
Jun 12th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.76 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <title>Baza danych butów</title>
  11. <link href="css/bootstrap.min.css" rel="stylesheet">
  12. </head>
  13. <body>
  14.  
  15. <div class="container">
  16.  
  17. <nav class="navbar navbar-default">
  18. <div class="container-fluid">
  19. <!-- Brand and toggle get grouped for better mobile display -->
  20. <div class="navbar-header">
  21. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
  22. <span class="sr-only">Toggle navigation</span>
  23. <span class="icon-bar"></span>
  24. <span class="icon-bar"></span>
  25. <span class="icon-bar"></span>
  26. </button>
  27. <a class="navbar-brand" href="#">Szybkie buty</a>
  28. </div>
  29.  
  30. <!-- Collect the nav links, forms, and other content for toggling -->
  31. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  32. <ul class="nav navbar-nav">
  33.  
  34. <li ><a href="index.php">Sklep</a></li>
  35. <li class="active"><a href="#">Wyszukaj<span class="sr-only">(current)</span></a></li>
  36.  
  37. </ul>
  38. </div><!-- /.navbar-collapse -->
  39. </div><!-- /.container-fluid -->
  40. </nav>
  41. <!--
  42. -->
  43.  
  44. <div class="row">
  45. <div class="col-md-8 col-md-offset-2">
  46. <form action="wyszukaj.php" method="post">
  47. <h3>Wyszukaj faktury poprzez wprowadzenie adresu email:</h3>
  48. <input type="email" name="getEmail" class="form-control" placeholder="Email"><br/>
  49. <button type="submit" name="szukaj" class="btn btn-primary" >Wyszukaj</button>
  50. </form>
  51. </div>
  52.  
  53. </div>
  54. <hr/ >
  55. <?php
  56. $ora_user = "c##damiann";
  57. $ora_password = "sysdba";
  58. $ora_bd = " (DESCRIPTION =
  59. (ADDRESS_LIST =
  60. (ADDRESS =
  61. (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))
  62. (CONNECT_DATA =
  63. (SERVICE_NAME = orcl)))";
  64. $conn = oci_connect($ora_user,$ora_password,$ora_bd);
  65. if(isset( $_POST['getEmail'])){
  66. $email = $_POST['getEmail'];
  67.  
  68.  
  69. }
  70. if (!$conn){
  71. $e = oci_error();
  72. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  73. }
  74.  
  75.  
  76.  
  77. $zapytanie = ""; //tutaj wstawic zapytanie ktoro wyszuka mi w bazie rekordy podanym emailem
  78. $stid = oci_parse($conn, $zapytanie);
  79.  
  80. if (!$stid) {
  81. $e = oci_error($conn);
  82. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  83. }
  84.  
  85. $r = oci_execute($stid);
  86. if (!$r) {
  87. $e = oci_error($stid);
  88. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  89.  
  90.  
  91. print '<table class="table table-striped">';
  92. print '<thead>';
  93. print '<tr>';
  94. print '<th>Imie</th>';
  95. print '<th>Nazwisko</th>';
  96. print '<th>Nr Faktury</th>';
  97. print '<th>Wartość Netto</th>';
  98. print '<th>Wartość Brutto</th>';
  99. print '<th>Bank</th>';
  100. print '<th>Forma Platności</th>';
  101. print '<th>Data Sprzedaży</th>';
  102. print '</tr>';
  103. print '</thead>';
  104. print '<tbody>';
  105. while (oci_fetch($stid)){
  106. $imie_faktura = oci_result($stid, 'IMIE');
  107. $nazwisko_faktura = oci_result($stid, 'NAZWISKO');
  108. $nr_faktury = oci_result($stid, 'NR_FAKTURY');
  109. $netto = oci_result($stid, 'WARTOSC_NETTO');
  110. $brutto = oci_result($stid, 'WARTOSC_BRUTTO');
  111. $bank = oci_result($stid, 'BANK');
  112. $forma_platnosci = oci_result($stid, 'FORMA_PLATNOSCI');
  113. $data_sprzedazy = oci_result($stid, 'DATA_SPRZEDAZY');
  114.  
  115. print '<tr>';
  116. print '<th>'.$imie_faktura.'</th>';
  117. print '<th>'.$nazwisko_faktura.'</th>';
  118. print '<th>'.$nr_faktury.'</th>';
  119. print '<th>'.$netto.'</th>';
  120. print '<th>'.$brutto.'</th>';
  121. print '<th>'.$bank.'</th>';
  122. print '<th>'.$forma_platnosci.'</th>';
  123. print '<th>'.$data_sprzedazy.'</th>';
  124. print '</tr>';
  125. }
  126.  
  127. print '</tbody>';
  128. print '</table>';
  129. }
  130. else{
  131. print '<br/><center><h2>Nie podano adresu email!</h2></center>';
  132. }
  133.  
  134. oci_free_statement($stid);
  135. oci_close($conn);
  136. ?>
  137.  
  138. </div>
  139.  
  140.  
  141. <br/>
  142. <br/>
  143. <hr/>
  144. <br/>
  145. <br/>
  146. <section id="footer">
  147. <div class="container">
  148. <div class="row text-center text-xs-center text-sm-left text-md-left">
  149. <div class="col-xs-12 col-sm-4 col-md-4">
  150. <h5>INFORMACJE</h5>
  151. <ul class="list-unstyled quick-links">
  152. <li><a href="#"><i class="fa fa-angle-double-right"></i>Regulamin</a></li>
  153. <li><a href="#"><i class="fa fa-angle-double-right"></i>Reklamacje</a></li>
  154. <li><a href="#"><i class="fa fa-angle-double-right"></i>O firmie</a></li>
  155. <li><a href="#"><i class="fa fa-angle-double-right"></i>Płatności</a></li>
  156. <li><a href="#"><i class="fa fa-angle-double-right"></i>Kontakt</a></li>
  157. </ul>
  158. </div>
  159. <div class="col-xs-12 col-sm-4 col-md-4">
  160. <h5>NEWSLETTER</h5>
  161. <ul class="list-unstyled quick-links">
  162. <br/>
  163. <form>
  164. <input type="email" class="form-control" placeholder="Email"><br/>
  165. <button type="submit" class="btn btn-info" >Zapisz się</button>
  166. </form>
  167. </ul>
  168. </div>
  169. <div class="col-xs-12 col-sm-4 col-md-4">
  170. <h5>KONTAKT</h5>
  171. <ul class="list-unstyled quick-links">
  172. <li><a href="#"><i class="fa fa-angle-double-right"></i>Facebook</a></li>
  173. <li><a href="#"><i class="fa fa-angle-double-right"></i>Instagram</a></li>
  174. <li><a href="#"><i class="fa fa-angle-double-right"></i>kontakt@szybkiebuty.com</a></li>
  175. <li><a href="#"><i class="fa fa-angle-double-right"></i>+48 123 32 07</a></li>
  176.  
  177. </ul>
  178. </div>
  179. </div>
  180.  
  181. <div class="row">
  182. <div class="col-xs-12 col-sm-12 col-md-12 mt-2 mt-sm-2 text-center text-white">
  183.  
  184. <p class="h6">&copy wszystkie prawa zastrzeżone. <a class="ml-2" href="#" target="_blank">Szybkie buty</a></p>
  185. </div>
  186. <hr/>
  187. </div>
  188. </div>
  189. </section>
  190.  
  191.  
  192.  
  193. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  194. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  195. <!-- Include all compiled plugins (below), or include individual files as needed -->
  196. <script src="js/bootstrap.min.js"></script>
  197. </body>
  198. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement