本文整理汇总了PHP中execQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP execQuery函数的具体用法?PHP execQuery怎么用?PHP execQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了execQuery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeCustomMenuItem
/**
* Mantis 1.2 only !!
* remove existing entries from mantis menu
*
* @param string $name 'CodevTT'
*/
function removeCustomMenuItem($name)
{
// get current mantis custom menu entries
$query = "SELECT value FROM `mantis_config_table` WHERE config_id = 'main_menu_custom_options'";
$result = execQuery($query);
$serialized = 0 != mysql_num_rows($result) ? mysql_result($result, 0) : NULL;
// add entry
if (!is_null($serialized) && "" != $serialized) {
$menuItems = unserialize($serialized);
foreach ($menuItems as $key => $item) {
if (in_array($name, $item)) {
echo "remove key={$key}<br>";
unset($menuItems[$key]);
}
}
$newSerialized = serialize($menuItems);
// update mantis menu
if (NULL != $serialized) {
$query = "UPDATE `mantis_config_table` SET value = '{$newSerialized}' " . "WHERE config_id = 'main_menu_custom_options'";
} else {
$query = "INSERT INTO `mantis_config_table` (`config_id`, `value`, `type`, `access_reqd`) " . "VALUES ('main_menu_custom_options', '{$newSerialized}', '3', '90');";
}
$result = execQuery($query);
} else {
// echo "no custom menu entries found<br>";
}
}
示例2: onAction
function onAction()
{
global $application;
$emails_keys = modApiFunc('Request', 'getValueByKey', 'emails');
$emails_topics = modApiFunc('Request', 'getValueByKey', 'topic');
$customer_id = modApiFunc('Request', 'getValueByKey', 'customer_id');
if (!is_array($emails_topics)) {
$emails_topics = array();
}
foreach (array_keys($emails_keys) as $email) {
$topics = @$emails_topics[$email];
if (!is_array($topics)) {
$topics = array();
}
modApiFunc('Subscriptions', 'changeSubscriptions', $email, $topics);
$params = array('customer_id' => $customer_id, 'email' => $email);
execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
}
$messages['MESSAGES'][] = getMsg('SYS', 'SUBSCRIPTIONS_UPDATED');
modApiFunc('Session', 'set', 'AplicationSettingsMessages', $messages);
$request = new Request();
$request->setView(CURRENT_REQUEST_URL);
$request->setKey('page_view', modApiFunc('Request', 'getValueByKey', 'page_view'));
$request->setKey('customer_id', $customer_id);
$application->redirect($request);
}
示例3: validaDados
function validaDados()
{
global $erro;
global $acao;
global $sistema;
global $diretorioarquivos;
global $urlarquivos;
if (empty($sistema)) {
$erro = "SISTEMA não informado.";
return false;
} else {
if (empty($diretorioarquivos)) {
$erro = "Diretorio de Arquivos não informado.";
return false;
} else {
if (empty($urlarquivos)) {
$erro = "URL dos Arquivos não informado.";
return false;
}
}
}
//verifica se ja existe registro cadastrado com a informaçao passada ---
if ($acao == "Incluir") {
$sql = "select * from sis_param where sistema = '{$sistema}'";
if (mysql_num_rows(execQuery($sql)) > 0) {
$erro = "Nome do Sistema já existe no cadastro.";
return false;
}
}
//-----------------------------------------------------------------------
return true;
}
示例4: __fetch_base_orders_info
/**
* Returns order_id, order_date, list<price_total, currency_code, currency_type> for each order
*/
function __fetch_base_orders_info($order_ids)
{
global $application;
if (empty($order_ids)) {
return array();
} else {
$res = execQuery('SELECT_BASE_ORDERS_INFO', array("order_ids" => $order_ids));
$orders = array();
foreach ($res as $row) {
if (!isset($orders[$row['order_id']])) {
$orders[$row['order_id']] = array("order_id" => $row['order_id'], "order_date" => $row['order_date'], "payment_status_id" => $row['payment_status_id'], "person_id" => $row['person_id'], "status_id" => $row['status_id'], "price_total" => array());
}
$orders[$row['order_id']]["price_total"][$row['currency_code']] = array("order_total" => $row['order_total'], "order_tax_total" => $row['order_tax_total'], "currency_code" => $row['currency_code'], "currency_type" => $row['currency_type']);
}
//convert currency data to checkout format
foreach ($orders as $order_id => $info) {
$info =& $orders[$order_id];
$order_currencies = array();
foreach ($info['price_total'] as $price_info) {
$order_currencies[] = array('currency_type' => $price_info['currency_type'], 'currency_code' => $price_info['currency_code']);
}
$info['order_currencies_list'] = modApiFunc("Checkout", "getOrderCurrencyList", $order_id, $order_currencies);
unset($info);
}
return $orders;
}
}
示例5: findListBoard
function findListBoard($parentId)
{
$strQuery = "select * from bbs_board where parentId={$parentId}";
$result = array();
$result = execQuery($strQuery);
return $result;
}
示例6: CheckAuthentication
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*
* @return boolean
*/
function CheckAuthentication()
{
//
// Validate the user's existing session and most privileged role.
//
// Sessions are stored in the database. Lookup a sesion via the cookie
// _lis_site_session. If it's valid, extract the ckfinder_role value
// and validate it.
//
$cookie = $_COOKIE['_lis_site_session'];
$value = explode('--', $cookie);
$value = $value[0];
$conn = dbConnect();
$query = mysql_real_escape_string($value);
$session = execQuery("SELECT * FROM sessions WHERE session_id = '$query'", "dbResultToArray");
$session_data = explode("\n", $session[0]['data']);
$valid_roles = array("superuser", "admin");
foreach ($session_data as $s) {
$role = preg_replace('/[^a-z]/', '', base64_decode($s));
for ($i = 0; $i < count($valid_roles); $i++) {
if (strstr($role, $valid_roles[$i])) {
return true;
}
}
}
return false;
}
示例7: onAction
function onAction()
{
global $application;
$request = $application->getInstance('Request');
$SessionPost = array();
/*
if(modApiFunc('Session', 'is_Set', 'SessionPost'))
{
_fatal(array( "CODE" => "CORE_050"), __CLASS__, __FUNCTION__);
}
*/
$SessionPost = $_POST;
$nErrors = 0;
$key = $request->getValueByKey('action_key');
// @ check key
$topics = $request->getValueByKey('topics');
$selected_topics = explode(',', $topics);
if (!is_array($selected_topics) || empty($selected_topics)) {
// @ INTERNAL
$SessionPost['ViewState']['ErrorsArray'][] = 'INTERNAL';
$nErrors++;
}
modApiFunc('Subscriptions', 'copyTempEmails', $key);
modApiFunc('Subscriptions', 'linkTempEmails', $key);
modApiFunc('Subscriptions', 'subscribeTempEmails', $key, $selected_topics);
modApiFunc('Subscriptions', 'cleanTempEmails', $key);
execQuery('SUBSCR_LINK_CUSTOMER_EMAILS', null);
execQuery('SUBSCR_LINK_ORDERS_EMAILS', null);
modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
$request = new Request();
$request->setView('Subscriptions_Manage');
// $request->setKey('stage', 'finish');
$application->redirect($request);
}
示例8: order
public static function order($name, $email = '', $phone = '', $address = '', $comment = '', $adminNotifyTplID = 'admin_purchase_notify', $customerNotifyTplID = 'user_purchase_notify')
{
global $db;
$user = \cf\User::getLoggedIn();
$productList = '';
$products = \cf\api\cart\getList();
if (!array_key_exists('contents', $products) || !count($products['contents'])) {
return false;
}
$tpl = new MailTemplate('order');
execQuery("\n\t\t\tINSERT INTO cf_orders (created,customer_name, customer_email, customer_phone, customer_address, customer_comments, comments)\n\t\t\tVALUES(NOW(),:name, :email, :phone, :address, :comments, :contents)", array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comments' => $comment, 'contents' => $tpl->parseBody(array('cart' => $products))));
$orderId = $db->lastInsertId();
$msgParams = array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comment' => $comment, 'order' => $orderId, 'total' => $products['total'], 'products' => $products['contents']);
\cf\api\cart\clear();
$mail = new \PHPMailer();
$mail->CharSet = 'UTF-8';
if ($adminNotifyTplID) {
$tpl = new MailTemplate($adminNotifyTplID);
$mail->Subject = $tpl->parseSubject($msgParams);
$mail->MsgHTML($tpl->parseBody($msgParams));
foreach ($tpl->recipients() as $address) {
$mail->addAddress($address);
}
$mail->Send();
}
$mail->clearAddresses();
if ($customerNotifyTplID && $email) {
$tpl = new MailTemplate($customerNotifyTplID);
$mail->Subject = $tpl->parseSubject($msgParams);
$mail->MsgHTML($tpl->parseBody($msgParams));
$mail->addAddress($email);
$mail->Send();
}
return $orderId;
}
示例9: onAction
function onAction()
{
global $application;
$this->topics = modApiFunc('Request', 'getValueByKey', 'topic');
if (empty($this->topics)) {
$this->topics = array();
}
$SessionPost = array();
$this->email = trim(modApiFunc('Request', 'getValueByKey', 'email'));
if (modApiFunc('Users', 'isValidEmail', $this->email)) {
if (modApiFunc('Subscriptions', 'canClientUnsubscribe')) {
$ViewState = $this->changeSubscriptions();
} else {
$ViewState = $this->addSubscriptions();
}
$SessionPost['ViewState'] = $ViewState;
if ($this->signed_in) {
$params = array('account' => $this->account, 'email' => $this->email);
execQuery('SUBSCR_LINK_SUBSCRIPTION_TO_CUSTOMER', $params);
} else {
modApiFunc('Subscriptions', 'setCustomerSubscribedEmail', $this->email);
}
} else {
$SessionPost['ViewState']['ErrorsArray'][] = getMsg('SUBSCR', 'ERROR_SUBSCR_INVALID_EMAIL');
}
modApiFunc('Session', 'set', 'SessionPost', $SessionPost);
$r = new Request();
$r->setView(CURRENT_REQUEST_URL);
$r->setAnchor('subscribe_box');
$application->redirect($r);
}
示例10: addCustomMenuItem
/**
* Add a new entry in MantisBT menu (main_menu_custom_options)
*
* ex: addCustomMenuItem('CodevTT', '../codev/index.php')
*
* @param string $name
* @param string $url
* @return string
*/
function addCustomMenuItem($name, $url)
{
$pos = '10';
// invariant
// get current mantis custom menu entries
$query = "SELECT value FROM `mantis_config_table` WHERE config_id = 'main_menu_custom_options'";
$result = execQuery($query);
$serialized = 0 != mysql_num_rows($result) ? mysql_result($result, 0) : NULL;
// add entry
if (NULL != $serialized && "" != $serialized) {
$menuItems = unserialize($serialized);
} else {
$menuItems = array();
}
$menuItems[] = array($name, $pos, $url);
$newSerialized = serialize($menuItems);
// update mantis menu
if (NULL != $serialized) {
$query = "UPDATE `mantis_config_table` SET value = '{$newSerialized}' " . "WHERE config_id = 'main_menu_custom_options'";
} else {
$query = "INSERT INTO `mantis_config_table` (`config_id`, `value`, `type`, `access_reqd`) " . "VALUES ('main_menu_custom_options', '{$newSerialized}', '3', '90');";
}
$result = execQuery($query);
return $newSerialized;
}
示例11: markRecordAsDeleted
function markRecordAsDeleted($order_id, $order_deleted)
{
if ($this->isStatisticsEnable() == false) {
return;
}
$params = array('order_id' => $order_id, 'order_deleted' => $order_deleted);
execQuery('UPDATE_ORDERS_STAT_RECORD', $params);
}
示例12: outputCZLayoutHTTPSSettings
function outputCZLayoutHTTPSSettings()
{
global $application;
//1. Layout- CZ FS.
//2. Layout- CZ .
//3. 2 1,
// .
//4. 2. .
$layouts_from_fs = LayoutConfigurationManager::static_get_cz_layouts_list();
$layouts_from_bd = modApiFunc("Configuration", "getLayoutSettings");
foreach ($layouts_from_fs as $fname => $info) {
if (!array_key_exists($fname, $layouts_from_bd)) {
execQuery('INSERT_LAYOUT_HTTPS_SETTINGS', array('layout_full_file_name' => $fname));
}
}
$layouts_from_bd = modApiFunc("Configuration", "getLayoutSettings");
if (sizeof($layouts_from_bd) > 0) {
$CZHTTPSLayouts = "";
foreach ($layouts_from_bd as $fname => $info) {
$config = LayoutConfigurationManager::static_parse_layout_config_file($fname);
if (!empty($config)) {
$this->_Template_Contents['CZHTTPSLayoutId'] = $info['id'];
//CZHTTPSLayouts
//CZHTTPSLayoutSections
$map = modApiFunc("Configuration", "getLayoutSettingNameByCZLayoutSectionNameMap");
$CZHTTPSLayoutSections = "";
$checked_sections = array();
foreach ($info as $key => $value) {
if (in_array($key, $map)) {
//
$this->_Template_Contents['_hinttext'] = gethinttext('HTTPS_FIELD_' . $key);
$this->_Template_Contents['CZHTTPSSectionName'] = getMsg('CFG', 'HTTPS_KEY_NAME_' . $key);
$this->_Template_Contents['CZHTTPSSectionKey'] = $key;
$this->_Template_Contents['CZHTTPSSectionValue'] = $value == DB_TRUE ? " CHECKED " : "";
if ($value == DB_TRUE) {
$checked_sections[] = $key;
}
$application->registerAttributes($this->_Template_Contents);
$CZHTTPSLayoutSections .= modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "section.tpl.html", array());
}
}
$this->_Template_Contents['CZHTTPSLayoutFileName'] = $fname;
$this->_Template_Contents['CZHTTPSLayoutURL'] = $config['SITE_URL'];
$this->_Template_Contents['CZHTTPSLayoutId'] = $info['id'];
$this->_Template_Contents['CZHTTPSLayoutSections'] = $CZHTTPSLayoutSections;
$this->_Template_Contents['CZHTTPSLayoutCheckedSections'] = implode('|', $checked_sections);
$application->registerAttributes($this->_Template_Contents);
$CZHTTPSLayouts .= modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "item.tpl.html", array());
}
}
$this->_Template_Contents['CZHTTPSLayouts'] = $CZHTTPSLayouts;
$application->registerAttributes($this->_Template_Contents);
return modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "container.tpl.html", array());
} else {
// : layout .
return modApiFunc('TmplFiller', 'fill', "configuration/cz_https/", "container-empty.tpl.html", array());
}
}
示例13: findUserById
function findUserById($id)
{
$strQuery = "select * from bbs_user where uId = {$id}";
$rs = execQuery($strQuery);
if (count($rs) > 0) {
return $rs[0];
}
return $rs;
}
示例14: onAction
function onAction()
{
global $application;
$request = $application->getInstance('Request');
$gc_code = $request->getValueByKey('gc_code');
execQuery('DELETE_GC_BY_CODE', array("gc_code" => $gc_code));
$request = new Request();
$request->setView(CURRENT_REQUEST_URL);
$application->redirect($request);
}
示例15: findListReply
function findListReply($page, $topicId)
{
$pageSize = $GLOBALS["cfg"]["server"]["page_size"];
if ($page >= 1) {
$page--;
}
$page *= $pageSize;
$strQuery = "select * from bbs_reply r,bbs_user u where r.uId=u.uId and r.topicId={$topicId} order by publishTime desc limit {$page} , {$pageSize}";
$rs = execQuery($strQuery);
return $rs;
}