function addEvent()
 {
     $this->load->model('Event');
     $event = new Event();
     //$array["name"] =
     $event . addEvent();
 }
Exemple #2
0
/**
 * Fraternity events are displayed with three action buttons:
 * Updated, Delete, and Show PNMs. 
 * This function is the form handler for all three.
 * This function is going to add an event for the passed $frat_letters
 * This function is called from ifcrush_frat with $frat_letters 
 **/
function ifcrush_event_handle_form($frat_letters)
{
    global $debug;
    if ($debug) {
        echo "[ifcrush_event_handle_form] {$frat_letters}";
        echo "<pre>";
        print_r($_POST);
        echo "</pre>";
    }
    $thisevent = array('eventID' => isset($_POST['eventID']) ? $_POST['eventID'] : "", 'eventDate' => $_POST['eventDate'], 'title' => $_POST['eventTitle'], 'fratID' => $frat_letters);
    // put the form input into an array
    switch ($_POST['action']) {
        case "Update Event":
            updateEvent($thisevent);
            break;
        case "Delete Event":
            deleteEvent($thisevent);
            break;
        case "Add Event":
            addEvent($thisevent);
            break;
        default:
            echo "[ifcrush_event_handle_form]: bad action";
    }
}
/**
 * Add New Instance Request.
 * @global type $pf_sel_c_instance_total
 * @param type $phase
 * @return type
 */
function addInstanceFlow($id_type, $first_name, $last_name, $e_mail, $phone, $e_date, $e_location, $e_reception, $n_guests)
{
    global $array_label;
    $result = "-";
    $id_instance = getNewIdInstance($id_type);
    if (strlen($id_instance) > 5) {
        $step_one = getStepOneFlow($id_type);
        if (is_numeric($step_one) && $step_one > 0) {
            if (addNewInstance($id_instance, $id_type, $step_one)) {
                if (addCustomer($id_instance, $first_name, $last_name, $e_mail, $phone) && addEvent($id_instance, $e_date, $e_location, $e_reception, $n_guests)) {
                    $result = $id_instance;
                } else {
                    $result .= $array_label['msg_error_insert_ins'];
                }
            } else {
                $result .= $array_label['msg_error_insert_ins'];
            }
        } else {
            $result .= $array_label['msg_error_undefined_f'];
        }
    }
    return $result;
}
Exemple #4
0
function reservationDispatch($op)
{
    if (isset($_POST['add_event'])) {
        Util::jump_to('index.php?modname=reservation&amp;op=add_event');
    }
    if (isset($_POST['category_gestion'])) {
        Util::jump_to('index.php?modname=reservation&amp;op=view_category&amp;id_course=' . $_SESSION['idCourse']);
    }
    if (isset($_POST['location_gestion'])) {
        Util::jump_to('index.php?modname=reservation&amp;op=classroom&amp;id_course=' . $_SESSION['idCourse']);
    }
    if (isset($_POST['undo'])) {
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=subscribed_user');
    }
    if (isset($_POST['undo_switch'])) {
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=events');
    }
    if (isset($_POST['undo_profile'])) {
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=events');
    }
    if (isset($_POST['undo_mail'])) {
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=events');
    }
    if (isset($_POST['okselector'])) {
        if (isset($_GET['id_course'])) {
            $op = 'send_registration';
        }
    }
    if (isset($_POST['cancelselector'])) {
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=subscribed_user');
    }
    if (isset($_POST['undo_cat'])) {
        $op = 'view_category';
    }
    if (isset($_POST['undo_lab'])) {
        $op = 'view_laboratories';
    }
    switch ($op) {
        case 'del_subscription':
            delSubscription();
            break;
        case 'add_subscription':
            addSubscription();
            break;
        case 'add_registration':
            addRegistration();
            break;
        case 'send_registration':
            sendRegistration();
            break;
        case 'del_event':
            delEvent();
            break;
        case 'mod_event':
            modEvent();
            break;
        case 'add_event':
            addEvent();
            break;
        case 'view_user_event':
            viewUserEvent();
            break;
        case 'send_user_event':
            sendUserEvent();
            break;
        case 'excel':
            getExcelFile();
            break;
        case 'reservation':
        default:
            reservation();
            break;
        case 'view_category':
            viewCategoy();
            break;
        case 'add_category':
            addCategoy();
            break;
        case 'mod_category':
            modCategoy();
            break;
        case 'del_category':
            delCategoy();
            break;
            /*case 'view_laboratories':
            			viewLaboratories();
            		break;
            		
            		case 'add_laboratory':
            			addLaboratory();
            		break;
            		
            		case 'mod_laboratory':
            			modLaboratory();
            		break;
            		
            		case 'del_laboratory':
            			delLaboratory();
            		break;*/
            //TODO:
        /*case 'view_laboratories':
        			viewLaboratories();
        		break;
        		
        		case 'add_laboratory':
        			addLaboratory();
        		break;
        		
        		case 'mod_laboratory':
        			modLaboratory();
        		break;
        		
        		case 'del_laboratory':
        			delLaboratory();
        		break;*/
        //TODO:
        case "classroom":
            classroom();
            break;
        case "addclassroom":
            editclassroom();
            break;
        case "modclassroom":
            editclassroom(true);
            break;
        case "saveclassroom":
            saveclassroom();
            break;
        case "delclassroom":
            delclassroom();
            break;
            //TODO:
        //TODO:
        case 'switch_subscription':
            switchSubscription();
            break;
        case 'set_room_view_perm':
            setRoomViewPerm();
            break;
        case 'send_mail':
            reservationSendMail();
            break;
        case 'info_location':
            infoLocation();
            break;
    }
}
Exemple #5
0
    $statement->execute();
    $gameSession = $statement->fetchAll(PDO::FETCH_ASSOC)[0];
    if (!empty($gameSession)) {
        return $gameSession['occupied'] !== '0' ? 'occupied' : 'unoccupied';
    }
    return "not found";
}
$value = "An error has occurred";
$action = getParamGET('action');
if ($action) {
    switch ($action) {
        case "creategame":
            $value = createGame($db);
            break;
        case "joingame":
            $value = joinGame($db);
            break;
        case "addevent":
            $value = addEvent($db);
            break;
        case "getevents":
            $value = getEvents($db);
            break;
        case "getoccupied":
            $value = getOccupied($db);
            break;
        default:
            $value = "unknown command";
    }
}
echo $value;
        $thisEvent->description = $_POST['description'];
        $thisEvent->seatingcap = $_POST['seatingCap'];
        $thisEvent->spectatorcap = $_POST['spectatorCap'];
        $thisEvent->dayticket = $_POST['dayTicket'];
        $thisEvent->weekendticket = $_POST['weekendTicket'];
        $thisEvent->spectatorticket = $_POST['spectatorTicket'];
        $thisEvent->save();
        header('Location: /events.php');
    }
}
if ($_POST['action'] == 'add') {
    echo '<pre>';
    var_dump($_POST);
    echo '</pre>';
    exit;
    addEvent($_POST['eventName'], $_POST['seatingCap'], $_POST['spectatorCap'], $_POST['description'], $_POST['start'], $_POST['end'], $_POST['weekendTicket'], $_POST['dayTicket'], $_POST['spectatorTicket']);
    header('Location: /events.php');
}
//Function
//Add Event
function addEvent($eventname, $seatingCap, $spectatorCap, $description, $start, $end, $weekendTicket, $dayTicket, $spectatorTicket)
{
}
//Validate Event Name
function validateEventName($eventname)
{
    $thisEvent = Event::find_by_name($eventname);
    //Check if event name events
    if ($thisEvent != NULL) {
        //Event Exists
        return FALSE;
Exemple #7
0
        break;
    case 'readall':
        $HTTPAnswer->HTTPAnswer(HTTP_ANSWER_STATUS_200, $Gpio->getAllBitsOnJson(), true);
        break;
    case 'readby':
        $HTTPAnswer->HTTPAnswer(HTTP_ANSWER_STATUS_200, $Gpio->getBitByOnJson($bit), true);
        break;
    case 'writevalue':
        $Gpio->readbitBy($bit);
        $value = $Gpio->value == 0 ? 1 : 0;
        $Gpio->writeValueByBit($bit, $value);
        addEvent($oMySQL, array('ip' => $ip, 'device' => $deviceName, 'bit' => $bit, 'value' => $value));
        $HTTPAnswer->HTTPAnswer(HTTP_ANSWER_STATUS_200, $Gpio->getAllBitsOnJson(), true);
        //smtpmailer($GLOBALS["email"], $GLOBALS["from"], $GLOBALS["from_name"],$mailSubject,$mailBody);
        break;
    case 'opengate':
        $Gpio->readBitBy($bit);
        if ($Gpio->value == 0) {
            $Gpio->writeValueByBit($bit, 1);
            addEvent($oMySQL, array('ip' => $ip, 'device' => $deviceName, 'bit' => $bit, 'value' => 1));
        }
        usleep(400000);
        $Gpio->readBitBy($bit);
        if ($Gpio->value == 1) {
            $Gpio->writeValueByBit($bit, 0);
            addEvent($oMySQL, array('ip' => $ip, 'device' => $deviceName, 'bit' => $bit, 'value' => 0));
        }
        $HTTPAnswer->HTTPAnswer(HTTP_ANSWER_STATUS_200, $Gpio->getAllBitsOnJson(), true);
        //smtpmailer($GLOBALS["email"], $GLOBALS["from"], $GLOBALS["from_name"],$mailSubject,$mailBody);
        break;
}
Exemple #8
0
function schedEvent($postData, $iEventID = '')
{
    global $mail;
    global $host;
    global $docroot;
    // take the input vals, call addEvent, and call addAssign
    // if we have an event_id, we do an update, else, we just add
    if ($iEventID) {
        $iEID = $iEventID;
        // we update the event, delete the currently assigned emps, and re-add the sub'd ones
        updateEvent($iEventID, sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName']));
        // now do the delete
        delAssign($iEventID);
    } else {
        // first add the event and get back the eventID
        $iEID = addEvent(sanitizeInput($postData['dDate']), sanitizeInput($postData['dStartTime']), sanitizeInput($postData['dEndTime']), sanitizeInput($postData['area']), sanitizeInput($postData['tbName']));
    }
    // now we grab the positions for the area
    // and iterate through the emp lists, adding the assignments
    $oPositions = getAreaPos($postData['area']);
    $oEmps = getMyEmployees($_SESSION['USERID']);
    // grab data for email
    // get sender details
    $oSender = getUserVals($_SESSION['USERID']);
    // get event details
    $oEventDetails = getEventDetails($iEID);
    // set up email basics
    $mail->From = $oSender->user_email;
    $mail->FromName = $oSender->user_first . ' ' . $oSender->user_last;
    // if updated event, change subj line
    if ($iEventID) {
        $sSubj = "UPDATED: ";
    } else {
        $sSubj = "";
    }
    $sSubj .= 'You have been scheduled for ' . $oEventDetails->event_name;
    $mail->Subject = $sSubj;
    // the message
    // handle updated event
    if ($iEventID) {
        $sBody = "The following event has been UPDATED!\n";
    } else {
        $sBody = "";
    }
    $sBody .= "You have been scheduled for the following:\n";
    $sBody .= "Event Name: " . $oEventDetails->event_name . "\n";
    $sBody .= "Event Date: " . date("l, F jS, Y", strtotime($oEventDetails->event_date)) . "\n";
    $sBody .= "From: " . date("g:i a", strtotime($oEventDetails->event_start)) . " To: " . date("g:i a", strtotime($oEventDetails->event_end)) . "\n";
    $sBody .= "\nPlease see http://" . $host . $docroot . " for more details.\n";
    $sBody .= "Thanks, \n" . $oSender->user_first . " " . $oSender->user_last;
    // append to mail
    $mail->Body = $sBody;
    // iterate list
    $bAssigned = false;
    // this flag flips once an assignment is made
    foreach ($oEmps as $Emp) {
        if ($_POST['rad' . $Emp->user_id]) {
            $bAssigned = true;
            // flip the flag
            addAssign($Emp->user_id, $_POST['rad' . $Emp->user_id], $iEID);
            $mail->AddAddress($Emp->user_email, $Emp->user_first . " " . $Emp->user_last);
        }
    }
    // now check for curUser assign
    if ($_POST['rad' . $_SESSION['USERID']]) {
        addAssign($_SESSION['USERID'], $_POST['rad' . $_SESSION['USERID']], $iEID);
    }
    // send mail if checkbox checked and if >= 1 emp assigned
    if ($postData['chkMail'] && $bAssigned) {
        // send the mail
        if (!$mail->Send()) {
            accessDenied("There has been an error sending mail!");
        }
        $mail->ClearAddresses();
        $mail->ClearAttachments();
    }
    return $iEID;
}
Exemple #9
0
function createTestRelease($release, $testProjectID)
{
    $connID = connectTLDB();
    $sql = "insert " . "into " . "nodes_hierarchy " . "(name, parent_id, node_type_id, node_order) " . "values ('" . $release . "', " . $testProjectID . ", " . "5, " . "0 " . ")";
    $rs = mysql_query($sql);
    // retrieve new planID
    $sql = "select " . "id " . "from " . "nodes_hierarchy " . "where " . "name='" . $release . "' and " . "parent_id =" . $testProjectID . " and " . "node_type_id=5";
    $rs = mysql_query($sql);
    if (mysql_num_rows($rs)) {
        $row = mysql_fetch_array($rs);
        $releaseID = $row[0];
    } else {
        $releaseID = "NOT_FOUND";
    }
    // if release entry created, add new TP entry
    if ($releaseID != "NOT_FOUND") {
        $sql = "insert " . "into " . "testplans " . "(id, testproject_id) " . "values ('" . $releaseID . "', " . $testProjectID . ")";
        $rs = mysql_query($sql);
        // retrieve new planID
        $sql = "select " . "id " . "from " . "testplans " . "where " . "id=" . $releaseID . " and " . "testproject_id =" . $testProjectID;
        $rs = mysql_query($sql);
        if (mysql_num_rows($rs)) {
            $row = mysql_fetch_array($rs);
            $releaseID = $row[0];
            $transID = addTransaction();
            if ($transID == "NOT_FOUND") {
                mysql_close($connID);
                return "NOT_FOUND";
            }
            $eventID = addEvent($transID, $release, $releaseID);
            if ($eventID == "NOT_FOUND") {
                mysql_close($connID);
                return "NOT_FOUND";
            } else {
                return $releaseID;
            }
        } else {
            $releaseID = "NOT_FOUND";
            mysql_close($connID);
            return $releaseID;
        }
    }
}
        $name = $event["title"];
        $start = date("Y-m-d H:i", $event["start"] / 1000);
        $end = date("Y-m-d H:i", $event["end"] / 1000);
    }
} else {
    $event = getEvent(-1);
    $id = $event["id"];
    $name = "";
    $start = "";
    $end = "";
}
if ($_POST["name"] == "") {
    echo "<h2>Ajouter une réunion</h2>";
} elseif ($_POST["password"] != "Joseph86") {
    echo "<h2>Mauvais mot de passe</h2>";
} elseif ($_POST["name"] != "" && addEvent($_POST) === false) {
    echo "<h2>Oups ! Une erreur d'analyse a été commise.</h2>";
} else {
    echo "<h2>Le nouvel événement à bien été ajouté</h2>";
}
?>

    <form role="form" method="post">
      <div class="form-group">
        <label for="eventid">Id</label>
        <input type="hidden" class="form-control" id="id" name="id" value="<?php 
echo $id;
?>
">
        <input type="text" class="form-control" id="eventid" name="eventid" value="<?php 
echo $id;
Exemple #11
0
 $request = $_POST['request'];
 switch ($request) {
     case 'register':
         $out = register($_POST['email'], $_POST['password'], $_POST['nickname']);
         break;
     case 'getRowById':
         $out = getRowById($_POST['table'], $_POST['id']);
         break;
     case 'getRowByColumn':
         $out = getRowByColumn($_POST['table'], $_POST['source_column'], $_POST['value']);
         break;
     case 'getColumnByColumn':
         $out = getColumnByColumn($_POST['table'], $_POST['source_column'], $_POST['value'], $_POST['returned_column']);
         break;
     case 'addEvent':
         $out = addEvent($_POST['id_sport'], $_POST['id_location'], $_POST['date'], $_POST['time'], $_POST['description'], $_POST['id_user']);
         break;
     case 'getEvent':
         $out = getEvent($_POST['id_sport'], $_POST['id_location'], $_POST['date']);
         break;
     case 'getHistoryForPlayer':
         $out = getHistoryForPlayer($_POST['id_user']);
         break;
     case 'getUpcomingEvents':
         $out = getUpcomingEvents($_POST['id_user']);
         break;
     case 'getEventBySportName':
         $out = getEventBySportName($_POST['name_sport'], $_POST['name_location'], $_POST['date']);
         break;
     case 'getNewEventsForUser':
         $out = getNewEventsForUser($_POST['id_user']);
        $msg = "Incorrect Login Id or Password !";
    }
}
if (isset($_POST['logout']) && isAdminLogin()) {
    $_SESSION = array();
    if (isset($_COOKIE[session_name()])) {
        setcookie(session_name(), '', time() - 42000, '/');
    }
    session_destroy();
    $logout = "You have been Successfully Logged Out!";
}
if (isset($_POST['addevent'])) {
    $event_name = addslashes(htmlentities($_POST['eventname']));
    $event_category_id = $_POST['eventcat'];
    $added_by = $_SESSION['admin'];
    addEvent($event_name, $event_category_id, $added_by);
    $addscs = "Event has been successfully added to the database !";
}
if (isset($_POST['selectevent'])) {
    $evntid = $_POST['eventname'];
    $edtevnt = getEventbyid($evntid);
}
if (isset($_POST['editevent'])) {
    $modified_by = $_SESSION['admin'];
    $eventname = htmlentities($_POST['eventname']);
    $event_category_id = htmlentities($_POST['eventcat']);
    $about = $san->cleanHTML($_POST['about']);
    $rules = $san->cleanHTML($_POST['rules']);
    $contacts = $san->cleanHTML($_POST['contacts']);
    $evntid = $san->cleanHTML($_POST['evntid']);
    $clink = $san->cleanHTML($_POST['clink']);
Exemple #13
0
            } else {
                if (intval($_GET["groupAS"]) == 0 && substr_compare($event["DESCRIPTION"], " GROUPE4", -8) != 0) {
                    addEvent($event);
                }
            }
            break;
        case "TD Anglais S1":
        case "TD Anglais S2":
        case "TD Anglais S3":
        case "TD Anglais S4":
        case "TD Anglais S5":
        case "TD Anglais S6":
            addEvent($event, $_GET["anglais"]);
            break;
        default:
            addEvent($event);
            break;
    }
}
// ...fin du calendrier
echo 'END:VCALENDAR';
// Filtrage des modules à exclure
function filter($event)
{
    $filters = explode(",", $_GET["filters"]);
    return !in_array(substr($event["SUMMARY"], -9, -1), $filters);
}
// Ajout d'un événement au calendrier
function addEvent($event, $alarm = 0, $room = 0)
{
    if (filter($event)) {
include 'functions.php';
?>
	<?php 
include 'connectdb.php';
?>
	<?php 
//Getting data from the former page via POST method
$status = $_POST["status"];
$title = $_POST["title"];
$content = $_POST["content"];
/* TO DO 
		if status == "Kesinleşmiş Olay"
		$date = $_POST["date"];
		$place = $_POST["place"];
		$test = $_POST["dtp_input1"];
		*/
//Status of the post translating into a numeric value
if ($status == 'Kararlaştırılmış Etkinlik') {
    $status = 1;
    $date = $_POST["datetime"];
    $place = $_POST["place"];
    addEvent($status, $title, $content, $date, $place);
    header("Location: events.php");
} else {
    $status = 0;
    addEventSuggestion($status, $title, $content);
    header("Location: event-suggestion.php");
}
?>
</body>
</html>
<?php

include '../includes/config.inc.php';
include '../fcts/hiking.fct.php';
include '../fcts/event.fct.php';
include '../fcts/mail.fct.php';
$result['data'] = 'unknown';
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
if (isset($request->organiserName) && isset($request->organiserPhone) && isset($request->name) && isset($request->duration) && isset($request->elevation) && isset($request->level) && isset($request->date) && isset($request->venueId) && isset($request->venueName) && isset($request->venueAddress) && isset($request->venueCity) && isset($request->latitude) && isset($request->longitude) && isset($request->numberOfPeople) && isAuthenticated()) {
    try {
        $description = templateMailContent($request->name, $request->level, $request->duration, $request->elevation, $request->venueName, $request->date, "{$request->latitude},{$request->longitude}", $request->additionalInfo, $request->link, '', $request->organiserName, $request->organiserPhone);
        $date = DateTime::createFromFormat('d/m/Y H:i', $request->date);
        $lastId = addEvent($bdd, $_SESSION['id'], $request->venueName, $request->name, $description, $request->numberOfPeople, date_format($date, 'Y-m-d H:i:s'), $request->venueId, $request->venueName, $request->venueAddress, $request->venueCity, 'FR', $request->latitude, $request->longitude);
        $hikingMail = "<p>Click <a href=\"http://hiking.cyril-grandjean.fr/validate-event.php?id={$lastId}\">here</a> to validate this hiking request ? :</p>{$description}";
        sendHtmlEmailToAdmin($request->name, '*****@*****.**', "Hiking request " . $request->name . " by " . $_SESSION['name'], $hikingMail);
        $result['data'] = 'success';
    } catch (Exception $e) {
        //header("HTTP/1.1 500 Internal Server Error");
        $result['data'] = 'error';
        $result['error'] = 'Exception occurred: ' + $e->getMessage();
    }
} else {
    //header("HTTP/1.1 500 Internal Server Error");
    $result['data'] = 'error';
    $result['error'] = 'Exception occurred: Not every required fields entered';
}
echo json_encode($result);
Exemple #16
0
function process_get()
{
    global $page;
    global $MySelf;
    $ajax = 0;
    switch ($_GET['action']) {
        // Maintenance!
        case "maintenance":
            $page = maintenance();
            break;
            // a specific run is requested.
        // a specific run is requested.
        case "show":
            $page = listRun();
            $ajax = 20;
            break;
            // a profile is requested.
        // a profile is requested.
        case "profile":
            $page = profile();
            break;
            // a profile change is requested.
        // a profile change is requested.
        case "modprofile":
            $page = modProfile();
            break;
            // Admin request to delete an api key (NOT user deleting own!)
        // Admin request to delete an api key (NOT user deleting own!)
        case "delapi":
            $page = deleteAPIKey();
            break;
            // Quick toggle of login capabilities.
        // Quick toggle of login capabilities.
        case "toggleLogin":
            $page = toggleLogin();
            break;
            // Quick confirm an account.
        // Quick confirm an account.
        case "quickconfirm":
            $page = quickConfirm();
            break;
            // Change of eMail requested
        // Change of eMail requested
        case "changeemail":
            $page = makeEmailChangeForm();
            break;
            // Show corp hierarchy
        // Show corp hierarchy
        case "hierarchy":
            $page = showHierarchy();
            break;
            // Browser solar Systems
        // Browser solar Systems
        case "browse":
            $page = browser();
            break;
            // User wants to delete a run.
        // User wants to delete a run.
        case "deleterun":
            deleteRun();
            break;
            // User wants to see the preferences page.
        // User wants to see the preferences page.
        case "preferences":
            $page = makePreferences();
            break;
            // A banker wants to see the transaction log for a user.
        // A banker wants to see the transaction log for a user.
        case "showTransactions":
            $page = showTransactions();
            break;
            // User wants to manage his cans.
        // User wants to manage his cans.
        case "cans":
            $page = makeCanPage();
            break;
            // Print out fancy global statistics
        // Print out fancy global statistics
        case "globstats":
            $page = globalStatistics();
            break;
            // User wants to re-validate his email.
        // User wants to re-validate his email.
        case "revalidate":
            validate();
            break;
            // User wants to pop a can.
        // User wants to pop a can.
        case "popcan":
            $page = popCan();
            break;
            // Kick a user.
        // Kick a user.
        case "kickban":
            $page = kick();
            break;
            // User wants to toggle the empty/full setting of a can.
        // User wants to toggle the empty/full setting of a can.
        case "togglecan":
            $page = toggleCan();
            break;
            // close a run.
        // close a run.
        case "endrun":
            endrun();
            break;
            // Show ore values
        // Show ore values
        case "showorevalue":
            $page = showOreValue();
            break;
            // Show ship values
        // Show ship values
        case "showshipvalue":
            $page = showShipValue();
            break;
            // Show Corp Hierarchy
        // Show Corp Hierarchy
        case "hier":
            $page = showHierarchy();
            break;
            // manage payouts
        // manage payouts
        case "payout":
            $page = payout();
            break;
            // set/view the online time
        // set/view the online time
        case "onlinetime":
            $page = onlineTime();
            break;
            // Mods a template
        // Mods a template
        case "edittemplate":
            $page = editTemplate();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changeow":
            $page = makeOreWorth();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changesv":
            $page = makeShipValue();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "changepw":
            $page = makePWChangeForm();
            break;
            // User wants to join the selected run.
        // User wants to join the selected run.
        case "joinrun":
            $page = joinRun();
            break;
            // User wants to part the selected run.
        // User wants to part the selected run.
        case "partrun":
            $page = leaveRun();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "lostpass":
            $page = makeLostPassForm();
            break;
            // Lotto: Create group
        // Lotto: Create group
        case "lotto_createGroup":
            $page = lotto_createGroup();
            break;
            // add ore from a haul to an open run.
        // add ore from a haul to an open run.
        case "addhaul":
            $page = addHaulPage();
            break;
            // Edit site configuration
        // Edit site configuration
        case "configuration":
            $page = configuration();
            break;
            // Add an event.
        // Add an event.
        case "addevent":
            $page = addEvent();
            break;
            // Show all events.
        // Show all events.
        case "showevents":
            $page = showEvents();
            break;
            // Join an Event
        // Join an Event
        case "joinevent":
            $page = joinEvent();
            break;
            // Show an event.
        // Show an event.
        case "showevent":
            $page = showEvent();
            break;
            // lists all ore runs.
        // lists all ore runs.
        case "list":
            $page = listRuns();
            $ajax = 60;
            break;
            // Manage wallet
        // Manage wallet
        case "manageWallet":
            $page = manageWallet();
            break;
            // Show current ranks
        // Show current ranks
        case "showranks":
            $page = showRanks();
            break;
            // delete a rank
        // delete a rank
        case "deleterank":
            $page = delRank();
            break;
            // delete an event from the database.
        // delete an event from the database.
        case "deleteevent":
            $page = deleteEvent();
            break;
            // lists all users.
        // lists all users.
        case "editusers":
            $page = listUsers();
            break;
            // lists one user.
        // lists one user.
        case "edituser":
            $page = listUser();
            break;
            // prints the form for a new run.
        // prints the form for a new run.
        case "newrun":
            $page = makeNewOreRunPage();
            break;
            // add a new user.
        // add a new user.
        case "newuser":
            $page = makeAddUserForm();
            break;
            // Toggle the charity flag.
        // Toggle the charity flag.
        case "toggleCharity":
            toggleCharity();
            break;
            /* Locking unlocking */
        /* Locking unlocking */
        case "lockrun":
            toggleLock();
            break;
            // prints the main welcome page.
        // prints the main welcome page.
        default:
            $page = makeWelcome();
            break;
            /* LOTTO STUFF */
        /* LOTTO STUFF */
        case "editLotto":
            $page = lotto_editLottery();
            break;
        case "lotto":
            $page = lotto_playLotto();
            break;
        case "claimTicket":
            lotto_claimTicket();
            break;
        case "drawLotto":
            lotto_draw();
            break;
        case "buycredits":
            $page = lotto_buyTickets();
            break;
        case "style":
            $page = style();
            break;
        case "getItemList":
            $page = getItemList();
            break;
        case "switch":
            $MySelf = null;
            $_SESSION['MySelf'] = null;
            unset($_SERVER[QUERY_STRING]);
            makeLoginPage($SUPPLIED_USERNAME);
            break;
    }
    if ($ajax > 1) {
        $ajaxHtml = "<script>window.setTimeout(function(){\$.ajax({";
        if (isset($_REQUEST['ajax'])) {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "',";
        } else {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "&ajax',";
        }
        $ajaxHtml .= "success: function(data) {\$('#content').html(data);}";
        $ajaxHtml .= "});},(" . $ajax * 1000 . "));</script>";
        $page .= $ajaxHtml;
    }
    if (isset($_REQUEST['ajax'])) {
        $html = new html();
        $page = $html->clean($page);
        print $page;
    } else {
        // Clean & Print the page.
        $html = new html();
        $html->addBody($page);
        print $html->flush();
    }
}
Exemple #17
0
<?php

addEvent("init", "get_mysql_db");
Exemple #18
0
            } else {
                if (intval($_GET["groupAS"]) == 0 && substr_compare($event["DESCRIPTION"], " GROUPE4", -8) != 0) {
                    addEvent($event, 0);
                }
            }
            break;
        case "TD Anglais S1":
        case "TD Anglais S2":
        case "TD Anglais S3":
        case "TD Anglais S4":
        case "TD Anglais S5":
        case "TD Anglais S6":
            addEvent($event, $_GET["anglais"]);
            break;
        default:
            addEvent($event, 0);
            break;
    }
}
// ...fin du calendrier
echo 'END:VCALENDAR';
// Filtrage des modules à exclure
function filter($event)
{
    $filters = explode(",", $_GET["filters"]);
    return !in_array(substr($event["SUMMARY"], -9, -1), $filters);
}
// Ajout d'un événement au calendrier
function addEvent($event, $room)
{
    if (filter($event)) {
Exemple #19
0
    // fill in a website where you want to redirect
    exit;
} else {
    if (ALLOW_ACCESS_BY == 'login' || ADMIN_CAN_LOGIN_FROM_ADMIN_URL === true && stristr($_SERVER['SCRIPT_NAME'], '/admin')) {
        if (!User::isLoggedIn()) {
            echo json_encode(array('success' => false, 'notloggedin' => true, 'error' => 'You are not logged in'));
            exit;
        }
    }
}
switch ($_GET['action']) {
    case 'start':
        getEvents();
        break;
    case 'add':
        addEvent();
        break;
    case 'update':
        updateEvent();
        break;
    case 'resize':
        resizeEvent();
        break;
    case 'del':
        deleteEvent();
        break;
    case 'get_cal':
        getCalendar();
        break;
    case 'mail_event':
        mailEvent();
/**
 * Return a single, non-recurring copy of an event with no id
 */
function createSingleCopy($event)
{
    global $mappings;
    $copy = $event;
    unset($copy[$mappings['event_id']]);
    unset($copy[$mappings['rrule']]);
    return addEvent($copy);
}
Exemple #21
0
<?php

include_once 'database/connection.php';
include_once 'database/events.php';
include_once 'database/images.php';
try {
    $id = addImage();
    addEvent($_POST['title'], $_POST['introduction'], $_POST['fulltext'], $_POST['user_id'], $id, $_POST['event']);
} catch (PDOException $e) {
    die($e->getMessage());
}
header('Location: index.php');
Exemple #22
0
    $monthName = $dateObj->format('F');
    // March
    $required = array("name", "month", "day", "year", "hour", "minute", "period", "location", "description");
    if (!checkdate($month, $day, $year)) {
        array_push($errors, $monthName . " " . $day . ", " . $year . " is an invalid date.");
    }
    foreach ($required as $require) {
        $value = trim($_POST[$require]);
        if (!has_value($value)) {
            $errors[$require] = ucfirst($require) . " can't be blank.";
        }
    }
    $max_lengths = array("name" => 40, "location" => 50);
    max_length($max_lengths);
    if (empty($errors)) {
        $uploadEvent = addEvent($name, $month, $day, $year, $hour, $minute, $period, $imagesrc, $location, $desc);
        $message = $uploadEvent;
    }
}
?>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>EDFC | Admin - Add an Event</title>
<link rel="stylesheet" href="../css/normalize.css"/>
  <link rel="stylesheet" href="../css/foundation.css" />
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css"/></head>
<body>
Exemple #23
0
 /**
  * Merges given data with current object
  *
  * @param ExtensibleData $gedcomx Assumes Gedcomx\Gedcomx or a subclass
  */
 public function embed(ExtensibleData $gedcomx)
 {
     $links = $gedcomx->getLinks();
     if ($links != null) {
         foreach ($links as $link) {
             $found = false;
             if ($link->getRel() != null) {
                 if ($this->getLinks() != null) {
                     foreach ($this->getLinks() as $target) {
                         if ($link->getRel() == $target->getRel()) {
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addLink($link);
             }
         }
     }
     $persons = $gedcomx->getPersons();
     if ($persons != null) {
         foreach ($persons as $person) {
             $found = false;
             if ($person->getId() != null) {
                 if ($this->getPersons() != null) {
                     foreach ($this->getPersons() as $target) {
                         if ($person->getId() == $target->getId()) {
                             $target->embed($person);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addPerson($person);
             }
         }
     }
     $relationships = $gedcomx->getRelationships();
     if ($relationships != null) {
         foreach ($relationships as $relationship) {
             $found = false;
             if ($relationship->getId() != null) {
                 if ($this->getRelationships() != null) {
                     foreach ($this->getRelationships() as $target) {
                         if ($relationship->getId() == $target->getId()) {
                             $target->embed($relationship);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addRelationship($relationship);
             }
         }
     }
     $sourceDescriptions = $gedcomx->getSourceDescriptions();
     if ($sourceDescriptions != null) {
         foreach ($sourceDescriptions as $sourceDescription) {
             $found = false;
             if ($sourceDescription->getId() != null) {
                 if ($this->getSourceDescriptions() != null) {
                     foreach ($this->getSourceDescriptions() as $target) {
                         if ($sourceDescription->getId() == $target->getId()) {
                             $target->embed($sourceDescription);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addSourceDescription($sourceDescription);
             }
         }
     }
     $agents = $gedcomx->getAgents();
     if ($agents != null) {
         foreach ($agents as $agent) {
             $found = false;
             if ($agent->getId() != null) {
                 if ($this->getAgents() != null) {
                     foreach ($this->getAgents() as $target) {
                         if ($agent->getId() == $target->getId()) {
                             $target->embed($agent);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addAgent($agent);
             }
         }
     }
     $events = $gedcomx->getEvents();
     if ($events != null) {
         foreach ($events as $event) {
             $found = false;
             if ($event->getId() != null) {
                 if ($this->getEvents() != null) {
                     foreach ($this->getEvents() as $target) {
                         if ($event->getId() == $target->getId()) {
                             $target->embed($event);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 addEvent(event);
             }
         }
     }
     $placeDescriptions = $gedcomx->getPlaces();
     if ($placeDescriptions != null) {
         foreach ($placeDescriptions as $placeDescription) {
             $found = false;
             if ($placeDescription->getId() != null) {
                 if ($this->getPlaces() != null) {
                     foreach ($this->getPlaces() as $target) {
                         if ($placeDescription->getId() == $target->getId()) {
                             $target->embed(placeDescription);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addPlace($placeDescription);
             }
         }
     }
     $documents = $gedcomx->getDocuments();
     if ($documents != null) {
         foreach ($documents as $document) {
             $found = false;
             if ($document->getId() != null) {
                 if ($this->getDocuments() != null) {
                     foreach ($this->getDocuments() as $target) {
                         if ($document . getId() == $target->getId()) {
                             $target->embed($document);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addDocument($document);
             }
         }
     }
     $collections = $gedcomx->getCollections();
     if ($collections != null) {
         foreach ($collections as $collection) {
             $found = false;
             if ($collection->getId() != null) {
                 if ($this->getCollections() != null) {
                     foreach ($this->getCollections() as $target) {
                         if ($collection->getId() == $target->getId()) {
                             $target->embed($collection);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addCollection($collection);
             }
         }
     }
     $fields = $gedcomx->getFields();
     if ($fields != null) {
         foreach ($fields as $field) {
             $found = false;
             if ($field->getId() != null) {
                 if ($this->getFields() != null) {
                     foreach ($this->getFields() as $target) {
                         if ($field->getId() == $target->getId()) {
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addField($field);
             }
         }
     }
     $recordDescriptors = $gedcomx->getRecordDescriptors();
     if ($recordDescriptors != null) {
         foreach ($recordDescriptors as $recordDescriptor) {
             $found = false;
             if ($recordDescriptor->getId() != null) {
                 if ($this->getRecordDescriptors() != null) {
                     foreach ($this->getRecordDescriptors() as $target) {
                         if ($recordDescriptor . getId() == $target->getId()) {
                             $target->embed($recordDescriptor);
                             $found = true;
                             break;
                         }
                     }
                 }
             }
             if (!$found) {
                 $this->addRecordDescriptor(recordDescriptor);
             }
         }
     }
 }
Exemple #24
0
$user = "******";
$pass = "******";
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass) {
    header('HTTP/1.1 401 Unauthorized');
    header('WWW-Authenticate: Basic realm="identify yourself"');
    exit('you must enter a valid username and password');
} else {
    require_once 'function.php';
    if (isset($_POST['submitEvent'])) {
        $day = $_POST['day'];
        $month = $_POST['month'];
        $year = $_POST['year'];
        $title = $_POST['title'];
        $desc = $_POST['desc'];
        $val = addEvent($day, $month, $year, $title, $desc);
        if ($val == 1) {
            echo 'Added successfully';
        } else {
            echo 'Error. Try again';
        }
    } else {
        ?>
<html>
	<form action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
" method="post">
		Day: <br/><input type="text" name="day" required/><br/>
		Month: <br/><input type="text" name="month" required/><br/>
		Year: <br/><input type="text" name="year" required/><br/>
Exemple #25
0
function reservationDispatch($op)
{
    if (isset($_POST['undo'])) {
        $op = 'view_event';
    }
    if (isset($_POST['undo_cat'])) {
        $op = 'view_category';
    }
    if (isset($_POST['undo_lab'])) {
        $op = 'view_laboratory';
    }
    if (isset($_POST['okselector'])) {
        if (isset($_GET['id_course'])) {
            $op = 'send_registration';
        }
    }
    if (isset($_POST['cancelselector'])) {
        if (isset($_GET['id_course'])) {
            $op = 'view_registration';
        }
    }
    switch ($op) {
        case 'view_event':
            viewEvent();
            break;
        case 'add_event':
            addEvent();
            break;
        case 'mod_event':
            modEvent();
            break;
        case 'del_event':
            delEvent();
            break;
        case 'view_category':
            viewCategoy();
            break;
        case 'add_category':
            addCategoy();
            break;
        case 'mod_category':
            modCategoy();
            break;
        case 'del_category':
            delCategoy();
            break;
            /*case 'view_laboratory':
            			viewLaboratories();
            		break;
            		
            		case 'add_laboratory':
            			addLaboratory();
            		break;
            		
            		case 'mod_laboratory':
            			modLaboratory();
            		break;
            		
            		case 'del_laboratory':
            			delLaboratory();
            		break;*/
        /*case 'view_laboratory':
        			viewLaboratories();
        		break;
        		
        		case 'add_laboratory':
        			addLaboratory();
        		break;
        		
        		case 'mod_laboratory':
        			modLaboratory();
        		break;
        		
        		case 'del_laboratory':
        			delLaboratory();
        		break;*/
        case 'view_registration':
            viewRegistration();
            break;
        case 'view_user_event':
            viewUserEvent();
            break;
        case 'excel':
            getExcelFile();
            break;
        case 'add_registration':
            addRegistration();
            break;
        case 'send_registration':
            sendRegistration();
            break;
        case 'del_registration':
            delRegistration();
            break;
        case 'set_room_view_perm':
            setRoomViewPerm();
            break;
    }
}
Exemple #26
0
<?php

//require_once 'functions.php';
if (isset($_POST['addEvent'])) {
    addEvent($_POST);
} elseif (isset($_POST['editEvent'])) {
    editEvent($_POST);
} elseif (isset($_POST['addCoordinator'])) {
    addCoordinator($_POST);
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="robots" content="noindex,nofollow">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>ADMIN | Renaissance 16</title>
        <link href='../assets/css/bootstrap.min.css' rel=stylesheet />
        <link href='style.css' rel=stylesheet />
    </head>
    <body>
        <br>
        <div class="container">

            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#addEvent" aria-controls="addEvent" role="tab" data-toggle="tab">Add Event</a></li>
                <li role="presentation"><a href="#editEvent" aria-controls="editEvent" role="tab" data-toggle="tab">Edit Event</a></li>
            </ul>
function update_trigger($triggerid, $expression = NULL, $description = NULL, $type = NULL, $priority = NULL, $status = NULL, $comments = NULL, $url = NULL, $deps = array(), $templateid = 0)
{
    $trigger = get_trigger_by_triggerid($triggerid);
    $trig_hosts = get_hosts_by_triggerid($triggerid);
    $trig_host = DBfetch($trig_hosts);
    $event_to_unknown = false;
    // Restore expression
    if (is_null($expression)) {
        $expression = explode_exp($trigger['expression'], 0);
        $expr = new CTriggerExpression(array('expression' => $expression));
    } else {
        $expr = new CTriggerExpression(array('expression' => $expression));
        $event_to_unknown = empty($expr->errors) && $expression != explode_exp($trigger['expression'], 0);
    }
    if (!empty($expr->errors)) {
        foreach ($expr->errors as $error) {
            error($error);
        }
        return false;
    }
    if (!is_null($deps) && !validate_trigger_dependency($expression, $deps)) {
        error(S_WRONG_DEPENDENCY_ERROR);
        return false;
    }
    if (is_null($description)) {
        $description = $trigger['description'];
    }
    if (CTrigger::exists(array('description' => $description, 'expression' => $expression))) {
        $host = reset($expr->data['hosts']);
        $options = array('filter' => array('description' => $description, 'host' => $host), 'output' => API_OUTPUT_EXTEND, 'editable' => 1);
        $triggers_exist = CTrigger::get($options);
        $trigger_exist = false;
        foreach ($triggers_exist as $tnum => $tr) {
            $tmp_exp = explode_exp($tr['expression'], false);
            if (strcmp($tmp_exp, $expression) == 0) {
                $trigger_exist = $tr;
                break;
            }
        }
        if ($trigger_exist && $trigger_exist['triggerid'] != $trigger['triggerid']) {
            error('Trigger with name "' . $trigger['description'] . '" and expression "' . $expression . '" already exists.');
            return false;
        } else {
            if (!$trigger_exist) {
                error('No Permissions');
                return false;
            }
        }
    }
    $exp_hosts = $expr->data['hosts'];
    if (!empty($exp_hosts)) {
        $chd_hosts = get_hosts_by_templateid($trig_host['hostid']);
        if (DBfetch($chd_hosts)) {
            $expHostName = reset($exp_hosts);
            $db_chd_triggers = get_triggers_by_templateid($triggerid);
            while ($db_chd_trigger = DBfetch($db_chd_triggers)) {
                $chd_trig_hosts = get_hosts_by_triggerid($db_chd_trigger['triggerid']);
                $chd_trig_host = DBfetch($chd_trig_hosts);
                $newexpression = str_replace('{' . $expHostName . ':', '{' . $chd_trig_host['host'] . ':', $expression);
                // recursion
                update_trigger($db_chd_trigger['triggerid'], $newexpression, $description, $type, $priority, $status, $comments, $url, is_null($deps) ? null : replace_template_dependencies($deps, $chd_trig_host['hostid']), $triggerid);
            }
        }
    }
    $result = delete_function_by_triggerid($triggerid);
    if (!$result) {
        return $result;
    }
    $expression = implode_exp($expression, $triggerid);
    if (is_null($expression)) {
        return false;
    }
    $update_values = array();
    if (!is_null($expression)) {
        $update_values['expression'] = $expression;
    }
    if (!is_null($description)) {
        $update_values['description'] = $description;
    }
    if (!is_null($type)) {
        $update_values['type'] = $type;
    }
    if (!is_null($priority)) {
        $update_values['priority'] = $priority;
    }
    if (!is_null($status)) {
        $update_values['status'] = $status;
    }
    if (!is_null($comments)) {
        $update_values['comments'] = $comments;
    }
    if (!is_null($url)) {
        $update_values['url'] = $url;
    }
    if (!is_null($templateid)) {
        $update_values['templateid'] = $templateid;
    }
    if ($event_to_unknown || !is_null($status) && $status != TRIGGER_STATUS_ENABLED) {
        if ($trigger['value'] != TRIGGER_VALUE_UNKNOWN) {
            addEvent($triggerid, TRIGGER_VALUE_UNKNOWN);
            $update_values['value'] = TRIGGER_VALUE_UNKNOWN;
            $update_values['lastchange'] = time();
        }
    }
    DB::update('triggers', array('values' => $update_values, 'where' => array('triggerid=' . $triggerid)));
    if (!is_null($deps)) {
        delete_dependencies_by_triggerid($triggerid);
        foreach ($deps as $id => $triggerid_up) {
            if (!($result2 = add_trigger_dependency($triggerid, $triggerid_up))) {
                error(S_INCORRECT_DEPENDENCY . ' [' . expand_trigger_description($triggerid_up) . ']');
            }
            $result &= $result2;
        }
    }
    if ($result) {
        $trig_hosts = get_hosts_by_triggerid($triggerid);
        $msg = S_TRIGGER . SPACE . '"' . $trigger['description'] . '"' . SPACE . S_UPDATED_SMALL;
        $trig_host = DBfetch($trig_hosts);
        if ($trig_host) {
            $msg .= SPACE . S_FOR_HOST_SMALL . SPACE . '"' . $trig_host['host'] . '"';
        }
        info($msg);
    }
    if ($result) {
        $trigger_new = get_trigger_by_triggerid($triggerid);
        add_audit_ext(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, $triggerid, $trig_host['host'] . ':' . $trigger['description'], 'triggers', $trigger, $trigger_new);
    }
    $result = $result ? $triggerid : $result;
    return $result;
}