本文整理汇总了PHP中getDbData函数的典型用法代码示例。如果您正苦于以下问题:PHP getDbData函数的具体用法?PHP getDbData怎么用?PHP getDbData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDbData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
/**
*
* view()
*
* Loads the view
*
*/
public function view($view, $data = NULL, $return = FALSE)
{
$CI =& get_instance();
$CI->load->library("session");
$CI->load->model('common_model');
$loaded_data = array();
$loaded_data['content'] = $this->obj->load->view($view, $data, true);
$loaded_data['user_details'] = '';
$loaded_data['logo_name'] = 'KTi Basic Audit';
if ($CI->session->userdata('user_id')) {
$user_cond = array('where' => array('id' => $CI->session->userdata('user_id')), 'row' => 1);
$user_details = $CI->common_model->get_rows($user_cond, 'users');
$loaded_data['user_details'] = $user_details;
if ($CI->session->userdata('user_type') == 3 && !is_null($user_details->agent)) {
$loaded_data['logo_name'] = getDbData('users', array('id' => $user_details->agent), 'username');
} elseif ($CI->session->userdata('user_type') == 2) {
$loaded_data['logo_name'] = $user_details->username;
}
}
if ($return) {
$output = $this->obj->load->view($this->template, $loaded_data, true);
return $output;
} else {
$this->obj->load->view($this->template, $loaded_data, false);
}
}
示例2: index
public function index()
{
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'page/setting.js'), 'type' => 'text/javascript'));
$user_id = $this->session->userdata('user_id');
$user_data = getDbData('users', array('id' => $user_id));
$this->template->view('settings/index', array('user_data' => $user_data));
}
示例3: letter_content
public function letter_content()
{
$this->check_post_ajax_request();
$return_data = array('status' => 0);
$sales_letter_id = $this->secure_data($this->input->post('id'));
$sales_letter_data = getDbData('sales_letters', array('id' => $sales_letter_id));
if ($sales_letter_id !== '' && $sales_letter_data) {
$return_data['sales_letter'] = $sales_letter_data;
$return_data['content'] = stripslashes($sales_letter_data['content']);
$return_data['status'] = 1;
} else {
$return_data['message'] = 'This letter is not available.';
}
echo json_encode($return_data);
}
示例4: template_content
public function template_content()
{
$this->check_post_ajax_request();
$return_data = array('status' => 0);
$template_id = $this->secure_data($this->input->post('id'));
$template_data = getDbData('templates', array('id' => $template_id));
if ($template_id !== '' && $template_data) {
$return_data['template'] = $template_data;
$return_data['content'] = stripslashes($template_data['body']);
$return_data['status'] = 1;
} else {
$return_data['message'] = 'This funnel is not available.';
}
echo json_encode($return_data);
}
示例5: basekit
public function basekit($code = '')
{
$auth_code = $this->secure_data($code);
$this->session->unset_userdata('user_id');
$this->session->unset_userdata('user_type');
$this->session->unset_userdata('admin_user_id');
$this->session->unset_userdata('admin_access');
$redirect = base_url() . 'login';
if ($auth_code) {
$user_data = getDbData('users', array('auth_code' => $auth_code));
if ($user_data) {
$this->session->set_userdata("user_id", $user_data['id']);
$this->session->set_userdata("user_type", $user_data['user_type']);
$redirect = base_url() . 'dashboard';
}
}
redirect($redirect);
exit;
}
示例6: gmbp
public function gmbp($catid = '', $leadid = '')
{
$this->dynamic_load->add_js('footer', array('src' => 'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places', 'type' => 'text/javascript'));
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'core/angular.min.js'), 'type' => 'text/javascript'));
$this->dynamic_load->add_js('footer', array('src' => '//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js', 'type' => 'text/javascript'));
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'core/jquery.raty.js'), 'type' => 'text/javascript'));
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'leadprocess/gmbp.js'), 'type' => 'text/javascript'));
$this->dynamic_load->add_css(array('href' => asset_url('css', 'jquery.raty.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
$catid = $this->secure_data($catid);
$leadid = $this->secure_data($leadid);
$lead_data = getDbData('leads', array('md5(id)' => $leadid));
if ($lead_data) {
$user_data = getDbData('users', array('id' => $lead_data['agent_id']));
if ($user_data) {
$this->template->view('leadprocess/gmbp', array('user_data' => $user_data, 'lead_data' => $lead_data, 'islead' => 1));
} else {
show_404();
exit;
}
} else {
show_404();
exit;
}
}
示例7: sprintf
<?php
for ($i = 1; $i <= $numofmonth; $i++) {
?>
<tr class="looptr">
<td class="datetd"><?php
echo sprintf('%02d', $month);
?>
/<?php
echo sprintf('%02d', $i);
?>
(<?php
echo getWeekday(date('w', mktime(0, 0, 0, $month, $i, $year)));
?>
)</td>
<?php
$DayOf1 = getDbData($table['s_counter'], $accountQue . "date='" . $year . sprintf('%02d', $month) . sprintf('%02d', $i) . "'", '*');
?>
<?php
$DayOf2 = getDbCnt($table['s_browser'], 'sum(hit)', $accountQue . "date='" . $year . sprintf('%02d', $month) . sprintf('%02d', $i) . "' and browser='Mobile'");
?>
<?php
$TOT1 += $DayOf1['hit'];
?>
<?php
$TOT2 += $DayOf1['page'];
?>
<?php
$TOT3 += $DayOf2;
?>
<td class="sumtd1"><?php
示例8: unlink
if ($U['type'] == 2) {
unlink($g['path_file'] . $U['folder'] . '/' . $U['thumbname']);
}
}
}
}
}
//태그삭제
if ($R['tag']) {
$_tagdate = substr($R['d_regis'], 0, 8);
$_tagarr1 = explode(',', $R['tag']);
foreach ($_tagarr1 as $_t) {
if (!$_t) {
continue;
}
$_TAG = getDbData($table['s_tag'], "site=" . $R['site'] . " and date='" . $_tagdate . "' and keyword='" . $_t . "'", '*');
if ($_TAG['uid']) {
if ($_TAG['hit'] > 1) {
getDbUpdate($table['s_tag'], 'hit=hit-1', 'uid=' . $_TAG['uid']);
} else {
getDbDelete($table['s_tag'], 'uid=' . $_TAG['uid']);
}
}
}
}
getDbUpdate($table[$m . 'month'], 'num=num-1', "date='" . substr($R['d_regis'], 0, 6) . "' and site=" . $R['site'] . ' and bbs=' . $R['bbs']);
getDbUpdate($table[$m . 'day'], 'num=num-1', "date='" . substr($R['d_regis'], 0, 8) . "' and site=" . $R['site'] . ' and bbs=' . $R['bbs']);
getDbDelete($table[$m . 'idx'], 'gid=' . $R['gid']);
getDbDelete($table[$m . 'data'], 'uid=' . $R['uid']);
getDbUpdate($table[$m . 'list'], 'num_r=num_r-1', 'uid=' . $R['bbs']);
if ($cuid) {
示例9: getDbArray
<?php
$sort = $sort ? $sort : 'gid';
$orderby = $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 91 ? $recnum : 30;
$RCD = getDbArray($table['s_module'], '', '*', $sort, $orderby, $recnum, $p);
$NUM = getDbRows($table['s_module'], '');
$TPG = getTotalPage($NUM, $recnum);
if (!$id) {
$id = 'home';
}
$R = getDbData($table['s_module'], "id='" . $id . "'", '*');
?>
<div id="catebody">
<div id="category">
<form name="mform1" action="<?php
echo $g['s'];
?>
/" method="post" target="_action_frame_<?php
echo $m;
?>
">
<input type="hidden" name="r" value="<?php
echo $r;
?>
" />
<input type="hidden" name="m" value="<?php
echo $module;
?>
" />
示例10: array
@chmod($_tmptfile, 0707);
include $_tmptfile;
$gid = 0;
$mdlarray = array('dashboard', 'market', 'admin', 'module', 'site', 'layout', 'domain', 'device');
foreach ($mdlarray as $_val) {
$QUE = "insert into " . $table['s_module'] . " \n\t(gid,system,hidden,mobile,name,id,tblnum,icon,d_regis) \n\tvalues \n\t('" . $gid . "','1','" . (strstr('[market][admin][site][layout]', '[' . $_val . ']') ? 0 : 1) . "','1','" . getFolderName($g['path_module'] . $moduledir[$_val][0]) . "','" . $moduledir[$_val][0] . "','" . $moduledir[$_val][1] . "','kf-" . ($_val == 'site' ? 'home' : $_val) . "','" . $date['totime'] . "')";
db_query($QUE, $DB_CONNECT);
$gid++;
}
$siteid = 'home';
$layout = 'b-dash/default.php';
$QKEY = "gid,id,name,title,titlefix,icon,layout,startpage,m_layout,m_startpage,lang,open,dtd,nametype,timecal,rewrite,buffer,usescode,headercode,footercode";
$QVAL = "'0','" . $siteid . "','{$sitename}','{$sitename}','0','','{$layout}','0','mobile/default.php','0','{$sitelang}','1','','nic','0','0','0','0','',''";
getDbInsert($table['s_site'], $QKEY, $QVAL);
db_query("OPTIMIZE TABLE " . $table['s_site'], $DB_CONNECT);
$S = getDbData($table['s_site'], "id='" . $siteid . "'", '*');
$LASTUID = $S['uid'];
$pagesarray = array('main' => array('메인화면', '3', ''));
foreach ($pagesarray as $_key => $_val) {
$QUE = "insert into " . $table['s_page'] . " \n\t(pagetype,ismain,mobile,id,category,name,perm_g,perm_l,layout,joint,hit,d_regis,d_update)\n\tvalues\n\t('{$_val['1']}','" . ($_key == 'main' ? 1 : 0) . "','" . ($_key == 'main' ? 1 : 0) . "','{$_key}','기본페이지','{$_val['0']}','','0','','{$_val['2']}','0','" . $date['totime'] . "','')";
db_query($QUE, $DB_CONNECT);
/*
$mfile = $g['path_page'].$_key.'.php';
$fp = fopen($mfile,'w');
fwrite($fp,$_val[0]);
fclose($fp);
@chmod($mfile,0707);
$mfile = $g['path_page'].$_key.'.widget.php';
$fp = fopen($mfile,'w');
fwrite($fp,'');
fclose($fp);
示例11: searchPages
/**
* Do the pages search
* @access public
* @param queries The search query (array)
*/
function searchPages($queries)
{
global $imSettings;
$html = "";
$found_content = array();
$found_count = array();
if (is_array($this->scope)) {
foreach ($this->scope as $filename) {
$count = 0;
$weight = 0;
$file_content = @implode("\n", file($filename));
// Replace the nonbreaking space with a white space
// to avoid that is converted to a 196+160 UTF8 char
$file_content = str_replace(" ", " ", $file_content);
if (function_exists("html_entity_decode")) {
$file_content = html_entity_decode($file_content, ENT_COMPAT, 'UTF-8');
}
// Remove the page menu
while (stristr($file_content, "<div id=\"imPgMn\"") !== false) {
$style_start = imstripos($file_content, "<div id=\"imPgMn\"");
$style_end = imstripos($file_content, "</div", $style_start);
$style = substr($file_content, $style_start, $style_end - $style_start);
$file_content = str_replace($style, "", $file_content);
}
// Remove the breadcrumbs
while (stristr($file_content, "<div id=\"imBreadcrumb\"") !== false) {
$style_start = imstripos($file_content, "<div id=\"imBreadcrumb\"");
$style_end = imstripos($file_content, "</div", $style_start);
$style = substr($file_content, $style_start, $style_end - $style_start);
$file_content = str_replace($style, "", $file_content);
}
// Remove CSS
while (stristr($file_content, "<style") !== false) {
$style_start = imstripos($file_content, "<style");
$style_end = imstripos($file_content, "</style", $style_start);
$style = substr($file_content, $style_start, $style_end - $style_start);
$file_content = str_replace($style, "", $file_content);
}
// Remove JS
while (stristr($file_content, "<script") !== false) {
$style_start = imstripos($file_content, "<script");
$style_end = imstripos($file_content, "</script", $style_start);
$style = substr($file_content, $style_start, $style_end - $style_start);
$file_content = str_replace($style, "", $file_content);
}
// Remove PHP
while (stristr($file_content, "<?php") !== false) {
$style_start = imstripos($file_content, "<?php");
$style_end = imstripos($file_content, "?>", $style_start) !== false ? imstripos($file_content, "?>", $style_start) + 2 : strlen($file_content);
$style = substr($file_content, $style_start, $style_end - $style_start);
$file_content = str_replace($style, "", $file_content);
}
$file_title = "";
// Replace the dynamic objects with their content
if (is_array($imSettings['search']['dynamicobjects'])) {
foreach ($imSettings['search']['dynamicobjects'] as $id => $object) {
// Only if the object is in the current scope
if ($object['Page'] != $filename) {
continue;
}
// Load the object's content
$dynobj = new DynamicObject($object['ObjectId']);
$dynobj->setDefaultText($object['DefaultText']);
if (isset($object['Folder'])) {
// Load from file
$dynobj->loadFromFile(pathCombine(array($imSettings['general']['public_folder'], $object['Folder'])));
} else {
if (isset($object['Database']) && isset($object['Table'])) {
// Load from db
$db = getDbData($object['Database']);
$dynobj->loadFromDb($db['host'], $db['user'], $db['password'], $db['database'], $object['Table']);
}
}
// Replace the content
$needle_start = "<!-- search-tag " . $object['ObjectId'] . " start -->";
$needle_end = "<!-- search-tag " . $object['ObjectId'] . " end -->";
$find_start = strpos($file_content, $needle_start);
$find_end = strpos($file_content, $needle_end) + strlen($needle_end);
$file_content = substr($file_content, 0, $find_start) . $dynobj->getContent() . substr($file_content, $find_end);
}
}
// Get the title of the page
preg_match('/\\<title\\>([^\\<]*)\\<\\/title\\>/', $file_content, $matches);
if (count($matches) > 1) {
$file_title = $matches[1];
} else {
preg_match('/\\<h2\\>([^\\<]*)\\<\\/h2\\>/', $file_content, $matches);
if (count($matches) > 1) {
$file_title = $matches[1];
}
}
if ($file_title != "") {
foreach ($queries as $query) {
$title = imstrtolower($file_title);
while (($title = stristr($title, $query)) !== false) {
//.........这里部分代码省略.........
示例12: l10n
><?php
echo l10n('cart_plot_cumulative', 'Cumulative amounts');
?>
</option>
<option value="?plot_type=products"<?php
echo $plot_type == 'products' ? " selected" : "";
?>
><?php
echo l10n('cart_plot_productscount', 'Products count');
?>
</option>
</select>
</div>
<?php
if (isset($imSettings['ecommerce']) && isset($imSettings['ecommerce']['database'])) {
$dbconf = getDbData($imSettings['ecommerce']['database']['id']);
$prefix = $imSettings['ecommerce']['database']['table'];
$pagination_length = 15;
$pagination_start = isset($_GET['page']) ? $_GET['page'] * $pagination_length : 0;
$ecommerce = new ImCart();
// Clean the temp files
$ecommerce->deleteTemporaryFiles("../");
if ($ecommerce->setDatabaseConnection($dbconf['host'], $dbconf['user'], $dbconf['password'], $dbconf['database'], $prefix)) {
// Connection check
// Build the plot data
$json = "";
$colors = array("rgb(250,164,58)", "rgb(96,189,104)", "rgb(77,77,77)", "rgb(93,165,218)", "rgb(241,124,176)", "rgb(222,207,63)", "rgb(178,118,178)", "rgb(178,145,47)", "rgb(241,88,84)");
$bgcolors = array("rgba(250,164,58,0.2)", "rgba(96,189,104,0.2)", "rgba(77,77,77,0.2)", "rgba(93,165,218,0.2)", "rgba(241,124,176,0.2)", "rgba(222,207,63,0.2)", "rgba(178,118,178,0.2)", "rgba(178,145,47,0.2)", "rgba(241,88,84,0.2)");
switch ($plot_type) {
/**
* -------------------
示例13: trim
$name = trim($name);
$codhead = trim($codhead);
$codfoot = trim($codfoot);
$category = trim($category);
$addinfo = trim($addinfo);
$writecode = trim($writecode);
$puthead = $inc_head_list . $inc_head_view . $inc_head_write;
$putfoot = $inc_foot_list . $inc_foot_view . $inc_foot_write;
if (!$name) {
getLink('', '', '게시판이름을 입력해 주세요.', '');
}
if (!$id) {
getLink('', '', '아이디를 입력해 주세요.', '');
}
if ($bid) {
$R = getDbData($table[$m . 'list'], "id='" . $bid . "'", '*');
$imghead = $R['imghead'];
$imgfoot = $R['imgfoot'];
$imgset = array('head', 'foot');
for ($i = 0; $i < 2; $i++) {
$tmpname = $_FILES['img' . $imgset[$i]]['tmp_name'];
$realname = $_FILES['img' . $imgset[$i]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$userimg = $R['id'] . '_' . $imgset[$i] . '.' . $fileExt;
$saveFile = $g['dir_module'] . 'var/files/' . $userimg;
if (is_uploaded_file($tmpname)) {
if (!strstr('[gif][jpg][png][swf]', $fileExt)) {
getLink('', '', '헤더/풋터파일은 gif/jpg/png/swf 파일만 등록할 수 있습니다.', '');
}
move_uploaded_file($tmpname, $saveFile);
示例14: checkAdmin
<?php
if (!defined('__KIMS__')) {
exit;
}
checkAdmin(0);
$admin_id = trim($admin_id);
$R = getDbData($table['s_mbrid'], "id='" . $admin_id . "'", '*');
if (!$R['uid']) {
getLink('', '', '존재하지 않는 회원아이디입니다.', '');
}
$M = getDbData($table['s_mbrdata'], 'memberuid=' . $R['uid'], '*');
if ($M['admin']) {
getLink('', '', '이미 관리자로 지정된 회원입니다.', '');
}
getDbUpdate($table['s_mbrdata'], "admin=1,adm_view=''", 'memberuid=' . $R['uid']);
$fp = fopen($g['dir_module'] . 'var/users/' . $R['id'] . '.widget.php', 'w');
fwrite($fp, '');
fclose($fp);
@chmod($g['dir_module'] . 'var/users/' . $R['id'] . '.widget.php', 0707);
getLink('reload', 'parent.', '', '');
示例15: checkAdmin
if (!defined('__KIMS__')) {
exit;
}
checkAdmin(0);
$id = trim($id);
$category = trim($category);
$name = trim($name);
$joint = trim(str_replace('&', '&', $joint));
$hit = 0;
$d_regis = $date['totime'];
$d_update = '';
if (strstr($joint, '&c=') || strstr($joint, '?c=')) {
getLink('', '', '연결주소에 사용할 수 없는 파라미터가 있습니다.', '');
}
if ($orign_id && $orign_id != $id || !$orign_id) {
$R = getDbData($table['s_page'], "id='" . $id . "'", '*');
if ($R['uid']) {
getLink('', '', '동일한 아이디의 페이지가 존재합니다.', '');
}
}
if ($uid) {
if ($orign_id != $id) {
$mfile1 = $g['path_page'] . $orign_id . '.php';
$mfile2 = $g['path_page'] . $id . '.php';
@rename($mfile1, $mfile2);
@chmod($mfile2, 0707);
$mfile1 = $g['path_page'] . $orign_id . '.widget.php';
$mfile2 = $g['path_page'] . $id . '.widget.php';
@rename($mfile1, $mfile2);
@chmod($mfile2, 0707);
@unlink($g['path_page'] . $orign_id . '.txt');