|
@@ -39,8 +39,9 @@ if($submit) {
|
|
|
$project->min_age = http::value("min_age", "int");
|
|
$project->min_age = http::value("min_age", "int");
|
|
|
$project->max_age = http::value("max_age", "int");
|
|
$project->max_age = http::value("max_age", "int");
|
|
|
$project->default_tester_fee = http::value("default_tester_fee", "float");
|
|
$project->default_tester_fee = http::value("default_tester_fee", "float");
|
|
|
- $project->dts_start = http::getDateFromFields("date_start");
|
|
|
|
|
- $project->dts_deadline = http::getDateFromFields("date_deadline");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $date_start = http::getDateFromFields("date_start");
|
|
|
|
|
+ $date_deadline = http::getDateFromFields("date_deadline");
|
|
|
|
|
|
|
|
$form_exception = new FormException;
|
|
$form_exception = new FormException;
|
|
|
|
|
|
|
@@ -54,18 +55,18 @@ if($submit) {
|
|
|
if(empty($project->min_age)) $form_exception->addError("Minimum age is required.");
|
|
if(empty($project->min_age)) $form_exception->addError("Minimum age is required.");
|
|
|
if(empty($project->max_age)) $form_exception->addError("Maximum age is required.");
|
|
if(empty($project->max_age)) $form_exception->addError("Maximum age is required.");
|
|
|
if(empty($project->default_tester_fee)) $form_exception->addError("Default tester fee is required.");
|
|
if(empty($project->default_tester_fee)) $form_exception->addError("Default tester fee is required.");
|
|
|
- if(empty($project->dts_start)) $form_exception->addError("Start Date is required.");
|
|
|
|
|
- if(empty($project->dts_deadline)) $form_exception->addError("Deadline is required.");
|
|
|
|
|
|
|
+ if(empty($date_start)) $form_exception->addError("Start Date is required.");
|
|
|
|
|
+ if(empty($date_deadline)) $form_exception->addError("Deadline is required.");
|
|
|
if($project->min_age > $project->max_age) $form_exception->addError("Minimum age cannot be greater than maximum age.");
|
|
if($project->min_age > $project->max_age) $form_exception->addError("Minimum age cannot be greater than maximum age.");
|
|
|
|
|
|
|
|
- $project->dts_start .= " 00:00:00";
|
|
|
|
|
- $project->dts_deadline .= " 23:59:59";
|
|
|
|
|
- $project->dts_created = Util::getDateTime();
|
|
|
|
|
|
|
+ $unix_start = strtotime($date_start . " 00:00:00");
|
|
|
|
|
+ $unix_deadline = strtotime($date_deadline . " 23:59:59");
|
|
|
|
|
|
|
|
- $unix_start = strtotime($project->dts_start);
|
|
|
|
|
- $unix_end = strtotime($project->dts_deadline);
|
|
|
|
|
|
|
+ $project->dts_start = Util::getDateTime($unix_start);
|
|
|
|
|
+ $project->dts_deadline = Util::getDateTime($unix_deadline);
|
|
|
|
|
+ $project->dts_created = Util::getDateTime();
|
|
|
|
|
|
|
|
- if($unix_start > $unix_end) $form_exception->addError("Start Date cannot be after the Deadline.");
|
|
|
|
|
|
|
+ if($unix_start > $unix_deadline) $form_exception->addError("Start Date cannot be after the Deadline.");
|
|
|
|
|
|
|
|
// Verify location IDs
|
|
// Verify location IDs
|
|
|
Location::load($location_ids_to_add);
|
|
Location::load($location_ids_to_add);
|