ok

Mini Shell

Direktori : /home/u732469475/domains/balajigrills.com/public_html/admin/
Upload File :
Current File : /home/u732469475/domains/balajigrills.com/public_html/admin/password.php

<?php include'header.php';?>
<style type="text/css">
.error{
margin-top: 6px;
margin-bottom: 0;
color: #fff;
background-color: #D65C4F;
display: table;
padding: 5px 8px;
font-size: 11px;
font-weight: 600;
line-height: 14px;
  }
  .green{
margin-top: 6px;
margin-bottom: 0;
color: #fff;
background-color: green;
display: table;
padding: 5px 8px;
font-size: 11px;
font-weight: 600;
line-height: 14px;
  }
</style>
    <!--Navigation Top Bar End-->
    <section id="main-container">

        <!--Left navigation section start-->
        <?php include'sidebar.php';?>
        <!--Left navigation section end-->

<?php
error_reporting(0); 
include'query/changepassword.php';

?>
        <!--Page main section start-->
	<section id="min-wrapper">
            <div id="main-content">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-12">
                            <!--Top header start-->
                            <h3 class="ls-top-header">Change Password</h3>
                          
                        </div>
                    </div>
                    <!-- Main Content Element  Start-->
                    <div class="row">
                        <div class="col-md-12">

                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h3 class="panel-title">Change Password</h3>
                                </div>
								
                                <div class="panel-body form_view">
									<?php 

										$ud=$_SESSION['user'];
										$edit_query = "select * from login where user_Id='$ud'";
										
										$run_edit = mysql_query($edit_query); 
										
										$edit_row=mysql_fetch_array($run_edit);
									?>
                                    <form class="formular form-horizontal ls_form" method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">
                         

										<div class="row ls_divider">
                                            <div class="form-group">
                                                <label class="col-md-2 control-label">Email:* </label>

                                                <div class="col-md-10">
                                                    <input value="<?php echo $edit_row['username']; ?>" class="form-control text-input" type="email" name="email" />
                                                </div>
                                            </div>
                                        </div> 
										
                                        <div class="row ls_divider">
                                            <div class="form-group">
                                                <label class="col-md-2 control-label">New Password:* </label>

                                                <div class="col-md-10">
                                                    <input placeholder="*****"  pattern="[a-zA-Z0-9]{6,20}" title="your password minimum 6 charactor" required class="form-control text-input" type="password" name="new_pass" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row ls_divider last">
                                            <div class="form-group">
                                                <label class="col-md-2 control-label"></label>

                                                <div class="col-sm-10">
                                                    <button class="submit btn-primary btn" type="submit" name="save_updates">Update</button>
                                                </div>
                                            </div>
                                        </div>

                                    </form>

                                </div>
                            </div>
                        </div>
                    </div>
 
                    <!-- Main Content Element  End-->

                </div>
            </div>
	</section>
 
 <?php
	
	if(isset($_POST['save_updates']))
	{
		$email = $_POST['email'];
	
		$new_pass = $_POST['new_pass'];
			
		$new_pass = hash('sha256', $new_pass); // password hashing using SHA256
		
		 
		
		$update_query = mysql_query("update login set username='$email',password='$new_pass' where user_Id='1'");
		
		
		
		if($update_query){
		
		echo "<script>alert('Password has been updated')</script>";
		echo "<script>window.open('password.php','_self')</script>";
		
		
		}
		else{
			echo "<script>alert('Password Not Change')</script>";
			}

	}

?>

    <!--Layout Script start -->
    <script type="text/javascript" src="assets/js/color.js"></script>
    <script type="text/javascript" src="assets/js/lib/jquery-1.11.min.js"></script>
    <script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="assets/js/multipleAccordion.js"></script>

    <!--easing Library Script Start -->
    <script src="assets/js/lib/jquery.easing.js"></script>
    <!--easing Library Script End -->

    <!--Nano Scroll Script Start -->
    <script src="assets/js/jquery.nanoscroller.min.js"></script>
    <!--Nano Scroll Script End -->

    <!--switchery Script Start -->
    <script src="assets/js/switchery.min.js"></script>
    <!--switchery Script End -->

    <!--bootstrap switch Button Script Start-->
    <script src="assets/js/bootstrap-switch.js"></script>
    <!--bootstrap switch Button Script End-->

    <!--easypie Library Script Start -->
    <script src="assets/js/jquery.easypiechart.min.js"></script>
    <!--easypie Library Script Start -->

    <!--bootstrap-progressbar Library script Start-->
    <script src="assets/js/bootstrap-progressbar.min.js"></script>
    <!--bootstrap-progressbar Library script End-->

    <script type="text/javascript" src="assets/js/pages/layout.js"></script>
    <!--Layout Script End -->

    <!--Masked Library Script Start-->
    <script src="assets/js/jquery.maskedinput.min.js"></script>
    <script src="assets/js/jquery.autosize.js"></script>
    <!--Masked Library Script End-->

    <!--validationEngine Library Script Start-->
    <script src="assets/js/validationEngine/languages/jquery.validationEngine-en.js"></script>
    <script src="assets/js/validationEngine/jquery.validationEngine.js"></script>
    <!--validationEngine Library Script End-->

    <!--bootstrap validation Library Script Start-->
    <script src="assets/js/bootstrapvalidator/bootstrapValidator.js"></script>
    <!--bootstrap validation Library Script End-->

    <!--Demo form validation  Script Start-->
    <script src="assets/js/pages/formValidation.js"></script>
    <!--Demo form validation  Script End-->
</body>

</html>

Zerion Mini Shell 1.0