Example #1
0
         $TPL["message_good"][] = "Repeating Expense form Pending.";
     } else {
         if ($_POST["changeTransactionStatus"] == "approved") {
             $transactionRepeat->set_value("status", "approved");
             $TPL["message_good"][] = "Repeating Expense form Approved!";
         } else {
             if ($_POST["changeTransactionStatus"] == "rejected") {
                 $transactionRepeat->set_value("status", "rejected");
                 $TPL["message_good"][] = "Repeating Expense form  Rejected.";
             }
         }
     }
 }
 if ($_POST["delete"] && $transactionRepeatID) {
     $transactionRepeat->set_id($transactionRepeatID);
     $transactionRepeat->delete();
     alloc_redirect($TPL["url_alloc_transactionRepeatList"] . "tfID=" . $_POST["tfID"]);
 }
 $_POST["product"] or alloc_error("Please enter a Product");
 $_POST["amount"] or alloc_error("Please enter an Amount");
 $_POST["fromTfID"] or alloc_error("Please select a Source TF");
 $_POST["tfID"] or alloc_error("Please select a Destination TF");
 $_POST["companyDetails"] or alloc_error("Please provide Company Details");
 $_POST["transactionType"] or alloc_error("Please select a Transaction Type");
 $_POST["transactionStartDate"] or alloc_error("You must enter the Start date in the format yyyy-mm-dd");
 $_POST["transactionFinishDate"] or alloc_error("You must enter the Finish date in the format yyyy-mm-dd");
 if (!$TPL["message"]) {
     !$transactionRepeat->get_value("status") && $transactionRepeat->set_value("status", "pending");
     $transactionRepeat->set_value("companyDetails", rtrim($transactionRepeat->get_value("companyDetails")));
     $transactionRepeat->save();
     alloc_redirect($TPL["url_alloc_transactionRepeat"] . "transactionRepeatID=" . $transactionRepeat->get_id());