<?php include("sass/header_links_only.php");?>
         
         <?php 
		 
		 $customer_setup_id =$_REQUEST['id'];

$result = mysqli_query($connection,"SELECT * FROM customer_setup WHERE customer_id  = '$customer_setup_id'");
$test = mysqli_fetch_array($result);
if (!$result) 
		{
		die("Error: Data not found..");
		}
				$customer_name=$test['customer_name'];
				$address=$test['address'];
				$address_bn_view = $address;
				$district=$test['district'];
				$district_bn_view = $district;
				$mobile_no=$test['mobile_no'];
				

if(isset($_POST['submit']))
{	
	$customer_setup_id =$_POST['customer_setup_id'];
	$customer_name = $_POST['customer_name'];
	$address = $_POST['address'];
	$district = $_POST['district'];
	$mobile_no = $_POST['mobile_no'];
	

	mysqli_query($connection,"UPDATE customer_setup SET customer_name ='$customer_name', address ='$address', district ='$district', mobile_no ='$mobile_no' WHERE customer_id = '$customer_setup_id'")
				or die(mysqli_error());
				 
	header("location: edit_cus_success.php");		
}
		 
		 
		 
		 
		 ?>
         
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->

            <!-- Right side column. Contains the navbar and content of the page -->
               <aside class="right-side">
              
                 <section class="content">
                 	 <div class="row">
                        <div class="col-md-6">
                 <!---Main Content--->
                 
                 			<form role="form"  action="<?php echo "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" method="post">
                              <?php
							if (!empty($errMsg))
							{echo "<div class='alert alert-warning alert-dismissible' role='alert'>$errMsg";
							echo "<button type='button' class='close' data-dismiss='alert'><span aria-hidden='false'>&times;</span><span class='sr-only'>		Close</span></button>
                        </div>";}
                        ?>
                                    <div class="box-body">
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Client Name</label>
                                            <input type="hidden" name="customer_setup_id" value="<?php echo $customer_setup_id;?>" />
                                            <input type="text" class="form-control" name="customer_name" value="<?php echo $customer_name;?>" id="" "পন্যের নাম লিখুন">
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Address</label>
                                            <input type="text" class="form-control" name="address" value="<?php echo $address_bn_view;?>">
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Contact Person</label>
                                            <input type="text" class="form-control" name="district" value="<?php echo $district_bn_view;?>">
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputEmail1">Mobile Number</label>
                                            <input type="text" class="form-control" name="mobile_no" value="<?php echo $mobile_no;?>">
                                        </div>
                                  
                                        
                                    </div><!-- /.box-body -->

                                    <div class="box-footer">
                                        <button type="submit" name="submit" class="btn btn-primary">Submit</button>
                                    </div>
                                </form>
                            
                 		</div>
                    </div>
                 
                 
                 </section>
                </aside>
                <!-- /.right-side -->
        </div><!-- ./wrapper -->


        <!-- jQuery 2.0.2 -->
         <?php include("sass/footer_for_datepicker_and_datatable.php");?>

    </body>
</html>