本文整理汇总了PHP中exequery函数的典型用法代码示例。如果您正苦于以下问题:PHP exequery函数的具体用法?PHP exequery怎么用?PHP exequery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了exequery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email_fw_webmail_box
function email_fw_webmail_box($USER_ID)
{
$EMAIL_FW_WEBMAIL_BOX = "";
$FROM_MAIL_ID = "";
$FROM_WEBMAIL_BOX_DEFAULT = "";
$EMAIL_FW_WEBMAIL_BOX_ARRAY = array();
$query = "select * from webmail where USER_ID='" . $USER_ID . "' and EMAIL_PASS!='' order by IS_DEFAULT desc";
$cursor = exequery(TD::conn(), $query);
while ($ROW = mysql_fetch_array($cursor)) {
$MAIL_ID = $ROW['MAIL_ID'];
$EMAIL = $ROW['EMAIL'];
$IS_DEFAULT = $ROW['IS_DEFAULT'];
$RECV_FW = $ROW['RECV_FW'];
if ($FROM_WEBMAIL_BOX_DEFAULT == "") {
$FROM_WEBMAIL_BOX_DEFAULT = $EMAIL;
$FROM_MAIL_ID = $MAIL_ID;
}
if ($RECV_FW == 1) {
$EMAIL_FW_WEBMAIL_BOX .= $EMAIL . ",";
}
}
$EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $FROM_WEBMAIL_BOX_DEFAULT;
$EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $EMAIL_FW_WEBMAIL_BOX;
$EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $FROM_MAIL_ID;
return $EMAIL_FW_WEBMAIL_BOX_ARRAY;
}
示例2: dept_tree_list
function dept_tree_list($DEPT_ID, $PRIV_OP)
{
global $DEEP_COUNT;
global $connection;
$query = "SELECT * from department where DEPT_PARENT='" . $DEPT_ID . "' order by DEPT_NO";
$cursor = exequery($connection, $query);
$OPTION_TEXT = "";
$DEEP_COUNT1 = $DEEP_COUNT;
$DEEP_COUNT .= " ";
while ($ROW = mysql_fetch_array($cursor)) {
++$COUNT;
$DEPT_ID = $ROW['DEPT_ID'];
$DEPT_NAME = $ROW['DEPT_NAME'];
$DEPT_PARENT = $ROW['DEPT_PARENT'];
$DEPT_NAME = str_replace("<", "<", $DEPT_NAME);
$DEPT_NAME = str_replace(">", ">", $DEPT_NAME);
$DEPT_NAME = stripslashes($DEPT_NAME);
$DEPT_PRIV = 1;
$OPTION_TEXT_CHILD = dept_tree_list($DEPT_ID, $PRIV_OP);
if ($DEPT_PRIV == 1) {
$OPTION_TEXT .= " <tr class=TableData> <td class='menulines' id='" . $DEPT_ID . "' title='" . $DEPT_NAME . "' onclick=javascript:click_dept('" . $DEPT_ID . "') style=cursor:pointer>" . $DEEP_COUNT1 . "├" . $DEPT_NAME . "</a></td> </tr>";
}
if ($OPTION_TEXT_CHILD != "") {
$OPTION_TEXT .= $OPTION_TEXT_CHILD;
}
}
$DEEP_COUNT = $DEEP_COUNT1;
return $OPTION_TEXT;
}
示例3: scelta
/** @return Le informazioni del sondaggio tramite un array associativo, dove:
"choices" => array con le scelte, dove:
"id" => id della scelta
"descr" => descrizione della scelta (come inserito dall'utente)
"votes" => numero di voti per questa scelta
"percentage" => percentuale normalizzata (0..1) in relazione al totale dei voti (4 decimali di precisione)
"votes_count" => numero di voti totali
"user_has_voted" => boolean se l'utente corrente ha gia' votato */
function getPollData()
{
global $currentUser;
// Cache
if ($this->poll_data == null) {
$poll_info = unserialize($this->getRaw('poll'));
$choices = array();
$votes_count = 0;
$user_has_voted = false;
foreach ($poll_info as $id => $value) {
// id = numero, value = stringa descrivente la scelta
$choices[] = array("id" => $id, "descr" => $value, "votes" => 0, "percentage" => 0);
}
// Prende i voti dal database
$q = exequery("SELECT user_id, vote FROM forum_poll WHERE topic_id = {$this['id']}");
while ($values = mysqli_fetch_array($q)) {
$choices[$values['vote']]['votes']++;
// perche' indice == id
$votes_count++;
if ($values['user_id'] == $currentUser['id']) {
$user_has_voted = true;
}
}
// Calcola le percentuali
if ($votes_count > 0) {
foreach ($choices as $id => &$values) {
$values['percentage'] = round((double) $values['votes'] / (double) $votes_count, 4);
}
}
$this->poll_data = array("choices" => $choices, "votes_count" => $votes_count, "user_has_voted" => $user_has_voted);
}
return $this->poll_data;
}
示例4: Add
public static function Add($text, $type)
{
global $currentUser;
$user_id = $currentUser->isLogged() ? $currentUser['id'] : null;
$ip = get_ip();
$timestamp = time();
$text = db_escape($text);
exequery("INSERT INTO logs (ip, `timestamp`, user_id, `text`, type) VALUES ('{$ip}', '{$timestamp}', {$user_id}, '{$text}', {$type})");
}
示例5: getPublished
public static function getPublished()
{
$query = exequery(Guide::SELECT_SQL . " WHERE published = 1");
$array = array();
while ($g = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$array[] = new Guide($g);
}
return $array;
}
示例6: getAllChapters
public function getAllChapters()
{
$qr = exequery(GuideChapter::SELECT_SQL . " WHERE guide_id={$this['id']} AND validated=1 ORDER BY chapter ASC");
$chapters = array();
while ($values = mysqli_fetch_array($qr, MYSQLI_ASSOC)) {
$chapters[] = new GuideChapter($values, $this->link);
}
return $chapters;
}
示例7: deptListTree
function deptListTree($PARENT_ID)
{
global $connection;
global $LOGIN_USER_ID;
global $LOGIN_DEPT_ID;
global $LOGIN_USER_PRIV;
global $PRIV_NO_FLAG;
global $PARA_URL;
global $PARA_TARGET;
global $PARA_ID;
global $PARA_VALUE;
global $showButton;
$query = "SELECT * from department where DEPT_PARENT='" . $PARENT_ID . "' order by DEPT_NO";
$cursor1 = exequery($connection, $query);
while ($ROW = mysql_fetch_array($cursor1)) {
$DEPT_ID1 = $ROW['DEPT_ID'];
$DEPT_NAME1 = $ROW['DEPT_NAME'];
$DEPT_NAME1 = htmlspecialchars($DEPT_NAME1);
$DEPT_NAME1 = str_replace("\"", """, $DEPT_NAME1);
$DEPT_NAME1 = stripslashes($DEPT_NAME1);
$CHILD_COUNT = 0;
$query = "SELECT 1 from department where DEPT_PARENT='" . $DEPT_ID1 . "'";
$cursor2 = exequery($connection, $query);
if ($ROW1 = mysql_fetch_array($cursor2)) {
++$CHILD_COUNT;
}
if ($PRIV_NO_FLAG) {
$DEPT_PRIV1 = is_dept_priv($DEPT_ID1);
} else {
$DEPT_PRIV1 = 1;
}
if ($DEPT_PRIV1 == 1) {
$XML_TEXT_DEPT .= "<TreeNode id=\"" . $DEPT_ID1 . "\" text=\"[{$DEPT_NAME1}]\" ";
} else {
$XML_TEXT_DEPT .= "<TreeNode id=\"" . $DEPT_ID1 . "\" text=\"{$DEPT_NAME1}\" ";
}
if ($showButton) {
$XML_TEXT_DEPT .= "onclick=\"click_node('" . $DEPT_ID1 . "',this.checked,'{$PARA_ID}','" . str_replace(".", "&", $PARA_VALUE) . "');\" ";
}
if ($PARA_URL != "" && $DEPT_PRIV1 == 1) {
if ($PARA_ID == "") {
$URL = "{$PARA_URL}?DEPT_ID={$DEPT_ID1}";
} else {
$URL = "{$PARA_URL}?DEPT_ID={$DEPT_ID1}&{$PARA_ID}=" . str_replace(".", "&", $PARA_VALUE);
}
$XML_TEXT_DEPT .= "href=\"" . $URL . "\" target=\"{$PARA_TARGET}\"";
} else {
$XML_TEXT_DEPT .= "href=\"javascript:;\" target=\"_self\"";
}
$XML_TEXT_DEPT .= " img_src=\"../../../Framework/images/endnode.gif\" title=\"" . $DEPT_NAME1 . "\"";
if (0 < $CHILD_COUNT) {
$XML_TEXT_DEPT .= " Xml=\"tree.php?DEPT_ID=" . $DEPT_ID1 . "&PARA_URL={$PARA_URL}&PARA_TARGET={$PARA_TARGET}&PRIV_NO_FLAG={$PRIV_NO_FLAG}&PARA_ID={$PARA_ID}&PARA_VALUE={$PARA_VALUE}&showButton={$showButton}\"";
}
$XML_TEXT_DEPT .= "/>\n";
}
return $XML_TEXT_DEPT;
}
示例8: add_task
function add_task($file, $code)
{
$qry = "SELECT * FROM office_task WHERE TASK_CODE='{$code}'";
$csr = exequery(TD::conn(), $qry);
if ($row = mysql_fetch_array($csr)) {
} else {
$qry = "INSERT INTO `office_task` (`TASK_TYPE`, `INTERVAL`, `EXEC_TIME`, `LAST_EXEC`,\n\t\t\t\t`EXEC_FLAG`, `EXEC_MSG`, `TASK_URL`, `TASK_NAME`, `TASK_DESC`, `TASK_CODE`, `USE_FLAG`,\n\t\t\t\t`SYS_TASK`, `EXT_DATA`) VALUES(\n\t\t\t\t'0',\n\t\t\t\t1,\n\t\t\t\t'00:00:00',\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t1,\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t'{$file}',\n\t\t\t\t'即时通讯离线消息推送',\n\t\t\t\t'定时将OA精灵离线消息推送到微信企业号',\n\t\t\t\t'{$code}',\n\t\t\t\t'1',\n\t\t\t\t'0',\n\t\t\t\t'')";
exequery(TD::conn(), $qry);
//Add system parameter
include_once "inc/utility_all.php";
add_sys_para(array("WEIXINQY_MSGCHECK_TIME" => ""));
}
}
示例9: getProdTypeList
function getProdTypeList($DEPT_PARENT)
{
global $connection;
$sql = "select DEPT_ID,DEPT_NAME,DEPT_PARENT from department where DEPT_PARENT='{$DEPT_PARENT}' order by DEPT_PARENT asc ,DEPT_NO asc";
$cursor = exequery($connection, $sql);
while ($ROW = mysql_fetch_array($cursor)) {
$DEPT_ID = $ROW['DEPT_ID'];
$DEPT_NAME = $ROW['DEPT_NAME'];
$DEPT_PARENT = $ROW['DEPT_PARENT'];
$open = "false";
print "zNodes[zNodes.length]={id:{$DEPT_ID}, pId:{$DEPT_PARENT}, name:'{$DEPT_NAME}', ename:'{$DEPT_NAME}', open:{$open}};";
getProdTypeList($DEPT_ID);
}
}
示例10: Find
public static function Find($name, $num_records = 20)
{
//Controllo dei parametri
validate_num($num_records);
db_escape(trim($name));
// Se non c'e' niente da cercare
if ($name == "") {
return array();
}
$q = exequery("SELECT user FROM users WHERE user LIKE'{$name}%' LIMIT {$num_records}");
$array = array();
while ($u = mysqli_fetch_array($q, MYSQLI_ASSOC)) {
$array[] = $u['user'];
}
return $array;
}
示例11: createUser
public function createUser($user_id)
{
$user_ids = "";
$user_arr = explode(",", $user_id);
foreach ($user_arr as $key => $value) {
$user_ids .= "'" . $value . "',";
}
$user_ids = rtrim($user_ids, ",");
$sync = array();
$query = "SELECT USER_ID,USER_NAME,DEPT_ID,DEPT_ID_OTHER,USER_PRIV_NAME,USER_PRIV,MOBIL_NO,SEX,TEL_NO_DEPT,EMAIL FROM USER where USER_ID IN (" . $user_ids . ")";
$cursor = exequery(TD::conn(), $query);
while ($ROW = mysql_fetch_array($cursor)) {
$USER_ID = $ROW['USER_ID'];
$USER_NAME = $ROW['USER_NAME'];
$DEPT_ID = $ROW['DEPT_ID'];
$DEPT_ID_OTHER = $ROW['DEPT_ID_OTHER'];
$USER_PRIV_NAME = $ROW['USER_PRIV_NAME'];
$USER_PRIV = $ROW['USER_PRIV'];
$MOBIL_NO = $ROW['MOBIL_NO'];
$SEX = $ROW['SEX'];
$TEL_NO_DEPT = $ROW['TEL_NO_DEPT'];
$EMAIL = $ROW['EMAIL'];
if ($EMAIL == "" && !preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO)) {
$sync['failed'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
} else {
$_dept = array();
$_dept[] = $this->deptinfo[$DEPT_ID]['weixin_dept_id'];
if ($DEPT_ID_OTHER != "") {
$_dept_arr = array_filter(explode(",", $DEPT_ID_OTHER));
foreach ($_dept_arr as $key => $value) {
$_dept[] = $this->deptinfo[$value]['weixin_dept_id'];
}
}
$rs = $this->postData($this->url['create'], array("userid" => $USER_ID, "name" => $USER_NAME, "department" => $_dept, "position" => $USER_PRIV_NAME, "mobile" => preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO) ? $MOBIL_NO : "", "gender" => $SEX, "tel" => $TEL_NO_DEPT, "email" => $EMAIL));
if ($rs['errcode'] == 0) {
$sync['success'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
} else {
if ($rs['errcode'] == 60102) {
$sync['exists'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']);
}
}
}
}
parent::logs("user_import", serialize($sync));
return array("success" => count($sync['success']), "failed" => count($sync['failed']), "exists" => count($sync['exists']));
}
示例12: getPageNumber
public function getPageNumber()
{
// Elenca tutti i posts nel thread fino a che non troviamo la nostra posizione...
// Ci dev'essere un modo migliore...?
$q = exequery("SELECT id FROM forum_posts \n\t\tWHERE root_topic = (SELECT root_topic FROM forum_posts WHERE id = {$this['id']}) ORDER BY id");
$position = 0;
$c = 1;
while ($res = mysqli_fetch_array($q)) {
if ($res['id'] == $this['id']) {
$position = $c;
break;
}
$c++;
}
if ($position == 0) {
return 1;
} else {
return floor(($position - 1) / Forum::POSTS_PER_PAGE + 1);
}
}
示例13: AddReplyNotifications
public static function AddReplyNotifications($post_id)
{
global $currentUser;
$post = new ForumPost($post_id);
// Lista di utenti che hanno risposto al topic, ma che non
// sono all'interno della skip list
$q = exequery("SELECT p.user_id as user_id, s.user_id as skip_user_id FROM forum_posts p \n\t\t\t\t\t\t\tLEFT OUTER JOIN forum_notifications_skip_list s ON (s.user_id = p.user_id AND s.topic_id = {$post['root_topic']}) \n\t\t\t\t\t\t\tWHERE p.root_topic = {$post['root_topic']} OR p.id = {$post['root_topic']} GROUP BY user_id\n\t\t\t\t\t\t\tUNION SELECT a.user_id AS user_id, NULL AS skip_user_id\n\t\t\t\t\t\t\tFROM forum_notifications_add_list a WHERE a.topic_id = {$post['root_topic']}\n\t\t\t");
// Una notifica a ciascuno, non fa male a nessuno
while ($values = mysqli_fetch_array($q)) {
if ($values['user_id'] == $currentUser['id']) {
continue;
}
//Skip noi stessi
if ($values['skip_user_id'] != null) {
continue;
}
//Skippa se richiesto
exequery("INSERT INTO forum_notifications (topic_id, user_id, notify_tm, post_id, page_num) \n\t\t\t \tVALUES ('{$post['root_topic']}','{$values['user_id']}'," . time() . ", {$post_id}, " . $post->getPageNumber() . ")");
}
//Rimuovi dalla lista di skip_notifications l'user che ha postato
exequery("DELETE FROM forum_notifications_skip_list \n\t\t\t \t\t\tWHERE user_id = {$currentUser['id']} AND topic_id = {$post['root_topic']}");
}
示例14: get_file_folder_path
function get_file_folder_path($sort_id)
{
if ($sort_id == "0") {
return "根目录";
}
global $connection;
$path = "";
$query = "select SORT_PARENT,SORT_NAME from FILE_SORT where SORT_ID='" . $sort_id . "'";
$cursor = exequery($connection, $query);
if ($ROW = mysql_fetch_array($cursor)) {
$SORT_PARENT = $ROW['SORT_PARENT'];
$SORT_NAME = $ROW['SORT_NAME'];
if ($SORT_PARENT != 0) {
$path = get_file_folder_path($SORT_PARENT) . "/" . $SORT_NAME;
return $path;
}
$path = $SORT_NAME . $path;
}
return $path;
}
示例15: exequery
$cursor = exequery(TD::conn(), $query);
while ($ROW = mysql_fetch_array($cursor)) {
if (!find_id($USER_ID_STR, $ROW['USER_ID'])) {
$USER_ID_STR .= $ROW['USER_ID'] . ",";
}
}
}
$MY_ARRAY_DEPT = explode(",", $TO_ID);
$ARRAY_COUNT_DEPT = sizeof($MY_ARRAY_DEPT);
$I = 0;
for (; $I < $ARRAY_COUNT_DEPT; ++$I) {
if ($MY_ARRAY_DEPT[$I] == "") {
continue;
}
$query_d = "select USER_ID from USER where (NOT_LOGIN = 0 or NOT_MOBILE_LOGIN = 0) and find_in_set('" . $MY_ARRAY_DEPT[$I] . "',DEPT_ID_OTHER)";
$cursor_d = exequery(TD::conn(), $query_d);
while ($ROWD = mysql_fetch_array($cursor_d)) {
if (!find_id($USER_ID_STR, $ROWD['USER_ID'])) {
$USER_ID_STR .= $ROWD['USER_ID'] . ",";
}
}
}
$USER_ID_STR_ARRAY = explode(",", $USER_ID_STR);
$USER_ID_STR_ARRAY_COUNT = sizeof($USER_ID_STR_ARRAY);
$I = 0;
for (; $I < $USER_ID_STR_ARRAY_COUNT; ++$I) {
if (!($USER_ID_STR_ARRAY[$I] == "")) {
$FUNC_ID_STR = getfunmenubyuserid($USER_ID_STR_ARRAY[$I]);
if (!find_id($FUNC_ID_STR, 4)) {
$USER_ID_STR = str_replace($USER_ID_STR_ARRAY[$I], "", $USER_ID_STR);
}