本文整理汇总了PHP中aql类的典型用法代码示例。如果您正苦于以下问题:PHP aql类的具体用法?PHP aql怎么用?PHP aql使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了aql类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: name
function name()
{
set_include_path(get_include_path() . PATH_SEPARATOR . BASEPATH . 'libraries/inc');
$aql = new aql();
$aql->set('basedir', '/etc/asterisk/');
$db = $aql->query("insert into t9.conf set callerid=\"'99' <99>\",section='555'");
echo $aql->errstr;
print_r($db);
return 'name';
}
示例2: select
function select($aql = null, $clause = null)
{
if ($aql) {
$this->aql = $aql;
}
if ($clause) {
$this->clause = $clause;
}
//pagination settings
$default_limit = if_not($this->clause['default_limit'], 25);
if (!$_GET['limit' . $this->i]) {
$_GET['limit' . $this->i] = $default_limit;
}
$this->offset = $_GET['page' . $this->i] * $_GET['limit' . $this->i] - $_GET['limit' . $this->i];
$this->clause['limit'] = $_GET['limit' . $this->i];
$this->clause['offset'] = $this->offset;
$this->rs = aql::select($this->aql, $this->clause);
$this->first_row = $this->offset + 1;
$this->last_row = count($this->rs) + $this->first_row - 1;
$c = aql::sql($this->aql, $this->clause);
$c = sql($c['sql_count']);
$this->total_rows = $c->Fields('count');
$this->num_pages = ceil($this->total_rows / $_GET['limit' . $this->i]);
return $this->rs;
}
示例3: construct
public function construct()
{
// get the fname and lname of the mod__person_id
$r = aql::value("person{fname,lname}", $this->mod__person_id);
$this->addProperty('modified_by');
$this->modified_by = $r['fname'] . ' ' . $r['lname'];
$this->addProperty('message');
$this->message = $this->getMessage();
}
示例4: validate_name
/**
* Makes sure this account only has one app by this name
* @param string $val
*/
public function validate_name($val)
{
$t = $this->getPrimaryTable();
$n = static::getAccountFieldName();
$acct_id = $this->{$n} ?: ($this->isInsert() ? null : aql::value("{$t}.{$n}", $this->getID()));
$clause = array('name' => $val);
if ($acct_id) {
$clause[$n] = $acct_id;
}
if (static::count($clause)) {
$this->addError('duplicate_app_name');
}
}
示例5: getList
public function getList($a = array())
{
//. category
//. seo_field
//. website_id
//. total_volume
//. page
//. name
//. order_by
$where = array();
if (is_array($a['where'])) {
foreach ($a['where'] as $w) {
$where[] = $w;
}
}
if ($a['category']) {
$where[] = "category = '" . addslashes($a['category']) . "'";
}
if ($a['seo_field']) {
$where[] = "seo_field = '" . addslashes($a['seo_field']) . "'";
}
if ($a['website_id']) {
$where[] = "website_id = " . $a['website_id'];
}
if ($a['total_volume']) {
$where[] = "total_volume >= " . $a['total_volume'];
}
if ($a['page']) {
$where[] = "page = '" . addslashes($a['page']) . "'";
}
if ($a['name']) {
$where[] = "name = '" . addslashes($a['name']) . "'";
}
if ($a['order_by']) {
$order_by = $a['order_by'];
}
$aql = "dup_phrase_group { }";
$clause = array("dup_phrase_group" => array("where" => $where, "order by" => $order_by));
$rs = aql::select($aql, $clause);
$ids = array();
foreach ($rs as $r) {
$ids[] = $r['dup_phrase_group_id'];
}
return $ids;
}
示例6: getList
public function getList($a = array())
{
//. category
//. sub_category
//. base
//. volume
//. holiday
//. keyword
$where = array();
if (is_array($a['where'])) {
foreach ($a['where'] as $w) {
$where[] = $w;
}
}
if ($a['category']) {
$where[] = "category = '" . addslashes($a['category']) . "'";
}
if ($a['sub_category']) {
$where[] = "sub_category = '" . addslashes($a['sub_category']) . "'";
}
if ($a['base']) {
$where[] = "base = '" . addslashes($a['base']) . "'";
}
if ($a['volume']) {
$where[] = "volume = " . $a['volume'];
}
if ($a['keyword']) {
$where[] = "keyword = '" . addslashes($a['keyword']) . "'";
}
if ($a['holiday']) {
$where[] = "holiday = '" . addslashes($a['holiday']) . "'";
}
if ($a['order_by']) {
$order_by = $a['order_by'];
}
$aql = "dup_phrase_data { }";
$clause = array("dup_phrase_data" => array("where" => $where, "order by" => $order_by));
$rs = aql::select($aql, $clause);
$ids = array();
foreach ($rs as $r) {
$ids[] = $r['dup_phrase_data_id'];
}
return $ids;
}
示例7: configure_perm
function configure_perm($sentences = array())
{
echo '<div class="has-floats" style="margin-bottom:15px;">';
echo '<div style="float:left; margin-right:10px;"><input type="checkbox" class="perm-box" s_order="';
$x = 0;
foreach ($sentences as $sentence_id) {
$x++;
echo $sentence_id;
if ($x != count($sentences)) {
echo ",";
}
}
echo '"/></div>';
echo '<div style="float:left;">';
foreach ($sentences as $sentence_id) {
$rs = aql::select("dup_sentence_data { sentence where id = " . $sentence_id . " } ");
echo $rs[0]['sentence'] . '<br>';
}
echo "</div></div>";
}
示例8: array
$title .= '- Title';
$type = "phrase";
break;
case 'h1':
$type = "phrase";
$title .= '- H1';
break;
case 'meta-title':
$type = "phrase";
$title .= '- Meta Title';
break;
}
$p->template('seo', 'top');
$filters = array('category' => 'both', 'market_name' => 'both', 'market' => 'phrase', 'base' => 'phrase', 'volume' => 'phrase', 'page' => 'modifier', 'sub_category' => 'modifier');
$width = 310;
$listing = aql::select("dup_phrase_data { id as phrase_id, lower(phrase) as lower_phrase, phrase, volume order by volume DESC, phrase asc }");
$count = count($listing);
foreach ($seo_field_array as $header => $arr) {
foreach ($arr as $field => $limit) {
if ($field == str_replace('-', '_', $_GET['type'])) {
$char_count_limit = $limit;
}
}
}
$field_array = array('Title', 'H1', 'Meta Title', 'Keywords');
?>
<div style="margin: 15px;"><a href="/admin/seo/duplicate-data/split-paragraph" >Paragraph Splitter</a> | <a href="/admin/seo/duplicate-data/phrases">Phrase Listing</a></div>
<h1><?php
echo $p->title;
?>
示例9: array
</div>
</fieldset>
<?php
if ($media_item) {
$aql = "blog_article{\n\t\t\t\ttitle,\n\t\t\t\tintroduction,\n\t\t\t\tmedia_item_id as article__media_item_id\n\t\t\t}\n\t\t\tblog_media\t{\n\t\t\t\t\t\t\tmedia_item_id as blog_media__media_item_id\n\t\t\t\t\t\t}\n\t\t\tblog_article_tag{\n\t\t\t\tname\n\t\t\t\twhere blog_media.blog_article_id = {$blog_article_id}\n\t\t\t\t\tand blog_media.type = 'mebox'\n\t\t\t\torder by iorder asc\n\t\t\t\tlimit 1\n\t\t\t}";
$rs = aql::select($aql);
}
$settingss = array("transition" => "fade", "duration" => 4000, "height" => 322, "width" => 640, "height_small" => 62, "width_small" => 90);
?>
<fieldset>
<legend>Mediabox Preview</legend>
<?php
if ($rs) {
$rs[0]['media_item_id'] = $rs[0]['blog_media__media_item_id'] ? $rs[0]['blog_media__media_item_id'] : $rs[0]['article__media_item_id'];
$aql = "blog_media {\n media_item_id\n where blog_media.blog_article_id = {$rs[0]['blog_article_id']}\n and type = 'tnail'\n limit 1\n }";
$thumb = aql::select($aql);
$rs[0]['thumb__media_item_id'] = $thumb[0]['media_item_id'] ? $thumb[0]['media_item_id'] : $rs[0]['media_item_id'];
blog::marquee($rs, $settingss);
} else {
echo "No images have been uploaded yet";
}
?>
</fieldset>
<ul class="contextMenu" id="imageContextMenu">
<li>
<a href="#set_article">Add to article</a>
</li>
<li>
<a href="#delete">Delete</a>
</li>
示例10: get_codebases
<?php
$title = 'Codebase Editor';
template::inc('skybox', 'top');
$selected_codebase = $_GET['codebase'];
$table = $_GET['table'];
$codebase_list = get_codebases();
$codebase_arr = array();
$aql = "dev_codebase\t{\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}";
$codebase_arr = array();
$rs = aql::select($aql);
foreach ($rs as $r) {
$codebase_arr[$r['name']] = $r['name'];
}
foreach ($codebase_list as $codebase) {
$codebase_arr[$codebase['codebase']] = $codebase['codebase'];
}
$param = array('id' => 'codebase_name', 'name' => 'name', 'selected_value' => $selected_codebase);
snippet::dropdown($codebase_arr, $param);
?>
<br><br>
<div>
<input type="hidden" id = "table_name" value = "<?php
echo $table;
?>
" />
<input type="submit" value="Save" onclick = "save_codebase()" />
</div>
<?php
template::inc('skybox', 'bottom');
示例11: array
<?php
$rs = aql::select("website_page_data { value where website_page_ide = '{$_POST['website_page_ide']}' and field = '{$_POST['field']}' }");
$data = array('value' => $_POST['value'], 'mod__person_id' => PERSON_ID, 'update_time' => 'now()');
if (is_numeric($rs[0]['website_page_data_id'])) {
$update = aql::update('website_page_data', $data, $rs[0]['website_page_data_ide']);
if ($update == true) {
echo 'saved';
} else {
echo 'error';
}
} else {
$data['website_page_id'] = decrypt($_POST['website_page_ide'], 'website_page');
$data['field'] = $_POST['field'];
$insert = aql::insert('website_page_data', $data);
if (is_numeric($insert['website_page_data_id'])) {
echo 'saved';
} else {
echo 'error';
}
}
示例12: array
?>
</select>
</div>
<?php
}
if (is_array($markets)) {
?>
<div class="col">
<?php
$aql = "market {\n\t\t\t\t\t\tname\n\t\t\t\t\t\twhere market.name is not null and market.name <>''\n\t\t\t\t\t\tand market.primary = 1 \n\t\t\t\t\t\torder by name asc\n\t\t\t\t\t}";
$dropdown = array('select_name' => 'market_ide', 'value_field' => 'market_ide', 'option_field' => 'name', 'selected_value' => $_GET['market_ide'], 'null_option' => 'All Markets', 'onchange' => 'this.form.submit();');
aql::dd($aql, $dropdown);
?>
</div>
<?php
}
//if
?>
</div>
<br/>
<div class="has-floats">
<div class="col">
<?php
$aql = "blog_category{\n\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t\torder by iorder\n\t\t\t\t\t\t\t}";
$dropdown = array('select_name' => 'blog_category_ide', 'value_field' => 'blog_category_ide', 'option_field' => 'name', 'selected_value' => $_GET['blog_category_ide'], 'null_option' => 'All Categories', 'onchange' => 'this.form.submit();');
aql::dd($aql, $dropdown);
?>
</div>
</div>
</div>
</form>
示例13: error_reporting
<?php
/*
* This is Test demo script for AQL
*/
error_reporting(E_ALL);
require "../inc/aql.php";
$a = new aql();
$setok = $a->set('basedir', './');
if (!$setok) {
echo __LINE__ . ' ' . $a->get_error();
}
$result = $a->query("insert into t10.conf set type='friend',section='8001',call-limit=1");
$result = $a->query("delete from t10.conf where section = '8001'");
if ($result == false) {
echo $a->get_error();
} else {
echo 'affected_rows :' . $a->get_affected_rows() . "\n";
}
示例14: addAQLErrors
/**
* Gets aql::$errors and adds them to the stack
*/
protected function addAQLErrors()
{
foreach (aql::$errors as $e) {
$this->addInternalError('aql_class_error', array('message' => $e->getMessage(), 'Exception' => $e));
}
aql::$errors = array();
}
示例15: date
}
}
if ($ct_holiday_id) {
$ct_holiday = aql::profile('ct_holiday', $ct_holiday_id);
$holiday_name = $ct_holiday['name'];
$holiday1 = $ct_holiday['holiday1'];
$holiday2 = $ct_holiday['holiday2'];
$holiday3 = $ct_holiday['holiday3'];
$holiday4 = $ct_holiday['holiday4'];
$holiday5 = $ct_holiday['holiday5'];
$holiday6 = $ct_holiday['holiday6'];
}
if ($ct_campaign_id) {
$ct_campaign = aql::profile('ct_campaign', $ct_campaign_id);
$campaign_name = $ct_campaign['name'];
}
if ($ct_contract_id) {
$ct_contract = aql::profile('ct_contract', $ct_contract_id);
$contract_name = $ct_contract['name'];
$contract_open_bar_start = $ct_contract['open_bar_start'];
$contract_open_bar_end = $ct_contract['open_bar_end'];
}
$website_name = $p->seo['domain'] = $website->website['domain'];
$seo_phone = $website->website['seo_phone'];
$seo_year = date('Y');
if ($ct_campaign_id == 1 || $ct_holiday_id == 1) {
$seo_year++;
}
if ($_GET['seo']) {
echo $market_id . 'zz';
}