本文整理汇总了PHP中Api::send_request方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::send_request方法的具体用法?PHP Api::send_request怎么用?PHP Api::send_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::send_request方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Api
<?php
include 'header.php';
if (!empty($_GET['username']) && !empty($_GET['password']) && !empty($_GET['lastname']) && !empty($_GET['firstname'])) {
$request = new Api();
$request->add_request('profileNew', array($_GET['username'], $_GET['password']));
$result = $request->send_request();
$new = $result->profileNew;
if (!empty($new)) {
$request = new Api();
$request->add_request('profileRename', array($_GET['lastname'], $_GET['firstname'], '', '', '', '', $new));
$request->send_request();
echo $new;
} else {
echo '0';
}
} else {
echo '0';
}
示例2: Api
<?php
include 'header.php';
if (empty($_POST['highCostval'])) {
$_POST['highCostval'] = '';
}
if (empty($_POST['lowCostval'])) {
$_POST['lowCostval'] = '';
}
if (empty($_POST['lowField1val'])) {
$_POST['lowField1val'] = '';
}
if (empty($_POST['lowField2val'])) {
$_POST['lowField2val'] = '';
}
if (empty($_POST['currencyval'])) {
$_POST['currencyval'] = '';
}
$request = new Api();
$request->add_request('confPriceElec', array($_POST['highCostval'], $_POST['lowCostval'], $_POST['lowField1val'], $_POST['lowField2val'], $_POST['currencyval']));
$result = $request->send_request();
示例3: showScenarioSummary
function showScenarioSummary($name, $id_smartcmd, $id_trigger, $id_schedule, $id_scenario)
{
$request_ok = 0;
$request = new Api();
if ($id_trigger != 0) {
$request->add_request('searchTriggerById', array($id_trigger));
$request_ok = 1;
}
if ($id_schedule != 0) {
$request->add_request('searchScheduleById', array($id_schedule));
$request_ok = 1;
}
if ($id_smartcmd != 0) {
$request->add_request('searchSmartcmdById', array($id_smartcmd));
$request_ok = 1;
}
if ($request_ok == 1) {
$result = $request->send_request();
}
$display = '<div class="inline">
<h4 id="summaryScenarioName" class="block-left">
' . $name . '
</h4>
<button type="button"
title="' . _('Edit Scenario Name') . '"
class="btn btn-primary margin-left"
onclick="popupUpdateScenarioName(' . $id_scenario . ')">
<i class="glyphicon glyphicon-edit"></i>
</button>
</div>
</br>';
if ($id_smartcmd == 0) {
$display .= '<div class="alert alert-danger" role="alert">
' . _('You must select a smartcommand.') . '
</div></br>';
} else {
$display .= '<div class="alert alert-success" role="alert">
' . _('Smartcommand : ') . $result->searchSmartcmdById->name . '
</div></br>';
}
if ($id_trigger == 0) {
$display .= '<div class="alert alert-warning" role="alert">
' . _('No Trigger Selected') . '
</div></br>';
} else {
$display .= '<div class="alert alert-success" role="alert">
' . _('Trigger : ') . $result->searchTriggerById->trigger_name . '
</div></br>';
}
if ($id_schedule == 0) {
$display .= '<div class="alert alert-warning" role="alert">
' . _('No Schedule Selected (All Time)') . '
</div></br>';
} else {
$display .= '<div class="alert alert-success" role="alert">
' . _('Schedule : ') . $result->searchScheduleById->schedule_name . '
</div></br>';
}
if ($id_trigger == 0 && $id_schedule == 0) {
$display .= '<div class="alert alert-danger" role="alert">
' . _('You must select at least one trigger or one schedule.') . '
</div></br>';
}
$display .= '<script type="text/javascript">
$(document).ready(function(){
if (' . $id_smartcmd . ' != 0 && (' . $id_trigger . ' != 0 || ' . $id_schedule . ' != 0)) {
$("#completeScenarioBtn").removeAttr(\'disabled\');
}
else {
$("#completeScenarioBtn").attr(\'disabled\', "");
}
});
</script>';
return $display;
}