<?php 
include '../class/categories.php';
include "../../connection.php";
$CAtegoryid = $_GET['categoryid'];
$CAtegoryname = $_GET['categoryname'];
if ($CAtegoryname == '') {
    echo "<script>\n        alert('Categoy Name is required');\n        window.location='../room/manageroom.php'\n        </script>";
} else {
    $Category = new Category($CAtegoryid, $CAtegoryname);
    if ($Category->UpdateCategory()) {
        echo "<script>\n            alert('Category successfully Updated');\n            window.location='../room/manageroom.php'\n            </script>";
    } else {
        echo "<script>\n            alert('An error has occured during the operation','Wesviewhotel');\n            window.location='../room/manageroom.php'\n            </script>";
    }
}