本文整理汇总了PHP中Requests::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Requests::update方法的具体用法?PHP Requests::update怎么用?PHP Requests::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Requests
的用法示例。
在下文中一共展示了Requests::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFirstMessage
private function getFirstMessage($agent)
{
/*
NOTE: CHRISTOPHER WHITELEY
Within this section we have allowed the alteration of how SIF Ack messages are needed.
If $sif_response, $sif_request, and $sif_event are set to a value of 2 then your system
will work according to SIF Specifications. If you do not want to send a SIF_Ack message
for any of the three message types below you can change the value to 3.
This functionality was done per request of a paid support member.
*/
$sif_response = 2;
$sif_request = 2;
$sif_event = 2;
$sif_ack = 2;
$empty = null;
$zero = 0;
$id = $zero;
$db = Zend_Registry::get('my_db');
# $mysql = ''
# .' ('
# .' Select response_id v, 1 t '
# .' from ' .DBConvertor::convertCase('response').' where status_id in (1,2) '
# .' and agent_id_requester = '.$agent->agentId.' and context_id = '.$_SESSION['CONTEXT_ID'].' and zone_id = '.$_SESSION['ZONE_ID']
# .') '
# .' union all '
# .' ('
# .' Select request_id v, 2 t '
# .' from ' .DBConvertor::convertCase('request').' where status_id in (1,2) '
# .' and agent_id_responder = '.$agent->agentId.' and context_id = '.$_SESSION['CONTEXT_ID'].' and zone_id = '.$_SESSION['ZONE_ID']
# .') '
# .' union all '
# .' ('
# .'Select event_id v, 3 t '
# .' from ' .DBConvertor::convertCase('event').' where status_id in (1,2) '
# .' and agent_id_rec = '.$agent->agentId.' and context_id = '.$_SESSION['CONTEXT_ID'].' and zone_id = '.$_SESSION['ZONE_ID']
# .')'
# .' ORDER BY t, v LIMIT 1';
$oracle = 'Select v, t from ( Select response_id v, 1 t ' . ' from ' . DBConvertor::convertCase('response') . ' where status_id in (1,2) ' . ' and agent_id_requester = ' . $agent->agentId . ' and context_id = ' . $_SESSION['CONTEXT_ID'] . ' and zone_id = ' . $_SESSION['ZONE_ID'] . ' union all ' . 'Select request_id v, 2 t ' . 'from ' . DBConvertor::convertCase('request') . ' where status_id in (1,2) ' . ' and agent_id_responder = ' . $agent->agentId . ' and context_id = ' . $_SESSION['CONTEXT_ID'] . ' and zone_id = ' . $_SESSION['ZONE_ID'] . ' union all ' . 'Select event_id v, 3 t ' . ' from ' . DBConvertor::convertCase('event') . ' where status_id in (1,2) ' . ' and agent_id_rec = ' . $agent->agentId . ' and context_id = ' . $_SESSION['CONTEXT_ID'] . ' and zone_id = ' . $_SESSION['ZONE_ID'] . ') ORDER BY t, v';
$mysql = 'select id, msg_type, data ' . ' from ' . DBConvertor::convertCase('messagequeue') . ' where agt_id_out = ' . $agent->agentId . ' and zone_id = ' . $_SESSION['ZONE_ID'] . ' and context_id = ' . $_SESSION['CONTEXT_ID'] . ' and status_id in (1,2) ' . ' order by status_id desc, msg_type asc, insert_timestamp asc' . ' Limit 1';
switch (DB_TYPE) {
case 'mysql':
$sql = $mysql;
break;
case 'oci8':
$sql = $oracle;
$db->setLobAsString(true);
break;
}
try {
$stmt = $db->query($sql);
$result = $stmt->fetchAll();
} catch (Zend_Exception $e) {
ZitLog::writeToErrorLog("[SystemControl]", "Errors:{$e->getTraceAsString}() \n \n {$sql}", "Try|Catch block", $_SESSION['ZONE_ID']);
GeneralError::systemError($xml);
}
switch (DB_TYPE) {
case 'mysql':
$id = isset($result[0]->id) ? $result[0]->id : $zero;
# $msgType = isset($result[0]->msg_type) ? $result[0]->msg_type : $zero;
$msgType = 4;
$XMLData = isset($result[0]->data) ? $result[0]->data : $zero;
break;
case 'oci8':
$id = isset($result[0]->V) ? $result[0]->V : $zero;
$msgType = isset($result[0]->T) ? $result[0]->T : $zero;
break;
}
// ZitLog::writeToErrorLog("[SystemControl]", "id: $id --> msgType: $msgType\n\n", "Record Found?", $_SESSION['ZONE_ID']);
if ($id != $zero) {
switch ($msgType) {
case 1:
/*****
ORACLE ONLY
$SIF_ACK is used to set the status of the message read. The SIF Standard states that you should
set this value to 2 so that the item can be requested again if an error happens. Setting the item
to a 3 will allow you not to send a SIF_Ack Message.
*****/
$response = new Responses($db);
$where = "response_id = {$id}";
$result2 = $response->fetchAll($where);
foreach ($result2 as $row) {
switch (DB_TYPE) {
case 'mysql':
$status_id = $row->status_id;
$responseData = $row->response_data;
break;
case 'oci8':
$status_id = $row->STATUS_ID;
$responseData = $row->RESPONSE_DATA;
break;
}
}
$dom = new DomDocument();
$dom->loadXML($responseData);
$headerNode = $dom->getElementsByTagName('SIF_Header')->item(0);
$msgId = $headerNode->getElementsByTagName('SIF_MsgId')->item(0)->nodeValue;
$data = array(DBConvertor::convertCase('status_id') => $sif_response, DBConvertor::convertCase('msg_id') => $msgId);
$n = $response->update($data, 'response_id = ' . $id);
return $responseData;
break;
//.........这里部分代码省略.........
示例2: Requests
if ($dResult[0] == "") {
$mysql = "insert into {$feedback_table} set rater_id='{$user_id}',rated_id='{$rated_id}',\n\t\t\t\t\t\t\tskill_id='{$skill_id}',value='{$value}',feedback_text='{$text}',status='{$status}',rated_date=now()";
} else {
$fid = $dResult['f_id'];
$mysql = "update {$feedback_table} set rater_id='{$user_id}',rated_id='{$rated_id}',\n\t\t\t\t\t\t\tskill_id='{$skill_id}',value='{$value}',feedback_text='{$text}',status='{$status}',\n\t\t\t\t\t\t\trated_date=now() where f_id='{$fid}'";
}
$db_object->insert($mysql);
}
if ($status == '1') {
echo $error_msg['cFeedbackSubmitted'];
}
if ($status == '0') {
echo $error_msg['cFeedbackSaved'];
}
include "footer.php";
exit;
}
}
$obj = new Requests();
$save = $post_var['save'];
$submit = $post_var['submit'];
if ($save) {
$status = "0";
$obj->update($db_object, $common, $post_var, $user_id, $error_msg, $status);
}
if ($submit) {
$status = "1";
$obj->update($db_object, $common, $post_var, $user_id, $error_msg, $status);
}
$obj->feedback_request($db_object, $common, $user_id, $default, $ratedid, $error_msg, $learning, $mode);
include "footer.php";