<body id="category">

<div id="wrap">
	
	<div id="content">
	
		<div id="processing">
		
			<?php 
$id = $_POST['id'];
$name = $_POST['name'];
$receipt = $_POST['type'] == "receipt" ? 1 : 0;
$description = isset($_POST['description']) ? $_POST['description'] : "";
$result = 0;
if (isset($id) && isset($name) && isset($receipt)) {
    $result = submit_edit_category($id, $name, $receipt, $description);
}
if ($result) {
    echo "<p><b>Updating category...</b></p>";
} else {
    echo "<p><b>An error occurs. Redirecting to category page...</b></p>";
}
?>
		
			<img alt="loading" src="image/loading.gif" />
		</div>
		
		<!-- Redirect to category page -->
		<script type="text/javascript">
		setTimeout(function () {
		   window.location.href= 'category.php';
Esempio n. 2
0
     break;
 case "submit_add":
     $isSuccess = submit_add_category($config);
     if ($isSuccess) {
         echo "<p>1 category is added</p>";
     } else {
         echo "<p>CAN NOT add category</p>";
     }
     list_category($config);
     show_add_category_form();
     break;
 case "edit":
     show_edit_category_form($config, $_GET['id']);
     break;
 case "submit_edit":
     $isSuccess = submit_edit_category($config);
     if ($isSuccess) {
         echo "<p>1 category is updated</p>";
     } else {
         echo "<p>CAN NOT update category</p>";
     }
     list_category($config);
     show_add_category_form();
     break;
 case "delete":
     confirmDeleteCategory($config);
     break;
 case "submit_delete":
     $isSuccess = submit_delete_category($config);
     if ($isSuccess) {
         echo "<p>1 category is deleted</p>";