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


$mac_id=$_POST['mac_id'];
$mac_name=$_POST['mac_name'];
$id_dep=$_POST['id_dep'];
$mac_status	=$_POST['mac_status'];


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

        }
        mysqli_close($con);




?>