本文整理汇总了PHP中callapi函数的典型用法代码示例。如果您正苦于以下问题:PHP callapi函数的具体用法?PHP callapi怎么用?PHP callapi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了callapi函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_taxtable
function set_taxtable()
{
global $token;
$post_data = '<?xml version="1.0" encoding="utf-8"?>
<SetTaxTableRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<TaxTable>
<TaxJurisdiction>
<JurisdictionID>AZ</JurisdictionID>
<SalesTaxPercent>8.25</SalesTaxPercent>
<ShippingIncludedInTax>true</ShippingIncludedInTax>
</TaxJurisdiction>
<TaxJurisdiction>
<JurisdictionID>MI</JurisdictionID>
<SalesTaxPercent>6.0</SalesTaxPercent>
<ShippingIncludedInTax>false</ShippingIncludedInTax>
</TaxJurisdiction>
</TaxTable>
<ErrorLanguage>en_US</ErrorLanguage>
<RequesterCredentials>
<eBayAuthToken>' . $token . '</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
</SetTaxTableRequest>';
$body = callapi($post_data, 'SetTaxTable');
return $body;
}
示例2: add_fixed_price_item
function add_fixed_price_item()
{
global $token, $asin, $title, $ebay_price, $ebay_description, $image_url, $weight, $height, $width, $length, $brand, $ean, $currency_code, $dispatch_time_max, $sku, $upc, $quantity, $condition_id, $listing_type, $duration, $refund_option, $shipping_service, $shipping_type, $shipping_cost, $payment_method, $cat_id, $return_within, $uuid, $site, $mpn;
$post_data = '<?xml version="1.0" encoding="utf-8"?>
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>' . $title . '</Title>
<SKU>' . $sku . '</SKU>
<PrimaryCategory>
<CategoryID>' . $cat_id . '</CategoryID>
</PrimaryCategory>
<Description><![CDATA[' . $ebay_description . ']]></Description>
<StartPrice>' . $ebay_price . '</StartPrice>
<ConditionID>' . $condition_id . '</ConditionID>
<Country>US</Country>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<Currency>' . $currency_code . '</Currency>
<DispatchTimeMax>' . $dispatch_time_max . '</DispatchTimeMax>
<ListingType>' . $listing_type . '</ListingType>
<ListingDuration>' . $duration . '</ListingDuration>
<PaymentMethods>' . $payment_method . '</PaymentMethods>
<PayPalEmailAddress>rinsad@gmail.com</PayPalEmailAddress>
<PictureDetails>
<PictureURL>' . $image_url . '</PictureURL>
</PictureDetails>
<PostalCode>95125</PostalCode>
<Quantity>' . $quantity . '</Quantity>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>' . $refund_option . '</RefundOption>
<ReturnsWithinOption>' . $return_within . '</ReturnsWithinOption>
<Description>If you are not satisfied, return the item for refund.</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>' . $shipping_type . '</ShippingType>
<InternationalShippingDiscountProfileID>0</InternationalShippingDiscountProfileID>
<ShippingDiscountProfileID>0</ShippingDiscountProfileID>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>' . $shipping_service . '</ShippingService>
<ShippingServiceCost>' . $shipping_cost . '</ShippingServiceCost>
<ShippingServiceAdditionalCost>30</ShippingServiceAdditionalCost>
</ShippingServiceOptions>
</ShippingDetails>
<UUID>' . $uuid . '</UUID>
<Site>' . $site . '</Site>
</Item>
<RequesterCredentials>
<eBayAuthToken>' . $token . '</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
</AddFixedPriceItemRequest>';
$body = callapi($post_data, "AddFixedPriceItem");
return $body;
}
示例3: substr
$requestparam = substr($requestparam, 0, -1);
for ($i = 5; $i <= 51; $i = $i * 2) {
if ($i == $limit) {
$sss = "selected";
} else {
$sss = "";
}
$slt .= "<option {$sss} value='{$i}'>{$i}</option> \n";
}
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers = array();
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$gets['from_row'] = $pages;
$gets['max_result'] = $limit;
$scyapi = callapi($headers, '', $gets, "api/schools/years");
$scydatas = explode("\n", $scyapi['output']);
$scydata = json_decode(end($scydatas));
//print_r($scydata->messageObject);
echo <<<eot
<div class="dataTables_wrapper form-inline">
\t<div class="row-fluid">
\t\t<div class="span6">
\t\t\t<div class="limit">
\t\t\t\t<label>
\t\t\t\t\t<select class="input-mini" name="limit">
\t\t\t\t\t\t{$slt}
\t\t\t\t\t</select> {$lang_recordperpage}
\t\t\t\t\t<span id='limitloadtext'></span>
\t\t\t\t</label>
示例4: strlen
$headers[] = "Content-Type: application/json";
$headers[] = "cache-control: no-cache";
$headers[] = "Content-Length:" . strlen($message);
$posts = $message;
$sendapi = callapi($headers, $posts, '', 'api/messages/create');
} else {
$messages['school_id'] = $myprofile->school_id;
$messages['content'] = $message;
$messages['dest_type'] = $send_type;
$messages['class_id'] = $filter_class_lists[0];
$messages['cc_list'] = $filter_class_list;
$message = json_encode($messages);
$headers[] = "Content-Type: application/json";
$headers[] = "Content-Length:" . strlen($message);
$posts = $message;
$sendapi = callapi($headers, $posts, '', 'api/messages/create_ext');
}
//print_r($sendapi);
//echo $message;
//echo $sendapi['output'];
if ($sendapi['http_code'] != 200) {
$status[] = $sendapi['http_code'];
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
$statu = "OKIE";
echo "<span class='label label-success'><i class='icon-ok-sign'></i> ຂໍ້ຄວາມ Sent!</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/msg/msg_manager_db.php?lang={$lang}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
}
} else {
示例5: json_decode
$myprofile = json_decode(end($userdatas));
$err = '';
$arr['sval'] = $_REQUEST['sval'];
$arr['id'] = $_REQUEST['id'];
$arr['fval1'] = $_REQUEST['fval1'];
$arr['fval2'] = $_REQUEST['fval2'];
$arr['lval'] = $_REQUEST['lval'];
$arr['notice'] = $_REQUEST['notice'];
$arr['school_id'] = $_REQUEST['school_id'];
//$arr['table'] = $_REQUEST['table'];
$table = $_REQUEST['table'];
$djson = json_encode($arr);
//echo "<textarea>$djson</textarea>";
if ($err == "") {
$posts = $djson;
$sendapi = callapi($headers, $posts, '', "api/masters/update/{$table}");
$sendapidatas = explode("\n", $sendapi['output']);
$sendapidata = json_decode(end($sendapidatas));
//print_r($sendapi);
if ($sendapi['http_code'] != 200) {
if ($sendapi['http_code'] == 400) {
$status[] = $sendapidata->developerMessage;
} else {
$status[] = $sendapi['http_code'];
}
$status[] = $sendapidata->developerMessage;
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
示例6: callapi
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$userdata = callapi($headers, '', '', 'api/users/myprofile');
$userdatas = explode("\n", $userdata['output']);
$myprofile = json_decode(end($userdatas));
$infdata = callapi($headers, '', '', "api/schools/{$myprofile->school_id}");
$infdatas = explode("\n", $infdata['output']);
$schooldata = json_decode(end($infdatas));
//print_r($schooldata);
$prvdata = callapi($headers, '', '', "api/sys/sys_province");
$prvdatas = explode("\n", $prvdata['output']);
$provincedata = json_decode(end($prvdatas));
$dgrdata = callapi($headers, '', '', "api/sys/sys_degree");
$dgrdatas = explode("\n", $dgrdata['output']);
$degreedata = json_decode(end($dgrdatas));
$disdata = callapi($headers, '', '', "api/sys/sys_dist");
$disdatas = explode("\n", $disdata['output']);
$distdata = json_decode(end($disdatas));
//print_r($distdata);
?>
<div class="bs-docs-example">
<div class="navbar navbar-static">
<div class="navbar-inner">
<div style="width: auto;" class="container">
<a href="javascript:;" class="brand"><?php
lang('sclmanager');
?>
</a>
<ul class="nav">
<li <?php
echo $type == 'search' || $type == '' ? "class='active'" : "";
示例7: lang
?>
</label>
<div class="controls">
<select name="filter_class_id" data-placeholder="Select Class" class="span3">
<option value="">- <?php
lang('selectcls');
?>
-</option>
<?php
$headers = array();
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$gets['from_row'] = 0;
$gets['max_result'] = 9999;
$clsaip = callapi($headers, '', $gets, 'api/classes');
$clsdatas = explode("\n", $clsaip['output']);
$clsdata = json_decode(end($clsdatas));
foreach ($clsdata->list as $lists) {
echo "<option value='{$lists->id}'>{$lists->title}</option>";
}
?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label"><?php
lang('sltdate');
?>
示例8: json_encode
$arr['description'] = $_REQUEST['description'];
$arr['term_val'] = $_REQUEST['term_val'];
$class_id = $_REQUEST['class_id'];
$djson = json_encode($arr);
$err = '';
foreach ($_REQUEST as $key => $r) {
if ($key == 'submit' || $key == 'description') {
continue;
}
if ($r == '') {
$err = "{$lang_pleasefill} {$key}";
}
}
if ($err == "") {
$posts = $djson;
$sendapi = callapi($headers, $posts, '', "api/timetables/update");
$sendapidatas = explode("\n", $sendapi['output']);
$sendapidata = json_decode(end($sendapidatas));
if ($sendapi['http_code'] != 200) {
if ($sendapi['http_code'] == 400) {
$status[] = $sendapidata->developerMessage;
} else {
$status[] = $sendapi['http_code'];
}
$status[] = $sendapidata->developerMessage;
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
$statu = "OKIE";
示例9: array
}
if ($r == '') {
$err = "{$lang_pleasefill} {$key}";
}
}
if ($err == "") {
$headers = array();
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$headers[] = "Content-Type: multipart/form-data;";
$posts = array();
$posts['file'] = new \CurlFile(realpath("../../uploads/{$uploadedfile}"), 'image/png', $uploadedfile);
$posts['class_id'] = $class_id;
//print_r($posts);
$sendapi = callapi($headers, $posts, '', 'api/users/upload_file');
$sendapidatas = explode("\n", $sendapi['output']);
$sendapidata = json_decode(end($sendapidatas));
if ($sendapi['http_code'] != 200) {
$status[] = $sendapi['http_code'];
$status[] = $sendapidata->developerMessage;
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
$statu = "OKIE";
echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_usrimported}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/usr/usr_manager_db.php?lang={$lang}&table={$table}&filter_user_role=STUDENT','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
}
} else {
echo "<span class='label label-important'><i class='icon-usro-sign'></i> {$err}</span>";
示例10: ebay_revise_item
function ebay_revise_item($item_id, $revise_price, $revise_qty)
{
global $token, $paypal_email, $return_accept_option, $refund_option, $return_within_days, $duration;
$post_data = '<?xml version="1.0" encoding="utf-8"?>
<ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<ErrorLanguage>en_US</ErrorLanguage>
<Item>
<ItemID>' . $item_id . '</ItemID>
<StartPrice>' . $revise_price . '</StartPrice>
<Quantity>' . $revise_qty . '</Quantity>
<PayPalEmailAddress>' . $paypal_email . '</PayPalEmailAddress>
<ListingDuration>' . $duration . '</ListingDuration>
<ReturnPolicy>
<ReturnsAcceptedOption>' . $return_accept_option . '</ReturnsAcceptedOption>
<RefundOption>' . $refund_option . '</RefundOption>
<ReturnsWithinOption>' . $return_within_days . '</ReturnsWithinOption>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
</Item>
<RequesterCredentials>
<eBayAuthToken>' . $token . '</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
</ReviseItemRequest>';
$body = callapi($post_data, 'ReviseItem');
return $body;
}
示例11: lang
?>
</select>
<select name="filter_subject_id" data-placeholder="Select Subject" class="span3">
<option value="">- <?php
lang('sltsubject');
?>
-</option>
<?php
$headers = array();
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$gets['from_row'] = 0;
$gets['max_result'] = 9999;
$sjtaip = callapi($headers, '', $gets, 'api/masters/m_subject');
$sjtdatas = explode("\n", $sjtaip['output']);
$sjtdata = json_decode(end($sjtdatas));
foreach ($sjtdata->messageObject->list as $lists) {
echo "<option value='{$lists->id}'>{$lists->sval}</option>";
}
?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<button type="submit" class="btn btn-info" name="submit"><i class="icon-search"></i> <?php
lang('search');
示例12: callapi
\t</div>
\t
\t<table class="table table-bordered table-hover dataTable">
\t\t<thead>
\t\t\t<tr>
\t\t\t\t<th>{$lang_year}</th>
\t\t\t\t<th>{$lang_term}</th>
\t\t\t\t<th>{$lang_startdate}</th>
\t\t\t\t<th>{$lang_enddate}</th>
\t\t\t\t<th>{$lang_status}</th>
\t\t\t\t<th>{$lang_notice}</th>
\t\t\t\t<th colspan=2>{$lang_action}</th>
eot;
echo "</tr>\n\t\t</thead>";
echo "<tbody>";
$yrsaip = callapi($headers, '', $gets, 'api/schools/years');
$yrsdatas = explode("\n", $yrsaip['output']);
$yrsdata = json_decode(end($yrsdatas));
//print_r($yrsdata);
foreach ($trmdata->messageObject as $lists) {
$lists->start_dt = reset(explode(' ', $lists->start_dt));
$lists->end_dt = reset(explode(' ', $lists->end_dt));
foreach ($yrsdata->messageObject as $yrslists) {
if ($yrslists->id == $lists->year_id) {
$year = $yrslists->years;
break;
}
}
if ($lists->actived == 0) {
$actived_text = $lang_inactive;
}
示例13: json_decode
$myprofile = json_decode(end($userdatas));
$err = '';
$id = $_REQUEST['id'];
$actived = $_REQUEST['actived'];
$err = '';
foreach ($_REQUEST as $key => $r) {
if ($key == 'submit') {
continue;
}
if ($r == '') {
$err = "{$lang_pleasefill} {$key}";
}
}
if ($err == "") {
$posts = "x";
$sendapi = callapi($headers, $posts, '', "api/terms/activate/{$id}/{$actived}");
//echo "api/terms/activate/$id/$actived";
$sendapidatas = explode("\n", $sendapi['output']);
$sendapidata = json_decode(end($sendapidatas));
//print_r($sendapi);
if ($sendapi['http_code'] != 200) {
$status[] = $sendapi['http_code'];
$status[] = $sendapidata->developerMessage;
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
$statu = "OKIE";
echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_updated}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/mtb/mtb_trm_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
}
示例14: lang
<label class="control-label"><?php
lang('status');
?>
</label>
<div class="controls">
<select name="sts" class="input-large">
<option value="">- <?php
lang('status');
?>
-</option>
<?php
$headers = array();
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$stsaip = callapi($headers, '', $gets, 'api/sys/sys_sts');
$stsdatas = explode("\n", $stsaip['output']);
$stsdata = json_decode(end($stsdatas));
foreach ($stsdata->messageObject->list as $lists) {
$selected = $lists->id == $clsdata->sts ? "selected" : "";
echo "<option {$selected} value='{$lists->id}'>{$lists->sval}</option>";
}
?>
</select>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-info" name="submit"><i class="icon-edit"></i> <?php
lang('edit');
示例15: json_decode
}
$sendapidata = json_decode(end($sendapidatas));
//print_r($sendapidatas);
//ອັບໂຫຼດ photo
if ($uploadedfile != '') {
$headers = array();
$auth_key = $_SESSION[$config_session]['auth_key'];
$headers[] = "auth_key: {$auth_key}";
$headers[] = "api_key: TEST_API_KEY";
$headers[] = "Content-Type: multipart/form-data;";
$posts = array();
//$posts['file'] = '@'.realpath("../../uploads/$uploadedfile");
$posts['file'] = new \CurlFile(realpath("../../uploads/{$uploadedfile}"), 'image/png', $uploadedfile);
$posts['user_id'] = $sendapidata->id;
//print_r($posts);
$sendapi = callapi($headers, $posts, '', 'api/users/upload_photo');
$sendapidatas = explode("\n", $sendapi['output']);
$sendapidata = json_decode(end($sendapidatas));
if ($sendapi['http_code'] != 200) {
$status[] = $sendapi['http_code'];
$status[] = $sendapidata->developerMessage;
}
}
if (count($status) > 0) {
$statu = implode(', ', $status);
echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> {$lang_error}: {$statu}\n\t\t\t\t</span>";
} else {
$statu = "OKIE";
echo "<span class='label label-success'><i class='icon-ok-sign'></i> {$lang_usreadded}</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/usr/usr_manager_db.php?lang={$lang}&table={$table}','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
}
} else {