<?php
ob_start();
@session_start();
require_once("../conn/conn.php");
include('../utility/chksession.php');
date_default_timezone_set("Asia/Bangkok");


$id_unit=$_POST['id_unit'];
$name_unit=$_POST['name_unit'];

echo $id_unit;


    
    $sql = "UPDATE pd_unit SET name_unit = '$name_unit' WHERE id_unit='$id_unit'";
	$query = mysqli_query($con,$sql);
        if($query){
            ?>
                <script language="JavaScript" type="text/javascript">
                    <!--
                    alert("บันทึกข้อมูลเรียบร้อย");
                    location.href='../admin/data_unit.php';
                    //-->
                </script>
            <?php
        }else{
            
            echo "Error: " . $sql . "<br>" . mysqli_error($con);

        }
        mysqli_close($con);




?>