function amplifyCell(&$record, $dummy = NULL) { switch ($record['realm']) { case 'object': $record['ports'] = getObjectPortsAndLinks($record['id']); $record['ipv4'] = getObjectIPv4Allocations($record['id']); $record['ipv6'] = getObjectIPv6Allocations($record['id']); $record['nat4'] = getNATv4ForObject($record['id']); $record['files'] = getFilesOfEntity($record['realm'], $record['id']); break; case 'file': $record['links'] = getFileLinks($record['id']); break; case 'location': $record['locations'] = getLocations($record['id']); $record['rows'] = getRows($record['id']); break; case 'row': $record['racks'] = getRacks($record['id']); case 'rack': $record['mountedObjects'] = array(); // start with default rackspace for ($i = $record['height']; $i > 0; $i--) { for ($locidx = 0; $locidx < 3; $locidx++) { $record[$i][$locidx]['state'] = 'F'; } } // load difference $query = "select unit_no, atom, state, object_id " . "from RackSpace where rack_id = ? and " . "unit_no between 1 and ? order by unit_no"; $result = usePreparedSelectBlade($query, array($record['id'], $record['height'])); global $loclist; $mounted_objects = array(); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $record[$row['unit_no']][$loclist[$row['atom']]]['state'] = $row['state']; $record[$row['unit_no']][$loclist[$row['atom']]]['object_id'] = $row['object_id']; if ($row['state'] == 'T' and $row['object_id'] != NULL) { $mounted_objects[$row['object_id']] = TRUE; } } $record['mountedObjects'] = array_keys($mounted_objects); unset($result); break; case 'vst': $record['rules'] = array(); $record['switches'] = array(); $result = usePreparedSelectBlade('SELECT rule_no, port_pcre, port_role, wrt_vlans, description ' . 'FROM VLANSTRule WHERE vst_id = ? ORDER BY rule_no', array($record['id'])); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $record['rules'][$row['rule_no']] = $row; } unset($result); $result = usePreparedSelectBlade('SELECT object_id, domain_id FROM VLANSwitch WHERE template_id = ?', array($record['id'])); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $record['switches'][$row['object_id']] = $row; } break; default: } }
$event_start_list = array('09:00:00', '09:15:00', '09:30:00', '10:00:00', '10:30:00'); $event_end_list = array('16:00:00', '16:30:00', '17:15:00', '15:30:00', '19:00:00'); $item_categories = array('1' => 'リサイクル品', '2' => '手作り品'); $link_from_list = array('1' => '楽市モバイルサイト', '2' => '楽市PCサイト', '3' => '会場設置チラシ', '4' => '友人・知人から聞いて', '5' => 'GOOGLE・YAHOO検索', '6' => '地域情報誌', '7' => '新聞折り込み', '8' => 'フリーマーケットへ行こう', '9' => 'フリーマーケットガイド(モバフリ)', '10' => 'ポスター', '11' => '楽市メルマガ', '12' => '楽市ブログ', '13' => 'Facebook', '14' => 'mixi'); $pickup_list = array(\Model_Fleamarket::PICKUP_FLAG_OFF, \Model_Fleamarket::PICKUP_FLAG_ON); $shop_fee_list = array(\Model_Fleamarket::SHOP_FEE_FLAG_FREE, \Model_Fleamarket::SHOP_FEE_FLAG_CHARGE); $car_shop_list = array(\Model_Fleamarket::CAR_SHOP_FLAG_NG, \Model_Fleamarket::CAR_SHOP_FLAG_OK); $pro_shop_list = array(\Model_Fleamarket::PRO_SHOP_FLAG_NG, \Model_Fleamarket::PRO_SHOP_FLAG_OK); $charge_parking_list = array(\Model_Fleamarket::CHARGE_PARKING_FLAG_NONE, \Model_Fleamarket::CHARGE_PARKING_FLAG_EXIST); $free_parking_list = array(\Model_Fleamarket::FREE_PARKING_FLAG_NONE, \Model_Fleamarket::FREE_PARKING_FLAG_EXIST); $rainy_location_list = array(\Model_Fleamarket::RAINY_LOCATION_FLAG_NONE, \Model_Fleamarket::RAINY_LOCATION_FLAG_EXIST); $register_types = array(\Model_Fleamarket::REGISTER_TYPE_ADMIN, \Model_Fleamarket::REGISTER_TYPE_USER); $about_titles = \Model_Fleamarket_About::getAboutTitles(); $abouts = getFleamarketAbouts(); $prefectures = \Config::get('master.prefectures'); $location_list = getLocations(); $entry_styles = array('1' => '手持ち出店', '2' => '手持ち出店(プロ)', '3' => '車出店', '4' => '車出店(プロ)'); $booth_fee_list = array(0, 500, 1000, 1500, 2000, 2500, 3000); $event_numbers = array(); // \DB::query('TRUNCATE TABLE fleamarkets')->execute(); // \DB::query('TRUNCATE TABLE fleamarket_entry_styles')->execute(); // \DB::query('TRUNCATE TABLE fleamarket_abouts')->execute(); // \DB::query('TRUNCATE TABLE locations')->execute(); for ($i = 1; $i <= 2000; $i++) { $group_code = array_rand($group_codes); $group_code_name = $group_codes[$group_code]; $register_type = array_rand($register_types); // 開催地情報 $location_name = array_rand($location_list, 1); $location = $location_list[$location_name]; list($prefecture, $address) = getAddress($location);
$result = mysql_query("DELETE FROM usagedata WHERE id=" . $id . ";"); } echo "{"; if ($_GET["action"] == "update") { connectDatabase("usagedata"); getData(); echo ", "; getMeta(); } else { if ($_GET["action"] == "headers") { connectDatabase("usagedata"); getHeaders(); } else { if ($_GET["action"] == "locations") { connectDatabase("usagedata"); getLocations(); } else { if ($_GET["action"] == "delete") { connectDatabase("usagedata"); deleteRecord(); } else { connectDatabase("usagedata"); getHeaders(); echo ", "; getData(); echo ", "; getMeta(); } } } }
// find the path $path = findS2SPath($start_marker, $end_marker); } else { if ($_GET['type'] == 'dir') { // get locations for end address $saddr = $_GET['saddr']; // check for boston and ma $saddr = checkString($saddr, $city); $saddr = checkString($saddr, $state); $starts = getLocations($saddr); // get locations for start address $daddr = $_GET['daddr']; // check for boston and ma $daddr = checkString($daddr, $city); $daddr = checkString($daddr, $state); $ends = getLocations($daddr); // log if ($logging) { logDirectionsQuery($_GET['saddr'], $_GET['daddr']); } // only one of each, so we can calculate the path if (count($starts) == 1 && count($ends) == 1) { $start_location = $starts[0]; $end_location = $ends[0]; #echo "start_location = " . $start_location . "<br/>"; #echo "end_location = " . $end_location . "<br/>"; if ($start_location != false && $end_location != false) { // find three closest starting stations $start_stations = findNearestStations2($start_location); // find three closest ending stations $end_stations = findNearestStations2($end_location);
x = parseFloat( x ); y = parseFloat( y ); return ((x < y) ? -1 : ((x > y) ? 1 : 0)); }; /* Custom sorting function used for empty span with title value */ jQuery.fn.dataTableExt.oSort['title-numeric-desc'] = function(a,b) { var x = a.match(/title="*(-?[0-9]+)/)[1]; var y = b.match(/title="*(-?[0-9]+)/)[1]; x = parseFloat( x ); y = parseFloat( y ); return ((x < y) ? 1 : ((x > y) ? -1 : 0)); }; </script> <?php $locations = getLocations(); $inspections = getInspectionTotals(); echo googlemaps_load($locations); ?> </head> <body onload="load()"> <!--[if lt IE 8]> <div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'> <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div> <div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'> <div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div> <div style='width: 275px; float: left; font-family: Arial, sans-serif;'> <div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>You are using an outdated browser</div> <div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>For a better experience using this site, please upgrade to a modern web browser.</div> </div> <div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div> <div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div> <div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div> <div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div> </div> </div> <![endif]--> <div id="wrapper"> <div id="header"> <div id="header_left"> <div id="logo"> <a href="/"><span>eatsure beta - London Food Inspection Scores</span></a> </div> </div> <div id="results">
function parseInputs($user) { if (isset($_POST['func'])) { $func = $_POST['func']; // getters =============================== if ($func === "getGoals") { echo json_encode(getGoals($user)); } if ($func === "getIndustries") { echo json_encode(getIndustries($user)); } if ($func === "getLocations") { echo json_encode(getLocations($user)); } if ($func === "getPostings") { getPostings($user); } if ($func === "getContacts") { echo json_encode(getContacts($user)); } if ($func === "getSchedules") { echo json_encode(getSchedules($user)); } if ($func === "getCompanies") { echo getCompanies($user); } if ($func === "getBlogId") { echo json_encode(getBlogId($user, $_POST['title'], $_POST['text'])); } if ($func === "getBlog") { echo json_encode(getBlog($user)); } if ($func === "getNotesOnPosting") { $postingId = $_POST['postingId']; echo json_encode(getNotesOnPosting($user, $postingId)); } // inserters =============================== if ($func === "insertGoal") { if (isset($_POST["goal"]) && $_POST["goal"] !== '') { echo json_encode(insertGoal($user, $_POST["goal"])); } } if ($func === "insertIndustry") { if (isset($_POST["industry"]) && $_POST["industry"] !== '') { echo json_encode(insertIndustry($user, $_POST["industry"])); } } if ($func === "insertCompany") { $url = urldecode($_POST["url"]); $companyName = $_POST["company"]; insertCompany($user, $companyName); } if ($func === "insertLocation") { if (isset($_POST["location"]) && $_POST["location"] !== '') { echo json_encode(insertLocation($user, $_POST["location"])); } } if ($func === "insertPosting") { echo json_encode(insertPosting($user)); } if ($func === "insertContact") { // more complex. will be responsible for getting $_POST echo json_encode(insertContact($user)); } if ($func === "insertSchedule") { // more complex. will be responsible for getting $_POST // echo json_encode(insertSchedule($user)); echo insertSchedule($user); } if ($func === "addSchedule") { // more complex. will be responsible for getting $_POST // echo json_encode(insertSchedule($user)); // echo "adding ZSchecdule"; $name = $_POST["name"]; $description = $_POST["description"]; $contact = $_POST["contact"]; $start = $_POST["start"]; $end = $_POST["end"]; // addSchedule($name,$description,$contact,$start,$end) if (addSchedule($name, $description, $contact, $start, $end)) { $scheduleId = getScheduleId($name, $description, $contact, $start, $end); if ($scheduleId > 0) { // echo $scheduleId; // insert schedule id and user id to user_schedule $query = "insert into user_schedule "; $query .= "(user,schedule) "; $query .= "values ( {$user}, "; $query .= "{$scheduleId} ) "; //return $query; echo booleanEcho($query); } else { echo "error getting schedule id."; } } else { echo "error inserting schedule."; } } if ($func === "insertBlog") { echo json_encode(insertBlog($user)); } if ($func === "insertNotesPostingUser") { // insertBlog, then insertNotesPostingUser $noteId = insertBlog($user); // $noteId = $_POST["noteId"]; $postingId = $_POST["postingId"]; echo json_encode(insertNotesPostingUser($noteId, $postingId, $user)); } // removers =============================== if ($func === "removeGoal") { // url is the id for user_goals if (isset($_POST["url"]) && $_POST["url"] !== '') { echo json_encode(removeGoal($user, $_POST["url"])); } } if ($func === "removeIndustry") { // url is the id for user_industries if (isset($_POST["url"]) && $_POST["url"] !== '') { echo json_encode(removeIndustry($user, $_POST["url"])); } } if ($func === "removeLocation") { // url is the id for locations if (isset($_POST["url"]) && $_POST["url"] !== '') { echo json_encode(removeLocation($user, $_POST["url"])); } } if ($func === "removeContact") { // url is the id for user_contacts if (isset($_POST["url"]) && $_POST["url"] !== '') { echo json_encode(removeUserContact($user, $_POST["url"])); } } if ($func === "removePosting") { if (isset($_POST["url"]) && $_POST["url"] !== '') { removePosting($user, $_POST["url"]); } } if ($func === "removeCompany") { $companyId = $_POST["url"]; // companyID is stored here removeCompany($user, $companyId); } if ($func === "removeSchedule") { $scheduleId = $_POST["url"]; // scheduleID is stored here echo json_encode(removeSchedule($user, $scheduleId)); } if ($func === "removeBlog") { $userNoteId = $_POST["url"]; // need to get noteId from userNoteId $noteId = getNoteIdFromUserNoteId($userNoteId); if (removeNoteUser($user, $userNoteId) === true) { if (removeNote($noteId) === true) { echo json_encode(true); } else { echo json_encode("Error removing from notes."); } } else { echo json_encode("Error removing from NoteUser."); } } // updaters =============================== if ($func === "updateGoal") { echo json_encode(updateGoal($user)); } if ($func === "updateIndustry") { echo json_encode(updateIndustry($user)); } if ($func === "updatePosting") { updatePosting($user); // returns on its own } if ($func === "updateContact") { echo json_encode(updateContact($user)); } } }
function displaySearchForm() { global $bedsBaths; global $resultsPage; global $showAreas; global $showSubtypes; global $locationsJSON; global $typesJSON; global $searchType; global $resultSearchType; global $currencies; global $energyRatings; global $showCurrency; global $showBeds; global $showBaths; global $showRating; global $languageArr; global $datePickerLanguages; global $language; global $showFeature; global $featuresLanguage; global $showChosen; $currencies = array('EUR', 'GBP', 'USD'); $energyRatings = array(); $rateKeys = array(); for ($i = 1; $i <= 16; $i++) { $rateKeys[] = $i; } $energyRatings = getEnergyRatingLanguage($rateKeys); $bedsBaths = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); $bedsData = getBedBathLanguage(array('1', '2', '3', '4', '5', '6', '7', '8', '9')); $bathsData = getBedBathLanguage(array('1', '2', '3', '4', '5', '6', '7', '8'), 'bathrooms'); $currencyIcon = array('EUR' => '€', 'GBP' => '£', 'USD' => '$'); $priceRange = generateRange(10000, 10000000, 5000); $priceRangeRentalLT = generateRange(450, 5000, 50); $priceRangeRentalST = generateRange(300, 5000, 50); $locationsList = formatSelectOptions(getLocations()); $featureCategories = groupCategory(); $featureList = ''; $featureArrs = array_map("trim", explode(",", $showFeature)); $currentCategoryName = ''; $tmpText = ''; foreach ($featureCategories['groupCategoryData'] as $k => $v) { foreach ($v as $item) { if (in_array($item['ConfigCategoryName'], $featureArrs)) { if ($item['CategoryName'] != $currentCategoryName) { if ($currentCategoryName != '') { $featureList .= TemplateHelper::render('templates/featureListItem.html', array('Search.Feature.More.Title' => $currentCategoryName, 'Search.Feature.More.Items' => $tmpText)); } $currentCategoryName = $item['CategoryName']; $tmpText = ''; } $tmpText .= '<div class="col-xs-6"><input class="feature-more text-nowrap" type="checkbox" value="' . $item['OptionName'] . '" /> ' . $item['FeatureName'] . '</div>'; } } } if ($tmpText != '') { $featureList .= TemplateHelper::render('templates/featureListItem.html', array('Search.Feature.More.Title' => $currentCategoryName, 'Search.Feature.More.Items' => $tmpText)); } $searchForm = TemplateHelper::render('templates/searchForm.html', array('Search.Form.Action' => $resultsPage, 'Search.PropertyId' => $languageArr['field_Headings']['prop_Id'], 'Search.SearchType.ForSale' => $languageArr['search_Types']['for_Sale'], 'Search.SearchType.LongTerm' => $languageArr['search_Types']['longTerm_Rent'], 'Search.SearchType.ShortTerm' => $languageArr['search_Types']['shortTerm_Rent'], 'Search.Rental.From' => $languageArr['field_Headings']['rental_From'], 'Search.Rental.To' => $languageArr['field_Headings']['rental_To'], 'Search.Area.Options' => formatAreaSelectOptions(getAreas()), 'Search.Location.Placeholder' => $languageArr['field_Headings']['select_Locations'], 'Search.Location.NoRef' => $languageArr['field_Headings']['option_NoPref'], 'Search.Location.Options' => $locationsList, 'Search.PropertyType.Placeholder' => $languageArr['field_Headings']['select_Types'], 'Search.PropertyType.NoRef' => $languageArr['field_Headings']['option_NoPref'], 'Search.PropertyType.Options' => formatSearchTypeGroupOption(getAllPropertyTypes()), 'Search.Feature.Placeholder' => $languageArr['field_Headings']['select_Features'], 'Search.Feature.NoRef' => $languageArr['field_Headings']['option_NoPref'], 'Search.Feature.Options' => formatFeatureOption($featureCategories['groupCategoryData']), 'Search.Feature.More.List' => $featureList, 'Search.Beds.NoRef' => $languageArr['field_Headings']['bedrooms']['header'], 'Search.Beds.Options' => formatOptions($bedsData), 'Search.Baths.NoRef' => $languageArr['field_Headings']['bathrooms']['header'], 'Search.Baths.Options' => formatOptions($bathsData), 'Search.MinPrice.Title' => $languageArr['field_Headings']['price_Min'], 'Search.MinPrice.Placeholder' => $languageArr['field_Headings']['price_Min'], 'Search.MaxPrice.Title' => $languageArr['field_Headings']['price_Max'], 'Search.MaxPrice.Placeholder' => $languageArr['field_Headings']['price_Max'], 'Search.Currency.NoRef' => $languageArr['field_Headings']['currency'], 'Search.Currency.Options' => formatOptions($currencies, false), 'Search.EnergyRating.NoRef' => $languageArr['field_Headings']['energyRating']['header'], 'Search.EnergyRating.Options' => formatOptions($energyRatings), 'Search.Button.Submit' => $languageArr['field_Headings']['search_Button'], 'Search.Location.JSON' => $locationsJSON, 'Search.Types.JSON' => $typesJSON, 'Search.Price.RangeData' => json_encode($priceRange), 'Search.Price.RangeRentalLongTermData' => json_encode($priceRangeRentalLT), 'Search.Price.RangeRentalShortTermData' => json_encode($priceRangeRentalST), 'Search.TypeData' => $searchType, 'Search.ResultPage' => $resultsPage, 'Search.Currency.Old' => isset($_SESSION["currency"]) ? $_SESSION["currency"] : 'EUR', 'Search.LanguageCode' => $datePickerLanguages[$language], 'Search.ShowChosen' => $showChosen), array('showAreas' => $showAreas, 'showBeds' => $showBeds, 'showBaths' => $showBaths, 'showCurrency' => $showCurrency, 'showRating' => $showRating, 'showChosen' => $showChosen)); echo $searchForm; }
//renvoit x locations a partir de l'id y. function getLocations($idToGet, $howMuch = null) { //database pas encore operationnelle, j'utilise les données json contenues dans data/places.json $data = json_decode(file_get_contents('../data/places_First20.json')); //print_r($data); /*le fichier contient reelement 20 places, mais je n'en selectionne que 10 idToGet est simulé. Ici juste un index dans un tableau*/ $data = array_splice($data, $idToGet, isset($howMuch) ? $howMuch : 0); //print_r($data); return json_encode($data); } if (isset($_POST['service'])) { switch ($_POST['service']) { //return les 10 dernieres case 'lastTen': echo getLocations($_POST['params'][0], $_POST['params'][1]); break; //return celle avec id specific //return celle avec id specific case 'specific': echo getLocations($_POST['params'][0]); break; default: #code... break; } } else { echo 'nothing to show here'; }
$details_html = $html->find('body', 0)->outertext; $details_html = str_replace('HomeAway', 'FlatFindr', $details_html); echo $details_html; //error_log($details_html); /*$body_js = ''; foreach($html->find('body script') as $javascript) { if(!empty($javascript->src)) $javascript->src = rel2abs($javascript->src, 'http://www.homeaway.com/'); $body_js .= $javascript->outertext; error_log("Body-JS: ".$body_js); }*/ ?> <?php $locations = getLocations($html); error_log("Locations: " . print_r($locations, true)); ?> <script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script> <link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' /> <script type="text/javascript"> //$('<?php echo $MAP_PARENT; ?> ').html('<div id="map"></div>'); var map = L.mapbox.map('property-map', 'examples.map-9ijuk24y'); L.control.layers({ 'Base Map': L.mapbox.tileLayer('examples.map-zgrqqx0w').addTo(map), 'Grey Map': L.mapbox.tileLayer('examples.map-20v6611k')
<p>Your temporary password: '******'</p> <p>You may change the password provided by updating the User Admin section.</p> <p>Thank you!<br/> Camrally Support</p>'; sendEmail($email, $subject, $body); break; case 'getLoc': $arrayPlace = array(); $array = array(); $i = 0; $userId = $_REQUEST['key']; $permission = $_REQUEST['permission']; echo getLocations($userId, $permission); break; case 'getFollower': $groupId = $_REQUEST['id']; $locResult = mysql_query(" SELECT id,businessName\n\t\t\tFROM businessList WHERE userGroupId = {$groupId}\n\t\t"); $arrayID = array(); while ($row = mysql_fetch_object($locResult)) { $placeId = $row->id; $hadTable = mysql_num_rows(mysql_query("SHOW TABLES LIKE 'businessCustomer_{$placeId}'")); if ($hadTable) { $arrayID[] = $placeId; } } $sql = ''; $totalnum = 0; $array_obj;
<?php require_once '_functions.php'; # Vars $cmsPDO = getCMSPDO(); $scPDO = getSCPDO(); # Input $locationID = isset($_GET['lid']) ? $_GET['lid'] : NULL; $from = isset($_GET['from']) ? $_GET['from'] : NULL; $to = isset($_GET['to']) ? $_GET['to'] : NULL; # Get locations $locations = getLocations($cmsPDO); if (!isset($locationID) && count($locations) === 1) { $locationID = $locations[0]->id; } # Overview page if (OVERVIEW_PAGE !== FALSE || isset($locationID)) { # Results ## Get Date objects if (isset($from)) { $d = explode('/', $from); $f = $d[2] . '-' . $d[1] . '-' . $d[0]; $fromDate = new DateTime($f, new DateTimeZone('UTC')); } else { $fromDate = new DateTime('now', new DateTimeZone('UTC')); $fromDate->sub(new DateInterval('P1M')); } if (isset($to)) { $d = explode('/', $to); $t = $d[2] . '-' . $d[1] . '-' . $d[0]; $toDate = new DateTime($t, new DateTimeZone('UTC'));