<?php require('includes/head.php');
require 'connection/conn.php';
 if(isset($_POST['submit']))
 {
     $c=$_POST['store_id'];
	 $n=$_POST['name'];
	 $n2=$_POST['name2'];
	 $m=$_POST['mobile'];
	 $a=$_POST['address'];
	 $add="update  `store`    set `store_name`='$n', `store_name_latin`='$n2',`user`='$user',`store_mobile`='$m' , `store_address`='$a' where `store_id`='$c'";
	$conn->query($add);
	echo "<script type='text/javascript'>
		           window.location.href='store_list.php'
		        </script>";
 }
 
 $id=$_GET['id'];
 $check="SELECT * FROM `store` WHERE `store_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="store_id" value="<?php echo $id;?>"></tr>
	
	
	<tr >
		<td>ناو</td><td><input type="text" name="name" required value="<?php echo $row['store_name'];?>"></td>
	</tr>
	<tr >
		<td>ناوی لاتینی</td><td><input type="text" name="name2" required value="<?php echo $row['store_name_latin'];?>"></td>
	</tr>
	<tr >
		<td>مۆبایل</td><td><input type="number" name="mobile" required value="<?php echo $row['store_mobile'];?>"></td>
	</tr>
	<tr >
		<td>ناونیشان</td><td><input type="text" name="address" required value="<?php echo $row['store_address'];?>"></td>
	</tr>
	
	<tr >
		<td></td><td><input type="submit" name="submit" value="گۆڕین"></td>
	</tr>
  </table>
 
</form><?php require'includes/foot.php';?>