Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include_once 'dbconnect.php';
  4.  
  5. if(isset($_POST['id'])){
  6. $id = $_POST["id"];
  7. echo $id;
  8. }
  9. ?>
  10.  
  11. <!DOCTYPE html>
  12. <html>
  13. <head>
  14. <title></title>
  15. <meta content="width=device-width, initial-scale=1.0" name="viewport" >
  16. <!--Insert sidebar CSS-->
  17. <link rel="stylesheet" href="css/sidebar.css" type="text/css" />
  18. <!--Insert Custom CSS-->
  19. <link rel="stylesheet" href="css/style.css" type="text/css"/>
  20. </head>
  21. <body>
  22.  
  23. <!-- Start of navbar -->
  24. <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  25. <div class="container-fluid">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="index.php"></a>
  34. </div>
  35. <div class="collapse navbar-collapse" id="navbar1">
  36. <ul class="nav navbar-nav navbar-right">
  37. <?php if (isset($_SESSION['usr_id'])) { ?>
  38. <li><h4 class="navbar-text"></h4></li>
  39. <li><a href="store.php">Store</a></li>
  40. <li><a href="settings.php"><i class="fa fa-cog" aria-hidden="true"></i>
  41. Account</a></li>
  42. <li><a href="logout.php"><i class="fa fa-power-off"></i> Log Out</a></li>
  43. <?php } else { ?>
  44. <li><a href="login.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
  45. <li><a href="register.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
  46. <?php } ?>
  47. </ul>
  48. </div>
  49. </div>
  50. </nav>
  51.  
  52.  
  53. <div id="wrapper">
  54.  
  55. <!-- Sidebar -->
  56. <div id="sidebar-wrapper">
  57. <ul class="sidebar-nav">
  58. <li class="sidebar-brand">
  59. <a href="#">
  60. Welcome <?php echo $_SESSION['usr_name'];?>!
  61. </a>
  62. </li>
  63.  
  64. <li>
  65. <a href="store.php" class="active">Edit Movies</a>
  66. </li>
  67. <li>
  68. <a href="users.php" class="active">Edit Users</a>
  69. </li>
  70.  
  71. <li>
  72. <a href="movies.php">Movies Gallery</a>
  73. </li>
  74. <li>
  75. <a href="#">My Rents</a>
  76. </li>
  77. <li>
  78. <a href="#">All Rents</a>
  79. </li>
  80. <li>
  81. <a href="#">Account</a>
  82. </li>
  83. <li>
  84. <a href="#">Contact</a>
  85. <li>
  86. <a href="#">Log out</a>
  87. </li>
  88. </ul>
  89. </div>
  90. <!-- /#sidebar-wrapper -->
  91.  
  92. <!-- Page Content -->
  93. <div id="page-content-wrapper">
  94. <div class="container-fluid" id="movie-catalog">
  95. <div class="row">
  96.  
  97. <?php
  98. $result = mysqli_query($con, "SELECT * FROM movies");
  99.  
  100. while($row = mysqli_fetch_array($result)){
  101. echo '
  102. <div class="col-md-3 portfolio-item">
  103. <a href="#">
  104. <img class="img-responsive img-center cover" src='.$row['cover_path'].' style="width:150px;height:200px;" alt="">
  105. </a>
  106. <h3 class="text text-center">
  107. <a href="#">'.$row['title'].'</a>
  108. </h3>
  109. <div class="centered">
  110. <input class="btn btn-info text-center info-button" type="submit" data-id="'.$row['id'].'" data-toggle="modal" name="id" value="Info" />
  111. <button type="button" class="btn btn-warning center">Rent</button>
  112. </div><br>
  113. </div>';
  114. }
  115.  
  116. ?>
  117.  
  118. </div>
  119. <!-- /.row -->
  120.  
  121. <!-- Pagination -->
  122. <div class="row text-center">
  123. <div class="col-lg-12">
  124. <ul class="pagination">
  125. <li>
  126. <a href="#">&laquo;</a>
  127. </li>
  128. <li class="active">
  129. <a href="#">1</a>
  130. </li>
  131. <li>
  132. <a href="#">2</a>
  133. </li>
  134. <li>
  135. <a href="#">3</a>
  136. </li>
  137. <li>
  138. <a href="#">4</a>
  139. </li>
  140. <li>
  141. <a href="#">5</a>
  142. </li>
  143. <li>
  144. <a href="#">&raquo;</a>
  145. </li>
  146. </ul>
  147. </div>
  148. </div>
  149. <!-- /.row -->
  150.  
  151. </div>
  152. </div>
  153. <!-- /#page-content-wrapper -->
  154. </div>
  155. <!-- /#wrapper -->
  156.  
  157.  
  158. <!-- Modal -->
  159. <div class="modal fade" id="myModal" role="dialog">
  160. <div class="modal-dialog modal-md">
  161. <div class="modal-content">
  162.  
  163. <div class="modal-header">
  164. <button type="button" class="close" data-dismiss="modal">&times;</button>
  165. <h4 class="modal-title">Movie Info</h4>
  166. </div>
  167.  
  168. <div class="modal-body">
  169. <div class="row">
  170. <p class="modal-text"></p>
  171. <?php
  172.  
  173.  
  174. $movie = mysqli_query($con, "SELECT * FROM movies WHERE id=".$id);
  175.  
  176. $row = mysqli_fetch_array($movie);
  177.  
  178. echo '
  179. <div class="col-md-4">
  180. <div class="info-image">
  181. <img class="img-responsive" src="'.$row['cover_path'].'" style="width:150px;height:200px;">
  182. </div>
  183. </div>
  184.  
  185. <div class="col-md-4">
  186. <h4>Title: '.$row['title'].'</h4>
  187. <h4>Director: '.$row['director'].'</h4>
  188. <h4>Year: '.$row['d'].'</h4>
  189. <h4>Description: '.$row['description'].'</h4>
  190. <a href=""><img class="imdb-img" src="images/IMDb-Icon.png" style="width:80px;height:80px;"></a>
  191. <a href=""><img class="imdb-img" src="images/youtube_logo.png" style="width:60px;height:40px;"></a>
  192. </div>
  193. '; ?>
  194. </div>
  195. </div>
  196.  
  197. <div class="modal-footer">
  198. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  199. </div>
  200.  
  201. </div>
  202. </div>
  203. </div>
  204.  
  205. <!-- Modal end -->
  206.  
  207. </body>
  208.  
  209. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  210. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
  211.  
  212. <!-- Menu Toggle Script -->
  213. <script>
  214. $(document).on("click", ".info-button", function () {
  215.  
  216. var myBookId = $(this).data('id');
  217. $(".modal-body .modal-text").text(myBookId);
  218.  
  219. var id = myBookId.toString();
  220. //alert(variableToSend);
  221.  
  222. $.ajax({
  223. url : "movies.php",
  224. type: "POST",
  225. data : {"id" : id},
  226. success: function(data)
  227. {
  228. //data - response from server
  229. alert(data);
  230. $('#myModal').modal('show');
  231. }
  232.  
  233. });
  234.  
  235.  
  236. });
  237. </script>
  238.  
  239. <!-- Latest compiled and minified CSS -->
  240. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  241.  
  242. <!-- Optional theme -->
  243. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
  244.  
  245. <!-- Latest compiled and minified JavaScript -->
  246. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  247.  
  248. <!-- Insert Font-Awesome -->
  249. <script src="https://use.fontawesome.com/2ce34ad1b9.js"></script>
  250.  
  251. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement