<?php require('includes/head.php');
require 'connection/conn.php';
 if(isset($_POST['submit']))
 {
     $c=$_POST['customer_id'];
	 $n=$_POST['name'];
	 $n2=$_POST['name2'];
	 $m=$_POST['mobile'];
	 $a=$_POST['address'];
	  $l=$_POST['limit'];
	 $add="update  `customer2`    set `limit`='$l',`customer_name`='$n', `customer_name_latin`='$n2',`user`='$user',`customer_mobile`='$m' , `customer_address`='$a' where `customer_id`='$c'";
	$conn->query($add);
	echo "<script type='text/javascript'>
		           window.location.href='customer_list2.php'
		        </script>";
 }
 
 $id=$_GET['id'];
 $check="SELECT * FROM `customer2` WHERE `customer_id`='$id'";
	$check_r=$conn->query($check);
	$row=mysqli_fetch_array($check_r);
?>


<center><h2>گۆڕانکاری</h2></center>
<form action="" method="post">
<table  dir=rtl border=3 width=80% align=center style="font-size:16pt">
<input type="hidden" name="customer_id" value="<?php echo $id;?>"></tr>
	
	
	<tr >
		<td>ناو</td><td><input type="text" name="name" required value="<?php echo $row['customer_name'];?>"></td>
	</tr>
	<tr >
		<td>ناوی لاتینی</td><td><input type="text" name="name2" required value="<?php echo $row['customer_name_latin'];?>"></td>
	</tr>
	<tr >
		<td>مۆبایل</td><td><input type="number" name="mobile" required value="<?php echo $row['customer_mobile'];?>"></td>
	</tr>
	<tr >
		<td>ناونیشان</td><td><input type="text" name="address" required value="<?php echo $row['customer_address'];?>"></td>
	</tr>
	<tr >
		<td>ماوە</td><td><input type="number" name="limit" required value="<?php echo $row['limit'];?>"></td>
	</tr>
	<tr >
		<td></td><td><input type="submit" name="submit" value="گۆڕین"></td>
	</tr>
  </table>
 
</form><?php require'includes/foot.php';?>