Advertisement
bjaybjay

Untitled

Mar 13th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Admin Home</title>
  6.      <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <!-- Bootstrap -->
  8.      <link href="css/bootstrap.min1.css"    rel="stylesheet">
  9.     <link href="css/custom1.css" rel="stylesheet">
  10.      <link href="css/font-awesome.css" rel="stylesheet">
  11.     <link href="jquery-ui-1.11.4.custom/jquery-ui.css" rel="stylesheet">
  12.     <link href="jquery-ui-1.11.4.custom/jquery-ui.theme.min.css" rel="stylesheet">
  13.      <link href="jquery-ui-1.11.4.custom/jquery-ui.structure.min.css" rel="stylesheet">
  14.      <link rel="stylesheet" type="text/css" href="css/font-awesome.css">
  15.      <link rel="stylesheet" type="text/css" href="css/summernote.css">
  16.     <link rel="stylesheet" type="text/css" href="css/summernote-bs3.css">
  17.     <script src="js/respond.js"></script>
  18.  
  19.    <?php
  20.     session_start();
  21.     $db = new mysqli ("localhost","svccedux","Playdota16","svccedux_svcc");
  22.     if(isset($_POST['submit'])){
  23.         $_password = $_POST['passsword'];
  24.         $_username = $_POST['username'];
  25.         $_id = $_POST['id'];
  26.        
  27.         $update = $db->query("UPDATE `admin` SET `username`='$_username',`password`='$_password',`status`='0' WHERE id = '$_id'") or die ($db->query);
  28.     }
  29.  
  30.  
  31.     if(!$_SESSION){
  32.         $_SESSION['login']="false";
  33.        
  34.     }else{
  35.        
  36.         if($_SESSION['login'] == "false"){
  37.             //session_destroy();
  38.             header("location:index.php");
  39.         }else{
  40.              
  41.             //echo "wasak";
  42.             $_SESSION['login']="true";
  43.         }
  44.     }
  45.         include("include/connection.php");
  46.         $_admin = $_SESSION["admin"];
  47.         $_status = "";
  48.         $_id = "";
  49.  
  50.         $query = "SELECT * FROM admin WHERE username = '$_admin'";
  51.         $result = mysql_query($query);
  52.         $rows = mysql_fetch_array($result,MYSQL_ASSOC);
  53.         while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
  54.             $_id = $row["id"];
  55.             $_status = $row["status"];
  56.         }
  57.  
  58.         if($_status == 1){
  59.             $showDivFlag=true;
  60.             $found = true;
  61.         }
  62.         else{
  63.             $showDivFlag=false;
  64.             $found=false;
  65.         }
  66.    ?>
  67. </head>
  68. <body style="background-color:#fff;">
  69. <div class="container-fluid" style="padding-top:30px;">
  70.  
  71.     <div class="row">
  72.         <nav class="navbar navbar-inverse navbar-fixed-top">
  73.           <div class="container">
  74.             <div class="navbar-header">
  75.              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
  76.                 <span class="icon-bar"></span>
  77.                 <span class="icon-bar"></span>
  78.                 <span class="icon-bar"></span>
  79.               </button>
  80.               <a class="navbar-brand" href="#">Admin Area</a>
  81.             </div>
  82.             <div id="myNavbar" class="collapse navbar-collapse">
  83.               <ul class="nav navbar-nav navbar-right">
  84.                 <li><a href="adminHome.php"><i class="glyphicon glyphicon-home" style="color:inherit;"></i> Home</a></li>
  85.                 <li><a href="adminOffers.php"><i class="glyphicon glyphicon-briefcase" style="color:inherit;"></i> Offers</a></li>
  86.                 <li><a href="adminAbout.php"><i class="glyphicon glyphicon-user" style="color:inherit;"></i> About</a></li>
  87.                 <li><a href="tempmap.php"><i class="glyphicon glyphicon-map-marker" style="color:inherit;"></i> Map</a></li>
  88.                 <li><a href="adminContact.php"><i class="glyphicon glyphicon-phone" style="color:inherit;"></i> Contact</a></li>
  89.                 <li <?php if ($showDivFlag===false){?>style="display:none"<?php }?>><a href="adminManage.php"><i class="glyphicon glyphicon-list-alt" style="color:inherit;"></i> Manage Admin</a></li>
  90.                 <li class="active" <?php if ($found===true){?>style="display:none"<?php }?>><a href="updateAccount.php"><i class="glyphicon glyphicon-edit" style="color:inherit;"></i> Update Account</a></li>
  91.              
  92.                  <li><a href="#" id="btnlogout"><i class="glyphicon glyphicon glyphicon-log-out" style="color:inherit;"></i>Logout</a></li>
  93.                 <li><a href="#" class="btnhide" style="display:none;" id="loadFA" data-toggle="modal" data-target="#myModaleditFA">rename</a></li>
  94.                 <li><a href="#"  class="btnhide" style="display:none;" id="loaddeleteFA" data-toggle="modal" data-target="#myModaldeleteFA">delete</a></li>
  95.                 <li><a href=""  class="btnhide" style="display:none;" onclick="loadFA()" id="loadFAtemp">load</a></li>
  96.               </ul>
  97.             </div>
  98.           </div>
  99.         </nav>
  100.     </div>
  101.  
  102. </div><!-- end of container-->
  103.  
  104. <div class="container" style="padding-top:40px;">
  105.         <div class="row" style="margin-top:20px;">
  106.             <div class="col-md-6 col-md-offset-3">
  107.                 <div id="loginForm">
  108.                 <form method="post">
  109.                     <input name="id" type="hidden" id="id" value="<?php echo $rows['id']; ?>">
  110.                     <label for="txtUsername">Username:</label>
  111.                     <input type="text" name="username" class="form-control" value="<?php echo $rows['username']; ?>" placeholder="Input Username Here..." readonly>
  112.                     <label for="txtPassword">Password:</label>
  113.                     <input type="password" name="password" value="yu" class="form-control" placeholder="Input Password Here...">
  114.                     <input type="submit" name="submit" value="Update Acount" class="btn btn-default col-md-offset-8" style="margin-top:10px;">
  115.                     </form>
  116.                 </div><!--end of loginForm-->
  117.             </div><!--end of col-->
  118.         </div><!--end of row-->
  119. </div><!--end of container-->
  120.  
  121. <div id="dialog-message" title="Warning">
  122.     <p style="color:red;">
  123.        The username is already exists please try another one.
  124.     </p>
  125. </div>
  126.  
  127. <div id="dialog" title="Message">
  128.     <p>
  129.        Successfully Inserted.
  130.     </p>
  131. </div>
  132.  
  133. <!-- javascript -->
  134.     <script src="jquery-ui-1.11.4.custom/external/jquery/jquery.js"></script>
  135.     <script src="js/bootstrap.min1.js"></script>
  136.     <script src="jquery-ui-1.11.4.custom/jquery-ui.js"></script>
  137.     <script type="text/javascript" src="js/summernote.min.js"></script>
  138.     <script type="text/javascript" src="js/summernote-ext-video.js"></script>
  139.     <script src="js/script.js"></script>
  140. </body>
  141. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement