本文整理汇总了PHP中getValue函数的典型用法代码示例。如果您正苦于以下问题:PHP getValue函数的具体用法?PHP getValue怎么用?PHP getValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
/**
* Function to connect to Exact, this creates the client and automatically retrieves oAuth tokens if needed
*
* @return \Picqer\Financials\Exact\Connection
* @throws Exception
*/
function connect()
{
$connection = new \Picqer\Financials\Exact\Connection();
$connection->setRedirectUrl('__REDIRECT_URL__');
$connection->setExactClientId('__CLIENT_ID__');
$connection->setExactClientSecret('__CLIENT_SECRET__');
// Retrieves authorizationcode from database
if (getValue('authorizationcode')) {
$connection->setAuthorizationCode(getValue('authorizationcode'));
}
// Retrieves accesstoken from database
if (getValue('accesstoken')) {
$connection->setAccessToken(getValue('accesstoken'));
}
// Retrieves refreshtoken from database
if (getValue('refreshtoken')) {
$connection->setRefreshToken(getValue('refreshtoken'));
}
// Retrieves expires timestamp from database
if (getValue('expires_in')) {
$connection->setTokenExpires(getValue('expires_in'));
}
// Set callback to save newly generated tokens
$connection->setTokenUpdateCallback('tokenUpdateCallback');
// Make the client connect and exchange tokens
try {
$connection->connect();
} catch (\Exception $e) {
throw new Exception('Could not connect to Exact: ' . $e->getMessage());
}
return $connection;
}
示例2: changePassword
function changePassword()
{
$array_return = array();
$admin_id = getValue('adm_id', 'int', 'POST', 0);
$pass_old = getValue('pass_old', 'str', 'POST', '');
$pass_new = getValue('pass_new', 'str', 'POST', '');
$repass_new = getValue('repass_new', 'str', 'POST', '');
if (!$pass_old) {
$array_return = array('error' => 'Bạn chưa điền mật khẩu cũ');
die(json_encode($array_return));
}
if (!$pass_new || !$repass_new || $repass_new != $pass_new) {
$array_return = array('error' => 'Mật khẩu mới không hợp lệ');
die(json_encode($array_return));
}
$db_admin_pas = new db_query('SELECT adm_password FROM admin_users WHERE adm_id = ' . $admin_id . '');
$row_admin_pas = mysqli_fetch_assoc($db_admin_pas->result);
unset($db_admin_pas);
if ($row_admin_pas['adm_password'] != md5($pass_old)) {
$array_return = array('error' => 'Mật khẩu cũ không đúng');
die(json_encode($array_return));
} else {
$db_update_pass = new db_execute('UPDATE admin_users SET adm_password = "' . md5($pass_new) . '" WHERE adm_id = ' . $admin_id . '');
if ($db_update_pass->total) {
$array_return = array('success' => 1, 'msg' => 'Đổi mật khẩu thành công');
die(json_encode($array_return));
} else {
$array_return = array('error' => 'Đổi mật khẩu thành công');
die(json_encode($array_return));
}
}
}
示例3: update_component
function update_component()
{
$comp = GetAllSelect('payroll_component', 'id')->result();
foreach ($comp as $c) {
$data = array('session_id' => $this->new_session, 'payroll_component_id' => $c->id);
$filter = array('session_id' => 'where/' . $this->new_session, 'payroll_component_id' => 'where/' . $c->id);
$num_rows = GetAllSelect('payroll_component_session', 'id', $filter)->num_rows();
if ($num_rows > 0) {
$this->db->where('session_id', $this->new_session)->where('payroll_component_id', $c->id)->update('payroll_component_session', $data);
} else {
$this->db->insert('payroll_component_session', $data);
}
$filter2 = array('session_id' => 'where/' . $this->old_session, 'payroll_component_id' => 'where/' . $c->id);
$comp_sess_before = getValue('id', 'payroll_component_session', $filter2);
print_ag($comp_sess_before);
$comp_value = getAll('payroll_component_value', array('payroll_component_session_id' => 'where/' . $comp_sess_before))->row();
print_ag($comp_value);
$comp_sess_new = getValue('id', 'payroll_component_session', $filter);
$num_rows_new = GetAllSelect('payroll_component_value', 'id', array('payroll_component_session_id' => 'where/' . $comp_sess_new))->num_rows();
if (!empty($comp_value)) {
$data2 = array('payroll_component_session_id' => $comp_sess_new, 'from' => $comp_value->from, 'to' => $comp_value->to, 'formula' => $comp_value->formula, 'is_condition' => $comp_value->is_condition, 'min' => $comp_value->min, 'max' => $comp_value->max, 'created_by' => sessId(), 'created_on' => dateNow());
if ($num_rows_new > 0) {
$this->db->where('payroll_component_session_id', $comp_sess_new)->update('payroll_component_value', $data2);
} else {
$this->db->insert('payroll_component_value', $data2);
}
}
print_ag($this->db->last_query());
}
}
示例4: sortValues
function sortValues()
{
// handle command...
$response = getValue("value");
sort($response);
return $response;
}
示例5: GetOptDoc
function GetOptDoc($group_id, $tabel = 'report', $judul = '-Laporan-', $filter = NULL, $field = NULL, $id = NULL, $field2 = NULL, $filter_where_in = NULL)
{
$CI =& get_instance();
$user_id = $CI->session->userdata('user_id');
if ($filter == NULL) {
$filter = array();
}
if ($filter_where_in == NULL) {
$filter_where_in = array();
}
if ($field == NULL) {
$field = 'title';
}
if ($id == NULL) {
$id = 'id';
}
$q = $CI->db->query("SELECT a.id id, a.title_document title_document FROM report a LEFT JOIN report_permission b ON b.menu_id=a.id AND b.user_id = '{$user_id}' WHERE b.view='1' AND a.statusisasi='1' ORDER BY a.title_document ASC");
if ($judul) {
$opt[''] = $judul;
}
foreach ($q->result_array() as $r) {
$in_group_id = getValue('group_id', 'report', array('id' => 'where/1'));
// die($r['id']);
$in_group_id = explode(',', $in_group_id);
if (in_array($group_id, $in_group_id)) {
die($group_id);
}
$opt[$r[$id]] = $r['title_document'];
}
return $opt;
}
示例6: Schalten
public function Schalten($value)
{
$proto = $this->ReadPropertyString("protokoll");
$idValue = IPS_GetVariableIDByName("Status", $this->InstanceID);
$value = getValue($idValue);
$cmd = "/usr/local/bin/pilight-send -p {$proto}";
// $idID=IPS_GetCategoryIDByName("ID",$inst);
// $idsId=IPS_GetChildrenIDs($idID);
// foreach($idsId as $ix=>$id) {
// $name=IPS_GetName($id);
// $parm=getValue($id);
// $cmd.=" --$name=$parm";
// }
$val = $this->ReadPropertyInteger("programcode");
$cmd .= " --programcode={$val}";
$val = $this->ReadPropertyInteger("systemcode");
$cmd .= " --systemcode={$val}";
if ($value) {
$value = "-t";
} else {
$value = "-f";
}
$cmd .= " {$value}";
// pilight-send -p kaku_switch -i 1 -u 1 -t
print_r("befehl=" . $cmd . "\n");
//$rc = trim(@shell_exec("/usr/local/bin/pilight-send -p $proto -i $id -u $unit $value"));
$retries = $this->ReadPropertyInteger("retries");
for ($i = 1; $i <= $retries; $i++) {
$rc = trim(@shell_exec($cmd));
}
}
示例7: GetNextID
public function GetNextID($serviceName)
{
$returnArray = array();
$responseArray = array();
$nextID = 0;
$selectQuery = "select id from idinfo where servicename = :servicename;";
$parameters = array(':servicename' => trim($serviceName));
$stmt = runQuery(DB_SERVER, DB_PORT, DB_USERNAME, DB_USERPASSWORD, DB_NAME, $selectQuery, $parameters);
if ($stmt == QUERY_FAILED) {
return FAILED;
}
$row = fetchNextRow($stmt['statement']);
if ($row != null) {
try {
$nextID = getValue($row, "id");
$nextID = $nextID + 1;
} catch (Exception $e) {
error_log('Database Error: ' . $e->getMessage());
return FAILED;
}
}
$updateQuery = "UPDATE idinfo SET id = :id WHERE servicename = :servicename;";
$parameters = array(':id' => $nextID, ':servicename' => trim($serviceName));
$stmt = runQuery(DB_SERVER, DB_PORT, DB_USERNAME, DB_USERPASSWORD, DB_NAME, $updateQuery, $parameters);
if ($stmt == QUERY_FAILED) {
error_log('Database Error: ' . $e->getMessage());
return FAILED;
}
return $nextID;
}
示例8: getGpsByIP
public function getGpsByIP($ip = null, $type = 'CITY', $cacheMinutes = null)
{
if ($type == 'COUNTRY') {
throw new InvalidArgumentException("Ilegal use of \$type variable. If you want to get country gps use getCountryGpsByIP method.");
}
$gpsToReturn = null;
$location = $this->geoIP->getLocation($ip);
if (empty($location)) {
return false;
}
$type_id = $this->gps->getTypeId($type);
$myGpses = $this->gps->getNodesByName(mysql_real_escape_string($location->city), $type_id, false, $cacheMinutes);
if (count($myGpses) > 1) {
// More than one node with same name
// Check country
foreach ($myGpses as $myGps) {
$country = $this->gps->getParentByType($myGps['id'], $this->gps->getTypeId('COUNTRY'));
if ($country['id'] == getValue($this->gps->getCountryByCode($location->country), 'gps_id')) {
$gpsToReturn = $myGps;
break;
}
}
} elseif (count($myGpses) == 1) {
// Only one city in gps databse
$gpsToReturn = $myGpses[0];
} else {
// No node with this name.
// Take closest by latitude and longitude node.
$gpsToReturn = $this->gps->getClosestNode($location->latitude, $location->longitude, $type_id);
}
return $gpsToReturn;
}
示例9: getBlockingList
function getBlockingList($sId, $bBlocking)
{
$sSelectField = $bBlocking ? "ID" : "Profile";
$sWhereField = $bBlocking ? "Profile" : "ID";
$sType = getValue("SELECT `Type` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID`='" . $sId . "' LIMIT 1");
if (empty($sType)) {
$sType = CHAT_TYPE_FULL;
}
$aAllTypes = array(CHAT_TYPE_FULL, CHAT_TYPE_MODER, CHAT_TYPE_ADMIN);
$iTypeIndex = array_search($sType, $aAllTypes);
if ($bBlocking) {
array_splice($aAllTypes, 0, $iTypeIndex);
} else {
array_splice($aAllTypes, $iTypeIndex + 1, count($aAllTypes) - $iTypeIndex - 1);
}
$sTypes = count($aAllTypes) > 0 ? " AND `profiles`.`Type` IN ('" . implode("','", $aAllTypes) . "')" : "";
$rResult = getResult("SELECT `blocked`.`" . $sSelectField . "` AS `Member` FROM `sys_block_list` AS `blocked` LEFT JOIN `" . MODULE_DB_PREFIX . "Profiles` AS `profiles` ON `blocked`.`" . $sSelectField . "`=`profiles`.`ID` WHERE `blocked`.`" . $sWhereField . "`='" . $sId . "'" . $sTypes);
$aUsers = array();
$iCount = $rResult->rowCount();
for ($i = 0; $i < $iCount; $i++) {
$aBlocked = $rResult->fetch();
$aUsers[] = $aBlocked["Member"];
}
return $aUsers;
}
示例10: printOrder
function printOrder()
{
$desk_id = getValue('desk_id', 'int', 'POST', 0);
check_desk_exist($desk_id);
$list_menu = getValue('list_menu', 'arr', 'POST', array());
//cập nhật số lượng thực đơn đã in bếp vào trường cdm_printed_number
$array_menu_success = array();
foreach ($list_menu as $menu) {
$sql = 'UPDATE current_desk_menu
SET cdm_printed_number = cdm_printed_number + ' . $menu['print_number'] . '
WHERE cdm_menu_id = ' . $menu['men_id'] . '
AND cdm_desk_id = ' . $desk_id;
$db_update = new db_execute($sql);
if ($db_update->total) {
$array_menu_success[] = $menu;
}
}
if (!$array_menu_success) {
return;
} else {
$array_return = array('success' => 1, 'list_menu' => $array_menu_success);
}
//log action
log_action(ACTION_LOG_PRINT_ORDER, 'In chế biến xuống bếp - bàn ID ' . $desk_id);
die(json_encode($array_return));
}
示例11: DisplayComments
function DisplayComments($input)
{
global $wgUser, $wgTitle, $wgOut, $wgVoteDirectory;
$wgOut->addScript("<script type=\"text/javascript\" src=\"extensions/Comments/Comment.js\"></script>\n");
require_once 'CommentClass.php';
require_once "{$wgVoteDirectory}/VoteClass.php";
getValue($scorecard, $input, "Scorecard");
getValue($allow, $input, "Allow");
getValue($voting, $input, "Voting");
getValue($title, $input, "title");
getValue($userRating, $input, "userrating");
$Comment = new Comment($wgTitle->mArticleID);
$Comment->setUser($wgUser->mName, $wgUser->mId);
$Comment->setAllow($allow);
$Comment->setVoting($voting);
$Comment->setTitle($title);
$Comment->setBool("ShowScorecard", $scorecard);
$Comment->setBool("ShowUserRating", $userRating);
if ($_POST['commentid']) {
$Comment->setCommentID($_POST['commentid']);
$Comment->delete();
}
$output = $Comment->displayOrderForm();
if ($Comment->ShowScoreCard == 1) {
$output .= "<div id=\"scorecard\"></div>";
}
$output .= "<div id=\"allcomments\">" . $Comment->display() . "</div>";
$output .= $Comment->diplayForm();
if ($Comment->ShowScoreCard == 1) {
$output .= $Comment->displayCommentScorecard($scorecard);
}
return $output;
}
示例12: parse
function parse($xml)
{
$this->name = getValue($xml, 'name');
$this->category = getValue($xml, 'category');
$this->subcategory = getValue($xml, 'subcategory');
$this->usage = getValue($xml, 'usage');
$this->returns = getValue($xml, 'returns');
$this->related = getValue($xml, 'related');
$this->related = preg_split("/\n/", $this->related, -1, PREG_SPLIT_NO_EMPTY);
$this->availability = getValue($xml, 'availability');
$this->partof = getValue($xml, 'partof');
$this->level = getValue($xml, 'level');
$this->type = getValue($xml, 'type');
$this->hasParameter = getValue($xml, 'label');
// Added for 149
$this->hasCode = getValue($xml, 'code');
// Added for 149
$this->description = innerHTML($xml, 'description');
$this->syntax = innerHTML($xml, 'syntax');
$this->constructor = innerHTML($xml, 'constructor');
$this->examples = getFragmentsAsArray($xml, 'example', array('image', 'code'));
$this->fields = getFragmentsAsArray($xml, 'field', array('fname', 'fdescription'));
$this->methods = getFragmentsAsArray($xml, 'method', array('mname', 'mdescription'));
$this->parameters = getFragmentsAsArray($xml, 'parameter', array('label', 'description'));
$this->cparameters = getFragmentsAsArray($xml, 'cparameter', array('clabel', 'cdescription'));
}
示例13: ajax_kik
public function ajax_kik()
{
$this->loadData();
list($nb_red, $nb_blue) = self::compterSignes($this->grille);
$x = intval(getValue('x'));
$y = intval(getValue('y'));
$charat = $y * 3 + $x;
if ($this->grille[$charat] == 0 && $nb_red - $nb_blue + 1 == intval(slot()->position)) {
$this->grille[$charat] = intval(slot()->position);
$this->saveData();
}
$winner = self::checkTicTacToe($this->grille);
switch ($winner['etat']) {
case 0:
return $this->ajax_update();
case 1:
case 2:
$slots = partie()->getSlots();
$slots[$winner['etat'] - 1]->addScore(1, true);
$r = $this->terminer();
$r->highlight = $winner['highlight'];
$r->grid = $this->grille;
return $r;
case 3:
$slots = partie()->getSlots();
$r = $this->terminer();
$r->highlight = $winner['highlight'];
$r->grid = $this->grille;
return $r;
default:
throw new Exception('grille de Tic Tac Toe impossible : ' . $winner);
}
}
示例14: message_clicked
public function message_clicked()
{
permissionUser();
$id = $this->input->post('id');
$f_name = getValue('sender_id', 'chat', array('id' => 'where/' . $id));
$this->db->where('sender_id', $f_name)->update($this->table_name, array('is_read' => 1));
echo base_url('message');
}
示例15: getErrors
function getErrors($array, $key)
{
$html = '';
foreach (getValue($array, $key, []) as $error) {
$html .= sprintf('<span>%s</span>', $error);
}
return $html;
}