Advertisement
Guest User

Untitled

a guest
Jun 10th, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 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="#">ButSQL</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 class="active"><a href="#">Sklep<span class="sr-only">(current)</span></a></li>
  35. <li><a href="wyszukaj.php">Wyszukaj</a></li>
  36.  
  37. </ul>
  38. </div><!-- /.navbar-collapse -->
  39. </div><!-- /.container-fluid -->
  40. </nav>
  41.  
  42.  
  43.  
  44. <?php
  45. $ora_user = "damian_wawrzkowicz";
  46. $ora_password = "sysdba";
  47. $ora_bd = " (DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))
  48. (CONNECT_DATA =(SERVICE_NAME = SKLEP)))";
  49. $conn = oci_connect($ora_user,$ora_password,$ora_bd)
  50. if (!$conn) ){
  51. $e = oci_error();
  52. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  53. }
  54.  
  55. $stid = oci_parse($conn, 'SELECT * FROM buty');
  56.  
  57. if (!$stid) {
  58. $e = oci_error($conn);
  59. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  60. }
  61.  
  62. // Perform the logic of the query
  63. $r = oci_execute($stid);
  64. if (!$r) {
  65. $e = oci_error($stid);
  66. trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  67. }
  68.  
  69.  
  70.  
  71. //--------
  72. $count = 6; //to tymczasowe zeby widziec jak by wypisywalo
  73.  
  74. print '<div class="container-fluid" style="background:transparent;" >';
  75. print '<table class="table table-striped">';
  76. print '<thead>';
  77. while (oci_fetch($stid)){ //ta petle trzeba bedzie zmaminiec na while wydaje mi sie
  78.  
  79. $bucik = "img/buty1.jpg";
  80. $opis = oci_result($row, 'OPIS');//wstawienie opisu
  81. $nazwa = oci_result($row, 'NAZWA_BUTA');
  82. $brutto = oci_result($row, 'CENA_BRUTTO');
  83. $id=oci_result($row, 'BUT_ID'); //tutaj id potrzeba zeby potem przekazac do formulara kupna i dalej do bazy
  84. print '<tr>';
  85. print '<form action="kupno.php" method="post">';
  86.  
  87. print '<div class="col-sm-6 col-md-4">';
  88. print '<div class="thumbnail">';
  89. print '<img src="'.$bucik.'">';
  90. print '<div class="caption">';
  91. print '<h3>'.$nazwa.'</h3>'; //nazwa
  92. print '<p>'.$opis.' </p>';
  93. print '<p>Rozmiar: '.$rozmiar.' Cena: '.$brutto.'</p>';
  94. print '<p>
  95. <button type="submit" name="id" value="'.$id.'"class="btn btn-primary" >Kup</button>
  96. </p>'; //tam gdzie $id zmienic potem na wartosci id z bazy danych
  97. print '</div>';
  98. print '</div>';
  99. print '</div>';
  100. print '</form>';
  101. print '</tr>';
  102.  
  103. }
  104.  
  105. print '</thead>';
  106. print '</table>' ;
  107. print '</div>';
  108.  
  109. oci_free_statement($stid);
  110. oci_close($conn);
  111. ?>
  112.  
  113.  
  114. </div>
  115.  
  116. <hr/>
  117. <section id="footer">
  118. <div class="container">
  119. <div class="row text-center text-xs-center text-sm-left text-md-left">
  120. <div class="col-xs-12 col-sm-4 col-md-4">
  121. <h5>INFORMACJE</h5>
  122. <ul class="list-unstyled quick-links">
  123. <li><a href="#"><i class="fa fa-angle-double-right"></i>Regulamin</a></li>
  124. <li><a href="#"><i class="fa fa-angle-double-right"></i>Reklamacje</a></li>
  125. <li><a href="#"><i class="fa fa-angle-double-right"></i>O firmie</a></li>
  126. <li><a href="#"><i class="fa fa-angle-double-right"></i>Płatności</a></li>
  127. <li><a href="#"><i class="fa fa-angle-double-right"></i>Kontakt</a></li>
  128. </ul>
  129. </div>
  130. <div class="col-xs-12 col-sm-4 col-md-4">
  131. <h5>NEWSLETTER</h5>
  132. <ul class="list-unstyled quick-links">
  133. <br/>
  134. <form>
  135. <input type="email" class="form-control" placeholder="Email"><br/>
  136. <button type="submit" class="btn btn-info" >Zapisz się</button>
  137. </form>
  138. </ul>
  139. </div>
  140. <div class="col-xs-12 col-sm-4 col-md-4">
  141. <h5>KONTAKT</h5>
  142. <ul class="list-unstyled quick-links">
  143. <li><a href="#"><i class="fa fa-angle-double-right"></i>Facebook</a></li>
  144. <li><a href="#"><i class="fa fa-angle-double-right"></i>Instagram</a></li>
  145. <li><a href="#"><i class="fa fa-angle-double-right"></i>kontakt@szybkiebuty.com</a></li>
  146. <li><a href="#"><i class="fa fa-angle-double-right"></i>+48 123 32 07</a></li>
  147.  
  148. </ul>
  149. </div>
  150. </div>
  151.  
  152. <div class="row">
  153. <div class="col-xs-12 col-sm-12 col-md-12 mt-2 mt-sm-2 text-center text-white">
  154.  
  155. <p class="h6">&copy wszystkie prawa zastrzeżone. <a class="text-green ml-2" href="#" target="_blank">Szybkie buty</a></p>
  156. </div>
  157. <hr/>
  158. </div>
  159. </div>
  160. </section>
  161.  
  162.  
  163.  
  164. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  165. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  166. <!-- Include all compiled plugins (below), or include individual files as needed -->
  167. <script src="js/bootstrap.min.js"></script>
  168. </body>
  169. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement