本文整理汇总了PHP中general类的典型用法代码示例。如果您正苦于以下问题:PHP general类的具体用法?PHP general怎么用?PHP general使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了general类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clientezona
function clientezona()
{
$dataClienteZona = new ClienteZona();
$opciones = new general();
$zona = new Zona();
$cliente = new Cliente();
$url = "/" . $_REQUEST['url'];
$id = $_REQUEST['id'] != '' ? $_REQUEST['id'] : 1;
$data['Opcion'] = $opciones->buscaOpcionexurl($url);
$data['Modulo'] = $opciones->buscaModulosxurl($url);
$tamanio = 10;
$data['ClienteZona'] = $dataClienteZona->listado($id, $tamanio);
$total = count($data['ClienteZona']);
for ($i = 0; $i < $total; $i++) {
if ($data['ClienteZona'][$i]['idcliente'] != '' && $data['ClienteZona'][$i]['idcliente'] != 0) {
$data['ClienteZona'][$i]['nombrecli'] = $cliente->nombrexid($data['ClienteZona'][$i]['idcliente']);
}
if ($data['ClienteZona'][$i]['idzona'] != '' && $data['ClienteZona'][$i]['idzona'] != 0) {
$data['ClienteZona'][$i]['nombrezona'] = $zona->nombrexid($data['ClienteZona'][$i]['idzona']);
}
}
$data['Paginacion'] = 1;
$data['Pagina'] = 1;
$this->view->show("/mantenimiento/clientezona.phtml");
}
示例2: indexAction
function indexAction()
{
if (isset($_POST['check'])) {
if ($_POST['FORM']['ua'] == 'on') {
$_POST['FORM']['ua'] = 1;
} else {
$_POST['FORM']['ua'] = 0;
}
if ($_POST['FORM']['en'] == 'on') {
$_POST['FORM']['en'] = 1;
} else {
$_POST['FORM']['en'] = 0;
}
if ($_POST['FORM']['fr'] == 'on') {
$_POST['FORM']['fr'] = 1;
} else {
$_POST['FORM']['fr'] = 0;
}
if ($_POST['FORM']['esp'] == 'on') {
$_POST['FORM']['esp'] = 1;
} else {
$_POST['FORM']['esp'] = 0;
}
if ($_POST['FORM']['ger'] == 'on') {
$_POST['FORM']['ger'] = 1;
} else {
$_POST['FORM']['ger'] = 0;
}
forms::multy_update_form($this->tablename, 1, 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
}
$sql = "SELECT * FROM languages";
$res = mysql::query_one($sql, 0);
return system::show_tpl(array('obj' => $res, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/index.php');
}
示例3: deleteAction
/**
* delete podrasdel
*/
function deleteAction()
{
$this->msg = general::messages(1, v::getI18n('backend_after_delete'));
// удаляем из таблицы Content
$_sql = 'DELETE FROM `' . $this->tablename . '` WHERE (`id`="' . $_GET['id'] . '")';
$result = mysql::just_query($_sql, 0);
return self::indexAction();
}
示例4: get_menu
function get_menu()
{
$sql = "SELECT * FROM content WHERE status=1 and action!='index' and id_parent=0";
$result = mysql::query($sql, 0);
foreach ($result as $r) {
$res .= '<li><a ' . general::active_menu($r->action) . 'href="/' . $_GET['lang'] . '/' . $r->action . '">' . $r->name_ru . '</a></li>';
}
return $res;
}
示例5: addAction
/**
* добавляем новый материал
*/
function addAction()
{
$this->table_name = $_GET['tablename'];
if ($_POST) {
// проверяем на checkbox
forms::check_box(array('status'));
// записываем в базу
forms::multy_insert_form($this->table_name, 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
}
return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
}
示例6: editAction
/**
* редактирование настроек
*/
function editAction()
{
if ($_POST) {
// записываем в базу
forms::multy_update_form_all_records($this->tablename, 'zna', 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
}
// строим запрос
$_sql = 'SELECT * FROM ' . $this->tablename . ' where status=1 order by sort';
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query($_sql, 0);
return system::show_tpl(array('result' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
}
示例7: editAction
/**
* редактируем материал
*/
function editAction()
{
if ($_POST) {
// записываем в базу
forms::multy_update_form($this->tablename, $_POST['id'], 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_POST['id'];
} else {
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id=' . $_GET['id'];
}
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query_one($_sql, 0);
return system::show_tpl(array('obj' => $result, 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/edit.php');
}
示例8: _post
function _post($response)
{
include_once "../main.php";
// ищем группы меню и проверяем на СуперАдмина
if (general::sadmin()) {
$_sql = "select * from menu where id_parent=0 and status=1 order by zindex";
} else {
$_sql = "select * from menu where id_parent=0 and status=1 and adm!=1 order by zindex";
}
$result = mysql::query($_sql, 0);
$this->menu = system::show_tpl(array('result' => $result), 'mainmenu/menu.php');
$this->center_block = $response;
echo system::show_tpl((array) $this, $this->layout);
}
示例9: indexAction
/**
* отображаем весь список материалов
*/
function indexAction()
{
// только для СуперАдмина
if (!general::sadmin()) {
return general::messages(0, v::getI18n('backend_orror_access'));
}
if ($_POST) {
// проверяем на checkbox
forms::check_box(dbh::menu_get_id());
// записываем в базу
forms::multy_update_form_all_records($this->tablename, 'status', 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
}
// строим запрос
$_sql = 'SELECT * FROM ' . $this->tablename . ' where id_parent=0 order by zindex';
// выполняем запрос + при необходимости выводим сам запрос
$result = mysql::query($_sql, 0);
return system::show_tpl(array('result' => $result, 'msg' => $this->msg), $this->tpl_folder . '/index.php');
}
示例10: addAction
/**
* добавляем новый материал
*/
function addAction()
{
if ($_POST) {
// загружаем файл
if ($_FILES) {
//$_arr=explode('.',$_FILES[file1][name]);
//$_file_name=v::toSlug($_arr[0]).'.'.$_arr[1];
preg_match('/(\\S+)\\.(\\S+)$/', $_FILES[file1][name], $_arr);
$_file_name = v::toSlug($_arr[1]) . '.' . $_arr[2];
//echo "<pre>".print_r($_FILES,1)."</pre>";
move_uploaded_file($_FILES[file1]['tmp_name'], HOST . PRICE_LIST_PATH . '/' . $_file_name);
$_POST['FORM']['pole'] = $_file_name;
}
// записываем в базу
forms::multy_insert_form($this->tablename, 0);
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
header('Location: /backend/' . $this->tpl_folder . '/index');
}
return system::show_tpl(array('msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
}
示例11: authorizeAction
/**
* мультиредактирование
*/
function authorizeAction()
{
//echo "<pre>".print_r($_POST['kt_where'] ,1)."</pre>";
foreach ($_POST['kt_where'] as $key => $value) {
//echo '<div style="width:200px; border: solid 0px red; color:#000000; background: yellow; padding: 2px; margin-left: 15px;"><b>'.$key.'</b> - '.$value.'</div>';
if ($_POST['st'] == 1) {
// авторизовуем
$_sql = "UPDATE `" . $this->tablename . "` SET `status`='1' WHERE (`id`='" . $value . "')";
$result = mysql::just_query($_sql, 0);
} else {
if ($_POST['st'] == 2) {
// авторизовуем
$_sql = "DELETE FROM `" . $this->tablename . "` WHERE (`id`='" . $value . "')";
$result = mysql::just_query($_sql, 0);
}
}
}
// сообщение
$this->msg = general::messages(1, v::getI18n('backend_after_save'));
return self::indexAction();
// редирект
//header('Location: /backend/gb/index'); ??????????????
}
示例12:
echo general::date_from_database($obj->date_news);
?>
" class="validate[required] text_1" name="FORM[date_news]" id="datepicker" style="width: 20%;">
</div>
<div class="item_1">
<label for="status" class="block title_1">Публиковать?:</label>
<input name="FORM[status]" type="checkbox" <?php
echo $obj->status == 1 ? checked : '';
?>
id="status">
</div>
<div class="item_1 textcenter">
<?php
echo general::link_to($tpl_folder . '/index', 'Вернуться к общему списку');
?>
<input type="submit" name="submit" value="Сохранить">
</div>
</div>
<input name="id" type="hidden" value="<?php
echo $obj->id;
?>
">
</form>
<script type="text/javascript">
$(document).ready(function(){
示例13: error_reporting
}
// если печатаем страницу
if (isset($_GET['action']) and $_GET['action'] == "print") {
require HOST . "/ctrl/print/print.php";
exit;
}
if (DEBUG_SITE == 1) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
}
if (DEBUG_SITE == 1) {
// время
$profiler->enterSection('center');
}
// выводим контентовую часть
$_str = general::center();
if (DEBUG_SITE == 1) {
// время
$profiler->leaveSection('center');
}
/*
* данный блок используется ЕСЛИ НЕОБХОДИМО ПОДСТАВЛЯТЬ НЕСКОЛЬКО ШАБЛОНОВ (начало)
*/
// подставляем необходимый шаблон
/*
$name_file="/tpl/index_full.tpl.html";
if (isset($_GET['action'])) {
switch ($_GET['action']) {
示例14: __
" id="image" style="margin:0; border: 0px;" />
<a style="display:block; font:11px/1.2em Arial;" href="#" onclick="document.getElementById('image').src = '/plagin/captcha/securimage_show.php?sid=' + Math.random(); return false"><?php
echo __('update_image');
?>
</a>
</td>
</tr>
</table>
</div>
<div class="row sdvig">
<input type="submit" class="but" value="<?php
echo __('send');
?>
" name="submit" />
</div>
</form>
<?endif?>
<?endforeach?>
</div>
</div>
<!-- сообщения -->
<?php
echo general::global_massage();
?>
<!-- сообщения -->
</body>
</html>
示例15: foreach
<?php
if (!empty($meja_list)) {
$no = 1;
foreach ($meja_list as $meja) {
?>
<tr>
<td><?php
echo $no;
?>
</td>
<td><?php
echo $meja->no_meja;
?>
</td>
<td style="text-align: center;"><?php
echo general::status($meja->status);
?>
</td>
<td style="text-align: center;"><a href="<?php
echo site_url('page=meja&act=meja_reset&id=' . $this->encrypt->encode_url($meja->id));
?>
" onclick="return confirm('Reset Meja ?')"><i class="fa fa-recycle"></i> Kosongkan</a></td>
<td style="text-align: center;"><a href="<?php
echo site_url('page=meja&act=meja_hapus&id=' . $this->encrypt->encode_url($meja->id));
?>
" onclick="return confirm('Hapus Meja ?')"><i class="fa fa-remove"></i> Hapus</a></td>
</tr>
<?php
$no++;
}
}