Example #1
0
 public function loginout()
 {
     $this->session->sess_destroy();
     $this->load->helper('cookie');
     delete_cookie('uid');
     delete_cookie('username');
     delete_cookie('lastlogin');
     delete_cookie('email');
     //Header("Location: /index.php/admin/login");
     show_error1('您已经成功退出!', '500', '操作提示', '/login', '1');
     exit;
 }
Example #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('free_m');
     $this->load->model('kehu_m');
     $this->load->library("session");
     $this->load->library("column");
     if ($this->session->userdata('username') == '') {
         //redirect(site_url('/login'),'location');
         show_error1('您还没有登录,请先登录', '500', '无权访问', '/login', '1');
         exit;
     }
 }
Example #3
0
 public function select()
 {
     mysql_query("SET NAMES GBK");
     if ($_POST) {
         if (!$this->input->post('cxlx')) {
             show_error1('系统出错!', '500', '操作提示');
             exit;
         }
         switch ($this->input->post('cxlx')) {
             case '1':
                 $vodty = 'tb_khmc';
                 break;
             case '2':
                 $vodty = 'tb_dwmc';
                 break;
             case '3':
                 $vodty = "tb_khllr";
                 break;
             case '4':
                 $vodty = "tb_sj";
                 break;
         }
         $data['list'] = $this->kehu_m->get_skehu_list($vodty, $this->input->post('title'), $this->input->post('khlx'));
     } else {
         $data['list'] = '';
     }
     $this->load->view('taobaocp/kehu_select', $data);
 }
Example #4
0
 public function show($id = 0)
 {
     mysql_query("SET NAMES GBK");
     if ($_POST) {
         if (!$this->input->post('khid')) {
             show_error1('请先选择客户', '500', '操作提示');
             exit;
         }
         if (!$this->input->post('ktrq')) {
             show_error1('开通时间不能为空', '500', '操作提示');
             exit;
         }
         if (!$this->input->post('dqrq')) {
             show_error1('到期时间不能为空', '500', '操作提示');
             exit;
         }
         $str = array('khid' => $this->input->post('khid'), 'cpmc' => $this->input->post('cpmc'), 'ktrq' => $this->input->post('ktrq'), 'dqrq' => $this->input->post('dqrq'), 'txrq' => $this->input->post('txrq'), 'cbjg' => $this->input->post('cbjg'), 'xsjg' => $this->input->post('xsjg'), 'content' => $this->input->post('content'));
         if ($this->kehu_m->update_yewu($id, $str)) {
             //$this->myclass->notice('alert("添加成功!");window.location.href="'.site_url('admin/shuju').'";');
             //print_r($str);
             show_error1('业务修改成功', '500', '操作提示');
         } else {
             show_error1('您未做任何修改', '500', '操作提示');
         }
         exit;
     }
     $data['kehu'] = $this->kehu_m->get_yewu_by_id($id);
     $this->load->view('taobaocp/yewu_edit', $data);
 }
Example #5
0
function executeSQL($myFile)
{
    $sql = file_get_contents($myFile);
    $sqllines = explode("\n", $sql);
    $cmd = '';
    $delim = false;
    foreach ($sqllines as $l) {
        if (preg_match('/^\\s*--/', $l) == 0) {
            if (preg_match('/DELIMITER \\$\\$/', $l) != 0) {
                $delim = true;
            } else {
                if (preg_match('/DELIMITER ;/', $l) != 0) {
                    $delim = false;
                } else {
                    if (preg_match('/END\\$\\$/', $l) != 0) {
                        $cmd .= ' END';
                    } else {
                        $cmd .= ' ' . $l . "\n";
                    }
                }
                if (preg_match('/.+;/', $l) != 0 && !$delim) {
                    $result = mysql_query($cmd) or die(show_error1() . ' Show Error 7');
                    $cmd = '';
                }
            }
        }
    }
}
Example #6
0
 public function password()
 {
     mysql_query("SET NAMES GBK");
     $id = $this->session->userdata('uid');
     if ($_POST) {
         if (!$this->input->post('email')) {
             show_error1('邮箱不能为空!', '500', '操作提示');
             exit;
         }
         if (!$this->myclass->isEmail($this->input->post('email'))) {
             show_error1('邮箱格式错误!', '500', '操作提示');
             exit;
         }
         if ($this->input->post('password')) {
             $str = array('email' => $this->input->post('email'), 'password' => md5($this->input->post('password')));
         } else {
             $str = array('email' => $this->input->post('email'));
         }
         if ($this->free_m->update_password($id, $str)) {
             show_error1('账号修改成功', '500', '操作提示');
         } else {
             show_error1('您输入的邮箱和密码和原信息相同', '500', '操作提示');
         }
     }
     $data['getuser'] = $this->free_m->get_user_by_id($id);
     $this->load->view('taobaocp/getpass', $data);
 }