当前位置: 首页>>代码示例>>PHP>>正文


PHP Api::send_request方法代码示例

本文整理汇总了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';
}
开发者ID:bonion,项目名称:Domoleaf,代码行数:19,代码来源:form_user_new.php

示例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();
开发者ID:bonion,项目名称:Domoleaf,代码行数:21,代码来源:form_general_price_elec.php

示例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;
}
开发者ID:bonion,项目名称:Domoleaf,代码行数:75,代码来源:form_show_scenario_summary.php


注:本文中的Api::send_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。