include_once dirname(__FILE__) . "/queryfunctions.php"; include_once dirname(__FILE__) . "/functions.php"; include_once dirname(__FILE__) . "/lang/lang_en.php"; $lang = get_language(); load_language($lang); access("admin"); //check if user is allowed to access this page $logofile = Get_LogoFile(); if (isset($_GET["search"])) { find($_GET["search"]); } if (isset($_POST['Submit']) && $_POST['tab'] == 'documents') { $action = $_POST['Submit']; switch ($action) { case $_L['BTN_save']: modify_documents($_POST['propertyno'], $_POST['invoiceno'], $_POST['receiptno'], $_POST['voucherno']); break; case $_L['BTN_delete']: break; case $_L['BTN_list']: break; case $_L['BTN_search']: //check if user is searching using name, payrollno, national id number or other fields // find($_POST["search"]); break; } } if (!$propertyno) { $propertyno = 1; } $items = array();
/** * Get the next document number, 1 Voucher, 2 Invoice, 3 Receipt * @ingroup ADMIN_MANAGEMENT * @param $propertyno [in] property number * @param $doctype [in] 1 Voucher, 2 Invoice, 3 Receipt * @param $update [in] 1 update the document numbers. * * @return next document number */ function get_nextdocumentno($propertyno, $doctype, $update) { global $conn; if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } if (!$conn) { return 0; } if (!$propertyno) { $propertyno = 1; } get_documents($propertyno, $inv, $rcp, $vch); if ($doctype == 1) { $doc = $vch; $vch++; } if ($doctype == 2) { $doc = $inv; $inv++; } if ($doctype == 3) { $doc = $rcp; $rcp++; } if ($update) { modify_documents($propertyno, $inv, $rcp, $vch); } return $doc; }