예제 #1
0
 private function fixDates()
 {
     if (is_string($this->uploadDate)) {
         $this->uploadDate = swwat_parse_date($this->uploadDate);
     }
     if (is_string($this->reviewDate)) {
         $this->reviewDate = swwat_parse_date($this->reviewDate);
     }
 }
예제 #2
0
파일: Expo.php 프로젝트: ConSked/scheduler
 private function fixDates()
 {
     if (is_string($this->startTime)) {
         $this->startTime = swwat_parse_date($this->startTime);
     }
     if (is_string($this->stopTime)) {
         $this->stopTime = swwat_parse_date($this->stopTime);
     }
     $this->scheduleAssignAsYouGo = 1 == $this->scheduleAssignAsYouGo;
     $this->scheduleVisible = 1 == $this->scheduleVisible;
     $this->allowScheduleTimeConflict = 1 == $this->allowScheduleTimeConflict;
     $this->newUserAddedOnRegistration = 1 == $this->newUserAddedOnRegistration;
     // $this->scheduleWorkerReset = (1 == this->$scheduleWorkerReset);
 }
예제 #3
0
function format_shift($shift)
{
    list($day, $start, $dash, $stop) = explode(' ', $shift);
    $day = date_format(swwat_parse_date($day), 'D M j');
    $min1 = date_format(swwat_parse_time($start . ":00"), 'i');
    if (strcmp($min1, '00')) {
        $start = date_format(swwat_parse_time($start . ":00"), 'g:i A');
    } else {
        $start = date_format(swwat_parse_time($start . ":00"), 'g A');
    }
    $min2 = date_format(swwat_parse_time($stop . ":00"), 'i');
    if (strcmp($min2, '00')) {
        $stop = date_format(swwat_parse_time($stop . ":00"), 'g:i A');
    } else {
        $stop = date_format(swwat_parse_time($stop . ":00"), 'g A');
    }
    return $day . ', ' . $start . ' - ' . $stop;
}
예제 #4
0
require_once 'db/StationJob.php';
require_once 'db/JobTitle.php';
require_once 'db/Worker.php';
require_once 'db/JobTitle.php';
require_once 'util/log.php';
require_once 'util/session.php';
require_once 'swwat/gizmos/parse.php';
$station = getStationCurrent();
if (isset($_REQUEST['copy'])) {
    $station->stationid = NULL;
}
if (isset($_POST[PARAM_SAVE])) {
    $titleEnums = JobTitle::titleEnums($station->expoid);
    try {
        $station->startTime = swwat_parse_date(html_entity_decode($_POST[PARAM_DATE] . " " . $_POST[PARAM_STARTHOUR]), true);
        $station->stopTime = swwat_parse_date(html_entity_decode($_POST[PARAM_DATE] . " " . $_POST[PARAM_STOPHOUR]), true);
        $station->jobTitle = swwat_parse_enum($_POST[PARAM_JOB], $titleEnums, false);
        $station->maxCrew = swwat_parse_integer(html_entity_decode($_POST[PARAM_MAXCREW]), 11, true);
        $station->minCrew = swwat_parse_integer(html_entity_decode($_POST[PARAM_MINCREW]), 11, true);
        $station->maxSupervisor = swwat_parse_integer(html_entity_decode($_POST[PARAM_MAXSUPERVISOR]), 11, true);
        $station->minSupervisor = swwat_parse_integer(html_entity_decode($_POST[PARAM_MINSUPERVISOR]), 11, true);
        $station->description = swwat_parse_string(html_entity_decode($_POST[PARAM_DESCRIPTION]), true);
        $station->title = swwat_parse_string(html_entity_decode($_POST[PARAM_TITLE]), true);
        $station->location = swwat_parse_string(html_entity_decode($_POST[PARAM_LOCATION]), true);
        $station->instruction = swwat_parse_string(html_entity_decode($_POST[PARAM_INSTRUCTION]), true);
    } catch (Exception $ex) {
        header('Location: WorkerLoginPage.php');
        include 'WorkerLoginPage.php';
        return;
    }
    $station = is_null($station->stationid) ? $station->insert() : $station->update();
예제 #5
0
// $Id: InvitationAction.php 2360 2012-10-09 01:14:19Z cross $ Copyright (c) ConSked, LLC. All Rights Reserved.
include 'util/authenticateOrganizer.php';
require_once 'properties/constants.php';
require_once 'util/log.php';
require_once 'util/session.php';
require_once 'swwat/gizmos/parse.php';
require_once 'db/Invitation.php';
$expo = getExpoCurrent();
// minor housekeeping
unset($_SESSION[PARAM_UPLOAD]);
unset($_SESSION[PARAM_MESSAGE]);
unset($_SESSION[PARAM_STOPTIME]);
unset($_SESSION[PARAM_WITHCODE]);
unset($_SESSION[PARAM_UNIQUE]);
$expirationDate = swwat_parse_date(html_entity_decode($_POST[PARAM_STOPTIME]));
$withCode = 0 == strcmp(PARAM_WITHCODE, swwat_parse_string(html_entity_decode($_POST[PARAM_WITHCODE])));
$uniqueCode = 0 == strcmp(PARAM_UNIQUE, swwat_parse_string(html_entity_decode($_POST[PARAM_UNIQUE])));
$errorMessage = "";
// invite or upload file button?
$invite = isset($_POST[PARAM_SAVE]);
$upload = isset($_POST[PARAM_UPLOAD]);
//
// todo should be _enum(, get if we ever have anything other than 5degrees
// $uploadFileType = swwat_parse_string(html_entity_decode($_POST[PARAM_UPLOADFILETYPE]));
if ($invite) {
    // get emails typed in
    $emails = swwat_parse_string(html_entity_decode($_POST[PARAM_EMAIL]));
    $emails = preg_replace('/\\s+/', ':', $emails);
    logMessage("message", $emails);
    // parse via whitespace
예제 #6
0
 private function fixDates()
 {
     if (is_string($this->expirationDate)) {
         $this->expirationDate = swwat_parse_date($this->expirationDate);
     }
 }
예제 #7
0
// $Id: ExpoEditAction.php 2431 2003-01-07 20:24:44Z cross $ Copyright (c) ConSked, LLC. All Rights Reserved.
include 'util/authenticateOrganizer.php';
require_once 'properties/constants.php';
require_once 'db/Expo.php';
require_once 'db/JobTitle.php';
require_once 'util/log.php';
require_once 'util/session.php';
require_once 'swwat/gizmos/parse.php';
$expo = getExpoCurrent();
if (isset($_POST[PARAM_SAVE])) {
    $expo->title = swwat_parse_string(html_entity_decode($_POST[PARAM_TITLE]), true);
    $expo->description = swwat_parse_string(html_entity_decode($_POST[PARAM_DESCRIPTION]), true);
    $expo->expoHourCeiling = swwat_parse_string(html_entity_decode($_POST[PARAM_MAXHOURS]), true);
    $expo->startTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STARTTIME]), true);
    $expo->stopTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STOPTIME]), true);
    $expo->scheduleAssignAsYouGo = isset($_POST[PARAM_SCHEDULE_ALGO]);
    $expo->scheduleVisible = isset($_POST[PARAM_SCHEDULE_PUBLISH]);
    $expo->allowScheduleTimeConflict = isset($_POST[PARAM_SCHEDULE_TIME_CONFLICT]);
    $expo->newUserAddedOnRegistration = isset($_POST[PARAM_NEWUSER_ADDED_ON_REGISTRATION]);
    if (is_null($expo->expoid)) {
        $expo->insert();
        $jobTitle = new JobTitle();
        $jobTitle->expoid = $expo->expoid;
        $jobTitle->jobTitle = 'Crew';
        $jobTitle->insert();
    } else {
        $expo->update();
    }
    setExpoCurrent($expo);
    // if saved
echo PARAM_STOPTIME;
?>
]');
			var d = $.datepicker.parseDate(DB_FORMAT, stdate.val());
            stdate.val($.datepicker.formatDate(DISPLAY_FORMAT, d));
		}; // init

	</script>
</head>

<body onload="init()">
<div id="container">

<?php 
$expo = getExpoCurrent();
$expDate = swwat_parse_date(html_entity_decode($_SESSION[PARAM_STOPTIME]), true);
if (is_null($expDate)) {
    $expDate = $expo->startTime;
    // default
    $_SESSION[PARAM_STOPTIME] = $expDate;
}
$withCode = isset($_SESSION[PARAM_WITHCODE]);
$uniqueCode = isset($_SESSION[PARAM_UNIQUE]);
// ok, start the html
include 'section/header.php';
?>

<div id="main">
    <?php 
if (!is_null($expo->expoid)) {
    include 'section/LinkExpo.php';
예제 #9
0
 /**
  * @see formatDateKey
  * @return array of string of form '2012-10-02'
  */
 public static function selectDate($expoId)
 {
     try {
         $rows = self::select(GROSSPREF_SELECT_DATE, $expoId);
         $values = array();
         foreach ($rows as $row) {
             $values[] = self::formatDateKey(swwat_parse_date($row['startDate']));
         }
         $rows = NULL;
         return $values;
     } catch (PDOException $pe) {
         logMessage('GrossPreference::selectDate(' . $expoId . ')', $pe->getMessage());
     }
 }
예제 #10
0
         $shiftstatus_new[$k]->stationid = swwat_parse_integer(html_entity_decode($station->stationid), 11, true);
         $shiftstatus_new[$k]->expoid = swwat_parse_integer(html_entity_decode($expo->expoid), 11, true);
         $shiftstatus_new[$k]->statusType = swwat_parse_string(html_entity_decode($_POST[PARAM_STATUSTYPE][$k]), true);
         $shiftstatus_new[$k]->statusTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STATUSDATE][$k] . " " . $_POST[PARAM_STATUSHOUR][$k]), true);
     } else {
         if ($_POST[PARAM_STATUSDATE][$k] == "" && $_POST[PARAM_STATUSHOUR][$k] != "") {
             $shiftstatus_new[$k]->shiftstatusid = swwat_parse_integer(html_entity_decode($_POST[PARAM_STATUSID][$k]), 11, true);
             $shiftstatus_new[$k]->workerid = swwat_parse_integer(html_entity_decode($worker->workerid), 11, true);
             $shiftstatus_new[$k]->stationid = swwat_parse_integer(html_entity_decode($station->stationid), 11, true);
             $shiftstatus_new[$k]->expoid = swwat_parse_integer(html_entity_decode($expo->expoid), 11, true);
             $shiftstatus_new[$k]->statusType = swwat_parse_string(html_entity_decode($_POST[PARAM_STATUSTYPE][$k]), true);
             if ($_POST[PARAM_STATUSTYPE][$k] == "CHECK_IN") {
                 $shiftstatus_new[$k]->statusTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STATUSDATE][$k + 1] . " " . $_POST[PARAM_STATUSHOUR][$k]), true);
             } else {
                 if ($_POST[PARAM_STATUSTYPE][$k] == "CHECK_OUT") {
                     $shiftstatus_new[$k]->statusTime = swwat_parse_date(html_entity_decode($_POST[PARAM_STATUSDATE][$k - 1] . " " . $_POST[PARAM_STATUSHOUR][$k]), true);
                 }
             }
         } else {
             $shiftstatus_new[$k]->shiftstatusid = NULL;
             $shiftstatus_new[$k]->workerid = NULL;
             $shiftstatus_new[$k]->stationid = NULL;
             $shiftstatus_new[$k]->expoid = NULL;
             $shiftstatus_new[$k]->statusType = NULL;
             $shiftstatus_new[$k]->statusTime = NULL;
         }
     }
 }
 for ($k = 0; $k < $c; $k++) {
     if (!is_null($shiftstatus_new[$k]->shiftstatusid)) {
         $shiftstatus_old = ShiftStatus::selectID($shiftstatus_new[$k]->shiftstatusid);