diff --git a/admin/reports.php b/admin/reports.php index 5a64841..1dd8f6d 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -59,6 +59,8 @@ $comment = mysql_escape_string(stripslashes($_POST['comment'])); if($category_exist != '') $category = $category_exist; + + if($category) { $type = $_POST['type']; if(!array_key_exists($type, $report_options['type']['values'])) { @@ -82,6 +84,13 @@ '$reports_id', '$category', '$comment', '$type', '$stock' );"); header("Location: reports.php?edit=1"); + exit; + } + else + { + header("Location: reports.php?edit=1&errormsg=nocategory"); + exit; + } } @@ -105,6 +114,8 @@ } require_once("../ajax.inc.php"); + if($_GET['errormsg']=="nocategory") + echo error(i18n("You must select a category or type a new category name to add a report to your list")); /* Load all the users reports */ $q = mysql_query("SELECT reports_committee.*,reports.name