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); }
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; }
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); }
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; }
_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='******'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='******'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
* 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>
* 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>
$_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>'; }
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); }
_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>
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); }
/** *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'); } } //删除
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')) ); } }
_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='******'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='******'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';
} //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>
/** *2012-8-2 | By:NaV! */ //防止恶意调用 define('IN_GM', true); //定义个常量,用来指定本页的内容 define('SCRIPT', 'notice_admin'); //引入公共文件 require dirname(__FILE__) . '/includes/common.inc.php'; //判断登录状态和权限 _login_state(2); if ($_GET['action'] == '') { $num = _num_rows("SELECT * FROM gm_notice"); //引入分页 _page($num, $_system['notice_pagesize']); $res = _query("SELECT * FROM gm_notice ORDER BY gm_time DESC LIMIT {$pagenum},{$pagesize}"); } elseif ($_GET['action'] == 'del' and $_GET['id'] != '') { if (_query("DELETE FROM gm_notice WHERE gm_id='{$_GET['id']}'")) { _alert_back('删除成功!'); } else { _alert_back('删除失败!'); } } ?> <!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
_query("DELETE FROM \n\t\t\t\t\t\t\t\t tg_flower\n\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t tg_id \n\t\t\t\t\t\t\t\t IN \n\t\t\t\t\t\t\t\t ({$_clean['ids']})"); if (_affected_rows()) { _close(); _location('Flower deleted', 'member_flower.php'); } else { _close(); _alert_back('Fail to delete'); } } else { _alert_back('Illegal access'); } } //Paging module global $_pagesize, $_pagenum; //the first parameter is the number of records and the second one is the number of records displayed on each page _page("select \n tg_id \n\t\t from \n\t\t tg_message \n\t\twhere \n\t\t tg_touser ='******'username']}'", 10); $_result = _query("select \n\t\t\t\t\t\ttg_id,tg_fromuser,tg_flower,tg_content,tg_date \n\t\t\t\t from \n\t\t\t\t \t\ttg_flower\n\t\t\t\t where\n\t\t\t\t \t\ttg_touser = '******'username']}'\n\t\t\t\t order by \n\t\t\t\t \t\ttg_date desc \n\t\t\t\t limit \n\t\t\t\t\t\t{$_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/CssLoad.inc.php'; ?> <script type="text/javascript"src="js/member_message.js"></script> </head> <body> <?php require ROOT_PATH . 'includes/header.inc.php';
_query("DELETE FROM \n\t\t\t\t\t\t tg_friend \n\t\t\t\t\t WHERE \n\t\t\t\t\t\t tg_id \n\t\t\t\t\t\t IN \n\t\t\t\t\t\t ({$_clean['ids']})"); if (_affected_rows()) { _close(); _location('Friend request deleted', 'member_friend.php'); } else { _close(); _alert_back('Fail to delete'); } } else { _alert_back('Illegal access'); } } //Paging module global $_pagesize, $_pagenum; //the first parameter is the number of records and the second one is the number of records displayed on each page _page("select \n tg_id \n\t\t from \n\t\t tg_friend\n\t\twhere \n\t\t tg_touser ='******'username']}'\n\t\t or\n\t\t tg_fromuser='******'username']}'", 10); $_result = _query("select \n\t\t\t\t\t\ttg_id,tg_state,tg_fromuser,tg_touser,tg_content,tg_date \n\t\t\t\t from \n\t\t\t\t \t\ttg_friend\n\t\t\t\t where\n\t\t\t\t \t\ttg_touser = '******'username']}'\n\t\t\t\t \t or\n\t\t tg_fromuser='******'username']}'\n\t\t\t\t order by \n\t\t\t\t \t\ttg_date desc \n\t\t\t\t limit \n\t\t\t\t\t\t{$_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/CssLoad.inc.php'; ?> <script type="text/javascript"src="js/member_message.js"></script> </head> <body> <?php require ROOT_PATH . 'includes/header.inc.php';
public function manage_admin() { 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 t_admin")->num_rows(); $per_page = 15000; $awal = mysql_real_escape_string($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() . "pengaturan/manage_admin/p"); //ambil variabel URL $act = mysql_real_escape_string($this->uri->segment(3)); $idu = mysql_real_escape_string($this->uri->segment(4)); $cari = addslashes($this->input->post('q')); //ambil variabel Postingan $idp = addslashes($this->input->post('idp')); $username = addslashes($this->input->post('username')); $password = md5(addslashes($this->input->post('password'))); $nama = addslashes($this->input->post('nama')); $jabatan = addslashes($this->input->post('jabatan')); $nip = addslashes($this->input->post('nip')); $level = addslashes($this->input->post('id_level')); $a['level_list'] = $this->web_model->get_level_list(); $cari = addslashes($this->input->post('q')); if ($act == "del") { $this->db->query("DELETE FROM pengguna WHERE id_pengguna = '{$idu}'"); $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil diubah</div>"); redirect('pengaturan/manage_admin'); } else { if ($act == "cari") { $a['data'] = $this->db->query("SELECT p.*, l.* FROM pengguna p, level l WHERE p.nama LIKE '%{$cari}%' AND p.id_level = l.id_level ORDER BY id DESC")->result(); $a['page'] = "pengaturan/l_manage_admin"; } else { if ($act == "add") { $a['page'] = "pengaturan/f_manage_admin"; } else { if ($act == "edt") { $a['datpil'] = $this->db->query("SELECT p.* , l.* FROM pengguna p, level l where p.id_level = l.id_level and p.id_pengguna = '{$idu}'")->row(); $a['page'] = "pengaturan/f_manage_admin"; } else { if ($act == "act_add") { $this->db->query("INSERT INTO pengguna VALUES (NULL, '{$username}', '{$password}', '{$nama}', '{$nip}','{$jabatan}', '{$level}')"); $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil ditambah</div>"); redirect('pengaturan/manage_admin'); } else { if ($act == "act_edt") { if ($password = md5("-")) { $this->db->query("UPDATE pengguna SET username = '******', nama = '{$nama}', nip = '{$nip}', id_level = '{$level}' WHERE id_pengguna = '{$idp}'"); } else { $this->db->query("UPDATE pengguna SET username = '******', password = '******', nama = '{$nama}', nip = '{$nip}', id_level = '{$level}' WHERE id_pengguna = '{$idp}'"); } $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data berhasil diubah </div>"); redirect('pengaturan/manage_admin'); } else { $a['data'] = $this->db->query("SELECT p.* , l.* FROM pengguna p, level l where p.id_level = l.id_level LIMIT {$awal}, {$akhir} ")->result(); $a['page'] = "pengaturan/l_manage_admin"; } } } } } } $this->load->view('admin/index', $a); }
* Web: http://www.yc60.com * ================================================ * Author:zhangshuhui * Date: 2014-6-26 */ session_start(); //定义个常量,用来授权调用includes里面的文件 define('IN_TG', true); //定义一个常量,用来指定本页的内容 define('SCRIPT', 'foodstuff'); //引入公共文件 require dirname(__FILE__) . '/includes/common.inc.php'; //转换成硬路径,速度更快 global $_pagesize, $_pagenum; $_sortid = $_GET['sort']; _page("SELECT id FROM tb_food WHERE sort='{$_sortid}'", 6); //第一个参数获取总条数,第二个参数,指定每页多少条 $_result = _query("SELECT id,name,pic FROM tb_food WHERE sort='{$_sortid}'"); ?> <!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> <?php switch ($_sortid) { case 0: echo "荤菜"; break; case 1: echo "素菜";
<?php if (!isset($_SESSION)) { session_start(); } //define the constant IN_TG to include common.inc.php define('IN_TG', true); //a constant for different scripts calling define("SCRIPT", "blog"); //include common.inc.php require dirname(__FILE__) . '/includes/common.inc.php'; //Paging module global $_pagesize, $_pagenum, $_system; _page("select tg_id from tg_user", $_system['blog']); //get data from database //Notice here we can't put this SQL statement into _fetch_array() //for this would result in forever loop. This SQL statement would execute //forever. The right thing to do is search the database once, and read the //resource handle several time with a while loop(this is what we do below) $_result = _query("select \n\t\t\t\t\t\t\t\t\ttg_id,tg_username,tg_sex,tg_profile \n\t\t\t\t \t \t\t\tfrom \n\t\t\t\t \t\t\t\t\ttg_user \n\t\t\t\t \t\t order by \n\t\t\t\t \t\t\t\t\ttg_reg_time desc \n\t\t\t\t \t\t\t limit \n\t\t\t\t\t\t {$_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/CssLoad.inc.php'; ?> <script type="text/javascript"src="js/blog.js"></script> </head>
session_start(); } //define the constant IN_TG to include common.inc.php define('IN_TG', true); //a constant for different scripts calling define("SCRIPT", "member_post"); //include common.inc.php require dirname(__FILE__) . '/includes/common.inc.php'; //whether login if (!isset($_COOKIE['username'])) { _alert_back('Please login first'); } //Paging module global $_pagesize, $_pagenum; //the first parameter is the number of records and the second one is the number of records displayed on each page _page("select \n tg_id \n\t\t from \n\t\t tg_article \n\t\twhere \n\t\t\t tg_reid=0\n\t\tand\n\t\t tg_username ='******'username']}'", 10); $_result = _query("select \n\t\t\t\t\t\t\t\t\t\ttg_id,tg_title,tg_content,tg_date \n\t\t\t\t\t\t\t\t from \n\t\t\t\t\t\t\t\t \t\ttg_article\n\t\t\t\t\t\t\t\t where\n\t\t\t\t\t\t\t\t \t\ttg_username = '******'username']}'\n\t\t\t\t\t\t\t\t \tand\n\t\t\t\t\t\t\t\t \t\ttg_reid = 0\n\t\t\t\t\t\t\t\t order by \n\t\t\t\t\t\t\t\t \t\ttg_date desc \n\t\t\t\t\t\t\t\t limit \n\t\t\t\t\t\t\t\t\t\t{$_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/CssLoad.inc.php'; ?> <script type="text/javascript"src="js/member_message.js"></script> </head> <body> <?php require ROOT_PATH . 'includes/header.inc.php';
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('LANG' => $core->v('default_lang'), 'TEMPLATE' => $tpl, 'TEMPLATE_NAME' => $this->tpl, 'S_SERVER' => $core->v('address'), 'S_STYLE' => $core->v('address') . 'style/', 'S_LIB' => LIBD, 'S_VISUAL' => LIBD . 'visual/', '_SELF' => _page(), 'SCRIPT_TYPE' => ' type="text/javascript"', 'CDATA_BEGIN' => '//<![CDATA[' . "\n", 'CDATA_END' => '//]]>' . "\n", 'IS_GHOST' => is_ghost(), 'IS_MEMBER' => (int) $user->v('is_member'), 'S_USERNAME' => _fullname($user->v()), 'S_TIME' => time()); } }
* ================================================ * Author:zhangshuhui * Date: 2014-9-21 */ session_start(); define('IN_TG', true); //引入公共文件 //定义一个常量,用来指定本页的内容 define('SCRIPT', 'orders_unread'); //引入公共文件 require dirname(__FILE__) . '/../../includes/common.inc.php'; include ROOT_PATH . 'includes/check.func.php'; $_percent = 0.2; //分页模块 global $_pagesize, $_pagenum, $_system; _page("SELECT id FROM tb_comment WHERE state = 0", 7); $_result = _query("SELECT * FROM \n\t\t\t\t\t\t\t\ttb_comment\n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tstate = 0 \n\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}\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" /> <title>未回复评论</title> <?php require ROOT_PATH . 'includes/db_title.inc.php'; ?> </head> <body> <?php require ROOT_PATH . 'includes/db_header.inc.php'; ?>
$side_list .= '<li><a ' . $class . ' href="article.php?m=' . $_mid . '&p=' . $c_list['pid'] . '" >' . $c_list['menu_name'] . '</a></li>'; } } $side_list .= '</ul>'; } $side_list .= '</li>'; } $_tpl->assign('side_list', $side_list); /*内容*/ if (!empty($_GET['d']) && is_numeric($_GET['d'])) { $_sql = "SELECT * FROM tg_article where pid=" . $_pid . " AND id=" . $_GET['d']; } else { $_sql = "SELECT * FROM tg_article where pid=" . $_pid; } global $_system; _page($_sql, $_system['pics_list_num']); $_article = _all(_query($_sql . " LIMIT {$_pageabsolute}," . $_system['pics_list_num'])); if (!count($_article)) { //echo '没数据,请添加右边内容数据'; Module(); exit; } _paging($_pid, 2); $_tpl->assign('page_num', $page_num); $_tpl->assign('article_list', $_article); $_tpl->assign('article', $_article[0]); if (isset($_GET['d']) && is_numeric($_GET['d'])) { $pos = _query("SELECT id,pid,title FROM tg_article where pid=" . $_pid); $pos_arr = array(); $_all_id = array(); while (!!($_rows = _fetch_list($pos))) {
//重定向 _location(null, 'photo_show.php?id=' . $_dirhtml['id']); } else { _alert_back('相册密码不正确!'); } } } else { _alert_back('不存在此相册!'); } } else { _alert_back('非法操作!'); } $_percent = 0.3; global $_pagesize, $_pagenum, $_system, $_id; $_id = 'id=' . $_dirhtml['id'] . '&'; _page("SELECT tg_id FROM tg_photo WHERE tg_sid='{$_dirhtml['id']}'", $_system['photo']); $_result = _query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_id,tg_username,tg_name,tg_url,tg_readcount,tg_commendcount \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_photo \r\n\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_sid='{$_dirhtml['id']}'\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'; ?> </head> <body> <?php require ROOT_PATH . 'includes/header.inc.php'; ?>
/** *2012-8-2 | By:NaV! */ //防止恶意调用 define('IN_GM', true); //定义个常量,用来指定本页的内容 define('SCRIPT', 'stu_date'); //引入公共文件 require dirname(__FILE__) . '/includes/common.inc.php'; //判断登录状态和权限 _login_state(2); if ($_GET['action'] == '') { $num = _num_rows("SELECT * FROM gm_stuinfo WHERE gm_active='1'"); //分页模块 _page($num, $_system['stu_date_pagesize']); $res = _query("SELECT * FROM gm_stuinfo WHERE gm_active='1' ORDER BY gm_num LIMIT {$pagenum},{$pagesize}"); } elseif ($_GET['action'] == 'one' and $_POST['value'] != '') { $type = "gm_" . $_POST['type']; $res = _query("SELECT * FROM gm_stuinfo WHERE gm_active='1' AND {$type} LIKE '%{$_POST['value']}%'"); $pagesize = $num = _num_rows_list($res); } if ($_GET['action'] == "del" && $_GET['num']) { $r_s = _fetch_array("SELECT gm_num,gm_teacher,gm_photoname FROM gm_stuinfo WHERE gm_num='{$_GET['num']}' LIMIT 1"); $num_s = _num_rows("SELECT gm_num,gm_teacher FROM gm_stuinfo WHERE gm_num='{$_GET['num']}' LIMIT 1"); if ($num_s) { if ($r_s['gm_teacher']) { $r_t = _fetch_array("SELECT gm_student FROM gm_teacher WHERE gm_username='******'gm_teacher']}' LIMIT 1"); $students = explode(",", $r_t['gm_student']); $students_e = ""; //通过循环过滤删除
session_start(); //定义一个常量,用来授权调用includes里面的文件 define('IN_TG', true); //定义一个常量,用来指定本页的内容 define('SCRIPT', 'index'); //引入公共文件 //转换成硬路径,引用速度更快 require dirname(__FILE__) . '/includes/common.inc.php'; //读取xml文件 $_html = _html(_get_xml('new.xml')); //读取帖子列表 //设置分页参数 global $_pagenum, $_pagesize, $_system; //第一个参数获取总条数,第二个参数指定每页多少条 _page("select tg_id from tg_article where tg_reid=0", $_system['article']); //从数据库里提取数据,获取结果集 $_result = _query("select \n\t\t\t\t\t\t\ttg_id,tg_title,tg_type,tg_readcount,tg_commentcount \n\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\ttg_article \n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\ttg_reid=0\n\t\t\t\t\t\torder by \n\t\t\t\t\t\t\ttg_date desc \n\t\t\t\t\t\tlimit \n\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}"); //最新图片,找到时间点最后上传的那张图片,并且是非公开的 $_photo = _fetch_array("select \n\t\t\t\t\t\t\t\ttg_id as id,\n\t\t\t\t\t\t\t\ttg_name as name,\n\t\t\t\t\t\t\t\ttg_url as url \n\t\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\t\ttg_photo \n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\t\ttg_sid in (select tg_id from tg_dir where tg_type=0)\n\t\t\t\t\t\t\torder by \n\t\t\t\t\t\t\t\ttg_date desc \n\t\t\t\t\t\t\tlimit \n\t\t\t\t\t\t\t\t1"); ?> <!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>
public function manage_admin() { if ($this->session->userdata('admin_valid') == FALSE && $this->session->userdata('admin_id') == "") { redirect("index.php/admin/login"); } /* pagination */ $total_row = $this->db->query("SELECT * FROM t_admin")->num_rows(); $per_page = 10; $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() . "admin/manage_admin/p"); //ambil variabel URL $mau_ke = $this->uri->segment(3); $idu = $this->uri->segment(4); $cari = addslashes($this->input->post('q')); //ambil variabel Postingan $idp = addslashes($this->input->post('idp')); $username = addslashes($this->input->post('username')); $password = md5(addslashes($this->input->post('password'))); $nama = addslashes($this->input->post('nama')); $nip = addslashes($this->input->post('nip')); $level = addslashes($this->input->post('level')); $cari = addslashes($this->input->post('q')); if ($mau_ke == "del") { $this->db->query("DELETE FROM t_admin WHERE id = '{$idu}'"); $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data has been deleted </div>"); redirect('index.php/admin/manage_admin'); } else { if ($mau_ke == "cari") { $a['data'] = $this->db->query("SELECT * FROM t_admin WHERE nama LIKE '%{$cari}%' ORDER BY id DESC")->result(); $a['page'] = "l_manage_admin"; } else { if ($mau_ke == "add") { $a['page'] = "f_manage_admin"; } else { if ($mau_ke == "edt") { $a['datpil'] = $this->db->query("SELECT * FROM t_admin WHERE id = '{$idu}'")->row(); $a['page'] = "f_manage_admin"; } else { if ($mau_ke == "act_add") { $cek_user_exist = $this->db->query("SELECT username FROM t_admin WHERE username = '******'")->num_rows(); if (strlen($username) < 6) { $this->session->set_flashdata("k", "<div class=\"alert alert-danger\" id=\"alert\">Username minimal 6 huruf</div>"); } else { if ($cek_user_exist > 0) { $this->session->set_flashdata("k", "<div class=\"alert alert-danger\" id=\"alert\">Username telah dipakai. Ganti yang lain..!</div>"); } else { $this->db->query("INSERT INTO t_admin VALUES (NULL, '{$username}', '{$password}', '{$nama}', '{$nip}', '{$level}')"); $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data has been added</div>"); } } $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data has been added</div>"); redirect('index.php/admin/manage_admin'); } else { if ($mau_ke == "act_edt") { if ($password = md5("-")) { $this->db->query("UPDATE t_admin SET username = '******', nama = '{$nama}', nip = '{$nip}', level = '{$level}' WHERE id = '{$idp}'"); } else { $this->db->query("UPDATE t_admin SET username = '******', password = '******', nama = '{$nama}', nip = '{$nip}', level = '{$level}' WHERE id = '{$idp}'"); } $this->session->set_flashdata("k", "<div class=\"alert alert-success\" id=\"alert\">Data has been updated </div>"); redirect('index.php/admin/manage_admin'); } else { $a['data'] = $this->db->query("SELECT * FROM t_admin LIMIT {$awal}, {$akhir} ")->result(); $a['page'] = "l_manage_admin"; } } } } } } $this->load->view('admin/aaa', $a); }
} //读取最后修改信息 if ($_html['last_modify_date'] != '0000-00-00 00:00:00') { $_html['last_modify_date_string'] = '本帖已由[' . $_html['username_subject'] . ']于' . $_html['last_modify_date'] . '修改过'; } //给楼主回复 if (isset($_COOKIE['username'])) { $_html['re'] = '<span>[<a href="#ree" name="re" title="回复1楼的' . $_html['username_subject'] . '">回复</a>]</span>'; } //个性签名 if ($_html['switch'] == 1) { $_html['autograph_html'] = '<p class="autograph">' . $_html['autograph'] . '</p>'; } //读取回帖 global $_pagenum, $_pagesize, $_page; _page("select tg_id from tg_article where tg_reid='{$_html['reid']}'", 10); $_result = _query("select \n\t\t\t\t\t\t\t\t\t\ttg_username,tg_type,tg_title,tg_content,tg_date\n\t\t\t\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\t\t\t\ttg_article \n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\ttg_reid='{$_html['reid']}'\n\t\t\t\t\t\t\t\t\torder by \n\t\t\t\t\t\t\t\t\t\ttg_date asc \n\t\t\t\t\t\t\t\t\tlimit \n\t\t\t\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}"); } else { //这个用户已被删除 } } else { _alert_back('不存在这个主题'); } } else { _alert_back('非法操作'); } ?> <!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>