本文整理汇总了PHP中_page函数的典型用法代码示例。如果您正苦于以下问题:PHP _page函数的具体用法?PHP _page怎么用?PHP _page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perkara
public function perkara()
{
if ($this->session->userdata('admin_valid') == FALSE && $this->session->userdata('admin_id') == "") {
$this->session->set_flashdata("k", "<div id=\"alert\" class=\"alert alert-error\">Maaf Anda belum login. Silakan login terlebih dahulu</div>");
redirect("logins/login");
}
//ambil variabel URL
$act = $this->uri->segment(3);
$id_dispu = $this->uri->segment(4);
$cari = addslashes($this->input->post('q'));
//ambil variabel Postingan
$id_perkara = addslashes($this->input->post('id_perkara'));
$no_agenda = addslashes($this->input->post('no_agenda'));
$tanggal_perkara = addslashes($this->input->post('tanggal_perkara'));
$nama_tersangka = addslashes($this->input->post('nama_tersangka'));
$id_jaksa = addslashes($this->input->post('id_jaksa'));
$perkara = addslashes($this->input->post('perkara'));
$cari = addslashes($this->input->post('q'));
/* pagination */
$total_row = $this->db->query("SELECT * FROM perkara p, jaksa j WHERE p.id_jaksa=j.id_jaksa")->num_rows();
$per_page = 150000;
$awal = $this->uri->segment(4);
$awal = empty($awal) || $awal == 1 ? 0 : $awal;
//if (empty($awal) || $awal == 1) { $awal = 0; } { $awal = $awal; }
$akhir = $per_page;
$a['pagi'] = _page($total_row, $per_page, 4, base_url() . "manajemen_perkara/perkara/" . $id_dispu . "/p");
$a['jaksa_list'] = $this->web_model->get_dropdown_list();
if ($act == "del") {
$this->db->query("DELETE FROM perkara WHERE id_perkara = '{$id_dispu}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">No agenda : {$no_agenda} berhasil dihapus </div>");
redirect('manajemen_perkara/perkara/');
} else {
if ($act == "add") {
$a['page'] = "manajemen_perkara/f_perkara";
} else {
if ($act == "edt") {
$a['data'] = $this->db->query("SELECT * FROM perkara WHERE id_perkara = '{$id_dispu}'")->row();
$a['page'] = "manajemen_perkara/f_perkara";
} else {
if ($act == "act_add") {
$this->db->query("INSERT INTO perkara(\t`id_perkara` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`no_agenda` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tanggal_perkara` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`nama_tersangka` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`perkara` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`id_jaksa`\n\t\t\t\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\tVALUES (NULL, '{$no_agenda}','{$tanggal_perkara}', '{$nama_tersangka}', '{$perkara}','{$id_jaksa}')");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">No agenda : {$no_agenda} berhasil ditambahkan</div>");
redirect('manajemen_perkara/perkara/');
} else {
if ($act == "act_edt") {
$this->db->query("UPDATE perkara SET no_agenda = '{$no_agenda}', tanggal_perkara = '{$tanggal_perkara}', nama_tersangka = '{$nama_tersangka}',perkara = '{$perkara}', id_jaksa = '{$id_jaksa}' WHERE id_perkara = '{$id_perkara}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">No agenda : {$no_agenda} berhasil diubah</div>");
redirect('manajemen_perkara/perkara/');
} else {
$a['data'] = $this->db->query("SELECT p.*,j.* FROM perkara p, jaksa j WHERE p.id_jaksa=j.id_jaksa order by p.tanggal_perkara asc LIMIT {$awal}, {$akhir} ")->result();
$a['page'] = "manajemen_perkara/l_perkara";
}
}
}
}
}
$this->load->view('admin/index', $a);
}
示例2: __construct
public function __construct()
{
$this->queue = new stdClass();
$this->base = new stdClass();
$this->uid = '';
$this->session = '';
$this->page = _page();
$this->browser = v_server('HTTP_USER_AGENT');
$this->ip = htmlspecialchars(v_server('REMOTE_ADDR'));
foreach (w('write replace remove') as $row) {
$this->queue->{$row} = w();
}
return;
}
示例3: klas_surat
public function klas_surat()
{
if ($this->session->userdata('admin_valid') == FALSE && $this->session->userdata('admin_id') == "") {
$this->session->set_flashdata("k", "<div id=\"alert\" class=\"alert alert-error\">Maaf Anda belum login. Silakan login terlebih dahulu</div>");
redirect("logins/login");
}
/* pagination */
$total_row = $this->db->query("SELECT * FROM ref_klasifikasi")->num_rows();
$per_page = 15000;
$awal = $this->uri->segment(4);
$awal = empty($awal) || $awal == 1 ? 0 : $awal;
//if (empty($awal) || $awal == 1) { $awal = 0; } { $awal = $awal; }
$akhir = $per_page;
$a['pagi'] = _page($total_row, $per_page, 4, base_url() . "klasifikasi_surat/klas_surat/p");
//ambil variabel URL
$act = $this->uri->segment(3);
$idu = $this->uri->segment(4);
$cari = addslashes($this->input->post('q'));
//ambil variabel Postingan
$idp = addslashes($this->input->post('idp'));
$nama = addslashes($this->input->post('nama'));
$uraian = addslashes($this->input->post('uraian'));
$cari = addslashes($this->input->post('q'));
if ($act == "cari") {
$a['data'] = $this->db->query("SELECT * FROM ref_klasifikasi WHERE nama LIKE '%{$cari}%' OR uraian LIKE '%{$cari}%' OR kode LIKE '%{$cari}%' ")->result();
$a['page'] = "referensi/l_klas_surat";
$a['cari'] = $cari;
} else {
if ($act == "add") {
$a['page'] = "f_klas_surat";
} else {
if ($act == "edt") {
$a['datpil'] = $this->db->query("SELECT * FROM ref_klasifikasi WHERE id = '{$idu}'")->row();
$a['page'] = "referensi/f_klas_surat";
} else {
if ($act == "act_edt") {
$this->db->query("UPDATE ref_klasifikasi SET nama = '{$nama}', uraian = '{$uraian}' WHERE id = '{$idp}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil diubah</div>");
redirect('klasifikasi_surat/klas_surat');
} else {
$a['data'] = $this->db->query("SELECT * FROM ref_klasifikasi LIMIT {$awal}, {$akhir} ")->result();
$a['page'] = "referensi/l_klas_surat";
}
}
}
}
$this->load->view('admin/index', $a);
}
示例4: __construct
public function __construct()
{
$sql = 'SELECT *
FROM _config';
$this->config = sql_rowset($sql, 'config_name', 'config_value');
if ($this->v('site_disable')) {
exit('not_running');
}
$address = $this->v('site_address');
$host_addr = array_key(explode('/', array_key(explode('//', $address), 1)), 0);
if ($host_addr != get_host()) {
$allow_hosts = get_file(XFS . XCOR . 'store/domain_alias');
foreach ($allow_hosts as $row) {
if (substr($row, 0, 1) == '#') {
continue;
}
$remote = strpos($row, '*') === false;
$row = !$remote ? str_replace('*', '', $row) : $row;
$row = str_replace('www.', '', $row);
if ($row == get_host()) {
$sub = str_replace($row, '', get_host());
$sub = f($sub) ? $sub . '.' : ($remote ? 'www.' : '');
$address = str_replace($host_addr, $sub . $row, $address);
$this->v('site_address', $address, true);
break;
}
}
}
if (strpos($address, 'www.') !== false && strpos(get_host(), 'www.') === false && strpos($address, get_host())) {
$page_protocol = array_key(explode('//', _page()), 0);
$a = $this->v('site_address') . str_replace(str_replace('www.', '', $page_protocol . $address), '', _page());
redirect($a, false);
}
$this->cache_dir = XFS . XCOR . 'cache/';
if (is_remote() && @file_exists($this->cache_dir) && @is_writable($this->cache_dir) && @is_readable($this->cache_dir)) {
$this->cache_f = true;
}
//
// Load additional objects.
//
$this->email = _import('emailer');
$this->cache = _import('cache');
return;
}
示例5: _uniqid
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
_query("DELETE FROM\n\t tg_flower\n\t WHERE\n\t tg_id\n\t IN\n\t ({$_clean['ids']})");
if (_affected_rows()) {
_close();
_location('花朵删除成功', 'member_flower.php');
} else {
_close();
_alert_back('花朵删除失败');
}
} else {
_alert_back('非法登录');
}
}
//分页模块
global $_pagesize, $_pagenum;
_page("SELECT tg_id FROM tg_flower WHERE tg_touser='{$_COOKIE['username']}'", 15);
//第一个参数获取总条数,第二个参数,指定每页多少条
$_result = _query("SELECT\n tg_id,tg_fromuser,tg_flower,tg_content,tg_date\n FROM\n tg_flower\n WHERE\n tg_touser='{$_COOKIE['username']}'\n ORDER BY\n tg_date DESC\n LIMIT\n {$_pagenum},{$_pagesize}\n ");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
<script src="js/member_message.js"></script>
</head>
<body>
<?php
示例6: session_start
* Copy 2010-2012 yc60
* Web: http://www.yc60.com
* ================================================
* Author: Lee
* Date: 2010-8-23
*/
session_start();
//定义个常量,用来授权调用includes里面的文件
define('IN_TG', true);
//定义个常量,用来指定本页的内容
define('SCRIPT', 'blog');
//引入公共文件
require dirname(__FILE__) . '/includes/common.inc.php';
//分页模块
global $_pagesize, $_pagenum, $_system;
_page("SELECT tg_id FROM tg_user", $_system['blog']);
//第一个参数获取总条数,第二个参数,指定每页多少条
//首页要得到所有的数据总和
//从数据库里提取数据获取结果集
//我们必须是每次重新读取结果集,而不是从新去执行SQL语句
$_result = _query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_id,tg_username,tg_sex,tg_face \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_user \r\n\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_reg_time DESC \r\n\t\t\t\t\t\t\t\t\t LIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}\r\n\t\t\t\t\t\t\t");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
<script type="text/javascript" src="js/blog.js"></script>
</head>
示例7: session_start
* Web: http://www.yc60.com
* ================================================
* Author:zhangshuhui
* Date: 2014-6-15
*/
//定义个常量,用来授权调用includes里面的文件
session_start();
define('IN_TG', true);
//定义一个常量,用来指定本页的内容
define('SCRIPT', 'index');
//引入公共文件
require dirname(__FILE__) . '/includes/common.inc.php';
//转换成硬路径,速度更快
$_percent = 0.8;
global $_pagesize, $_pagenum;
_page("SELECT id FROM tb_food", 6);
//第一个参数获取总条数,第二个参数,指定每页多少条
$_result = _query("SELECT id,name,pic,price FROM tb_food");
$_result2 = _query("SELECT id,name,pic FROM tb_food WHERE recommend = '1' LIMIT 1");
$_result3 = _query("SELECT id,name,pic FROM tb_food WHERE recommend = '1' ORDER BY date_time LIMIT 1");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统——首页</title>
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="js/slide.js"></script>
示例8: _html
$_html['id'] = $_rows['tg_id'];
$_html['sid'] = $_rows['tg_sid'];
$_html['name'] = $_rows['tg_name'];
$_html['url'] = $_rows['tg_url'];
$_html['username'] = $_rows['tg_username'];
$_html['readcount'] = $_rows['tg_readcount'];
$_html['commendcount'] = $_rows['tg_commendcount'];
$_html['date'] = $_rows['tg_date'];
$_html['content'] = $_rows['tg_content'];
$_html = _html($_html);
//创建一个全局变量,做个带参的分页
global $_id;
$_id = 'id=' . $_html['id'] . '&';
//读取评论
global $_pagesize, $_pagenum, $_page;
_page("SELECT tg_id FROM tg_photo_commend WHERE tg_sid='{$_html['id']}'", 10);
$_result = _query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\ttg_username,tg_title,tg_content,tg_date\r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\ttg_photo_commend \r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\ttg_sid='{$_html['id']}'\r\n\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ttg_date ASC \r\n\t\t\t\t\t\t\t\t LIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}\r\n\t\t");
//上一页,取得比自己大的ID中,最小的那个即可。
$_html['preid'] = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin(tg_id) \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_photo \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_sid='{$_html['sid']}' \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id>'{$_html['id']}'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t\t");
if (!empty($_html['preid']['id'])) {
$_html['pre'] = '<a href="photo_detail.php?id=' . $_html['preid']['id'] . '#pre">上一页</a>';
} else {
$_html['pre'] = '<span>到头了</span>';
}
//下一页,取得比自己小的ID中,最大的那个即可。
$_html['nextid'] = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax(tg_id) \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_photo \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_sid='{$_html['sid']}' \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id<'{$_html['id']}'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t\t");
if (!empty($_html['nextid']['id'])) {
$_html['next'] = '<a href="photo_detail.php?id=' . $_html['nextid']['id'] . '#next">下一页</a>';
} else {
$_html['next'] = '<span>到底了</span>';
}
示例9: masuk
public function masuk()
{
if ($this->session->userdata('admin_valid') == FALSE && $this->session->userdata('admin_id') == "") {
$this->session->set_flashdata("k", "<div id=\"alert\" class=\"alert alert-error\">Maaf Anda belum login. Silakan login terlebih dahulu</div>");
redirect("logins/login");
}
/* pagination */
$total_row = $this->db->query("SELECT * FROM surat_masuk")->num_rows();
$per_page = 15000;
$awal = $this->uri->segment(4);
$awal = empty($awal) || $awal == 1 ? 0 : $awal;
//if (empty($awal) || $awal == 1) { $awal = 0; } { $awal = $awal; }
$akhir = $per_page;
$a['pagi'] = _page($total_row, $per_page, 4, base_url() . "surat_masuk/masuk/p");
//ambil variabel URL
$act = $this->uri->segment(3);
$idu = $this->uri->segment(4);
$cari = addslashes($this->input->post('q'));
//ambil variabel Postingan
$id_surat_masuk = addslashes($this->input->post('id_surat_masuk'));
$no_agenda = addslashes($this->input->post('no_agenda'));
$index_surat_masuk = addslashes($this->input->post('index_surat_masuk'));
$kode_surat_masuk = addslashes($this->input->post('kode_surat_masuk'));
$asal_surat_masuk = addslashes($this->input->post('asal_surat_masuk'));
$no_surat_masuk = addslashes($this->input->post('no_surat_masuk'));
$status_surat_masuk = addslashes($this->input->post('status_surat_masuk'));
$tgl_surat_masuk = addslashes($this->input->post('tgl_surat_masuk'));
$perihal_surat_masuk = addslashes($this->input->post('perihal_surat_masuk'));
$keterangan = addslashes($this->input->post('keterangan'));
$status_disposisi = addslashes($this->input->post('status_disposisi'));
$cari = addslashes($this->input->post('q'));
//upload config
$config['upload_path'] = './upload/surat_masuk';
$config['allowed_types'] = 'gif|jpg|png|pdf|doc|docx';
$config['max_size'] = '2000';
$config['max_width'] = '3000';
$config['max_height'] = '3000';
$this->load->library('upload', $config);
if ($act == "del") {
$this->db->query("DELETE FROM surat_masuk WHERE id_surat_masuk = '{$idu}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil dihapus </div>");
redirect('surat_masuk/masuk');
} else {
if ($act == "cari") {
$a['data'] = $this->db->query("SELECT * FROM surat_masuk WHERE perihal_surat_masuk LIKE '%{$cari}%' OR index_surat_masuk LIKE '%{$cari}%' OR asal_surat_masuk LIKE '%{$cari}%' OR no_surat_masuk LIKE '%{$cari}%' ORDER BY id DESC")->result();
$a['page'] = "surat_masuk/l_surat_masuk";
} else {
if ($act == "add") {
$a['page'] = "surat_masuk/f_surat_masuk";
} else {
if ($act == "edt") {
$a['datpil'] = $this->db->query("SELECT * FROM surat_masuk WHERE id_surat_masuk = '{$idu}'")->row();
$a['page'] = "surat_masuk/f_surat_masuk";
} else {
if ($act == "act_add") {
if ($this->upload->do_upload('lampiran')) {
$up_data = $this->upload->data();
$this->db->query("INSERT INTO surat_masuk VALUES (NULL, '{$kode_surat_masuk}', '{$no_surat_masuk}', '{$asal_surat_masuk}', '{$tgl_surat_masuk}', '{$status_surat_masuk}', '{$perihal_surat_masuk}', '{$index_surat_masuk}', '{$no_agenda}', '" . $up_data['file_name'] . "', NOW(), '" . $this->session->userdata('admin_id') . "', '{$keterangan}','1' )");
} else {
$this->db->query("INSERT INTO surat_masuk VALUES (NULL, '{$kode_surat_masuk}', '{$no_surat_masuk}', '{$asal_surat_masuk}', '{$tgl_surat_masuk}', '{$status_surat_masuk}', '{$perihal_surat_masuk}', '{$index_surat_masuk}', '{$no_agenda}', '', NOW(), '" . $this->session->userdata('admin_id') . "', '{$keterangan}','1')");
}
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id_surat_masuk=\"alert\">Data berhasil ditambahkan. " . $this->upload->display_errors() . "</div>");
redirect('surat_masuk/masuk');
} else {
if ($act == "act_edt") {
if ($this->upload->do_upload('lampiran')) {
$up_data = $this->upload->data();
$this->db->query("UPDATE surat_masuk SET kode_surat_masuk = '{$kode_surat_masuk}', no_surat_masuk = '{$no_surat_masuk}', asal_surat_masuk = '{$asal_surat_masuk}', tgl_surat_masuk = '{$tgl_surat_masuk}', status_surat_masuk = '{$status_surat_masuk}', perihal_surat_masuk = '{$perihal_surat_masuk}', index_surat_masuk = '{$index_surat_masuk}', no_agenda = '{$no_agenda}', keterangan = '{$keterangan}', lampiran = '" . $up_data['file_name'] . "' WHERE id_surat_masuk = '{$id_surat_masuk}'");
} else {
$this->db->query("UPDATE surat_masuk SET kode_surat_masuk = '{$kode_surat_masuk}', no_surat_masuk = '{$no_surat_masuk}', asal_surat_masuk = '{$asal_surat_masuk}', tgl_surat_masuk = '{$tgl_surat_masuk}', status_surat_masuk = '{$status_surat_masuk}', perihal_surat_masuk = '{$perihal_surat_masuk}', index_surat_masuk = '{$index_surat_masuk}', no_agenda = '{$no_agenda}', keterangan = '{$keterangan}' WHERE id_surat_masuk = '{$id_surat_masuk}'");
}
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id_surat_masuk=\"alert\">Data berhasil diubah. " . $this->upload->display_errors() . "</div>");
redirect('surat_masuk/masuk');
} else {
$a['data'] = $this->db->query("SELECT * FROM surat_masuk order by tgl_surat_masuk DESC LIMIT {$awal}, {$akhir} ")->result();
$a['page'] = "surat_masuk/l_surat_masuk";
}
}
}
}
}
}
$this->load->view('admin/index', $a);
}
示例10: _close
_close();
_alert_back('目录删除失败');
}
}
} else {
_alert_back('不存在此目录');
}
} else {
_alert_back('非法登录');
}
}
//读取数据
//设置分页参数
global $_pagenum, $_pagesize, $_system;
//第一个参数获取总条数,第二个参数指定每页多少条
_page("select tg_id from tg_dir", $_system['photo']);
//从数据库里提取数据,获取结果集
$_result = _query("select tg_id,tg_name,tg_type,tg_face from tg_dir order by tg_date desc limit {$_pagenum},{$_pagesize}");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
</head>
<body>
示例11: surat_disposisi
public function surat_disposisi()
{
if ($this->session->userdata('admin_valid') == FALSE && $this->session->userdata('admin_id') == "") {
$this->session->set_flashdata("k", "<div id=\"alert\" class=\"alert alert-error\">Maaf Anda belum login. Silakan login terlebih dahulu</div>");
redirect("logins/login");
}
//ambil variabel URL
$act = $this->uri->segment(4);
$id_suratu = $this->uri->segment(3);
$id_dispu = $this->uri->segment(5);
$cari = addslashes($this->input->post('q'));
//ambil variabel Postingan
$id_disposisi = addslashes($this->input->post('id_disposisi'));
$id_surat_masuk = addslashes($this->input->post('id_surat_masuk'));
$tujuan_disposisi = addslashes($this->input->post('tujuan_disposisi'));
$isi_instruksi = addslashes($this->input->post('isi_instruksi'));
$tgl_instruksi = addslashes($this->input->post('tgl_instruksi'));
$batas_waktu = addslashes($this->input->post('batas_waktu'));
$kini = new DateTime('now');
$kemarin = new DateTime($batas_waktu);
$kemarin->diff($kini)->format('%a hari %h jam %i menit % detik');
$datetime1 = new DateTime('now');
$datetime2 = new DateTime($batas_waktu);
$difference = $datetime1->diff($datetime2);
$waktu_lama_instruksi = $kemarin->diff($kini)->format('%a');
$paraf_kasi = addslashes($this->input->post('paraf_kasi'));
$paraf_kajari = addslashes($this->input->post('paraf_kajari'));
$tgl_disposisi = addslashes($this->input->post('tgl_disposisi'));
$catatan = addslashes($this->input->post('catatan'));
if ($paraf_kasi == '1') {
$status_disposisi = 1;
} else {
if ($paraf_kajari == '1') {
$status_disposisi = 2;
}
}
$cari = addslashes($this->input->post('q'));
/* pagination */
$total_row = $this->db->query("SELECT * FROM disposisi WHERE id_surat_masuk = '{$id_suratu}'")->num_rows();
$per_page = 15000;
$awal = $this->uri->segment(4);
$awal = empty($awal) || $awal == 1 ? 0 : $awal;
//if (empty($awal) || $awal == 1) { $awal = 0; } { $awal = $awal; }
$akhir = $per_page;
$a['pagi'] = _page($total_row, $per_page, 4, base_url() . "disposisi/surat_disposisi/" . $id_suratu . "/p");
$a['judul_surat'] = gval("surat_masuk", "id_surat_masuk", "perihal_surat_masuk", $id_suratu);
if ($act == "del") {
$this->db->query("DELETE FROM disposisi WHERE id_disposisi = '{$id_dispu}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil dihapus </div>");
redirect('disposisi/surat_disposisi/' . $id_dispu);
} else {
if ($act == "add") {
$a['page'] = "surat_disposisi/f_surat_disposisi";
} else {
if ($act == "edt") {
$a['datpil'] = $this->db->query("SELECT * FROM disposisi WHERE id_disposisi = '{$id_dispu}'")->row();
$a['page'] = "surat_disposisi/f_surat_disposisi";
} else {
if ($act == "act_add") {
$this->db->query("INSERT INTO disposisi(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`id_disposisi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`id_surat_masuk` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`isi_instruksi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tgl_instruksi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`batas_waktu` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`waktu_lama_instruksi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`paraf_kasi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`paraf_kajari` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tujuan_disposisi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tgl_disposisi` ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`catatan`\n\t\t\t\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\tVALUES (NULL, '{$id_surat_masuk}', '{$isi_instruksi}', NOW(),'{$batas_waktu}', '{$waktu_lama_instruksi}', '{$paraf_kasi}', '{$paraf_kajari}', '{$tujuan_disposisi}', NOW() , '{$catatan}')");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil ditambahkan</div>");
redirect('disposisi/surat_disposisi/' . $id_surat_masuk);
} else {
if ($act == "act_edt") {
$this->db->query("UPDATE disposisi SET tujuan_disposisi = '{$tujuan_disposisi}', isi_instruksi = '{$isi_instruksi}', batas_waktu = '{$batas_waktu}', waktu_lama_instruksi = '{$waktu_lama_instruksi}', paraf_kajari = '{$paraf_kajari}', paraf_kasi = '{$paraf_kasi}', catatan = '{$catatan}' WHERE id_disposisi = '{$id_disposisi}'");
$this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil diubah</div>");
redirect('disposisi/surat_disposisi/' . $id_surat_masuk);
} else {
$a['data'] = $this->db->query("SELECT * FROM disposisi WHERE id_surat_masuk = '{$id_suratu}' LIMIT {$awal}, {$akhir} ")->result();
$a['page'] = "surat_disposisi/l_surat_disposisi";
}
}
}
}
}
$this->load->view('admin/index', $a);
}
示例12: define
/**
*2012-7-31 | By:NaV!
*/
//防止恶意调用
define('IN_GM', true);
//定义个常量,用来指定本页的内容
define('SCRIPT', 'stu_active');
//引入公共文件
require dirname(__FILE__) . '/includes/common.inc.php';
//判断登录状态和权限
_login_state(2);
//判断是否有学生需要审核
if ($num = _num_rows("SELECT gm_active FROM gm_stuinfo WHERE gm_active='0'")) {
//分页模块
_page($num, $_system['stu_active_pagesize']);
$res = _query("SELECT gm_active,gm_username,gm_num,gm_sex,gm_grade,gm_subject,gm_type FROM gm_stuinfo WHERE gm_active='0' ORDER BY gm_num LIMIT {$pagenum},{$pagesize}");
}
//开始激活和删除处理
if (!empty($_GET['num']) and !empty($_GET['action'])) {
//判断传过来的学号是否真实存在
if (_fetch_array("SELECT gm_active FROM gm_stuinfo WHERE gm_num='{$_GET['num']}' LIMIT 1")) {
//激活
if ($_GET['action'] == pass) {
if (_query("UPDATE gm_stuinfo SET gm_active='1' WHERE gm_num='{$_GET['num']}'") and _query("UPDATE gm_user SET gm_active='1' WHERE gm_num='{$_GET['num']}'")) {
_location('审核成功!', 'stu_active.php');
} else {
_location('审核失败!', 'stu_active.php');
}
}
//删除
示例13: xs_startup
function xs_startup()
{
global $core, $user;
if (empty($this->xs_started))
{
$this->xs_started = 1;
// Adding current template
$tpl = $this->root . '/';
if (substr($tpl, 0, 2) === './')
{
$tpl = substr($tpl, 2, strlen($tpl));
}
// Adding predefined variables
$this->vars += array(
'PHP' => 'php',
'LANG' => $core->v('default_lang'),
'TEMPLATE' => $tpl,
'TEMPLATE_NAME' => $this->tpl,
'S_SERVER' => $core->v('address'),
'S_STYLE' => $core->v('address') . 'style/',
'_SELF' => _page(),
'IS_MEMBER' => (int) $user->d('is_member'),
'S_USERNAME' => _fullname($user->data),
'S_TIME' => time(),
'U_LOGIN' => _link('signin'),
'U_LOGOUT' => _link('signout'),
'U_PREFERENCES' => _link('pref'),
'U_CHAT_BACKGROUND' => _link('chat', array('x1' => 'update', 'x2' => 'background'))
);
}
}
示例14: _uniqid
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
_query("DELETE FROM \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_message \r\n\t\t\t\t\t\t\t\t WHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_id \r\n\t\t\t\t\t\t\t\t\t\t\tIN \r\n\t\t\t\t\t\t\t\t\t\t\t\t({$_clean['ids']})");
if (_affected_rows()) {
_close();
_location('短信删除成功', 'member_message.php');
} else {
_close();
_alert_back('短信删除失败');
}
} else {
_alert_back('非法登录');
}
}
//分页模块
global $_pagesize, $_pagenum;
_page("SELECT tg_id FROM tg_message WHERE tg_touser='{$_COOKIE['username']}'", 15);
//第一个参数获取总条数,第二个参数,指定每页多少条
$_result = _query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_id,tg_state,tg_fromuser,tg_content,tg_date \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_message \r\n\t\t\t\t\t\t\t\t WHERE \r\n\t\t\t\t\t\t\t\t \t\t\t\ttg_touser='{$_COOKIE['username']}'\r\n\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_date DESC \r\n\t\t\t\t\t\t\t\t\t LIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}\r\n\t\t\t\t\t\t\t");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
<script type="text/javascript" src="js/member_message.js"></script>
</head>
<body>
<?php
require ROOT_PATH . 'includes/header.inc.php';
示例15: _page
}
//read the last modification date
if ($_html['last_modify_date'] != '0000-00-00 00:00:00') {
$_html['last_modify_date_string'] = 'This post is modified by [' . $_html['username'] . '] at ' . $_html['last_modify_date'] . '.';
}
//reply to the main post
if (isset($_COOKIE['username'])) {
$_html['re'] = '<span>[<a href="#ree" name="re" title="Reply to ' . $_html['username'] . '. 1#.">Reply</a>]</span>';
}
//autograph
if ($_html['switch'] == 1) {
$_html['autograph_html'] = '<p class="autograph">' . $_html['autograph'] . '</p>';
}
//read reply
global $_pagesize, $_pagenum, $_page, $_page;
_page("SELECT tg_id FROM tg_article WHERE tg_reid='{$_html['reid']}'", 2);
$_result = _query("SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t tg_username,tg_type,tg_title,tg_content,tg_date \n\t\t\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t\t\t\t\t\t tg_article \n\t\t\t\t\t\t\t\t\t WHERE\n\t\t\t\t\t\t\t\t\t\t\t\t tg_reid='{$_html['reid']}'\n\t\t\t\t\t\t\t ORDER BY \n\t\t\t\t\t\t\t\t\t\t\t\t tg_date ASC \n\t\t\t\t\t\t\t\t\t LIMIT \n\t\t\t\t\t\t\t\t\t\t\t\t {$_pagenum},{$_pagesize}\n\t\t\t");
} else {
//The user was deleted
}
} else {
_alert_back('This post does not exist');
}
} else {
_alert_back('Illegal access');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>