Esempio n. 1
0
 /**
  * @param \Sitemapper\Url $url
  */
 public function addLocation(Location $location)
 {
     $node = $this->root->appendChild($this->doc->createElement(static::URL_NODE_NAME));
     $node->appendChild($this->doc->createElement('loc', $location->getLocation()));
     if ($location->getLastModification()) {
         $node->appendChild($this->doc->createElement('lastmod', $location->getLastModification()));
     }
     return $node;
 }
Esempio n. 2
0
</label>
            <strong> <span class="selectRequiredMsg selectInvalidMsg text-danger"> Required</span></strong>
          </div>
          <div class="col-sm-5">
            <select class="form-control" id="loc_s" tabindex="<?php 
$tabindex++;
print $tabindex;
?>
">
              <option value="-1" selected disabled>Choose a Location</option>
<?php 
include_once $_SERVER['DOCUMENT_ROOT'] . "/lib/modules/location.php";
$loca = new Location($mySQL);
$loca->getLocations();
foreach ($loca->location as $ID) {
    $loca->getLocation($ID);
    print '              <option value="' . $loca->ID . '">' . $loca->name . ' (' . $loca->address['city'] . ')</option>' . PHP_EOL;
}
?>
             <option value="c">Custom...</option>
           </select>
          </div>
          <div class="col-sm-5">
            <input type="text" class="form-control hidden" name="location" id="location" placeholder="Custom Location" value="<?php 
print $location;
?>
" tabindex="<?php 
$tabindex++;
print $tabindex;
?>
"/>
echo $template->page_title;
?>
</h1>
			</div>
	
			<?php 
get_message();
?>
			
			<?php 
if (is_single()) {
    ?>
			
				<?php 
    $location_id = get_var('id');
    $location = $location_id ? Location::getLocation($location_id) : false;
    $location_name = $location ? $location->getName() : '';
    $location_country = $location ? $location->getCountry() : '';
    $location_state = $location ? $location->getState() : '';
    $location_city = $location ? $location->getCity() : '';
    $location_street = $location ? $location->getStreet() : '';
    $location_zip = $location ? $location->getZip() : '';
    ?>
				
				<?php 
    if (get_var('action') != 'add' && !$location) {
        ?>
				
					<?php 
        create_message('danger', 'Location does not exist!', true);
        ?>
Esempio n. 4
0
 function createData()
 {
     $eventdata = $this->mySQL['r']->prepare("SELECT `title`,`starts`,`ends`,`notes`,`link`,`location`,`allDay` from `news_events` WHERE `ID`=?");
     $eventdata->bind_param('i', $this->ID);
     $eventdata->execute();
     $eventdata->store_result();
     if ($eventdata->num_rows != 0) {
         $eventdata->bind_result($title, $starts, $ends, $notes, $link, $location, $allDay);
         while ($eventdata->fetch()) {
             $this->title = $title;
             $this->starts = $starts;
             $this->ends = $ends;
             $this->notes = $notes;
             $this->allDay = $allDay;
             $this->link = $link;
             if (substr($location, 0, 1) == '%' && substr($location, -1, 1) == '%') {
                 $loca = new Location($this->mySQL);
                 $loca->getLocation(substr($location, 1, -1));
                 $this->location = '<a href="/location?l=' . $loca->ID . '">' . $loca->name . ', ' . $loca->address['city'] . '</a>';
             } else {
                 $this->location = $location;
             }
         }
         $this->data = true;
     } else {
         $this->data = false;
     }
 }
Esempio n. 5
0
 function createMeet()
 {
     // Get data from Main Comp DB
     $meet_query = $this->mySQL['r']->prepare("SELECT\n\t\t\t`title`,\n\t\t\t`date_f`,\n\t\t\t`date_s`,\n\t\t\t`sessions`,\n\t\t\t`events`,\n\t\t\t`notes_e`,\n\t\t\t`notes_c`,\n\t\t\t`notes_s`,\n\t\t\t`notes_p`,\n\t\t\t`docs`,\n\t\t\t`licence`,\n\t\t\t`enable`,\n\t\t\t`location`,\n\t\t\t`wizStat`\n\t\tFROM `comp_meet` WHERE `ID`=?");
     $meet_query->bind_param('s', $this->id);
     $meet_query->execute();
     $meet_query->store_result();
     $res_query = $this->mySQL['r']->prepare("SELECT\n\t\t\t`enable`,\n\t\t\t`text`,\n\t\t\t`download`,\n\t\t\t`meet`,\n\t\t\t`series`,\n\t\t\t`services`,\n\t\t\t`nextSession`,\n\t\t\t`indSession`\n\t\tFROM `comp_res` WHERE `MID`=?");
     $res_query->bind_param('s', $this->id);
     $res_query->execute();
     $res_query->store_result();
     if ($meet_query->num_rows != 0) {
         $res_query->bind_result($res['enable'], $res['text'], $res['download'], $res['meet'], $res['series'], $res['services'], $res['nextSession'], $res['indivSession']);
         $meet_query->bind_result($title, $date_f, $date_s, $sessions, $events, $notes['e'], $notes['c'], $notes['s'], $notes['p'], $docs, $licence, $enable, $location, $wizStat);
         while ($meet_query->fetch()) {
             $this->title = $title;
             $this->date_s = $date_s;
             $this->date_f = $date_f;
             $this->enable = $enable;
             while ($res_query->fetch()) {
                 $this->resServ = $res;
             }
             $this->licence = $licence;
             $this->resServ['services'] = unserialize($this->resServ['services']);
             if ($date_f != "" && $date_f != $date_s) {
                 $this->date = date("l jS F Y", strtotime($date_s)) . " - " . date("l jS F Y", strtotime($date_f));
                 if ($date_s <= date('Y-m-d', strtotime('yesterday')) && $date_f == date('Y-m-d', strtotime('today'))) {
                     $this->date_wordy = 'Today';
                 } elseif ($date_s <= date('Y-m-d', strtotime('yesterday')) && $date_f == date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Today until Tomorrow';
                 } elseif ($date_s == date('Y-m-d', strtotime('yesterday')) && $date_f == date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Today until Tomorrow';
                 } elseif ($date_s == date('Y-m-d', strtotime('today')) && $date_f == date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Today until Tomorrow';
                 } elseif ($date_s == date('Y-m-d', strtotime('today')) && $date_f > date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Today until ' . date("l jS F Y", strtotime($date_f));
                 } elseif ($date_s == date('Y-m-d', strtotime('tomorrow')) && $date_f > date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Tomorrow until ' . date("l jS F Y", strtotime($date_f));
                 } elseif ($date_s == date('Y-m-d', strtotime('tommorrow'))) {
                     $this->date_wordy .= 'Tomorrow';
                 } else {
                     $this->date_wordy = date("l jS F Y", strtotime($date_s)) . ' to ' . date("l jS F Y", strtotime($date_f));
                 }
             } else {
                 $this->date = date("l jS F Y", strtotime($date_s));
                 if ($date_s == date('Y-m-d', strtotime('tomorrow'))) {
                     $this->date_wordy = 'Tomorrow';
                 } elseif ($date_s == date('Y-m-d', strtotime('today'))) {
                     $this->date_wordy = 'Today';
                 } else {
                     $this->date_wordy = date("l jS F Y", strtotime($date_s));
                 }
             }
             $this->numberEvents = $events;
             $this->numberSessions = $sessions;
             //$this->wizard = $wizard;
             /*if($resServ['text']==''&&$resServ['enable']==1){
             			$this->resServ['text'] = "<p>Find the results <a href=\"http://".RESULTS_SERVER."/?m=".$resServ['meet']."&series=".$resServ['series']."\">here</a></p>\n";
             		}*/
             $this->notes['e'] = $notes['e'];
             $this->notes['c'] = $notes['c'];
             $this->notes['p'] = $notes['p'];
             $this->notes['s'] = $notes['s'];
             if (substr($location, 0, 1) == '%' && substr($location, -1) == '%') {
                 $loc = new Location($this->mySQL);
                 $loc->getLocation(substr($location, 1, -1));
                 $this->location = $loc->getData();
             } else {
                 $this->location['name'] = $location;
             }
             $this->link = "/competitions/meet?m=" . $this->id;
             $this->docs = strgetcsv($docs);
             if ($sessions > 0) {
                 $session_query = $this->mySQL['r']->prepare("\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t`SID`,\n\t\t\t\t\t\t`num`,\n\t\t\t\t\t\t`number`,\n\t\t\t\t\t\t`date`,\n\t\t\t\t\t\t`t_warm`,\n\t\t\t\t\t\t`t_sign`,\n\t\t\t\t\t\t`t_start`,\n\t\t\t\t\t\t`events`\t\t\t\t\t\n\t\t\t\t\tFROM `comp_session`\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t`MID`=?\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\t`num` ASC\n\t\t\t\t\t");
                 $session_query->bind_param('s', $this->id);
                 $session_query->execute();
                 $session_query->store_result();
                 if ($session_query->num_rows != 0) {
                     $session_query->bind_result($SID, $num, $number, $date, $t['warm'], $t['sign'], $t['start'], $events);
                     while ($session_query->fetch()) {
                         $this->meet['S'][$number]['SID'] = $SID;
                         $this->meet['S'][$number]['num'] = $num;
                         $this->meet['S'][$number]['date'] = date("d/m/Y", strtotime($date));
                         $this->meet['S'][$number]['t']['warm'] = date("H:i", strtotime($t['warm']));
                         $this->meet['S'][$number]['t']['sign'] = date("H:i", strtotime($t['sign']));
                         $this->meet['S'][$number]['t']['start'] = date("H:i", strtotime($t['start']));
                         if ($events > 0) {
                             $event_query = $this->mySQL['r']->prepare("\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\t`num`,\n\t\t\t\t\t\t\t\t\t`number`,\n\t\t\t\t\t\t\t\t\t`prefix`,\n\t\t\t\t\t\t\t\t\t`e_g`,\n\t\t\t\t\t\t\t\t\t`e_d`,\n\t\t\t\t\t\t\t\t\t`e_s`,\n\t\t\t\t\t\t\t\t\t`e_r`,\n\t\t\t\t\t\t\t\t\t`e_al`,\n\t\t\t\t\t\t\t\t\t`e_au`\n\t\t\t\t\t\t\t\tFROM `comp_event`\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t`MID`=? AND\n\t\t\t\t\t\t\t\t\t`SID`=?\n\t\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t`number` ASC\n\t\t\t\t\t\t\t\t");
                             $event_query->bind_param('ss', $this->id, $SID);
                             $event_query->execute();
                             $event_query->store_result();
                             if ($event_query->num_rows != 0) {
                                 $event_query->bind_result($e_num, $e_number, $prefix, $e['g'], $e['d'], $e['s'], $e['r'], $e['a']['l'], $e['a']['u']);
                                 while ($event_query->fetch()) {
                                     if ($prefix == true) {
                                         $this->meet['S'][$number]['E'][$e_number]['num'] = $number . str_pad($e_num, 2, '0', STR_PAD_LEFT);
                                     } else {
                                         $this->meet['S'][$number]['E'][$e_number]['num'] = $e_num;
                                     }
                                     $this->meet['S'][$number]['E'][$e_number]['g'] = $e['g'];
                                     $this->meet['S'][$number]['E'][$e_number]['d'] = $e['d'];
                                     $this->meet['S'][$number]['E'][$e_number]['s'] = $e['s'];
                                     $this->meet['S'][$number]['E'][$e_number]['r'] = $e['r'];
                                     $this->meet['S'][$number]['E'][$e_number]['al'] = $e['a']['l'];
                                     $this->meet['S'][$number]['E'][$e_number]['au'] = $e['a']['u'];
                                 }
                             }
                         }
                     }
                 }
             } else {
                 $this->dispEvts = false;
             }
             return true;
         }
     } else {
         return false;
     }
 }
Esempio n. 6
0
          <tbody>
<?php 
$event_query = $mySQL['r']->prepare("SELECT `ID`,`title`,`location`,`starts`,`ends`,`enable` FROM `news_events` ORDER BY `ID`");
$event_query->execute();
$event_query->bind_result($ID, $title, $location, $starts, $ends, $enabled);
$event_query->store_result();
while ($event_query->fetch()) {
    print '            <tr>' . PHP_EOL;
    print '              <td>' . $ID . '</td>' . PHP_EOL;
    print '              <td><span class="hidden">' . $enabled . '</span>';
    print Form::toggleLink($enabled, '', 53, array('s' => array('h' => 'Click to unpublish event.', 'i' => 'eye-open', 'u' => '/act/enable?cat=' . $page->getSubCat() . '&mode=event&i=' . $ID . '&m=0"'), 'f' => array('h' => 'Click to publish event.', 'i' => 'eye-close', 'u' => '/act/enable?cat=' . $page->getSubCat() . '&mode=event&i=' . $ID . '&m=1"')));
    print '</td>' . PHP_EOL;
    print '              <td>' . $title . '</td>' . PHP_EOL;
    if (substr($location, 0, 1) == '%' && substr($location, -1, 1) == '%') {
        $loca = new Location($mySQL);
        $loca->getLocation(substr($location, 1, -1));
        print '              <td>' . $loca->name . '</td>' . PHP_EOL;
    } else {
        print '              <td>' . $location . '</td>' . PHP_EOL;
    }
    print '              <td>' . date("d/m/Y H:i", strtotime($starts)) . '</td>' . PHP_EOL;
    print '              <td>' . date("d/m/Y H:i", strtotime($ends)) . '</td>' . PHP_EOL;
    if ($user->accessPage(53)) {
        print '              <td><a href="event_edit?e=' . $ID . '">Edit <span class="' . B_ICON . ' ' . B_ICON . '-pencil"></span></a></td>' . PHP_EOL;
    }
    print '            </tr>' . PHP_EOL;
}
?>
          </tbody>
        </table>
        <script src="/js/jquery.tablesorter.js"></script>