2016-07-14 10:19:38 +02:00
|
|
|
<?php
|
2016-09-27 17:24:18 +02:00
|
|
|
|
2016-07-14 10:19:38 +02:00
|
|
|
/**
|
2016-09-27 17:59:28 +02:00
|
|
|
* Get event config.
|
2016-07-14 10:19:38 +02:00
|
|
|
*/
|
2016-09-27 17:49:13 +02:00
|
|
|
function EventConfig() {
|
2016-09-27 17:59:28 +02:00
|
|
|
$event_config = sql_select("SELECT * FROM `EventConfig` LIMIT 1");
|
|
|
|
if ($event_config === false)
|
2016-09-27 17:24:18 +02:00
|
|
|
return false;
|
2016-09-27 17:59:28 +02:00
|
|
|
if (count($event_config) > 0)
|
|
|
|
return $event_config[0];
|
2016-09-27 17:24:18 +02:00
|
|
|
return null;
|
2016-07-14 10:19:38 +02:00
|
|
|
}
|
2016-09-27 17:24:18 +02:00
|
|
|
|
2016-07-14 10:19:38 +02:00
|
|
|
/**
|
2016-09-27 17:59:28 +02:00
|
|
|
* Update event config.
|
2016-07-14 10:19:38 +02:00
|
|
|
*
|
|
|
|
* @param string $event_name
|
2016-09-27 17:24:18 +02:00
|
|
|
* @param int $buildup_start_date
|
|
|
|
* @param int $event_start_date
|
|
|
|
* @param int $event_end_date
|
|
|
|
* @param int $teardown_end_date
|
|
|
|
* @param string $event_welcome_msg
|
2016-07-14 10:19:38 +02:00
|
|
|
*/
|
2016-09-27 17:49:13 +02:00
|
|
|
function EventConfig_update($event_name, $buildup_start_date, $event_start_date, $event_end_date, $teardown_end_date, $event_welcome_msg) {
|
2016-09-27 17:59:28 +02:00
|
|
|
if (EventConfig() == null) {
|
2016-09-27 17:49:13 +02:00
|
|
|
return sql_query("INSERT INTO `EventConfig` SET
|
2016-09-27 17:24:18 +02:00
|
|
|
`event_name`=" . sql_null($event_name) . ",
|
|
|
|
`buildup_start_date`=" . sql_null($buildup_start_date) . ",
|
|
|
|
`event_start_date`=" . sql_null($event_start_date) . ",
|
|
|
|
`event_end_date`=" . sql_null($event_end_date) . ",
|
|
|
|
`teardown_end_date`=" . sql_null($teardown_end_date) . ",
|
|
|
|
`event_welcome_msg`=" . sql_null($event_welcome_msg));
|
|
|
|
}
|
2016-09-27 17:49:13 +02:00
|
|
|
return sql_query("UPDATE `EventConfig` SET
|
2016-09-27 17:24:18 +02:00
|
|
|
`event_name`=" . sql_null($event_name) . ",
|
|
|
|
`buildup_start_date`=" . sql_null($buildup_start_date) . ",
|
|
|
|
`event_start_date`=" . sql_null($event_start_date) . ",
|
|
|
|
`event_end_date`=" . sql_null($event_end_date) . ",
|
|
|
|
`teardown_end_date`=" . sql_null($teardown_end_date) . ",
|
|
|
|
`event_welcome_msg`=" . sql_null($event_welcome_msg));
|
2016-07-14 10:19:38 +02:00
|
|
|
}
|
|
|
|
?>
|