示例#1
0
 public static function delete($id)
 {
     $db = new DB();
     $spTools = new SponsorshipTools();
     $result = $spTools->deleteSponsorshipsByEvent($id);
     if ($result) {
         $result = $db->delete(array($id), "events");
     }
     return $result;
 }
示例#2
0
                                    </p>
                                </fieldset>
                            </form>
                            <p id="error-message">Some form fields are empty</p>
                        </div> 
                        <div style="display: none" id="message-dialog">     
                            <input type="hidden" id="reload-at-ok" value="" />
                            <p id="message-dialog-content"></p>
                        </div>
                        <div style="display: none" id="wait-dialog">                            
                            <img src="img/ajax-loader.gif" alt="wait..."/>
                        </div>
                        <ul>
                            <?php 
$eventTools = new EventTools();
$sponsorshipTools = new SponsorshipTools();
$months = $eventTools->getGroupedEvents();
$currentDate = new DateTime();
foreach ($months as $month) {
    echo "<li>";
    echo "<div class='curl'></div>";
    echo "<h4>" . key($month) . "</h4>";
    $events = $month[key($month)];
    if (count($events) > 0) {
        foreach ($events as $event) {
            $date = new DateTime($event->date);
            $avail_sponsorships = $sponsorshipTools->getSponsorshipsByEvent($event->id, TRUE);
            echo "<div class='calendar-entry'>";
            echo "<input id='event-id' type='hidden' value='" . $event->id . "'/>";
            if ($currentDate > $date) {
                echo "<p class='clickable'>";
示例#3
0
<?php

require_once './global.inc.php';
verify_oauth_session_exists();
$event_id = $_POST["event_id"];
$event_details = Event::get($event_id);
$spTools = new SponsorshipTools();
$sponsorship_details = $spTools->getAllSponsorshipsByEvent($event_id);
$sponsorships = array();
foreach ($sponsorship_details as $sp) {
    $company = NULL;
    if ($sp->taken_by != "") {
        $company = Company::get($sp->taken_by);
    }
    array_push($sponsorships, array($sp, $company));
}
echo json_encode(array($event_details, $sponsorships));
示例#4
0
<?php

require_once './global.inc.php';
verify_oauth_session_exists();
if (HttpSession::currentUser()->getOrganization()->access_level > 2) {
    $sp_id = $_POST['sp_id'];
    $org_id = $_POST['org_id'];
    $contact_name = $_POST['contact_name'];
    $contact_phone = $_POST['contact_phone'];
    $sponsorshipTools = new SponsorshipTools();
    echo json_encode($sponsorshipTools->takeSponsorship($sp_id, $org_id, $contact_name, $contact_phone));
}