public function search($song = null) { $data = ['requestdata' => json_encode(['q' => $song, 'sort' => 'hot'])]; $callAPI = call_api('get', $this->url, $data); $dataReceived = json_decode($callAPI); if ($dataReceived) { $result = $this->process($dataReceived->docs); } return isset($result) ? $result : array(); }
function get_session_token($onetimetoken) { $output = call_api($onetimetoken, "https://www.google.com/accounts/AuthSubSessionToken"); if (preg_match("/Token=(.*)/", $output, $matches)) { $sessionToken = $matches[1]; } else { echo "Error authenticating with Google."; exit; } return $sessionToken; }
function api_update_photo($updated) { return call_api('photo_inventory', 'api_update_photo', array('photo_updated' => serialize($updated))); }
echo $game['faceoffPct']; ?> </td> </tr> <?php } } } else { echo "<tr><td colspan='13' class='tdText'>Data Not Found</td></tr>"; } ?> </tbody> </table> </div> <?php $seasons = !empty($SeasonStatastics) ? call_api("http://www.nhl.com/feed/nhl/playerdata/playercard.json?id=8467329&seasonid={$season_id}&view=career&auth=") : array(); ?> <h5 class="smallHeading">CAREER REGULAR SEASON STATISTICS</h5> <div id="statsTableInner2"> <table class="table table-bordered statsTable"> <thead> <tr> <th>SEASON</th> <th>TEAM</th> <th><span class="toolTip" title="GAMES PLAYED">GP</span></th> <th><span class="toolTip" title="GAME">G</span></th> <th><span class="toolTip" title="ASSISTS">A</span></th> <th><span class="toolTip" title="POINTS">P</span></th> <th><span class="toolTip" title="PLUS-MINUS">+/-</span></th> <th><span class="toolTip" title="PENALTIES IN MINUTES">PIM</span></th> <th><span class="toolTip" title="POWER PLAY GOALS">PPG</span></th>
$form = $rowData[1]; $parentID = $rowData[2]; if (trim($faire) != '' && trim($form) != '') { //echo 'For ' .$faire .' setting form '.$form.'<br/>'; $data = array('form_id' => $form, 'status' => 'active', "id" => "", "date_created" => ""); foreach ($rowData as $key => $value) { if ($fieldIDs[$key] != '' && $value != '') { $data[$fieldIDs[$key]] = htmlspecialchars($value); //echo 'Setting field '.$fieldIDs[$key]. ' to '.htmlspecialchars($value).'<br/>'; } } $APIdata[] = $data; $tableData[] = array('parentID' => $parentID, 'childID' => '', 'faire' => $faire, 'form_id' => $form); } } $childID = call_api($APIdata); foreach ($tableData as $key => $value) { $tableData[$key]['childID'] = $childID[$key]; } //now we need to update the database //find the end of the $tableData $endkey = key(array_slice($tableData, -1, 1, TRUE)); $contchar = ','; $insertRel = ''; $insertLead = ''; //loop thru array to build SQL inserts foreach ($tableData as $key => $value) { if ($endkey == $key) { $contchar = ''; } echo 'parent: ' . $value['parentID'] . ' child: ' . $value['childID'] . '<br/>';
<?php // Set post data $data = $_POST; $data['ip_address'] = $_SERVER["REMOTE_ADDR"]; $data['captcha_confirmed'] = false; // Call API require "panopta_api.php"; extract(call_api("trial", "POST", $data)); // Prepare result $field_errors = array(); if ($httpCode == 201) { $result = NULL; } else { if ($httpCode == 400) { $res = ""; foreach ($result as $field => $error) { if (in_array($field, array("fullname", "email_address", "company_name", "package"))) { $field_errors[$field] = $error; } else { $res = $res . $field . ": " . $error . "<br/>"; } } $result = $res; } else { $result = "There was a problem processing your order. Please contact sales@panopta.com to complete your order."; } } // Return data to ajax call $return = array("result" => $result, "field_errors" => $field_errors, "httpCode" => $httpCode); echo json_encode($return);
xassert(!$user_wilma->has_outstanding_review()); xassert($user_wilma->can_view_review($paper1, $review1, false)); xassert($user_wilma->can_view_review($paper1, $review2, false)); // set up some tags and tracks AssignmentSet::run($user_chair, "paper,tag\n3 9 13 17,green\n", true); $Conf->save_setting("tracks", 1, "{\"green\":{\"assrev\":\"-red\"}}"); $paper17 = $Conf->paperRow(17, $user_jon); xassert(!$Conf->check_tracks($paper17, $user_jon, Track::ASSREV)); xassert(!$user_jon->can_accept_review_assignment_ignore_conflict($paper17)); xassert(!$user_jon->can_accept_review_assignment($paper17)); // check shepherd search visibility $paper11 = $Conf->paperRow(11, $user_chair); $paper12 = $Conf->paperRow(12, $user_chair); $j = call_api("setshepherd", $user_chair, ["shepherd" => $user_estrin->email], $paper11); xassert_eqq($j->ok, true); $j = call_api("setshepherd", $user_chair, ["shepherd" => $user_estrin->email], $paper12); xassert_eqq($j->ok, true); assert_search_papers($user_chair, "shep:any", "11 12"); assert_search_papers($user_chair, "shep:estrin", "11 12"); assert_search_papers($user_shenker, "shep:any", "11 12"); // tag searches assert_search_papers($user_chair, "#green", "3 9 13 17"); Dbl::qe("insert into PaperTag (paperId,tag,tagIndex) values (1,?,10), (1,?,5), (2,?,3)", $user_jon->cid . "~vote", $user_marina->cid . "~vote", $user_marina->cid . "~vote"); assert_search_papers($user_jon, "#~vote", "1"); assert_search_papers($user_jon, "#~vote≥10", "1"); assert_search_papers($user_jon, "#~vote>10", ""); assert_search_papers($user_jon, "#~vote=10", "1"); assert_search_papers($user_jon, "#~vote<10", ""); assert_search_papers($user_marina, "#~vote", "1 2"); assert_search_papers($user_marina, "#~vote≥5", "1"); assert_search_papers($user_marina, "#~vote>5", "");
define('APPLICATION_KEY', "cc8bba3692e4445f39e48838b12cdf6a"); function call_api($endpoint, $parameters) { $ch = curl_init('https://api.aylien.com/api/v1/' . $endpoint); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'X-AYLIEN-TextAPI-Application-Key: ' . APPLICATION_KEY, 'X-AYLIEN-TextAPI-Application-ID: ' . APPLICATION_ID)); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); return json_decode($response); } if (isset($_POST['analyse_location']) && !empty($_POST['textInput'])) { $input = htmlspecialchars($_POST['textInput']); $params = array('text' => $input); $entities = call_api('entities', $params); $originalText = $entities->text; } else { $entities = null; $originalText = ""; } /* if (isset($entities->entities->location)) { echo json_encode($entities->entities->location); } if (isset($entities->entities->person)) { echo json_encode($entities->entities->person); } if (isset($entities->entities->organization)) {
/** * This function creates an inventory object for each agent of pandora with name, address, description * and extra fields if are defined as operating system and url address */ function synchronize_pandora_inventory() { global $config; if (!isset($config["pandora_url"])) { return; } if ($config["pandora_url"] == "") { return; } $separator = ':;:'; $url = $config['pandora_url'] . '/include/api.php?op=get&apipass='******'pandora_api_password'] . '&op2=all_agents&return_type=csv&user='******'pandora_user'] . '&pass='******'pandora_pass']; $return = call_api($url); $agents_csv = explode("\n", $return); foreach ($agents_csv as $agent_csv) { // Avoiding empty csv lines like latest one if ($agent_csv == '') { continue; } $values = array(); $agent = explode(";", $agent_csv); $agent_id = $agent[0]; $agent_name = $agent[1]; $agent_name_safe = safe_input($agent_name); $address = $agent[2]; $description = $agent[3]; $os_name = $agent[4]; $url_address = $agent[5]; // Check if exist to avoid the creation $inventory_id = get_db_value('id', 'tinventory', 'name', $agent_name_safe); if ($inventory_id !== false) { process_sql_delete('tinventory', array('id' => $inventory_id)); process_sql_delete('tobject_field_data', array('id_inventory' => $inventory_id)); } $id_object_type = get_db_value('id', 'tobject_type', 'name', safe_input('Pandora agents')); $values['name'] = $agent_name_safe; $values['description'] = $description; $values['id_object_type'] = $id_object_type; $values['id_contract'] = $config['default_contract']; $id_inventory = process_sql_insert('tinventory', $values); if ($id_inventory) { $id_type_field_os = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => safe_input('OS'))); $id_type_field_ip = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => safe_input('IP Address'))); if ($id_type_field_ip == false) { $id_type_field_ip = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => 'IP Address')); } $id_type_field_url = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => safe_input('URL Address'))); if ($id_type_field_url == false) { $id_type_field_url = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => 'URL Address')); } $id_type_field_id = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => safe_input('ID Agent'))); if ($id_type_field_id == false) { $id_type_field_id = get_db_value_filter('id', 'tobject_type_field', array('id_object_type' => $id_object_type, 'label' => 'ID Agent')); } $value_os = array(); $value_os['id_inventory'] = $id_inventory; $value_os['id_object_type_field'] = $id_type_field_os; $value_os['data'] = $os_name; process_sql_insert('tobject_field_data', $value_os); $value_ip = array(); $value_ip['id_inventory'] = $id_inventory; $value_ip['id_object_type_field'] = $id_type_field_ip; $value_ip['data'] = $address; process_sql_insert('tobject_field_data', $value_ip); $value_url = array(); $value_url['id_inventory'] = $id_inventory; $value_url['id_object_type_field'] = $id_type_field_url; $value_url['data'] = $url_address; process_sql_insert('tobject_field_data', $value_url); $value_id = array(); $value_id['id_inventory'] = $id_inventory; $value_id['id_object_type_field'] = $id_type_field_id; $value_id['data'] = $agent_id; process_sql_insert('tobject_field_data', $value_id); } } }
<ul class="pagination"> <?php for ($i = 1; $i <= 26; $i++) { echo '<li><a href="artists.php?pattern=' . chr($i + 64) . '">' . chr($i + 64) . '</a></li>'; } ?> <li><a href="artists.php?pattern=0">#</a></li> </ul> <?php $pattern = $_REQUEST["pattern"]; if (strlen($pattern) >= 1) { $api_get_url = $api_url . "uca-artists/{$api_key}/{$pattern}"; $artists_json = call_api("GET", $api_get_url); $artists = json_decode($artists_json, true); if (sizeof($artists["artists"]) > 0) { echo '<table class="table">'; echo "<tr>"; echo "<th>"; echo "Artist"; echo "</th>"; echo "</tr>"; foreach ($artists["artists"] as $artist) { echo "<tr>"; echo "<td>"; echo '<a href="songs.php?pattern=' . $artist["id"] . '">' . $artist["artist"] . '</a>'; echo "</td>"; echo "</tr>"; }
function getInvoices($client) { return call_api(array('action' => 'getinvoices', 'userid' => $client->userid)); }
function getStatistics() { $responses = call_api("http://www.nhl.com/feed/nhl/club/schedule.json?team=PHI&auth="); $games = !empty($responses) ? $responses["games"] : array(); echo vinny_schedule($games, $_POST["place"]); echo '<script type="text/javascript"> if(jQuery(window).width()<=767){jQuery("#homeScheduleScrollbar, #statsTableInner1, #statsTableInner2, #statsTableInner3, #statsTableInner4, #statsTableInner5, #statsTableInner6, #statsTableInner7, #statsTableInner8, #statsTableInner9, .January, .February, .March, .April, .May, .June, .July, .August, .September, .October, .November, .December, #scheduleScrollbar, #statsScrollbar, #splitsScrollbar, #gameLogsScrollbar, #tweets, .patientTabs, .innerMenuInner").mCustomScrollbar("destroy");}</script>'; exit; }
function pricing_page() { $pricing_data = call_api("trial/pricing_grid_data"); $pricing_data = $pricing_data["result"]; if (!$pricing_data) { ?> <p class="error">Problem retrieving plans. Please contact sales@panopta.com.</p> <?php } else { ?> <table class="price-table" cellspacing="0" style="border-bottom: none!important"> <thead> <tr> <th> <table> <tr> <td class="plan" style="padding: 5px">All plans come with:</td> <td style="vertical-align: middle"><img src="/wp-content/themes/panopta-startbox/images/pricing/arrow.png" style="max-width: 20px; padding: 5px;"/></td> </tr> </table> </th> <th> <table> <tr> <td style="vertical-align: top"><img src="/wp-content/themes/panopta-startbox/images/pricing/circle-tick.png" style="margin: 2px 2px 0px 0px; padding-right: 0px; max-width: none;"/></td> <td>30-day completely FREE trial!</td> </tr> </table> </th> <th> <table> <tr> <td style="vertical-align: top"><img src="/wp-content/themes/panopta-startbox/images/pricing/circle-tick.png" style="margin: 2px 2px 0px 0px; padding-right: 0px; max-width: none;"/></td> <td>2-months free with annual pricing</td> </tr> </table> </th> <th> <table> <tr> <td style="vertical-align: top"><img src="/wp-content/themes/panopta-startbox/images/pricing/circle-tick.png" style="margin: 2px 2px 0px 0px; padding-right: 0px; max-width: none;"/></td> <td>No setup or service fees</td> </tr> </table> </th> <th> <table> <tr> <td style="vertical-align: top"><img src="/wp-content/themes/panopta-startbox/images/pricing/circle-tick.png" style="margin: 2px 2px 0px 0px; padding-right: 0px; max-width: none;"/></td> <td>Full API Access</td> </tr> </table> </th> <th> <table> <tr> <td style="vertical-align: top"><img src="/wp-content/themes/panopta-startbox/images/pricing/circle-tick.png" style="margin: 2px 2px 0px 0px; padding-right: 0px; max-width: none;"/></td> <td>Android & iOS mobile Apps</td> </tr> </table> </th> </tr> <tr> <td style="height: 20px"></td> </tr> </thead> </table> <table class="price-table" cellspacing="0"> <tbody> <tr> <td class="package"> <div class="spacer"></div> Just pick a package that meets your needs, then add services and users as you need them! </td> <?php foreach ($pricing_data['packages'] as $package) { ?> <td class="package-item <?php echo $package['highlight'] ? 'popular' : ''; ?> " style="width: <?php echo 80 / count($pricing_data['packages']); ?> %}"> <div class="spacer <?php echo $package['blurb'] && $package['highlight'] ? 'help-icon' : ''; ?> "> <?php if ($package['highlight']) { ?> <img src="/wp-content/themes/panopta-startbox/images/pricing/popular.png" /> <?php } ?> <?php if ($package['blurb']) { ?> <div class="help-content hide"><?php echo $package['blurb']; ?> </div> <?php } ?> </div> <div class="content <?php echo $package['blurb'] && !$package['highlight'] ? 'help-icon' : ''; ?> "> <div class="h1-title"><?php echo $package['name']; ?> </div> <?php if ($package['monthly_fee']) { ?> <div class="h2-title">$<?php echo $package['monthly_fee']; ?> /month</div><?php } ?> <a href="#" class="button" data-package="<?php echo $package['textkey']; ?> " data-title="<?php echo $package['name']; ?> ">Start Free Trial!</a> <?php if ($package['yearly_fee']) { ?> <div class="h3-title">$<?php echo $package['yearly_fee']; ?> /year</div><?php } ?> </div> </td> <?php } ?> </tr> <?php foreach ($pricing_data['addons'] as $addon_category) { ?> <tr> <td colspan="<?php echo count($pricing_data['packages']) + 1; ?> " style="background: black; height: 2px"></td> </tr> <?php foreach ($addon_category as $addon) { ?> <tr class="pakacge-details"> <td> <?php echo $addon['name']; ?> <?php if ($addon['tooltip']) { ?> <img src="/wp-content/themes/panopta-startbox/images/pricing/circle-question.png" class="help-icon" /> <div class="help-content hide"><?php echo $addon['tooltip']; ?> </div> <?php } ?> </td> <?php foreach ($addon["values"] as $val) { ?> <td> <?php if ($addon['type'] == 'numeric' && $val === -1) { echo "Unlimited"; } else { if (!$val) { echo '<img src="/wp-content/themes/panopta-startbox/images/pricing/x.png"/>'; } else { if ($addon['type'] == 'boolean') { echo '<img src="/wp-content/themes/panopta-startbox/images/pricing/tick.png" />'; } else { echo $val; } } } ?> </td> <?php } ?> </tr> <?php } ?> <?php } ?> <tr> <td colspan="6" style="background: black; height: 2px"></td> </tr> <tr class="package-buttons"> <td></td> <?php foreach ($pricing_data['packages'] as $package) { ?> <td><a href="#" class="button" data-package="<?php echo $package['textkey']; ?> " data-title="<?php echo $package['name']; ?> ">Start Free Trial!</a></td> <?php } ?> </tr> </tbody> </table> <br /> <p> Need more? We also offer bulk discounts - if you're looking to monitor a large number of servers or need a specialized monitoring setup please <a style="color: #ff9900;" href="mailto:sales@panopta.com">contact our sales team</a> to discuss custom pricing. </p> <?php } }
function get_course_upcoming($course, $canvas_site, $access_token) { //get upcoming assignments for this specific course $url = $canvas_site . "/" . "courses/" . $course . "/assignments?bucket=future&access_token=" . $access_token; $data = call_api("GET", $url); //source: http://stackoverflow.com/questions/7127764/sort-array-of-objects-by-date-field //Sort assignments by due date usort($data, function ($a, $b) { return strtotime($a->due_at) - strtotime($b->due_at); }); return $data; }
}else{ $seasonId = (date('Y',time())-1).date('Y',time()) ; $season = (date('Y',time())-1)."-".(date('Y',time())); } }*/ $regularSeasonStats = array(); $rank = array(); $seasonGames = array(); $SeasonStatastics = call_api("http://www.nhl.com/feed/nhl/playerdata/playercard.json?id=8467329&auth="); if (!empty($SeasonStatastics)) { $regularSeasonStats = $SeasonStatastics['regularseasonstats'][0]; $season_id = str_replace("-", "", $regularSeasonStats['season']); $rank = $SeasonStatastics['regularseasonrankings'][0]; $seasonGames = $SeasonStatastics['gamebygame']; } $responses = call_api("http://www.nhl.com/feed/nhl/club/schedule.json?team=PHI&auth="); $games = !empty($responses) ? $responses["games"] : array(); ?> <header> <div class="topBarWrapper clearfix" id="topBanner"> <div class="topBar"> <script type="text/javascript" src="http://network.nhl.com/nhlnetnav.js"></script> </div> </div> <div class="navbarWrapper"> <div class="navbar navbar-inverse" id="playerNavbar"> <div class="container"> <h1 class="logo" title="VINNY40"><a href="#home" id="logo"></a></h1> <div class="navSearchWrapper">
define('APPLICATION_ID', "71fd369b"); define('APPLICATION_KEY', "cc8bba3692e4445f39e48838b12cdf6a"); function call_api($endpoint, $parameters) { $ch = curl_init('https://api.aylien.com/api/v1/' . $endpoint); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'X-AYLIEN-TextAPI-Application-Key: ' . APPLICATION_KEY, 'X-AYLIEN-TextAPI-Application-ID: ' . APPLICATION_ID)); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); return json_decode($response); } $params = array('text' => 'John is a very good football player! Bet he sucks at playing the piano. Don\'t worry though, he does not even own a piano. Everything is ok. The sun is shining, the weather is great. I love my new pair of shoes.'); $sentiment = call_api('sentiment', $params); $language = call_api('language', $params); echo sprintf("Sentiment: %s (%F)", $sentiment->polarity, $sentiment->polarity_confidence), PHP_EOL; echo sprintf("Language: %s (%F)", $language->lang, $language->confidence), PHP_EOL; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width"> <title>Semantic Text Analysis</title> <link href="css/style.css" rel="stylesheet" type="text/css"/> <script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script> </head> <body>
print_r(json_decode(call_api('/api/v1/pods/', 'get'))); echo "</pre>"; } if (isset($serviceInfo)) { echo "<pre style='background-color: #f5f5f5; border: 0px; color:#337ab7; font-size: 10px;'>"; print_r(json_decode(call_api('/api/v1/services/', 'get'))); echo "</pre>"; } if (isset($repInfo)) { echo "<pre style='background-color: #f5f5f5; border: 0px; color:#337ab7; font-size: 10px;'>"; print_r(json_decode(call_api('/api/v1/replicationcontrollers/', 'get'))); echo "</pre>"; } if (isset($nodeInfo)) { echo "<pre style='background-color: #f5f5f5; border: 0px; color:#337ab7; font-size: 10px;'>"; print_r(json_decode(call_api('/api/v1/nodes/', 'get'))); echo "</pre>"; } $pod_count = getPodInfo(); $json = compile_tree($node_count, $pod_count, $_SESSION['imageName'], $_SESSION['podName'], $_SESSION['nodeSize'], $_SESSION['prName']); } chdir($old_path); ?> <script> var json = $.parseJSON('<?php echo $json; ?> '); </script> </div>
function create_pod($name, $image) { $json = '{ "apiVersion": "v1", "kind": "Pod", "metadata": { "name": "", "labels": { "name": "test" } }, "spec": { "containers": [ { "name": "", "image": "", "ports": [ { "containerPort": 80 } ] } ] } }'; $json_obj = json_decode($json); $json_obj->metadata->name = $name; $json_obj->metadata->labels->name = $name; $json_obj->spec->containers[0]->name = $image; $json_obj->spec->containers[0]->image = $image; $post = json_encode($json_obj); $slug = '/api/v1/namespaces/default/pods'; $restType = 'post'; call_api($slug, $restType, $post); }
function getServiceInfo() { $json_obj = json_decode(call_api('/api/v1/services/', 'get')); $itemcount = count($json_obj->items); for ($i = 0; $i < $itemcount; $i++) { if (!empty($json_obj->items[$i]->status->loadBalancer->ingress[0]->ip)) { $external_ip_item[$json_obj->items[$i]->metadata->name] = $json_obj->items[$i]->status->loadBalancer->ingress[0]->ip; } else { $no_ip_item[] = $json_obj->items[$i]->metadata->name; } $all_services[] = $json_obj->items[$i]->metadata->name; } $data['no_ip_services'] = $no_ip_item; $data['external_ip_services'] = $external_ip_item; $data['all_services'] = $all_services; return $data; }
<?php require_once __DIR__ . '/../functions/panopta_api.php'; $pricing_data = call_api("trial/pricing_grid_data"); $pricing_data = $pricing_data["result"]; if (!$pricing_data) { ?> <p class="error">Problem retrieving plans. Please contact sales@panopta.com.</p> <?php } else { ?> <div class="all-plans"> <h3>All plans come with:</h3> <ul> <li><i class="fa fa-check-circle"></i> 2-months free with annual pricing</li> <li><i class="fa fa-check-circle"></i> 30-day completely FREE trial!</li> <li><i class="fa fa-check-circle"></i> Android & iOS mobile apps</li> <li><i class="fa fa-check-circle"></i> No setup or service fees</li> <li><i class="fa fa-check-circle"></i> Full API access</li> </ul> </div> <div id="pricingGrid"> <div class="pricing-info"> <div class="pricing-head"> <h3>Just pick a package that meets your needs, then add services and users as you need them!</h3> </div> <?php foreach ($pricing_data['addons'] as $addon_category) { ?> <ul> <?php
<ul class="pagination"> <?php for ($i = 1; $i <= 26; $i++) { echo '<li><a href="songs.php?pattern=' . chr($i + 64) . '">' . chr($i + 64) . '</a></li>'; } ?> <li><a href="songs.php?pattern=0">#</a></li> </ul> <?php $pattern = $_REQUEST["pattern"]; if (strlen($pattern) >= 1) { $api_get_url = $api_url . "uca-compositions/{$api_key}/{$pattern}"; $comps_json = call_api("GET", $api_get_url); $comps = json_decode($comps_json, true); if (sizeof($comps["compositions"]) > 0) { echo '<table class="table">'; echo "<tr>"; echo "<th>"; echo "Song"; echo "</th>"; echo "<th>"; echo "Artist"; echo "</th>"; echo "<th>"; echo "Created"; echo "</th>"; echo "</tr>"; foreach ($comps["compositions"] as $comp) {
/** * Handler for calls to the site API * * @param string $command Site command to run * @param array $args Arguments for command * * @return void */ function site($command, $args) { echo "*** Site: {$command} ***\n"; switch ($command) { case 'status': $string = getarg($args, 0, 'apiv1 test'); call_api('site', 'status', array("test_string" => $string)); break; default: echo "ERROR: invalid command\n"; return; } }
if (isset($_SESSION['yahoo_oauth_access_token'])) { // restore access token from session $oauthapp->token = YahooOAuthAccessToken::from_string($_SESSION['yahoo_oauth_access_token']); } } try { // fetch latest user data $profile = $oauthapp->getProfile(); $nickname = $profile->nickname; $fullname = $profile->givenName . " " . $profile->familyName; if (!empty($email_address) && !empty($nickname)) { $response = call_api("updateThirdPartyAuth", array('email' => $email_address, 'type' => 'yahoo', 'thirdparty_token' => $auth_token, 'yahoo_feed' => $yahoo_feed)); if ($response == FALSE || $response["status"] != "SUCCESS") { $nickname = preg_replace('/([^@]+)@.*/', '\\1', $email_address); $params = array('email' => $email_address, 'name' => $fullname, 'nickname' => $nickname . "-y-" . rand(0, 10000), 'type' => 'yahoo', 'thirdparty_token' => $auth_token); $response = call_api("createUser", $params); if ($response == FALSE || $response["status"] != "SUCCESS") { $error_flag = TRUE; setSigninFailedCookie(); } else { setSigninCookie($response['data']['token']); } } else { setSigninCookie($response['data']['token']); } //do contact importing } } catch (Exception $e) { setSigninFailedCooie(); } }
function get_sharURL($url) { $token = isset($_COOKIE["ShareUT"]) ? $_COOKIE["ShareUT"] : ""; $cookie = isset($_COOKIE["__stid"]) ? $_COOKIE["__stid"] : ""; $params = array("url" => $url, "token" => $token, "clicookie" => $cookie); $response = call_api("createSharURL", $params); if ($response !== FALSE) { switch ($response["status"]) { case "SUCCESS": return $response["data"]["sharURL"]; break; case "FAILURE": return $url; break; default: return $url; } } else { return $url; } }
public function index_delete($id = "") { $data = call_api($url, 'POST', $delete); }