function __construct($SET) { $this->id = i(); html::addJsFile(sysURL . 'core/js/qgSettingsEditor.js'); $this->SET = $SET; $_SESSION['qgSettingsEditor roots'][$SET->i] = 1; }
public function index($start = 0) { $this->load->library("admin"); $this->session->set_userdata("URL_BACK", uri_string()); $items = ITEMS_POR_PAG; $this->load->library("admin"); $items_lista = crearConsulta("SELECT p FROM " . $this->entityStr . " p"); $this->load->library('pagination'); $config['base_url'] = site_url($this->ctrlPath . "/index"); $config['total_rows'] = count($items_lista->execute()); $config['per_page'] = $items; $config['uri_segment'] = 3; //1->Controlador, 2->Metodo, 3 en adelante son los argumentos $this->pagination->initialize($config); $items_lista->setMaxResults($items)->setFirstResult($start); $this->admin->listado($items_lista->execute()); $this->admin->campos($this->camposTabla); $this->admin->id("id"); $this->admin->titulos($this->titulosTabla); if ($this->accionesDefault) { $this->acciones = array("agregar" => array("url" => $this->ctrlPath . "agregar"), "editar" => array("url" => $this->ctrlPath . "/editar", "texto" => icon("fa-pencil") . " Editar", "propiedades" => array("class" => "btn-primary")), "eliminar" => array("texto" => i("", array("class" => "glyphicon glyphicon-remove")) . " Eliminar", "url" => $this->ctrlPath . "/eliminar", "propiedades" => array("class" => "eliminar_link btn-danger"))); } $this->admin->acciones($this->acciones); if ($this->vistaPre !== NULL) { $this->admin->agregarVistaPre($this->vistaPre, $this->datosPre); } $this->admin->titulo($this->tituloMaestro); $this->admin->show(); }
public function render() { // Here comes the rendering process //classes $footerClass = "impressum stdanimation1_2"; //array mit link, icon, label // mit i übersetzen $footerArray[] = array("link" => "index.php?view=impressum", "icon" => "icon_house_alt", "label" => "Impressum"); $footerArray[] = array("link" => "index.php?view=contact", "icon" => "icon_tag", "label" => "Contact"); $footerArray[] = array("link" => "index.php?view=version", "icon" => "icon_profile", "label" => "Shop version"); $footerArray[] = array("link" => "index.php?view=support", "icon" => "icon_gift", "label" => "Support"); $footerList = ""; //create a list item for every array found $footerList = ""; foreach ($footerArray as $footerpoint) { //do translation $footerpoint["label"] = i($footerpoint["label"]); $footerList .= ' <div class="' . $footerClass . '" ><a href="' . $footerpoint["link"] . '">' . $footerpoint["label"] . '</a></div> '; } return $footerList; /* return '<div class="impressum stdanimation1_2">Impressum</div> <div class="impressum stdanimation1_2">Kontakt</div> <div class="impressum stdanimation1_2">Shopversion</div> <div class="impressum stdanimation1_2">Über uns</div> <div class="impressum stdanimation1_2">Support Hotline</div>'; */ }
public function notifyNewArgument(Question $q, Argument $a) { global $sDB, $sTimer, $sTemplate; $sTimer->start("notifyNewArgument"); $res = $sDB->exec("SELECT `notifications`.`userId`, `notifications`.`flags`, `users`.`email`, `users`.`userName` FROM `notifications`\n LEFT JOIN `users` ON `users`.`userId` = `notifications`.`userId`\n WHERE `questionId` = '" . i($q->questionId()) . "';"); while ($row = mysql_fetch_object($res)) { // no notifications for our own arguments. /*if($a->userId() == $row->userId) { continue; }*/ $uId = new BaseConvert($row->userId); $qId = new BaseConvert($q->questionId()); $profileUrl = $sTemplate->getShortUrlBase() . "u" . $uId->val(); $unfollowUrl = $sTemplate->getShortUrlBase() . "f" . $qId->val(); $url = $a->shortUrl(); if (!SHORTURL_BASE) { $profileUrl = $sTemplate->getRoot() . "user/" . $row->userId . "/"; $unfollowUrl = $sTemplate->getRoot() . "unfollow.php?qId=" . $q->questionId(); $url = $a->fullurl(); } $subject = $sTemplate->getString("NOTIFICATION_NEW_ARGUMENT_SUBJECT"); $message = $sTemplate->getString("NOTIFICATION_NEW_ARGUMENT_BODY", array("[USERNAME]", "[AUTHOR]", "[URL]", "[QUESTION]", "[ARGUMENT]", "[UNFOLLOW_URL]", "[PROFILE_URL]"), array($row->userName, $a->author(), $url, $q->title(), $a->headline(), $unfollowUrl, $profileUrl)); $this->sendMail($row->email, "", $subject, $message); } $sTimer->stop("notifyNewArgument"); }
/** * constructor */ public function __construct() { $this->major = self::getVersion(i(self::VERSION_PART_MAJOR)); $this->minor = self::getVersion(i(self::VERSION_PART_MINOR)); $this->revision = self::getVersion(i(self::VERSION_PART_REVISION)); $this->build = self::getVersion(i(self::VERSION_PART_BUILD)); }
public function Argument($argumentId, $row = false, $parent = false) { global $sDB, $sQuery; if (!$row) { $res = $sDB->exec("SELECT * FROM `arguments` WHERE `argumentId` = '" . i($argumentId) . "' LIMIT 1;"); $row = mysql_fetch_object($res); } if (!$row) { $this->argumentId = -1; return; } $this->argumentId = $argumentId; $this->questionId = $row->questionId; $this->parentId = $row->parentId; $this->parent = $parent; $this->userId = $row->userId; $this->username = $sQuery->getUsernameById($row->userId); $this->headline = $row->headline; $this->abstract = $row->abstract; $this->details = $row->details; $this->dateAdded = $row->dateAdded; $this->type = $row->type; $this->score = $row->score; $this->url = $row->url; $this->timeSince = timeSinceString($row->dateAdded); $this->arguments = array(); }
function new_dropoff_transaction() { $s = q("insert into transaction values('', NULL, '', CURDATE());"); if (a() > 0) { return i(); } return false; }
function create_aid($name) { $s = q("insert into aid values('','" . clean_query($name) . "','0');"); if (a() > 0) { return i(); } return false; }
function create_product($name, $quantity) { $s = q("insert into product values('', '" . $name . "', '" . $quantity . "');"); if (a() > 0) { return i(); } return false; }
public function remove(Charcoal_Integer $index, Charcoal_Integer $length = NULL) { if (!$length) { $length = i(1); } $index = $index->getValue(); $length = $length->getValue(); return array_splice($this->values, $index, $length); }
public static function getTranslatedGenres() { $list = static::findList(null, array('id', 'key')); $genres = array(); foreach ($list as $row) { $genres[] = array('value' => $row['id'], 'label' => i('db_genre_key_' . $row['key'])); } return $genres; }
function param($name, $default_value = false) { global $QUERY; $return = i($QUERY, $name); if (!$return and $default_value === false) { die("Neccessary Parameter Missing: {$name}"); } return $return; }
function array_to_string($result) { $data = i('IP,PING次数,掉包量' . "\n"); //栏目名称 $size_result = sizeof($result); for ($i = 0; $i < $size_result; $i++) { $data .= i($result[$i]['IP']) . ',' . i($result[$i]['PING']) . ',' . i($result[$i]['TIME_OUT']) . "\n"; } return $data; }
public function question() { $LoginLogic = D('Login', 'Logic'); $studentID = $LoginLogic->apiLoginCheck(); $paperID = I('post.paperID'); $num = i('post.q'); $examLogic = D('Exam', 'Logic'); $question = $examLogic->getQuestion($paperID, $num); $this->ajaxReturn($question); }
public function ajaxWiki() { $query = isset($_REQUEST['query']) ? $_REQUEST['query'] : null; $result = Utilities::wiki($query); if (!$result) { $result = i('We could not find a suitable wikipedia article'); } // we will return the value as json encoded content return json_encode(array('query' => $query, 'wiki' => $result)); }
/** * 验证用户名是否存在 */ public function ajax_check_name() { $name = i('username', '', 'trim'); $id = i('id', 0, 'intval'); if ($this->_mod->name_exists($name, $id)) { echo 0; } else { echo 1; } }
private function _getShowCase($genre, $page = 0, $size = 4) { $books = $this->_getBooksByGenre($genre, $page, $size); $num_books = Core::instance()->getDb()->countBookyByGenre($genre); if (count($books) == 0) { return null; } $args = array('books' => $books, 'style' => 'showcase', 'text_details' => i('To the details'), 'navigation' => true, 'prev_hidden' => $num_books <= $size, 'next_hidden' => count($books) < $size, 'config' => urlencode(json_encode(array('page' => $page, 'size' => $size, 'request' => Controller::instance()->getViewUrl() . '&ajax=1&ajax_fn=nextShowcasePage&page={%page%}&size={%size%}&genre=' . $genre)))); return TemplateRenderer::instance()->extendedRender('theme/templates/snippets/showcase.html', $args); }
function array_to_string($result) { $data = i('网络,机房,PING_IP,掉包数,掉包率(%)' . "\n"); //栏目名称 $size_result = sizeof($result); for ($i = 0; $i < $size_result; $i++) { $data .= i($result[$i]['NAME']) . ',' . i($result[$i]['MROOM_NAME']) . ',' . i($result[$i]['PING_IP']) . ',' . i($result[$i]['TIME_OUT']) . ',' . i($result[$i]['PREC_TIME_OUT']) . "\n"; } return $data; }
function array_to_string($result) { $data = i('用户名,时长(分钟),流入(MB),流出(MB),总流量(MB),主要流量分布' . "\n"); //栏目名称 $size_result = sizeof($result); for ($i = 0; $i < $size_result; $i++) { $data .= i($result[$i]['VPN_USER']) . ',' . i($result[$i]['TOTALTIME']) . ',' . i($result[$i]['SEND_BYTES']) . ',' . i($result[$i]['RECEIVE_BYTES']) . ',' . i($result[$i]['TOTALBYTES']) . ',' . i($result[$i]['REMARKS']) . "\n"; } return $data; }
public function index() { /*页面跳转选项*/ //$this->redirect('edit','',3,'跳转界面'); //$this->success('跳转成功',U('User/login'),3); //$this->error('出错了,跳转失败',U('User/login'),5); //$this->ajaxReturn(getTestdata(),'xml'); /*获取输入变量*/ $server = i('server.HTTP_HOST'); dump($server); }
public function render() { if (!static::$enabled) { return ''; } $html = ''; foreach (static::$path as $folder) { $html .= ($html == '' ? '' : '<span class="arrow_carrot-right arrow"></span>') . '<a href="' . $folder['link'] . '" target="_self">' . $folder['name'] . '</a>'; } return '<div class="breadcrumb">' . i('Your are here:') . ' ' . $html . '</div>'; }
/** * Write file * * @param Charcoal_String $mode File access mode * * @return Charcoal_Integer Written size in bytes */ public function write($data) { if (!$this->fp) { _throw(new Charcoal_FileOutputException($this->file->getPath())); } $ret = fwrite($this->fp, $data); if ($ret === FALSE) { _throw(new Charcoal_FileOutputException($this->file->getPath())); } return i($ret); }
/** * 这个文件定义了一系列全局函数,用来操作APP * @author ryan <*****@*****.**> */ function init_var() { // don't use $_SERVER['REDIRECT_URL'], it is not good for urldecode() $GLOBALS['req_uri'] = $req_uri = reset(explode('?', $_SERVER['REQUEST_URI'])); define('SELF_PAGE', $req_uri); $arr = explode('/', trim($req_uri, '/')); // we should use function here $GLOBALS['by_ajax'] = i($_REQUEST['is_ajax']) || strtolower(i($_SERVER['HTTP_X_REQUESTED_WITH'])) == strtolower('XMLHttpRequest'); $GLOBALS['by_post'] = strtolower(i($_SERVER['REQUEST_METHOD'])) == 'post'; $GLOBALS['page'] = array('title' => $GLOBALS['config']['site']['name'], 'head' => array(), 'scripts' => array(), 'styles' => array(), 'append_divs' => array()); // 关于这个页面的变量 }
public function roleDel() { $id = i('id'); $role = M('Role'); $where = array('id' => $id); $res = $role->where($where)->delete(); if ($res) { $this->crmSuccess('删除成功'); } else { $this->crmError('删除失败'); } }
function create_bag($name, $source_bagid) { $s = q("insert into bag values('', '" . clean_query($name) . "')"); if (a() == 0) { return false; } $bagid = i(); if ($source_bagid != 'none') { copy_bag_contents($source_bagid, $bagid); } return $bagid; }
function array_to_string($result) { if (empty($result)) { return i("没有符合您要求的数据!"); } $data = i('快递单号, 快递公司, 收件人, 收件人手机, 收件地址, 登记时间') . "\n"; $size_result = sizeof($result); for ($i = 0; $i < $size_result; $i++) { $data .= '="' . i($result[$i]['out_id']) . '",' . i($result[$i]['express']) . ',' . i($result[$i]['owner_name']) . ',' . '="' . i($result[$i]['owner_mobile']) . '",' . i($result[$i]['address']) . ',' . '="' . i($result[$i]['sign_time']) . "\"\n"; } return $data; }
/** * テスト */ public function test($action, $context) { $action = us($action); $cache_driver = Charcoal_Factory::createObject(s('memcache'), s('cache_driver'), s('Charcoal_ICacheDriver')); Charcoal_Cache::register(s('memcache'), $cache_driver); switch ($action) { case "get_empty_data": Charcoal_Cache::delete(s('foo')); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(FALSE, $value); return TRUE; case "get_integer_data": Charcoal_Cache::set(s('foo'), i(100)); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(i(100), $value); return TRUE; case "get_string_data": Charcoal_Cache::set(s('foo'), s('bar')); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(s('bar'), $value); return TRUE; case "get_array_data": $data = array('foo' => 100, 'bar' => 'baz'); Charcoal_Cache::set(s('foo'), v($data)); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(v($data), $value); return TRUE; case "get_boolean_data": Charcoal_Cache::set(s('foo'), b(TRUE)); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(b(TRUE), $value); Charcoal_Cache::set(s('foo'), b(FALSE)); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(b(FALSE), $value); return TRUE; case "get_float_data": Charcoal_Cache::set(s('foo'), f(3.14)); $value = Charcoal_Cache::get(s('foo')); $this->assertEquals(f(3.14), $value); return TRUE; case "get_object_data": $data = new Charcoal_DTO(); $data['foo'] = 100; $data['bar'] = 'test'; Charcoal_Cache::set(s('foo'), $data); $value = Charcoal_Cache::get(s('foo')); echo "value:" . print_r($value, true) . eol(); $this->assertEquals($data, $value); return TRUE; } return FALSE; }
private function load($group) { global $sDB; if (@$this->cache[$group]) { return true; } $this->cache[$group] = array(); $res = $sDB->exec("SELECT * FROM `permissions` WHERE `groupId` = '" . i($group) . "';"); while ($row = mysql_fetch_object($res)) { $this->cache[$group][$row->action] = $row->state; } return true; }
function array_to_string($result) { if (empty($result)) { return i("没有符合您要求的数据!^_^"); } $data = '书ID,书名' . "\n"; //栏目名称 $size_result = sizeof($result); for ($i = 0; $i < $size_result; $i++) { $data .= i($result[$i]['name']) . ',' . i($result[$i]['option']) . "\n"; } return $data; }
/** * *导出数据转换 * * @param * $result * */ function array_to_string($result) { $data = ''; foreach ($result as $v) { $line = ''; foreach ($v as $vo) { $line .= i($vo) . ','; } $line = rtrim($line, ','); $data .= $line . "\n"; } return $data; }