Exemplo n.º 1
0
         if ($row['istitle']) {
             $wrt .= '<li id="item_' . $row['id'] . '" class="ui-state-default">' . $row['name'] . '</li>';
         } else {
             $wrt .= '<li id="item_' . $row['id'] . '" class="ui-state-default"><a>' . $row['name'] . '</a></li>';
         }
     }
 }
 $wrt .= '</ul>';
 $wrt .= '</td></tr></table>';
 $wrt .= '</td><td>';
 //############################################# navigation edit sof
 $resultt = mysql_query("SELECT * FROM navigation WHERE (maccess in (" . $sql_in . ",'10')) ORDER BY s_order ASC");
 $wrtt = '<table border="0" cellspacing="0" cellpadding="0" width="300">';
 //$wrtt .= '<tr><td colspan="2" class="tright">Add Entry</td></tr>';
 $wrtt .= '<tr><td class="ft_head left">Main navigation</td><td class="ft_head right font_s"><a href="' . $module_admin . '&a=add">Add Entry</a></td></tr>';
 $check_nave = good_query_value("SELECT count(*) FROM navigation");
 if ($check_nav == 0) {
     $wrtt .= '<tr><td>nothing to do</td></tr>';
 } else {
     $nav_edit = good_query_table("SELECT * FROM navigation WHERE (access in (" . $sql_in . ",'10')) ORDER BY s_order ASC");
     foreach ($nav_edit as $rowt) {
         if ($evenOdd) {
             $odder = "even";
             $splitter = false;
         } else {
             $odder = "odd";
             $splitter = true;
         }
         $evenOdd = !$evenOdd;
         if ($rowt['istitle']) {
             $spc = '';
Exemplo n.º 2
0
<?php

require_once 'common.php';
$token = $db->escape_string($_GET['token']);
$email = $db->escape_string($_GET['email']);
logRequest('invite', 'token: ' . $token . '; email: ' . $email);
$invite = getInvite($token);
if ($invite && $invite['freeInvites'] > 0) {
    $newToken = generateToken();
    $sql = "INSERT INTO garage_invites SET token = '{$newToken}', email = '{$email}', referredBy = '{$token}'";
    if (!good_query($sql)) {
        $error = $db->error;
        // Check if error is only due to duplicate email (person already invited)
        if (stripos($error, "Duplicate") !== FALSE && stripos($error, "'email'") !== FALSE) {
            $newToken = good_query_value("SELECT token FROM garage_invites WHERE email = '{$email}'");
            // If the person was already invited, invite him again using his old token
            if (empty($newToken)) {
                respond(json_encode(array('status' => 'error', 'message' => "Invitation wasn't found")));
            }
        } else {
            // There is a minor chance that the token would already exist
            respond(json_encode(array('status' => 'error', 'message' => 'Invitation didn\'t go through. Please try again.')));
        }
    } else {
        good_query("UPDATE garage_invites SET freeInvites = (freeInvites - 1) WHERE token = '{$token}'");
    }
    $name = $invite['name'];
    $link = 'http://elisaxslush.com/garage/?t=' . $newToken;
    $message .= "Hi!\n\n" . $name . " just registered for Elisa Garage Chillax and invites you to join the fun, too.\n\n**Elisa Garage Chillax takes place on the first day of Slush, November 18th at 6-9pm**, in our garage (Ratavartijankatu 5, Helsinki), just a 5-minute walk from the Slush venue.\n\nOur garage space is huge but has a guest limit! So sign up with your personal link right now: " . $link . " .\n\nThe program includes free food & drinks, music, dev comps, playing with facial recognition, and relaxing in big couches.\n\nFor the Slush participants, the night will continue at the official Slush after party in Messukeskus.\n\nWe look forward to having you here,\n\nHilla & Albert\nTeam behind Elisa X Slush\n\n\n--\nwww.elisa.com\nYou received this message because somebody sent an invite to your email.\n[" . date('Y-m-d G:i:s') . "]\n";
    //  $message = str_replace("\n", "\r\n", $message);
    $header = "From: Elisa X Slush <*****@*****.**>\r\n";
Exemplo n.º 3
0
<?php

require_once 'common.php';
// Get "free" invite token. Token is reserved for only 15 minutes and then becomes free again if no registration is done.
$invite = good_query_value("SELECT token FROM `garage_invites` WHERE referredBy = 'open' AND registered IS NULL AND (visited IS NULL OR visited < SUBTIME(NOW(), '00:15:00')) LIMIT 1");
if (!$invite) {
    // If no free token is found, show that the event is full
    header('Location: http://elisaxslush.com/garage/?event_full=1');
} else {
    header('Location: http://elisaxslush.com/garage/?t=' . $invite);
}
Exemplo n.º 4
0
<?php

require_once 'common.php';
$token = $db->escape_string($_GET['token']);
$count = good_query_value("SELECT COUNT(*) FROM garage_invites WHERE registered IS NOT NULL");
$eventFull = false;
if ($count > 315) {
    // Max number of tickets until the event is declared full
    $eventFull = true;
    $header = "From: Elisa X Slush <*****@*****.**>\r\n";
    $header .= "Content-Type: text/plain;charset=utf-8\r\n";
    // Once the event is full, create a file named "event_full"
    if (!file_exists('event_full')) {
        // Inform organizers of the event reaching full capacity
        mail('albert.nazander@elisa.fi, hilla.pyykkonen@elisa.fi', 'GARAGE CHILLAX is FULL', "The garage party is full", $header);
        touch('event_full');
    }
}
$invite = getInvite($token);
if (!$invite) {
    $response = array('status' => 'error', 'message' => 'No invitation found', 'code' => 'NOTFOUND');
} else {
    $response = array('status' => 'success', 'data' => $invite);
    if ($eventFull) {
        $response['eventIsFull'] = true;
    }
    $timestamp = date('Y-m-d G:i:s');
    $sql = "UPDATE garage_invites SET visited = '{$timestamp}' WHERE token = '{$token}'";
    good_query($sql);
}
respond(json_encode($response));