
test 0

<?php
// ket noi CSDL
//include('ketnoidbegis.php');
// Thông tin kết nối CSDL


echo 'bat dau trang web';

$servername = "localhost";
$username = "hatranlt_quantriedl";
$password = "XXi#0eMsvU)C";
$dbname = "hatranlt_egisvnm";



// Tạo kết nối
$conn = new mysqli($servername, $username, $password, $dbname);
// Kiểm tra kết nối
if ($conn->connect_error) {
    die("Kết nối thất bại: " . $conn->connect_error);
}
$sql = "";
echo "test 1";
if (!isset($_GET['tenloaithietbi']) || $_GET['tenloaithietbi']=="")
{
    echo "test 2";
    if($_GET['id']>0)
    {
        echo "test 3";
       // $sql="update tbldevicetype set devicetypename='" & $_GET['tenloaithietbi'] & "', remark='" & $_GET['remark'] & "' where devicetypeid=" & $_GET['id'] & ";";
       $sql="Select * tbldevicetype where devicetypeid=" & $_GET['id'] & ";";
       $result = $conn->query($sql);
       $row=$result->fetch_assoc()) ;
       echo "<form action="" method="GET">;
       echo "<INPUT TYPE=hidden name='id' value='" & $row['devicetypeid'] & "<BR>";
        echo "Loai Thiet Bi:<INPUT TYPE=text name='tenloaithietbi' value='" & $row['devicetypename'] & "<BR>";
       echo "Ghi Chú: <INPUT TYPE=text name='ghichu' value='" & $row['remark'] & "<BR>";
       echo "<INPUT TYPE=submit value='Update'";
       echo "</form>";
        
    else
    {
        header("Location: /loaithietbi.php");
        exit;
    }
}









$conn->close();
?>