Action = "insert"; $InsertQuery->Table = "`rsl`"; $InsertQuery->bindColumn("name", "s", "" . ((isset($_POST["name"])) ? $_POST["name"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("description", "s", "" . ((isset($_POST["description"])) ? $_POST["description"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("start", "s", "" . ((isset($_POST["start"])) ? $_POST["start"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("end", "s", "" . ((isset($_POST["end"])) ? $_POST["end"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("company_id", "s", "" . ((isset($_POST["company_id"])) ? $_POST["company_id"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("department_id", "s", "" . ((isset($_POST["department_id"])) ? $_POST["department_id"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("rsl_category_id", "s", "" . ((isset($_POST["rsl_category_id"])) ? $_POST["rsl_category_id"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("user_id", "s", "" . ((isset($_POST["user_id"])) ? $_POST["user_id"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("version", "s", "" . ((isset($_POST["version"])) ? $_POST["version"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("active", "s", "" . ((isset($_POST["active"])) ? $_POST["active"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("created_at", "s", "" . ((isset($_POST["created_at"])) ? $_POST["created_at"] : "") . "", "WA_DEFAULT"); $InsertQuery->bindColumn("updated_at", "s", "" . ((isset($_POST["updated_at"])) ? $_POST["updated_at"] : "") . "", "WA_DEFAULT"); $InsertQuery->saveInSession(""); $InsertQuery->execute(); // Get the last inserted ID $lastInsertedId = $repnew->insert_id; // Now, insert into rsllimits $InsertRsllimitsQuery = new WA_MySQLi_Query($repnew); $InsertRsllimitsQuery->Action = "insert"; $InsertRsllimitsQuery->Table = "`rsllimits`"; $InsertRsllimitsQuery->bindColumn("idrsl", "s", $lastInsertedId, "WA_DEFAULT"); $InsertRsllimitsQuery->bindColumn("namersllimits", "s", "default", "WA_DEFAULT"); $InsertRsllimitsQuery->execute(); $InsertGoTo = "rsl.php"; if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo ? rel2abs($InsertGoTo, dirname(__FILE__)) : ""; $InsertQuery->redirect($InsertGoTo); } ?>