<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start();
$ver = $_SESSION['distributor_user_id'];
$user_role= $_SESSION['user_role']; 
if(!isset($_SESSION["distributor_user_id"])){
   header('location:https://tarkashcorp.appexperts.net/index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
      <?php include("link_head.php");?>  
    <!-- END HEAD -->
<script>
function myFunction() {
	var txt;
	var r = confirm("Are you sure to cancel!");
	if (r == true) {
		window.location.href="customer-master.php";
	} 
}

</script>
	<style>
	::-webkit-scrollbar {
		display: none;
		overflow: hidden;
	}
	</style>
	<script>
	window.onscroll = function () {
	window.scrollTo(0,0);
	}
	</script>			
	</head>
	
    <body class="">
        <!-- BEGIN HEADER -->
		<?php include("header.php");?>
        <!-- END HEADER -->
		
        <!-- BEGIN CONTAINER -->
        <div class="container-fluid">
            <div class="page-content page-content-popup">
                
                <div class="page-sidebar-wrapper">
                    <!-- BEGIN SIDEBAR -->
                    <?php include("menu.php");?> 
				    <!-- END SIDEBAR -->
                </div>
                <div class="page-fixed-main-content">
                        <div class="row">
                            <div class="col-md-12">
                                <!-- BEGIN SAMPLE TABLE PORTLET-->
                                <div class="portlet">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-bell-o"></i>Edit Customer Detail</div>
											<div class="actions">
										
										   <div class="form-group">
										   <a href="customer-master.php"><button type="submit" style="padding:3px 10px;" class="btn btn-outline btn-circle blue btn-sm blue" name="searchd">Back </button></a>
											</div>
                                            </div>
                                    </div>
											
									<?php
									$pid=$_GET['id'];
									$res = mysqli_query($con,"SELECT * FROM tbl_master_customer where 
									customer_id='$pid'");
									while($fetch_product1=mysqli_fetch_assoc($res))
									{
									?>
										
									<div class="portlet-body form" >
                                        <form method="post" name="form1" action="edit-customer-detail-confirmation.php?id1=<?=$pid;?>">
                                            <div class="form-body">
											<div class="form-group">										
											<div class="col-md-4">
											 <label>Customer Name <span style="color:red;">*</span></label>
											 <input type="text" value="<?=$fetch_product1['customer_name']; ?>" onkeypress='return (event.charCode >= 95 && event.charCode <= 122) || (event.charCode >= 65 && event.charCode <= 90) || (event.charCode == 32) || (event.charCode == 46)' class="form-control" placeholder="Customer Name" name="customer_name" required> 
											</div>
                                            
											
											<div class="col-md-4">
											<label>Email ID <span style="color:red;">*</span></label>
                                              <input type="text" value="<?=$fetch_product1['email_address']; ?>" class="form-control" placeholder="Email ID" name="email_address" required> 
											</div>

											<div class="col-md-4">
											<label>Password <span style="color:red;">*</span></label>
                                             <input type="text" value="<?=$fetch_product1['password']; ?>" class="form-control" placeholder="Password" name="cust_pass"> 
											</div>
											
											</div>
											<br clear="all"><br>
											
											<div class="form-group">
											
											<div class="col-md-4">
											<label>Phone Number <span style="color:red;">*</span></label>
                                             <input type="text" value="<?=$fetch_product1['customer_phone']; ?>" onkeypress='return event.charCode >= 48 && event.charCode <= 57' class="form-control" required placeholder="Phone Number" maxlength="10" name="customer_phone">
											</div>											
											
											<div class="col-md-4">
											<label>Address <span style="color:red;">*</span></label>
                                             <input type="text" value="<?=$fetch_product1['customer_address']; ?>" class="form-control" required placeholder="Address" name="customer_address"> 
											</div>
										<?php }  ?>
											</div>
											<br clear="all"><br>
                                            </div>
										
                                            <div class="form-actions">
											<?php if($user_role=="Admin") { ?>
                                                <button type="submit" name="sub" class="btn blue">Submit</button>
                                                <button type="button" onclick="myFunction();" name="subcancel" class="btn blue">Cancel</button>
											<?php } ?>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <!-- END SAMPLE TABLE PORTLET-->
                            </div>
						</div>
                    </div>					
                    <div class="clearfix"></div>
                    <!-- END DASHBOARD STATS 1-->
                    <!-- END PAGE BASE CONTENT -->
                </div>		
		    <!-- END CONTAINER -->
            <!-- BEGIN FOOTER -->
			<a href="#index" class="go2top">
                    <i class="icon-arrow-up"></i>
                </a>
                <!-- END FOOTER -->
			<div class="copyright-v2" style="padding:3px; margin-top:-18px;">
		    <?=date("Y")?> &copy; Tarkashcorp Developed By <a target="_blank" href="http://www.belltechnology.in">Bell Technology</a>
			</div>
            </div>
        </div>
        <!-- END CONTAINER -->
        <!-- BEGIN QUICK SIDEBAR -->
        <a href="javascript:;" class="page-quick-sidebar-toggler">
            <i class="icon-login"></i>
        </a>
        
        <!-- END QUICK SIDEBAR -->
        <!-- BEGIN QUICK NAV -->
        
        <div class="quick-nav-overlay"></div>
        <!-- END QUICK NAV -->
        
        <!-- BEGIN CORE PLUGINS -->
        <?php include("link_script.php");?>  
        <!-- END THEME LAYOUT SCRIPTS -->
        <script>
            $(document).ready(function()
            {
                $('#clickmewow').click(function()
                {
                    $('#radio1003').attr('checked', 'checked');
                });
            })
        </script>
    </body>
</html>