Advertisement
Guest User

Untitled

a guest
Dec 31st, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Bootstrap Case</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="./css/bootstrap.min.css">
  8. <script src="./js/jquery.min.js"></script>
  9. <script src="./js/bootstrap.min.js"></script>
  10.  
  11. <style>
  12. body{
  13. background: url("images/./bg.jpg");
  14. }
  15.  
  16. #w1{
  17. color: white;
  18. }
  19. .maL{
  20.  
  21. margin-left:15px;
  22. }
  23. #t2{
  24. text-indent:25px;
  25. }
  26.  
  27. </style>
  28. <?php
  29. session_start();
  30. require_once("./connection.php");
  31. ?>
  32. <?php
  33. if(isset($_POST['username'])){
  34.  
  35. $username = $_POST['username'];
  36. $password = $_POST['password'];
  37. $query = "Select * FROM login WHERE username='".$username."' and password ='".$password."'";
  38. $result = mysqli_query($con,$query);
  39.  
  40. if($row = mysqli_fetch_array($result)){
  41. //echo "<meta http-equiv=\"refresh\" content=\"0;URL=./home.php\">";
  42. $_SESSION['username'] = $row['username'];
  43. $_SESSION['password'] = $row['password'];
  44. $_SESSION['id'] = $row['id'];
  45. }
  46. }
  47. ?>
  48. </head>
  49. <body>
  50.  
  51. <nav class="navbar-static" style="opacity:0.9;">
  52. <div class="container navbar-inverse" style="border-radius:10px; margin-top:35px;">
  53. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  54. <span class="sr-only">Toggle Navigation</span>
  55. <span class="icon-bar"></span>
  56. <span class="icon-bar"></span>
  57. <span class="icon-bar"></span>
  58. </button>
  59. <div class="navbar-header">
  60. <a class="navbar-brand" href="javascript:window.location.href=window.location.href">Cambinac's Poultry</a>
  61. </div>
  62. <div class="navbar-collapse collapse">
  63. <ul class="nav navbar-nav navbar-right">
  64.  
  65.  
  66. <li>
  67. <a href="index.php" >Home</a>
  68. </li>
  69. <li>
  70. <a href="#" data-toggle="modal" data-target="#aboutModal">About</a>
  71. </li>
  72. <li><a href="./maintenance.php">Maintenance</a></li>
  73. <li class="dropdown">
  74. <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="margin-right:40px;">
  75. <?php
  76. if(isset($_SESSION['username'])){
  77. ?>
  78. <span class="glyphicon glyphicon-user"></span> <?php if(isset($_SESSION['username'])){echo $_SESSION['username'];}?>
  79. <?php }else{ ?>
  80. Login
  81.  
  82. <?php
  83. }
  84. ?>
  85.  
  86. <span class="caret"></span>
  87. </a>
  88.  
  89. <ul class="dropdown-menu navbar-inverse" style="border-radius:8px;">
  90. <?php
  91. if(!isset($_SESSION['username'])){
  92. ?>
  93. <form method="POST" style="padding:5px 5px; width:180px; margin-top:10px" novalidate="novalidate" class="bv-form text-center" action="./home.php">
  94. <div class="form-group">
  95. <input class="form-control text-center" type="text" placeholder="Username" name="username" style="border-radius:5px;">
  96. </div>
  97. <div class="form-group">
  98. <input class="form-control text-center" type="password" placeholder="Password" name="password" style="border-radius:5px;">
  99. </div>
  100. <div class="form-group">
  101. <button class="btn btn-info form-control btn-xs">Login</button>
  102. </div>
  103. </form>
  104. <?php
  105. }else{
  106. ?>
  107. <li>
  108. <a href="#" id="edit_account" class="dropdown-item" style="color:white;">
  109. <span class="glyphicon glyphicon-cog"></span> Edit Account</a>
  110. </li>
  111. <li>
  112. <a href="#" id="out" value="Logout" class="dropdown-item" style="color:white;">
  113. <span class="glyphicon glyphicon-log-out"></span> Logout
  114. </a>
  115. </li>
  116. <?php }
  117. ?>
  118. <ul>
  119. </li>
  120. </ul>
  121. </div>
  122. </div>
  123. </nav>
  124.  
  125.  
  126. <script type="text/javascript">
  127. $(document).ready(function () {
  128. var url = window.location;
  129. $('ul.nav a[href="'+ url +'"]').parent().addClass('active');
  130. $('ul.nav a').filter(function() {
  131. return this.href == url;
  132. }).parent().addClass('active');
  133. });
  134.  
  135.  
  136. </script>
  137.  
  138. <!-- Trigger the modal with a button -->
  139.  
  140.  
  141. <!-- Modal -->
  142.  
  143.  
  144.  
  145.  
  146. </body>
  147. <div class="modal fade" id="aboutModal" role="dialog" style="margin-top:90px;">
  148. <div class="modal-dialog modal-lg">
  149. <div class="modal-content" style="opacity:0.95;">
  150. <div class="modal-header" style="background-color:black; opacity:0.9;">
  151. <h4 class="modal-title" id="w1">Summary</h4>
  152. </div>
  153. <div class="modal-body">
  154. <p class="maL">
  155. Cambinac is a poultry contract growing of Broiler chicken and it was established last Oct. 15, 2012. The reason of its establishment is that Agriculture business is very viable in Leyte and we want to employ people especially in remote brgys
  156. </p><br/>
  157. <h4>Product and Services</h4><br/>
  158. <p class="maL">
  159. Product: Chicken/Broiler<br/>
  160. Services: Growing of Broiler Chicken
  161. </p><br/>
  162. <h4>Mission</h4><br/>
  163. <p class="maL">
  164. To promote job creation especially in the remote barangay and to help to sustain the value chain of food production.
  165. </p><br/>
  166. <h4>Vision</h4>
  167. <p class="maL">
  168. To promote sustainable method of broiler growing and to always observe sustainable environment impact.
  169. </p>
  170. </div>
  171. <div class="modal-footer">
  172. <table>
  173. <tr>
  174. <td align="center" width="100%">
  175. <address>Brgy. Sherwood, Albuera, Leyte, 6542</address>
  176. </td>
  177. <td align="right">
  178. <button type="button" class="btn btn-default" data-dismiss="modal">close</button>
  179. </td>
  180. </tr>
  181. </table>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186.  
  187. <div class="modal fade" id="editaccount" role="dialog" style="margin-top:90px;">
  188. <div class="modal-dialog modal-sm">
  189. <div class="modal-content" style="opacity:0.95;">
  190. <div class="modal-header" style="background-color:black; opacity:0.9;">
  191. <h4 class="modal-title" id="w1">Account Information</h4>
  192. </div>
  193. <form action ='' method ='POST'>
  194. <div class="modal-body">
  195.  
  196. <div class="form-group">
  197. <label> New Username</label>
  198. <!--<input type='text' name = 'mn' >-->
  199. <input class="form-control" type="text" name = 'newusername' value= <?php echo $_SESSION['username'];?>>
  200. </div>
  201. <div class="form-group">
  202. <label>New Password</label>
  203. <input class="form-control" type='password' name = 'newpassword' value= <?php echo $_SESSION['password'];?>>
  204. </div>
  205. <!--<input type='submit' name = 'yes' value= 'UPDATE'>-->
  206.  
  207.  
  208. </div>
  209. <div class="modal-footer">
  210. <button type="submit" name="yes" class="btn btn-info" >Save Changes</button>
  211. <button type="button" class="btn btn-default" data-dismiss="modal">close</button>
  212. </div>
  213. </form>
  214. </div>
  215. </div>
  216. </div>
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223. <script type="text/javascript">
  224. $(document).ready(function(){
  225. $("#out").click(function(event){
  226. event.preventDefault();
  227. window.location = "./index.php";
  228. });
  229. $("#edit_account").click(function(event){
  230. $("#editaccount").modal("show");
  231. });
  232.  
  233. });
  234. </script>
  235. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement