<?php
include_once "../includes/connectConfig.php";
not_login($log_session);

only_sects("Admin");

$nw_ss = date('Y');
$post_url="";

$post_url = (isset($_GET['preg'])) ? $_GET['preg'] : '';

$prd = (isset($_GET['prd'])) ? $_GET['prd'] : '';

$setup = (isset($_GET['setup'])) ? $_GET['setup'] : '';

$chk_pss = getOne("tks_users"," tus_id = '$log_session' ","acc_stp");
$chkprf = getOne("tks_users"," tus_id = '$log_session' ","photo");
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
    <title>DASHBOARD</title>
	<link rel="icon" type="image/x-icon" href="../img/kmart-icon.png"/>

    <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap" rel="stylesheet">
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/plugins.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/styles.css" rel="stylesheet" type="text/css" />
	<link href="assets/css/dash_2.css" rel="stylesheet" type="text/css" />
	<link href="assets/css/alert.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="plugins/font-icons/fontawesome/css/regular.css">
    <link rel="stylesheet" href="plugins/font-icons/fontawesome/css/fontawesome.css">

	<link rel="stylesheet" type="text/css" href="assets/css/datatables.css">
	
	
	<link href="plugins/sweetalerts/sweetalert2.min.css" rel="stylesheet" type="text/css" />
    <link href="plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
	
	<script src="assets/js/jquery-3.1.1.min.js"></script>
	
	
</head>
<body  class="sidebar-noneoverflow" id="pgtop">

<?php
if(empty($chk_pss) || $chk_pss == "" || $chk_pss == 0)
{
	?>
<script type="text/javascript" language="javascript" >	$(document).ready(function(){	$('#passnew_Modal').modal('show');	});	</script>

 <div class="modal fade" id="passnew_Modal" tabindex="-1" role="dialog" aria-labelledby="catModalLabel" aria-hidden="true"  data-backdrop="static">
    <div class="modal-dialog modal-sm" role="document">
    <form method="post" id="password_form" role="form" autocomplete="off">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="cthead">Create Password</h5>
        </div>
        <div class="modal-body">
				<div class="pass_success"></div>
				
				<div class="form-group frm">
					<label class="text-dark font-weight-bold">Password <code>*</code></label>
					<input type="password" name="password" id="password" class="form-control" placeholder="*******" required="required" />
					<span class="error_here text-left"></span>
				</div>
				
				<div class="form-group frm">
					<label class="text-dark font-weight-bold">Confirm Password <code>*</code></label>
					<input type="password" name="cn_password" class="form-control" placeholder="*******" required="required"  />
					<span class="error_here text-left"></span>
				</div>
		</div>
        <div class="modal-footer">
		  <button name="button_pss"  id="loggpass" type="submit" class="btn btn-primary"> Submit </button>
        </div>
      </div>
	  
	  </form>
	  
    </div>
  </div>

<script src="../log_reg/js/validation.min.js" type="text/javascript"></script>
<script src="../log_reg/js/jquery.validate.min.js"></script>

<script type="text/javascript">
$('document').ready(function()
{ $("#password_form").validate({
 rules:{ password: {required: true,minlength: 8,maxlength: 15},cn_password: {required: true,equalTo: '#password' }, },
messages:{password:{	required: "Enter Password",minlength: "Password at least have 8 characters"},cn_password:{ required: "Please Retype your Password",equalTo: "Password Did not Match !"},},
errorPlacement : function(error, element) {$(element).closest('.frm').find('.error_here').html(error.html()); },
highlight : function(element) { $(element).closest('.frm').removeClass('has-success').addClass('has-error'); },
unhighlight: function(element, errorClass, validClass) { $(element).closest('.frm').removeClass('has-error').addClass('has-success');  $(element).closest('.frm').find('.error_here').html(''); },
submitHandler: submitForm }); 
function submitForm(){		
var data = $("#password_form").serialize(); $.ajax({type : 'POST',url  : 'actions/submit_password.php',	data : data,	beforeSend: function()
{$("#loggpass").html('Changing &nbsp; <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-loader spin mr-2"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>');
$("#loggpass").attr('disabled','disabled'); }, success :  function(data) {	$(".pass_success").html(data); setTimeout(function(){$('#passnew_Modal').modal('hide');},2000); } });	return false;	} });
</script>
 
	<?php
}
?>


	<div class="header-container fixed-top">
        <header class="header navbar navbar-expand-sm">
            <ul class="navbar-item flex-row">
                <li class="nav-item theme-logo">
                    <a href="index">
						<img src="../img/kmart-logo.png" alt="K-Mart logo" class="img-fluid m-auto rounded navbar-logo"/> 
                    </a>
                </li>
            </ul>

            <a href="javascript:void(0);" class="sidebarCollapse" data-placement="bottom"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3" y2="6"></line><line x1="3" y1="12" x2="3" y2="12"></line><line x1="3" y1="18" x2="3" y2="18"></line></svg></a>
			
            <ul class="navbar-item flex-row navbar-dropdown ml-auto align-items-baseline">
				<?php /*
				<li class="nav-item mr-md-5 mr-1">
                    <a href="puc-live" class="d-block spinner-grow text-white  align-self-center loader-sm position-relative" style="width:30px; height:30px;">
						<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" style="position: relative; top: 3px; left: 3px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-radio"><circle cx="12" cy="12" r="2"></circle><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"></path></svg>
					</a>
                </li>
                
				<li class="nav-item mr-1">
                    <a href="https://projectuconference.com/puc-shop" class="nav-link exlnk">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-bag"><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path></svg>
						<span class="text-primary">My e bag</span>
					</a>
                </li>
				<li class="nav-item">
                    <a href="https://wa.me/+13464753576" target="_blank" class="nav-link exlnk">
                        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-headphones"><path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path></svg>
						<span class="text-primary">Help & Support</span>
					</a>
                </li>*/ ?>
                <li class="nav-item dropdown user-profile-dropdown  order-lg-0 order-1">
                    <a href="javascript:void(0);" class="nav-link dropdown-toggle user" id="userProfileDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <img src="<?= '../img/photo.jpg'; ?>" alt="<?= gtfullname($log_session,1); ?> Profile" class="img-fluid ProfilePreview">
                    </a>
                    <div class="dropdown-menu position-absolute animated fadeInUp" aria-labelledby="userProfileDropdown">
                        <div class="user-profile-section">
                            <div class="media mx-auto">
                                <img src="<?= '../img/photo.jpg'; ?>" class="img-fluid mr-2 ProfilePreview" alt="Admin Profile">
                                <div class="media-body">
                                    <h5><?= gtfullname($log_session,''); ?></h5>
                                </div>
                            </div>
                        </div>
                        <div class="dropdown-item">
							<a href="logout">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> <span>Log Out</span>
                            </a>
                        </div>
                    </div>
                </li>
            </ul>
        </header>
    </div>

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container" id="container">

        <div class="overlay"></div>
        <div class="cs-overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN SIDEBAR  -->
        <div class="sidebar-wrapper sidebar-theme">
            
            <nav id="compactSidebar">
                <ul class="menu-categories">
                    <li class="menu" >
                        <a href="index"  class="menu-toggle">
                            <div class="base-menu">
                                <div class="base-icons">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
                                </div>
                                <span>Dashboard</span>
                            </div>
                        </a>
                    </li>
					
				<li class="menu" >
					<a href="banner"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>
							</div>
							<span>Home Banner</span>
						</div>
					</a>
				</li>
				
				<li class="menu" >
					<a href="page-features"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-aperture"><circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-aperture"><circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line></svg>
							</div>
							<span>Page Features</span>
						</div>
					</a>
				</li>
				
				<li class="menu" >
					<a href="category"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-life-buoy"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="4.93" y1="4.93" x2="9.17" y2="9.17"></line><line x1="14.83" y1="14.83" x2="19.07" y2="19.07"></line><line x1="14.83" y1="9.17" x2="19.07" y2="4.93"></line><line x1="14.83" y1="9.17" x2="18.36" y2="5.64"></line><line x1="4.93" y1="19.07" x2="9.17" y2="14.83"></line></svg>
							</div>
							<span>Category</span>
						</div>
					</a>
				</li>
				
				<li class="menu" >
					<a href="products"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-layers"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>
							</div>
							<span>Products</span>
						</div>
					</a>
				</li>
				
				<li class="menu" >
					<a href="orders"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>
							</div>
							<span>Orders</span>
						</div>
					</a>
				</li>
				
				
				<li class="menu" >
					<a href="news"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pen-tool"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.586 7.586"></path><circle cx="11" cy="11" r="2"></circle></svg>
							</div>
							<span>Blogs</span>
						</div>
					</a>
				</li>
				
				
				<li class="menu" >
					<a href="faqs"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>
							</div>
							<span>FAQs</span>
						</div>
					</a>
				</li>
				
				<li class="menu" >
					<a href="account-users"  class="menu-toggle">
						<div class="base-menu">
							<div class="base-icons">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
							</div>
							<span>Users</span>
						</div>
					</a>
				</li>
				
					
					
                </ul>
            </nav>

        </div>
		
		<form method="post" action="actions/profilepic.php" enctype="multipart/form-data" id="picUploadForm" target="uploadTarget">
			<input type="file" name="picture" id="profile_chnge"  style="display:none" accept="image/jpeg, image/png, image/jpg"/>
		</form>
		<iframe id="uploadTarget" name="uploadTarget" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe>