<!-- Author Aaron Displays information about the package the registered user booked -->
<?php 
session_start();
$title = "Summary";
include "menu.php";
include "header.php";
include "functions.php";
//define variables
$PackageName = $_SESSION['packagename'];
$time = $_SERVER['REQUEST_TIME'];
$currentTime = date("F,j,Y", $time);
?>
<!DOCTYPE html>
<div class="container">
	<div class="panel panel-success">
    <?php 
echo "<div class='panel-heading'><h2>Package Booked!</h2></div> \n      \t<div class='panel-body'>\n      \t\t<div class='row'>\n      \t\t\t<h2><u>" . $PackageName . "</u></h2>\n      \t\t</div>\n\t     \t<div class='col-md-5'>\t\n\t\t\t  <br><img class='img-thumbnail' src=" . getPictures($PackageName, 0) . "width='400' height='300'>\n\t\t\t</div>\n\n\t\t\t<div class='col-md-7'>\n\t\t\t<table class='table'>\n\t\t\t\t<tr><td><h3><small>Booking Number:</small></h3></td><td><h3> " . getBookingNo($_SESSION['CustomerId']) . "</h3></td></tr>\n\t\t\t\t<tr><td><h3><small>Booking Date:</small></h3></td><td><h3> " . $currentTime . "</h3></td></tr> \n\t\t\t\t<tr><td><h3><small>Class:</small></h3></td><td><h3> " . $_SESSION['Class'] . "</h3></td></tr>\n\t\t\t\t<tr><td><h3><small>Trip Type:</small></h3></td><td><h3> " . $_SESSION['TripType'] . "</h3></td></tr>\n\t\t\t\t<tr><td><h3><small>Number of Travelers:</small></h3></td><td><h3> " . $_SESSION['TravelerCount'] . "</h3></td></tr>\n\t\t\t</table>\n\t\t\t</div>\n\t\t</div> \n\t</div>";
?>

    </div>
	
	</div>
</div>
<?php 
include "footer.php";
Beispiel #2
0
function getDetails(&$list)
{
    global $_G;
    $tbTids = array();
    foreach ($list as $l) {
        $tids[$l['tid']] = array('tid' => $l['tid'], 'posttableid' => $l['posttableid']);
        if (0 == $l['posttableid']) {
            $table = DB::table('forum_post');
        } else {
            $table = DB::table('forum_post') . '_' . $l['posttableid'];
        }
        $tbTids[$table][] = $l['tid'];
    }
    $sqls = array();
    foreach ($tbTids as $table => &$tids) {
        $tids = array_unique($tids);
        $sql = 'SELECT pid, tid, message FROM ' . $table . ' WHERE tid IN (' . implode(', ', $tids) . ') AND first = 1';
        $sqls[] = $sql;
    }
    unset($tids);
    if (empty($sqls)) {
        return;
    }
    $threadInfo = array();
    $pids = array();
    foreach ($sqls as $sql) {
        true === BIGAPP_DEV && runlog('bigapp', 'get message from forum_thread, sql: ' . $sql);
        $query = DB::query($sql);
        while ($tmp = DB::fetch($query)) {
            $threadInfo[$tmp['tid']] = array('pid' => $tmp['pid'], 'tid' => $tmp['tid'], 'message' => $tmp['message']);
            $pids[$tmp['pid']] = $tmp['pid'];
        }
    }
    if (empty($pids)) {
        return;
    }
    $sql = 'SELECT aid, tid, tableid, pid FROM ' . DB::table('forum_attachment') . ' WHERE pid IN (' . implode(', ', $pids) . ')';
    true === BIGAPP_DEV && runlog('bigapp', 'get aid and tableid from db [ sql: ' . $sql . ' ]');
    $tbIdx = array();
    $query = DB::query($sql);
    while ($tmp = DB::fetch($query)) {
        if ($tmp['tableid'] < 10) {
            $threadInfo[$tmp['tid']]['aid'][] = $tmp['aid'];
            $tbIdx[$tmp['tableid']][] = $tmp['aid'];
        }
    }
    foreach ($tbIdx as $tableId => $aids) {
        $sql = 'SELECT aid, tid, attachment, description, remote, isimage FROM ' . DB::table('forum_attachment_' . $tableId) . ' WHERE aid IN (' . implode(', ', $aids) . ')';
        true === BIGAPP_DEV && runlog('bigapp', 'get attachment info from db, sql: ' . $sql);
        $query = DB::query($sql);
        while ($tmp = DB::fetch($query)) {
            $isImage = $tmp['isimage'];
            if ($tmp['isimage'] && !$_G['setting']['attachimgpost']) {
                $isImage = 0;
            }
            if ($isImage) {
                $threadInfo[$tmp['tid']]['attachments'][$tmp['aid']] = array('attachment' => $tmp['attachment'], 'description' => $tmp['description'], 'remote' => $tmp['remote'], 'isimage' => $isImage);
                continue;
            }
            true === BIGAPP_DEV && runlog('bigapp', 'attachment is not an image or attachimgpost is not true, ignore [ attachment info: ' . $tmp['attachment'] . ' ]');
        }
    }
    getPictures($threadInfo);
    foreach ($list as &$l) {
        if (isset($threadInfo[$l['tid']]['message']) && is_string($threadInfo[$l['tid']]['message'])) {
            $l['message_abstract'] = $threadInfo[$l['tid']]['message'];
        }
        if (isset($threadInfo[$l['tid']]['attachment_urls']) && is_array($threadInfo[$l['tid']]['attachment_urls'])) {
            $l['attachment_urls'] = $threadInfo[$l['tid']]['attachment_urls'];
        }
        if (true === BigAppConf::$enablePicOpt) {
            foreach ($l['attachment_urls'] as &$_url) {
                if (ApiUtils::isOptFix($_url)) {
                    $_url = rtrim($_G['siteurl'], '/') . '/plugin.php?id=bigapp:optpic&size=' . urlencode(BigAppConf::$thumbSize) . '&url=' . urlencode($_url);
                    $_url = str_replace('source/plugin/mobile/', '', $_url);
                    $_url = str_replace('source/plugin/bigapp/', '', $_url);
                }
            }
            unset($_url);
        }
    }
    unset($l);
}
                <p></p>
              </div>
            </div>
          
            <div class="item">
               <?php 
echo "<img src=" . getPictures($PackageName, 2) . "width='600' height='600'>";
?>
              <div class="carousel-caption">
                <h3>America</h3>
              </div>
            </div>

            <div class="item">
               <?php 
echo "<img src=" . getPictures($PackageName, 3) . "width='600' height='600'>";
?>
              <div class="carousel-caption">
                <h3>America</h3>
                <p></p>
              </div>
            </div>
          </div>

          <!-- Left and right controls -->
          <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
     $rsArea = XDb::xSql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`linkid` AS `linkid`,`npa_areas`.`sitename` AS `npaSitename`, `npa_areas`.`sitecode` AS `npaSitecode`, `npa_areas`.`sitetype` AS `npaSitetype`\n                FROM `cache_npa_areas`\n                INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id`\n                WHERE `cache_npa_areas`.`cache_id`= ? AND `cache_npa_areas`.`npa_id`!='0'", $r['cacheid']);
     if (XDb::xNumRows($rsArea) != 0) {
         $thisextra .= "\nNATURA 2000: ";
         while ($npa = XDb::xFetchArray($rsArea)) {
             $thisextra .= " - " . $npa['npaSitename'] . "  " . $npa['npaSitecode'] . " - ";
         }
     }
 }
 $thisline = str_replace('{extra_info}', $thisextra, $thisline);
 // end of extra info
 if ($r['rr_comment'] == '') {
     $thisline = str_replace('{rr_comment}', '', $thisline);
 } else {
     $thisline = str_replace('{rr_comment}', cleanup_text("<br /><br />--------<br />" . $r['rr_comment'] . "<br />"), $thisline);
 }
 $thisline = str_replace('{{images}}', getPictures($r['cacheid'], false, $r['picturescount']), $thisline);
 if (isset($gpxType[$r['type']])) {
     $thisline = str_replace('{type}', $gpxType[$r['type']], $thisline);
 } else {
     $thisline = str_replace('{type}', $gpxType[1], $thisline);
 }
 if (isset($gpxGeocacheTypeText[$r['type']])) {
     $thisline = str_replace('{type_text}', $gpxGeocacheTypeText[$r['type']], $thisline);
 } else {
     $thisline = str_replace('{type_text}', $gpxGeocacheTypeText[1], $thisline);
 }
 if (isset($gpxContainer[$r['size']])) {
     $thisline = str_replace('{container}', $gpxContainer[$r['size']], $thisline);
 } else {
     $thisline = str_replace('{container}', $gpxContainer[0], $thisline);
 }
Beispiel #5
0
function search_output()
{
    global $opt, $login;
    global $cache_note_text;
    $server_address = $opt['page']['absolute_url'];
    $server_domain = parse_url($server_address, PHP_URL_HOST);
    $gpxHead = '<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" creator="Opencaching.de - http://www.opencaching.de" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/1 http://www.groundspeak.com/cache/1/0/1/cache.xsd" xmlns="http://www.topografix.com/GPX/1/0">
  <name>Cache listing generated from Opencaching.de</name>
  <desc>This is a waypoint file generated from Opencaching.de{wpchildren}</desc>
  <author>Opencaching.de</author>
  <email>contact@opencaching.de</email>
  <url>http://' . $server_domain . '</url>
  <urlname>Opencaching.de - Geocaching in Deutschland, Oesterreich und der Schweiz</urlname>
  <time>{time}</time>
  <keywords>cache, geocache, opencaching, waypoint</keywords>
';
    $gpxLine = '  <wpt lat="{lat}" lon="{lon}">
    <time>{time}</time>
    <name>{waypoint}</name>
    <desc>{cachename}</desc>
    <src>' . $server_domain . '</src>
    <url>' . $server_address . 'viewcache.php?cacheid={cacheid}</url>
    <urlname>{cachename}</urlname>
    <sym>{sym}</sym>
    <type>Geocache|{type}</type>
    <groundspeak:cache id="{cacheid}" {status} xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
      <groundspeak:name>{cachename}</groundspeak:name>
      <groundspeak:placed_by>{owner}</groundspeak:placed_by>
      <groundspeak:owner id="{userid}">{owner}</groundspeak:owner>
      <groundspeak:type>{type}</groundspeak:type>
      <groundspeak:container>{container}</groundspeak:container>
      <groundspeak:attributes>
{attributes}      </groundspeak:attributes>
      <groundspeak:difficulty>{difficulty}</groundspeak:difficulty>
      <groundspeak:terrain>{terrain}</groundspeak:terrain>
      <groundspeak:country>{country}</groundspeak:country>
      <groundspeak:state>{state}</groundspeak:state>
      <groundspeak:short_description html="True">{shortdesc}</groundspeak:short_description>
      <groundspeak:long_description html="True">{desc}&lt;br /&gt;{images}</groundspeak:long_description>
{hints}      <groundspeak:logs>
{logs}      </groundspeak:logs>
      <groundspeak:travelbugs>
{geokrety}      </groundspeak:travelbugs>
    </groundspeak:cache>
  </wpt>
{cache_waypoints}';
    /* Ocprop:
     *    <wpt\s+lat=\"([0-9\-\+\.]+)\"\s+lon=\"([0-9\-\+\.]+)\">
     *    <time>(.*?)<\/time>
     *      (Date: ^([0-9]{4})\-([0-9]{2})\-([0-9]{2})T[0-9\:\-\.]+(Z)?$/s)
     *    <name>(.*?)<\/name>
     *    <url>http:\/\/www\.opencaching\.de\/viewcache\.php\?cacheid=([0-9]+)<\/url>
     *    <sym>(.*?)<\/sym>
     *    <groundspeak:cache\s+id=\"[0-9]+\"\s+available=\"(True|False)\"\s+archived=\"(True|False)\"
     *    <groundspeak:name>(.*?)<\/groundspeak:name>
     *    <groundspeak:placed_by>(.*?)<\/groundspeak:placed_by>
     *    <groundspeak:owner id="([0-9])+">(.*?)<\/groundspeak:owner>
     *    <groundspeak:type>(.*?)<\/groundspeak:type>
     *    <groundspeak:container>(.*?)<\/groundspeak:container>
     *    <groundspeak:difficulty>(.*?)<\/groundspeak:difficulty>
     *    <groundspeak:terrain>(.*?)<\/groundspeak:terrain>
     *    <groundspeak:country>(.*?)<\/groundspeak:country>
     *    <groundspeak:state>(.*?)<\/groundspeak:state>
     *    <groundspeak:short_description html="(.*?)".*?>(.*?)<\/groundspeak:short_description>
     *    <groundspeak:long_description html="(.*?)".*?>(.*?)<\/groundspeak:long_description>
     *    <groundspeak:encoded_hints>(.*?)<\/groundspeak:encoded_hints>
     */
    $gpxAttributes = ' 	      <groundspeak:attribute id="{attrib_id}" inc="{attrib_inc}">{attrib_name}</groundspeak:attribute>';
    $gpxLog = '      <groundspeak:log id="{id}">
        <groundspeak:date>{date}</groundspeak:date>
        <groundspeak:type>{type}</groundspeak:type>
        <groundspeak:finder id="{userid}">{username}</groundspeak:finder>
        <groundspeak:text encoded="False">{text}</groundspeak:text>
      </groundspeak:log>';
    $gpxGeokrety = '		<groundspeak:travelbug id="{gkid}" ref="{gkref}">
		  <groundspeak:name>{gkname}</groundspeak:name>
		</groundspeak:travelbug>';
    $gpxWaypoints = '  <wpt lat="{wp_lat}" lon="{wp_lon}">
    <time>{time}</time>
    <name>{name}</name>
    <cmt>{comment}</cmt>
    <desc>{desc}</desc>
    <url>' . $server_address . 'viewcache.php?cacheid={cacheid}</url>
    <urlname>{parent} {cachename}</urlname>
    <sym>{type}</sym>
    <type>Waypoint|{type}</type>
    <gsak:wptExtension xmlns:gsak="http://www.gsak.net/xmlv1/4">
      <gsak:Parent>{parent}</gsak:Parent>
    </gsak:wptExtension>
  </wpt>
';
    $gpxFoot = '</gpx>';
    $gpxTimeFormat = 'Y-m-d\\TH:i:s\\Z';
    $gpxStatus[0] = 'available="False" archived="False"';
    // other (unavailable, not archived)
    $gpxStatus[1] = 'available="True" archived="False"';
    //available, not archived
    $gpxStatus[2] = 'available="False" archived="False"';
    //unavailable, not archived
    $gpxStatus[3] = 'available="False" archived="True"';
    //unavailable, archived
    $gpxStatus[6] = 'available="False" archived="True"';
    //locked, visible
    $gpxContainer[0] = 'Other';
    $gpxContainer[2] = 'Micro';
    $gpxContainer[3] = 'Small';
    $gpxContainer[4] = 'Regular';
    $gpxContainer[5] = 'Large';
    $gpxContainer[6] = 'Large';
    $gpxContainer[7] = 'Virtual';
    $gpxContainer[8] = 'Micro';
    // cache types known by gpx
    $gpxType[0] = 'Unknown Cache';
    $gpxType[2] = 'Traditional Cache';
    $gpxType[3] = 'Multi-cache';
    $gpxType[4] = 'Virtual Cache';
    $gpxType[5] = 'Webcam Cache';
    $gpxType[6] = 'Event Cache';
    // unknown ... converted
    $gpxType[7] = 'Unknown Cache';
    $gpxType[8] = 'Unknown Cache';
    $gpxType[10] = 'Traditional Cache';
    $gpxLogType[0] = 'Other';
    $gpxLogType[1] = 'Found it';
    $gpxLogType[2] = 'Didn\'t find it';
    $gpxLogType[3] = 'Write note';
    $gpxLogType[7] = 'Attended';
    $gpxLogType[8] = 'Will attend';
    $gpxLogType[9] = 'Archive';
    $gpxLogType[10] = 'Owner Maintenance';
    $gpxLogType[11] = 'Temporarily Disable Listing';
    $gpxLogType[13] = 'Archive';
    $gpxLogType[14] = 'Archive';
    $gpxSymNormal = 'Geocache';
    $gpxSymFound = 'Geocache Found';
    $childwphandler = new ChildWp_Handler();
    $children = '';
    $rs = sql('SELECT &searchtmp.`cache_id` `cacheid` FROM &searchtmp');
    while ($r = sql_fetch_array($rs) && $children == '') {
        if (count($childwphandler->getChildWps($r['cacheid']))) {
            $children = ' (HasChildren)';
        }
    }
    mysql_free_result($rs);
    $gpxHead = mb_ereg_replace('{wpchildren}', $children, $gpxHead);
    $gpxHead = mb_ereg_replace('{time}', date($gpxTimeFormat, time()), $gpxHead);
    append_output($gpxHead);
    $user_id = $login->userid;
    $rs = sql_slave("SELECT SQL_BUFFER_RESULT &searchtmp.`cache_id` `cacheid`, &searchtmp.`longitude` `longitude`, &searchtmp.`latitude` `latitude`,\n\t\t\t\t\t\t\t`cache_location`.`adm2` `state`, `caches`.`wp_oc` `waypoint`, `caches`.`date_hidden` `date_hidden`, `caches`.`name` `name`,\n\t\t\t\t\t\t\t`caches`.`country` `country`, `countries`.`name` AS `country_name`, `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `caches`.`desc_languages` `desc_languages`,\n\t\t\t\t\t\t\t`caches`.`size` `size`, `caches`.`type` `type`, `caches`.`status` `status`, `user`.`username` `username`, `caches`.`user_id` `userid`, `user`.`data_license`,\n\t\t\t\t\t\t\t`cache_desc`.`desc` `desc`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`hint` `hint`,\n\t\t\t\t\t\t\tIFNULL(`stat_cache_logs`.`found`, 0) AS `found`\n\t\t\t\t\t\tFROM &searchtmp\n\t\t\t\t\t\t\tINNER JOIN `caches` ON &searchtmp.`cache_id`=`caches`.`cache_id`\n\t\t\t\t\t\t\tINNER JOIN `countries` ON `caches`.`country`=`countries`.`short`\n\t\t\t\t\t\t\tINNER JOIN `user` ON &searchtmp.`user_id`=`user`.`user_id`\n\t\t\t\t\t\t\tINNER JOIN `cache_desc` ON `caches`.`cache_id`=`cache_desc`.`cache_id`AND `caches`.`default_desclang`=`cache_desc`.`language`\n\t\t\t\t\t\t\tLEFT JOIN `cache_location` ON &searchtmp.`cache_id`=`cache_location`.`cache_id`\n\t\t\t\t\t\t\tLEFT JOIN `stat_cache_logs` ON &searchtmp.`cache_id`=`stat_cache_logs`.`cache_id` AND `stat_cache_logs`.`user_id`='&1'", $user_id);
    while ($r = sql_fetch_array($rs)) {
        $thisline = $gpxLine;
        $lat = sprintf('%01.5f', $r['latitude']);
        $thisline = mb_ereg_replace('{lat}', $lat, $thisline);
        $lon = sprintf('%01.5f', $r['longitude']);
        $thisline = mb_ereg_replace('{lon}', $lon, $thisline);
        $time = date($gpxTimeFormat, strtotime($r['date_hidden']));
        $thisline = mb_ereg_replace('{time}', $time, $thisline);
        $thisline = mb_ereg_replace('{waypoint}', $r['waypoint'], $thisline);
        $thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
        $thisline = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thisline);
        $thisline = mb_ereg_replace('{country}', text_xmlentities($r['country_name']), $thisline);
        $thisline = mb_ereg_replace('{state}', text_xmlentities($r['state']), $thisline);
        if ($r['hint'] == '') {
            $thisline = mb_ereg_replace('{hints}', '', $thisline);
        } else {
            // Ocprop:  <groundspeak:encoded_hints>(.*?)<\/groundspeak:encoded_hints>
            $hint = html_entity_decode(strip_tags($r['hint']), ENT_COMPAT, "UTF-8");
        }
        $thisline = mb_ereg_replace('{hints}', '      <groundspeak:encoded_hints>' . text_xmlentities($hint) . '</groundspeak:encoded_hints>
', $thisline);
        $thisline = mb_ereg_replace('{shortdesc}', text_xmlentities($r['short_desc']), $thisline);
        $desc = str_replace(' src="images/uploads/', ' src="' . $server_address . 'images/uploads/', $r['desc']);
        $license = getLicenseDisclaimer($r['userid'], $r['username'], $r['data_license'], $r['cacheid'], $opt['template']['locale'], true, true);
        if ($license != "") {
            $desc .= "<p><em>{$license}</em></p>\n";
        }
        $desc .= get_desc_npas($r['cacheid']);
        $thisline = mb_ereg_replace('{desc}', text_xmlentities(decodeEntities($desc)), $thisline);
        $thisline = mb_ereg_replace('{images}', text_xmlentities(getPictures($r['cacheid'], $server_address)), $thisline);
        if (isset($gpxType[$r['type']])) {
            $thisline = mb_ereg_replace('{type}', $gpxType[$r['type']], $thisline);
        } else {
            $thisline = mb_ereg_replace('{type}', $gpxType[0], $thisline);
        }
        if (isset($gpxContainer[$r['size']])) {
            $thisline = mb_ereg_replace('{container}', $gpxContainer[$r['size']], $thisline);
        } else {
            $thisline = mb_ereg_replace('{container}', $gpxContainer[0], $thisline);
        }
        if (isset($gpxStatus[$r['status']])) {
            $thisline = mb_ereg_replace('{status}', $gpxStatus[$r['status']], $thisline);
        } else {
            $thisline = mb_ereg_replace('{status}', $gpxStatus[0], $thisline);
        }
        $sDiffDecimals = '';
        if ($r['difficulty'] % 2) {
            $sDiffDecimals = '.5';
        }
        $r['difficulty'] -= $r['difficulty'] % 2;
        $thisline = mb_ereg_replace('{difficulty}', $r['difficulty'] / 2 . $sDiffDecimals, $thisline);
        $sTerrDecimals = '';
        if ($r['terrain'] % 2) {
            $sTerrDecimals = '.5';
        }
        $r['terrain'] -= $r['terrain'] % 2;
        $thisline = mb_ereg_replace('{terrain}', $r['terrain'] / 2 . $sTerrDecimals, $thisline);
        $thisline = mb_ereg_replace('{owner}', text_xmlentities($r['username']), $thisline);
        $thisline = mb_ereg_replace('{userid}', $r['userid'], $thisline);
        if ($r['found'] > 0) {
            $thisline = mb_ereg_replace('{sym}', text_xmlentities($gpxSymFound), $thisline);
        } else {
            $thisline = mb_ereg_replace('{sym}', text_xmlentities($gpxSymNormal), $thisline);
        }
        // clear cache specific data
        $logentries = '';
        $cache_note = false;
        $attribentries = '';
        $waypoints = '';
        $gkentries = '';
        // fetch logs
        if ($user_id != 0) {
            // insert personal note
            $cacheNote = getCacheNote($user_id, $r['cacheid']);
            if ($cacheNote) {
                $thislog = $gpxLog;
                $thislog = mb_ereg_replace('{id}', 0, $thislog);
                $thislog = mb_ereg_replace('{date}', date($gpxTimeFormat), $thislog);
                $thislog = mb_ereg_replace('{userid}', $user_id, $thislog);
                $thislog = mb_ereg_replace('{username}', text_xmlentities($login->username), $thislog);
                $thislog = mb_ereg_replace('{type}', $gpxLogType[3], $thislog);
                $thislog = mb_ereg_replace('{text}', text_xmlentities($cacheNote['note']), $thislog);
                $logentries .= $thislog . "\n";
            }
            // current users logs
            $rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`=&2 ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC", $r['cacheid'], $user_id);
            while ($rLog = sql_fetch_array($rsLogs)) {
                $thislog = $gpxLog;
                $thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
                $thislog = mb_ereg_replace('{date}', date($gpxTimeFormat, strtotime($rLog['date'])), $thislog);
                $thislog = mb_ereg_replace('{userid}', $rLog['user_id'], $thislog);
                $thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog);
                if (isset($gpxLogType[$rLog['type']])) {
                    $logtype = $gpxLogType[$rLog['type']];
                } else {
                    $logtype = $gpxLogType[0];
                }
                $thislog = mb_ereg_replace('{type}', $logtype, $thislog);
                $thislog = mb_ereg_replace('{text}', text_xmlentities(decodeEntities($rLog['text'])), $thislog);
                $logentries .= $thislog . "\n";
            }
            mysql_free_result($rsLogs);
        }
        // newest 20 logs (except current users)
        $rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`!=&2 ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC LIMIT 20", $r['cacheid'], $user_id);
        while ($rLog = sql_fetch_array($rsLogs)) {
            $thislog = $gpxLog;
            $thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
            $thislog = mb_ereg_replace('{date}', date($gpxTimeFormat, strtotime($rLog['date'])), $thislog);
            $thislog = mb_ereg_replace('{userid}', $rLog['user_id'], $thislog);
            $thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog);
            if (isset($gpxLogType[$rLog['type']])) {
                $logtype = $gpxLogType[$rLog['type']];
            } else {
                $logtype = $gpxLogType[0];
            }
            $thislog = mb_ereg_replace('{type}', $logtype, $thislog);
            $thislog = mb_ereg_replace('{text}', text_xmlentities(decodeEntities($rLog['text'])), $thislog);
            $logentries .= $thislog . "\n";
        }
        mysql_free_result($rsLogs);
        $thisline = mb_ereg_replace('{logs}', $logentries, $thisline);
        // attributes
        $rsAttributes = sql_slave("SELECT `gc_id`, `gc_inc`, `gc_name`\n\t\t                             FROM `caches_attributes`\n\t\t                       INNER JOIN `cache_attrib` ON `cache_attrib`.`id`=`caches_attributes`.`attrib_id`\n\t\t                            WHERE `caches_attributes`.`cache_id`=&1", $r['cacheid']);
        $gc_ids = array();
        while ($rAttrib = sql_fetch_array($rsAttributes)) {
            // Multiple OC attributes can be mapped to one GC attribute, either with
            // the same "inc"s or with different. Both may disturb applications, so we
            // output each GC ID only once.
            if (!isset($gc_ids[$rAttrib['gc_id']])) {
                $thisattribute = mb_ereg_replace('{attrib_id}', $rAttrib['gc_id'], $gpxAttributes);
                $thisattribute = mb_ereg_replace('{attrib_inc}', $rAttrib['gc_inc'], $thisattribute);
                $thisattribute = mb_ereg_replace('{attrib_name}', text_xmlentities($rAttrib['gc_name']), $thisattribute);
                $attribentries .= $thisattribute . "\n";
                $gc_ids[$rAttrib['gc_id']] = true;
            }
        }
        mysql_free_result($rsAttributes);
        $thisline = mb_ereg_replace('{attributes}', $attribentries, $thisline);
        // geokrety
        $rsGeokrety = sql_slave("SELECT `gk_item`.`id`, `gk_item`.`name`,  `caches`.`wp_oc` FROM `gk_item` INNER JOIN `gk_item_waypoint` ON `gk_item`.`id`=`gk_item_waypoint`.`id` INNER JOIN `caches` ON `gk_item_waypoint`.`wp`=`caches`.`wp_oc` WHERE `caches`.`cache_id`=&1", $r['cacheid']);
        while ($rGK = sql_fetch_array($rsGeokrety)) {
            $thiskrety = $gpxGeokrety;
            $thiskrety = mb_ereg_replace('{gkid}', $rGK['id'], $thiskrety);
            $thiskrety = mb_ereg_replace('{gkref}', sprintf("GK%04X", $rGK['id']), $thiskrety);
            $thiskrety = mb_ereg_replace('{gkname}', text_xmlentities($rGK['name']), $thiskrety);
            $gkentries .= $thiskrety . "\n";
        }
        mysql_free_result($rsGeokrety);
        $thisline = mb_ereg_replace('{geokrety}', $gkentries, $thisline);
        // additional waypoints, including personal cache note
        $childWaypoints = $childwphandler->getChildWps($r['cacheid']);
        $n = 1;
        $digits = "%0" . strlen(count($childWaypoints)) . "d";
        foreach ($childWaypoints as $childWaypoint) {
            $thiswp = $gpxWaypoints;
            $thiswp = mb_ereg_replace('{wp_lat}', sprintf('%01.5f', $childWaypoint['latitude']), $thiswp);
            $thiswp = mb_ereg_replace('{wp_lon}', sprintf('%01.5f', $childWaypoint['longitude']), $thiswp);
            $thiswp = mb_ereg_replace('{time}', $time, $thiswp);
            $thiswp = mb_ereg_replace('{name}', $r['waypoint'] . '-' . sprintf($digits, $n), $thiswp);
            $thiswp = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thiswp);
            $thiswp = mb_ereg_replace('{comment}', text_xmlentities($childWaypoint['description']), $thiswp);
            $thiswp = mb_ereg_replace('{desc}', text_xmlentities($childWaypoint['name']), $thiswp);
            switch ($childWaypoint['type']) {
                case 1:
                    $wp_typename = "Parking Area";
                    break;
                    // well-known garmin symbols
                // well-known garmin symbols
                case 2:
                    $wp_typename = "Flag, Green";
                    break;
                    // stage / ref point
                // stage / ref point
                case 3:
                    $wp_typename = "Flag, Blue";
                    break;
                    // path
                // path
                case 4:
                    $wp_typename = "Circle with X";
                    break;
                    // final
                // final
                case 5:
                    $wp_typename = "Diamond, Green";
                    break;
                    // point of interest
                // point of interest
                default:
                    $wp_typename = "Flag, Blue";
                    break;
                    // for the case new types are forgotten here ..
            }
            $thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp);
            $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
            $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp);
            $waypoints .= $thiswp;
            ++$n;
        }
        if ($cacheNote && !empty($cacheNote['latitude']) && !empty($cacheNote['longitude'])) {
            $thiswp = $gpxWaypoints;
            $thiswp = mb_ereg_replace('{wp_lat}', sprintf('%01.5f', $cacheNote['latitude']), $thiswp);
            $thiswp = mb_ereg_replace('{wp_lon}', sprintf('%01.5f', $cacheNote['longitude']), $thiswp);
            $thiswp = mb_ereg_replace('{time}', $time, $thiswp);
            $thiswp = mb_ereg_replace('{name}', $r['waypoint'] . 'NOTE', $thiswp);
            $thiswp = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thiswp);
            $thiswp = mb_ereg_replace('{comment}', text_xmlentities($cacheNote['note']), $thiswp);
            $thiswp = mb_ereg_replace('{desc}', text_xmlentities($cache_note_text), $thiswp);
            $thiswp = mb_ereg_replace('{type}', "Reference Point", $thiswp);
            $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
            $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp);
            $waypoints .= $thiswp;
        }
        $thisline = mb_ereg_replace('{cache_waypoints}', $waypoints, $thisline);
        append_output($thisline);
    }
    mysql_free_result($rs);
    append_output($gpxFoot);
}
             if (isset($path[1]) && trim($path[1]) !== "") {
                 $data["projectID"] = $path[1];
             }
             $results = deleteProject($data);
             break;
         default:
             $results["meta"] = methodNotAllowed($method, $path);
     }
     break;
 case "pictures":
     switch ($method) {
         case "GET":
             if (isset($path[1]) && trim($path[1]) !== "") {
                 $data["projectID"] = $path[1];
             }
             $results = getPictures($data);
             break;
         case "POST":
             if (isset($path[1]) && trim($path[1]) !== "") {
                 $data["projectID"] = $path[1];
             }
             $results = addPicture($data);
             break;
         case "DELETE":
             if (isset($path[1]) && trim($path[1]) !== "") {
                 $data["projectID"] = $path[1];
             }
             $results = deletePicture($data);
             break;
         default:
             $results["meta"] = methodNotAllowed($method, $path);
Beispiel #7
0
		<ul>
			<li><a href="../index.php">home</a></li>			
            <li><a href="../visionfront.php" >Vision</a></li>
            <li><a href="../goals.php">goals</a></li>			
			<li><a href="../mous.php">mou's</a></li>
            <li><a href="../showreports.php">reports</a></li>
			<li><a href="../staff.php">staff</a></li></ul>
		</ul>
		</div>
<div id="center">

<h2>Image Gallery  <span>Planning & Development</span>  </h2>
<br class="spacer" />

<?php 
getPictures();
?>


<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
</div>
<div id="footerOutside">
	<div id="footer">
		<ul class="nav">
		
			<li><a href="../index.php">home</a></li>			
            <li><a href="../visionfront.php" >Vision</a></li>
            <li><a href="../goals.php">goals</a></li>			
			<li><a href="../mous.php">mou's</a></li>
function generatePackage()
{
    $servername = "localhost";
    $username = "******";
    $password = "";
    $dbname = "team3_travelexperts";
    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    $sql = "SELECT PackageId,PkgName, PkgStartDate, PkgEndDate, PkgPicture, PkgDesc, PkgBasePrice FROM packages";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        //Store Package name,startdate,enddate as session variable when user clicks on package
        while ($row = $result->fetch_assoc()) {
            $getStartDate = strtotime($row["PkgStartDate"]);
            $DisplayStart = date("F,j,Y", $getStartDate);
            $getEndDate = strtotime($row["PkgEndDate"]);
            $DisplayEnd = date("F,j,Y", $getEndDate);
            //put date in seconds format to determine how it should be displayed
            $time = $_SERVER['REQUEST_TIME'];
            $currentTime = date("z", $time);
            $compareStart = date("z", $getStartDate);
            $compareEnd = date("z", $getEndDate);
            if ($compareEnd == $currentTime || $compareEnd < $currentTime) {
                continue;
            }
            //echo each valid package to the index page
            echo "<form id='myform' method='POST' action=''>";
            echo "<div class='col-sm-4'>" . "<div id='package' class='panel panel-default'>" . "<div class='panel-heading'><h4>" . $row["PkgName"] . "</h4></div>" . "<div class='panel-body'>" . "<input type='image' onclick='DirectUser()' value='" . $row["PkgName"] . "' src=" . getPictures($row["PkgName"], 0) . "'width='200' height='200'" . "' name='package'>" . "<h5>" . $row["PkgDesc"] . "</h5><br>";
            if ($compareStart == $currentTime || $compareStart < $currentTime) {
                echo "<h4 style='color:red'><small>From:</small> " . $DisplayStart . "</h4>";
            } else {
                echo "<h4><small>From:</small> " . $DisplayStart . "</h4>";
            }
            echo "<h4><small>To: </small>" . $DisplayEnd . "</h4><br>" . "<h4>CAD\$" . $row["PkgBasePrice"] . "<small> per person</small></h4></div>" . "</div><!--close the panel-->" . "</div>";
            echo "</form>";
        }
    } else {
        echo "0 results";
    }
    $conn->close();
}