/**
  * Load the main view with all the current model model's data.
  * @return void
  */
 public function index()
 {
     $config['per_page'] = 20;
     $config['base_url'] = base_url() . 'admin/profit_and_loss_logs';
     $config['use_page_numbers'] = TRUE;
     $config['num_links'] = 5;
     $config['full_tag_open'] = '<ul>';
     $config['full_tag_close'] = '</ul>';
     $config['num_tag_open'] = '<li>';
     $config['num_tag_close'] = '</li>';
     $config['cur_tag_open'] = '<li class="active"><a>';
     $config['cur_tag_close'] = '</a></li>';
     $page = $this->uri->segment(3);
     //math to get the initial record to be select in the database
     $limit_end = $page * $config['per_page'] - $config['per_page'];
     if ($limit_end < 0) {
         $limit_end = 0;
     }
     $data['user_fund_log'] = $this->user_fund_log_model->get_user_profit_loss_log1($config['per_page'], $limit_end);
     $data['count_user_fund_log'] = $this->user_fund_log_model->count_user_profit_loss_log();
     $config['total_rows'] = $data['count_user_fund_log'];
     $this->pagination->initialize($config);
     //echo "<pre>";print_r($data['share_limit']); exit;
     // Need loop for added property name and userid
     $data['main_content'] = 'admin/profit_and_loss/list';
     $this->load->view('includes/template', $data);
 }
Exemplo n.º 2
1
 function __construct()
 {
     parent::__construct();
     $this->gallery_path = realpath(APPPATH . '../images');
     /*I also can use BASEPATH rather than APPPATH*/
     $this->gallery_path_url = base_url() . 'images/';
 }
Exemplo n.º 3
1
 function form_buscar()
 {
     if (!$this->session->userdata('sess_id_user')) {
         redirect("login");
     } else {
         $this->load->library('pagination');
         /*Se personaliza la paginación para que se adapte a bootstrap*/
         $config['base_url'] = base_url() . 'departamentos/form_buscar/';
         $config['total_rows'] = $this->Departamentos_model->get_total_departamentos();
         $config['per_page'] = 10;
         $desde = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
         $config['cur_tag_open'] = '<li class="active"><a href="#">';
         $config['cur_tag_close'] = '</a></li>';
         $config['num_tag_open'] = '<li>';
         $config['num_tag_close'] = '</li>';
         $config['last_link'] = FALSE;
         $config['first_link'] = FALSE;
         $config['next_link'] = '&raquo;';
         $config['next_tag_open'] = '<li>';
         $config['next_tag_close'] = '</li>';
         $config['prev_link'] = '&laquo;';
         $config['prev_tag_open'] = '<li>';
         $config['prev_tag_close'] = '</li>';
         $datos["titulo"] = " .: Mantenimiento :.";
         $datos["departamento"] = $this->Departamentos_model->get_departamentos($config['per_page'], $desde);
         $this->pagination->initialize($config);
         $this->load->view("header", $datos);
         $this->load->view("departamentos/buscar_departamento", $datos);
         $this->load->view("footer", $datos);
         $this->load->view("fin", $datos);
     }
 }
Exemplo n.º 4
1
 public function index()
 {
     if (empty($this->session->userdata('user'))) {
         redirect(base_url());
     } else {
         $user = $this->session->userdata('user');
         switch ($user->id_jenis_user) {
             case 00:
                 $this->load->view("group-admin");
                 break;
             default:
                 $data['id_grup'] = $this->input->get('id_grup');
                 if ($this->input->get('id_grup')) {
                     $data['id_grup'] = $this->input->get('id_grup');
                 } else {
                     $user = $this->session->userdata('user');
                     $id_user = $user->id_user;
                     $query = $this->model_anggota->viewByIdUser($id_user);
                     $data['id_grup'] = $query[0]->id_grup;
                 }
                 $this->load->view("grup", $data);
                 break;
         }
     }
 }
Exemplo n.º 5
1
 function index()
 {
     $css = array(base_url() . "resources/css/jqueryui.css", base_url() . "resources/plugin/codeprettifier/prettify.css", base_url() . "resources/plugin/form-toggle/toggles.css", base_url() . "resources/plugin/pines-notify/jquery.pnotify.default.css", base_url() . "resources/plugin/bootstrap3-dialog-master/bootstrap-dialog.css");
     $js = array(base_url() . "resources/plugin/bootstrap3-dialog-master/bootstrap-dialog.js", base_url() . "resources/plugin/pines-notify/jquery.pnotify.min.js");
     $this->template_admin->header_web(TRUE, "Contest", $css, $js, TRUE, "");
     $this->template_admin->headerbar();
     $this->template_admin->top_menu(TRUE);
     $this->load->view("panel/panel_utama");
     $this->template_admin->panel_menu();
     $this->load->view("panel/panel_content");
     $this->load->view("panel/panel_wrap");
     //        $this->mongo_db->select_db("Assets");
     //        $this->mongo_db->select_collection("Color");
     //        $isiform['colorls']=$this->mongo_db->find(array(),0,0,array('name'=>1));
     //        $this->mongo_db->select_collection("AvatarBodyPart");
     //        $isiform['tipe']=$this->mongo_db->find(array("parent"=>''),0,0,array('name'=>1));
     //        $this->mongo_db->select_collection("Brand");
     //        $isiform['brand']=$this->mongo_db->find(array(),0,0,array('name'=>1));
     //        $this->mongo_db->select_db("Articles");
     //        $this->mongo_db->select_collection("ContentType");
     //        $isiform['searchtype']=$this->mongo_db->find(array(),0,0,array('name'=>1));
     //        $this->mongo_db->select_collection("ContentCategory");
     //        $isiform['searchcategory']=$this->mongo_db->find(array(),0,0,array('name'=>1));
     //        $this->mongo_db->select_db("Game");
     //        $this->mongo_db->select_collection("RequiredRewards");
     //        $isiform['datareward']=$this->mongo_db->find(array('type'=>'Rewards'),0,0,array('name'=>1));
     //        $this->load->view("leaderboard_view",$isiform);
     $this->load->view("panel/close_div");
     $this->load->view("panel/close_div");
     $this->template_admin->addresbar();
     $this->load->view("panel/close_div");
     $this->template_admin->footer();
 }
Exemplo n.º 6
1
 function index()
 {
     $config['base_url'] = base_url() . 'index.php/con_toga/index/';
     $config['total_rows'] = $this->modtoga->pinjamtoga()->num_rows();
     $config['per_page'] = 8;
     if (isset($_POST['btCari'])) {
         $cari = $this->input->post('cari');
         $id = array('NPM' => $cari);
         $hasil = $this->modtoga->cek_input($id);
         if ($hasil == 0) {
             echo "<script>alert('Data Tidak Ditemukan')\n\t\t\t\tlocation.href='con_toga'</script>";
         } else {
             $config['total_rows'] = $this->modtoga->caridata($cari)->num_rows();
             $this->pagination->initialize($config);
             $data['paging'] = $this->pagination->create_links();
             $halaman = $this->uri->segment(3);
             $halaman = $halaman == '' ? 0 : $halaman;
             $data['pinjamtoga'] = $this->modtoga->caridatapaging($cari, $halaman, $config['per_page']);
             $this->template->load('Template_keuangan', 'Keuangan/laporan/Toga/laporantoga', $data);
         }
     } else {
         $this->pagination->initialize($config);
         $data['paging'] = $this->pagination->create_links();
         $halaman = $this->uri->segment(3);
         $halaman = $halaman == '' ? 0 : $halaman;
         $data['pinjamtoga'] = $this->modtoga->pinjamtogapaging($halaman, $config['per_page']);
         $this->template->load('Template_keuangan', 'Keuangan/laporan/Toga/laporantoga', $data);
     }
 }
Exemplo n.º 7
1
 /**
  * [_is_auth_success 验证权限是否成功]
  * @param  [type]  $auths [description]
  * @return boolean        [description]
  */
 private function _is_auth_success($auths)
 {
     $route = Common::get_route();
     //需权限
     if (array_key_exists($route, $auths)) {
         $user = isset($_SESSION[$this->login_in_session_name]) ? $_SESSION[$this->login_in_session_name] : NULL;
         $user_role = isset($user['role']) ? $user['role'] : NULL;
         //有权限
         if (strstr($auths[$route], "|{$user_role}|")) {
             return TRUE;
         } else {
             //有登录权限
             if (strstr($auths[$route], "|1|")) {
                 //已登录
                 if (!empty($user)) {
                     return TRUE;
                 } else {
                     $this->error->output('NOTLOGIN_ERROR', array('script' => 'swal({title: "请登录后再进行操作",type: "warning",showCancelButton: true,confirmButtonColor: "#DD6B55",confirmButtonText: "注册/登录",closeOnConfirm: false},function () {showsign();});'));
                 }
             }
             //没有权限
             $this->error->output('NOAUTH_ERROR', array('script' => 'window.location.href ="' . base_url() . '";'));
         }
     } else {
         return TRUE;
     }
 }
Exemplo n.º 8
1
 public function common_index($sql_queries)
 {
     $this->load->helper('file');
     //above line helps to create and write the file
     $role_code = $_SESSION['user_data']['result'][0]['user_role_code'];
     //above line helps to get user code from session
     $product_name = $_SESSION['user_data']['result'][0]['user_product_names'];
     //above line helps to get user product from session
     $data['module'] = $module = $this->uri->segment(1);
     //above line helps to get user module from browser url
     $data['class'] = $class = $this->uri->segment(2);
     //above line helps to get user class on which we shall work
     $data['url'] = $url = $module . '/' . $class;
     //above line helps to get
     $get_page_details_controls = $this->get_page_details_controls($url, $role_code);
     $data['page_name'] = $page_name = $get_page_details_controls[0]['menu_text'];
     $data['page_breadcrumb'] = array($module, $class);
     $data['page_access_controls'] = $get_page_details_controls[0];
     $data['form_name'] = $page_name . ' Form';
     $data['form_url'] = base_url() . $url . '/' . $class . '_action';
     $data['list_name'] = $page_name . ' List';
     $data['list_url'] = base_url() . $module . '/' . $class . '/' . $class . '_list';
     $data['del_url'] = base_url() . $url . '/' . $class . '_delete';
     $columns = $this->columns($sql_queries);
     $data['columns'] = $columns['columns'];
     $data['js_function_path'] = 'assets/app/js/' . $module . '/' . $module . '_function.js';
     $data['errorInfo'] = $columns['errorInfo'];
     $data['js_path'] = 'assets/app/js/' . $url . '.js';
     $data['main_menu'] = $this->usermenumodel->usermenu($role_code, $product_name);
     //echo '<pre>'.print_r($data['main_menu'],true);die();
     return $data;
 }
Exemplo n.º 9
1
 public function post($news_id, $p = 0)
 {
     $category = $this->db->query("SELECT * FROM td_news WHERE news_id = '" . $news_id . "'")->result_array();
     $category['p_c_name'] = $this->db->query("SELECT * FROM td_category WHERE id = '" . $category[0]['category'] . "'")->result_array();
     $category['menus'] = $this->db->query('SELECT * FROM td_category LIMIT 7')->result_array();
     $category['top_banner'] = $this->db->query('SELECT * FROM td_sponsor WHERE sp_pos = "top"')->result_array();
     $category['current_news'] = $this->db->query('SELECT * FROM td_news LIMIT 20')->result_array();
     $category['breking_news'] = $this->db->query('SELECT * FROM td_news WHERE slider = 1')->result_array();
     $category['previous'] = $this->db->query('select * from td_news where news_id = (select max(news_id) from td_news where news_id < "' . $news_id . '")')->result_array();
     $category['next'] = $this->db->query('select * from td_news where news_id = (select min(news_id) from td_news where news_id > "' . $news_id . '")')->result_array();
     $limit = 6;
     //how many items to show per page
     $page = $p;
     if ($page) {
         $start = ($page - 1) * $limit;
     } else {
         $start = 0;
     }
     $category['post_data'] = $this->db->query("select * from td_news where news_id = '" . $news_id . "' LIMIT {$start}, {$limit} ")->result_array();
     $total_pages = $this->db->query("select * from td_news where news_id = '" . $news_id . "'")->num_rows();
     require_once APPPATH . "libraries/pagination.php";
     $category['res'] = create_pagination('td_news', base_url() . 'index.php/gallery/galleryImages/' . $news_id, $limit, $page, $total_pages);
     //$this->load->view('table',$result);
     $category['total_item'] = $total_pages;
     $this->load->view('post', $category);
 }
Exemplo n.º 10
1
    /**
     *	this one is the magic one... (pentru asta am facut aceasta clasa...)
     *	scoatem urmatorul banner pentru un grup si incrementam view-ul...
     */
    function getNextBanner($group)
    {
        $CI =& get_instance();
        $output = "";
        $CI->db->where("banner_group", $group);
        $CI->db->where("order", "1");
        $query = $CI->db->get('banners');
        if ($query->num_rows() > 0) {
            $prev_banner = $query->row_array();
            $prev_id = $prev_banner["id"];
        } else {
            $prev_id = 0;
        }
        $CI->db->where("banner_group", $group);
        $CI->db->select_max('id', 'last_id');
        $query = $CI->db->get('banners');
        $last_banner = $query->row_array();
        $last_id = $last_banner["last_id"];
        $banner_id_where = "AND `b`.`id` > (SELECT `id` FROM `banners` WHERE `order` = '1')";
        if ($prev_id == 0 || $prev_id == $last_id) {
            $banner_id_where = "";
        }
        $query = $CI->db->query("SELECT \r\n\t\t\t\t\t\t\t\t\t`b`.*,\r\n\t\t\t\t\t\t\t\t\t`bl`.`name`,\r\n\t\t\t\t\t\t\t\t\t`bl`.`description`\r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t`banners` as `b`\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN `banners_lang` as `bl`\r\n\t\t\t\t\t\t\t\t\t\tON (`bl`.`banner_id` = `b`.`id`)\r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t`b`.`banner_group` = '{$group}'\r\n\t\t\t\t\t\t\t\t\tAND `bl`.`lang_id` = '" . $CI->lang_id . "'\r\n\t\t\t\t\t\t\t\t\t{$banner_id_where}\r\n\t\t\t\t\t\t\t\tLIMIT 1\r\n\t\t\t\t\t\t\t\t");
        if ($query->num_rows() > 0) {
            $banner = $query->row_array();
            // setam toate la 0 si asta curent la 1
            $CI->db->query("UPDATE `banners` SET `order` = '0' WHERE `banner_group` = '{$group}' ");
            $CI->db->query("UPDATE `banners` SET `order` = '1', `views` = `views`+1 WHERE `id` = '" . $banner["id"] . "' ");
            $output .= '<a href="' . site_url("banners/navigate/" . $banner["id"]) . '" target="_blank" title="' . $banner["name"] . ' - ' . $banner["description"] . '">
				<img src="' . base_url() . 'uploads/banners/' . $banner["file_name"] . '" alt="' . $banner["name"] . ' - ' . $banner["description"] . '"/></a>';
        }
        return $output;
    }
Exemplo n.º 11
1
 public function meja($code = '')
 {
     $access = strtolower($this->module . '.' . __CLASS__ . '.' . __FUNCTION__);
     $this->permission->check_permission($access);
     $data['operator'] = $this->session->userdata('astrosession');
     $date = date('Y-m-d');
     $id = $data['operator'][0]->id;
     $cek = $this->mk->cek($id, $date);
     if ($cek >= 1) {
         $data['title'] = "Kasir";
         $data['sidebar_active'] = "kasir";
         $data['resv_list'] = $this->ksr->get_resv_list();
         $data['stats'] = $this->ksr->get_statistik();
         $data['meja'] = $this->ksr->get_meja($code);
         $data['meja_isi'] = $this->ksr->get_meja_isi();
         $data['meja_tergabung'] = $this->ksr->get_meja_tergabung();
         // foreach ($data['meja_tergabung'] as $key => $value)
         // 	array_push($data['meja_isi'], $value);
         // print_r($data['meja_isi']);exit();
         $data['reservasi'] = $this->ksr->get_reserved();
         $data['code_meja'] = $this->ksr->code_meja();
         $data['content'] = $this->load->view($this->module . '/pilih-meja', $data, TRUE);
         $this->load->view('/template', $data);
     } else {
         redirect(base_url('kasir/cashdraw/'));
     }
 }
Exemplo n.º 12
0
 function index($offset = FALSE)
 {
     $this->load->model('Productmodel');
     $this->load->library('pagination');
     $this->load->helper('text');
     $this->load->library('form_validation');
     $this->load->helper('form');
     //Setup Pagination
     $perpage = 25;
     $config['base_url'] = base_url() . "products/index/";
     $config['uri_segment'] = 3;
     $config['total_rows'] = $this->Productmodel->countAll();
     $config['per_page'] = $perpage;
     $this->pagination->initialize($config);
     //Get all Product
     $products = array();
     $products = $this->Productmodel->listAll($offset, $perpage);
     //render view
     $inner = array();
     $inner['products'] = $products;
     $inner['pagination'] = $this->pagination->create_links();
     $page = array();
     $page['content'] = $this->load->view('product-index', $inner, TRUE);
     $this->load->view('shell', $page);
 }
Exemplo n.º 13
0
 public function index()
 {
     $filtro_usuario = $this->input->post('usuario');
     $filtros_usuario = $this->paginador_model->filtro($filtro_usuario, 'usuario_filtro');
     /**
      * configuracion de paginacion
      */
     $data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario);
     $total_rows = $data['usuarios'] == false ? 0 : $data['usuarios']->num_rows();
     $base_url = site_url('maestro/usuario/index');
     $config = $this->paginador_model->paginar($total_rows, $base_url);
     $perpage = $this->paginador_model->get_perpage();
     $this->pagination->initialize($config);
     /**
      * fin paginacion.
      */
     $data['per_page'] = $perpage;
     $data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario, $perpage, $this->uri->segment(4));
     $data0['roles'] = $this->usuario_model->buscar('roles');
     $data0['bodegas'] = $this->usuario_model->buscar('bodegas', array('bode_estado' => 'A'));
     $data['vista_nuevo_usuario'] = $this->load->view('nuevo_usuario_view', $data0, true);
     $data['vista_editar_usuario'] = $this->load->view('editar_usuario_view', $data0, true);
     $data['vista_buscar_usuario'] = $this->load->view('buscar_usuario_view', $data0, true);
     $menu = array(array('callback' => 'nuevo_usuario();return false;', 'val' => '<img class="qtip" alt="Nuevo Usuario"  src="' . base_url() . 'assets/images/add-files.png" />'), array('callback' => 'buscar_usuario();return false;', 'val' => '<img class="qtip" alt="Buscar Usuario" src="' . base_url() . 'assets/images/search.png" />'), array('val' => '<img class="qtip" alt="Mostrar Todos" src="' . base_url() . 'assets/images/all.png" />', 'href' => site_url('maestro/usuario/todos')));
     $this->run('usuarios_view', $data, 'Listado de usuarios', $menu, null, null, 'usuario.js');
 }
Exemplo n.º 14
0
 function suggest_university()
 {
     if (!$this->tank_auth->is_admin_logged_in()) {
         redirect('admin/adminlogin/');
     } else {
         $data = $this->path->all_path();
         $data['user_id'] = $this->tank_auth->get_admin_user_id();
         $data['admin_user_level'] = $this->tank_auth->get_admin_user_level();
         $data['admin_priv'] = $this->adminmodel->get_user_privilege($data['user_id']);
         if (!$data['admin_priv']) {
             redirect('admin/adminlogout');
         }
         $hint = strtolower($_GET["q"]);
         if (!$hint) {
             return;
         }
         $data['univ_info'] = $this->autosuggest_model->get_univ_detail($hint);
         if ($data['univ_info'] != 0) {
             foreach ($data['univ_info'] as $univ_info) {
                 $univ_name = $univ_info->univ_name;
                 $univ_id = $univ_info->univ_id;
                 if (file_exists(getcwd() . '/uploads/univ_gallery/' . $univ_info->univ_logo_path) && $univ_info->univ_logo_path != '') {
                     $img_name = $univ_info->univ_logo_path;
                 } else {
                     $img_name = 'logo.png';
                 }
                 $img = '<img src="' . base_url() . '/uploads/univ_gallery/' . $img_name . '" style="width:50px;height:25px;">';
                 echo $img . '<b>' . "{$univ_name}|{$univ_id}\n";
             }
         } else {
             echo 'No Result Found';
         }
     }
 }
Exemplo n.º 15
0
 /**
  * @author : Gede Lumbung
  * @web : http://gedelumbung.com
  **/
 function index($title = "", $uri = 0)
 {
     if ($this->session->userdata('logged_in') != "") {
         $id_param = $this->session->userdata("id_member");
         $d['left_top_menu'] = $this->app_global_web_model->generate_menu("kiri", "nav pull-left");
         $d['right_top_menu'] = $this->app_global_web_model->generate_menu("kanan", "nav pull-right");
         $d['center_bottom_menu'] = $this->app_global_web_model->generate_menu("footer");
         $d['combo_lokasi'] = $this->app_global_web_model->generate_combo_lokasi();
         $d['combo_kategori'] = $this->app_global_web_model->generate_combo_kategori();
         $d['list_kategori'] = $this->app_global_web_model->generate_list_kategori("nav nav-list");
         $d['left_artikel_hot'] = $this->app_global_web_model->generate_front_artikel($_SESSION['site_limit_artikel_hot'], 0, "counter", 1);
         $d['left_iklan_hot'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "counter");
         $d['left_iklan_new'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "id_iklan");
         $where['id_member'] = $id_param;
         $gen_menu = $this->db->get_where("dlmbg_member", $where);
         if ($gen_menu->num_rows() == 0) {
             redirect(base_url());
         }
         $menu_crumb = $gen_menu->row();
         $this->breadcrumb->append_crumb('BERANDA', base_url());
         $this->breadcrumb->append_crumb('DASHBOARD', base_url() . 'user/dashboard');
         $this->breadcrumb->append_crumb(strtoupper($menu_crumb->nama), base_url() . 'web/kategori/get/' . $id_param . '/' . url_title($menu_crumb->nama, '-', TRUE));
         $d['dt_retrieve'] = $this->app_user_web_model->generate_detail_member($id_param, $_SESSION['site_limit_iklan_kategori'], $uri);
         $this->load->view($_SESSION['site_theme'] . '/bg_header', $d);
         $this->load->view($_SESSION['site_theme'] . '/user/dashboard/bg_home');
         $this->load->view($_SESSION['site_theme'] . '/bg_left');
         $this->load->view($_SESSION['site_theme'] . '/bg_footer');
     } else {
         redirect(base_url());
     }
 }
Exemplo n.º 16
0
	function page($index=0)
	{
        $config['base_url'] = base_url().'tintuc/page';

		//$config['per_page'] = 3;
		//$config['total_rows'] = count($this->Mtintuc->getRowByColumn('tintuc','duyet',1));

		$config['per_page'] = 5;
		$config['total_rows'] = count($this->Mtintuc->getListByColumn('tintuc','duyet',1));

		$config['uri_segment'] = 3;
		$this->pagination->initialize($config);
				
				//phai limit de lay so trang can phan
		//$data['items'] = $this->Mtintuc->getListOffset('tintuc',4,$index);
	    $data['list2']=$this->Mtintuc->getListOffset123('tintuc',5,'duyet',1,$index);
		$data['list_tagv'] = $this->Mtintuc->getListFull('tagcloud');
		$data['title']='Niw - Tin tức';
		

		$data['list_tagscloud']=$this->Mtintuc->getListFull('tagcloud');
		// Meta tags
		$tintuc = $this->Mtintuc->getRowByColumn('metatag','id',1);
		$data['meta_tag'] = $tintuc->meta_tintuc;
		$data['list_slide']=$this->Mtintuc->getRowByColumn('slide','id','1');
		// Lấy ra ds tin tức & sản phẩm ở footer
		$data['list_tintucft']=$this->Mtintuc->getListOffsetODB('tintuc',6,'id','DESC','duyet',1);
		$data['list_sanphamft']=$this->Mtintuc->getListFullODB('sanpham',6,'id','DESC');
		$data['module']=$this->module;
		$data['lang']=$this->session->userdata("lang");
		$data['index']= 6 ;
		$data['page']='vtintuc';
		$this->load->view('front/container',$data);
	}
Exemplo n.º 17
0
 function get_element_image($src = '', $class = 'image')
 {
     if (strlen($src) === 0) {
         $src = base_url('img/no_image.png');
     }
     return '<img class="' . $class . '" src="' . $src . '" >';
 }
Exemplo n.º 18
0
 public function index($sort_by = 'username', $sort_order = 'asc', $offset = 0)
 {
     $this->data['fields'] = array('user_id' => '#', 'username' => 'username', 'blocked' => 'Web Login', 'read_write' => ' Allow all Updates Except Queue', 'allow_queue_add' => ' Allow Queue Operations', 'allow_queue_edit' => ' Allow Bandwidth Update');
     $data = array();
     $config = array();
     $config["base_url"] = base_url() . "admin/index/{$sort_by}/{$sort_order}";
     $config["total_rows"] = $this->admin_model->get_all_admin_users($data, TRUE);
     $config["per_page"] = 10;
     $config["uri_segment"] = 5;
     $config['full_tag_open'] = '<p id="pagination">';
     $config['full_tag_close'] = '</p>';
     $config['first_link'] = 'First';
     $config['last_link'] = 'Last';
     $this->pagination->initialize($config);
     $data['start'] = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
     $data['limit'] = $config["per_page"];
     $data['sort_by'] = $sort_by;
     $data['sort_order'] = $sort_order;
     $this->data['sort_by'] = $sort_by;
     $this->data['sort_order'] = $sort_order;
     $this->data["links"] = $this->pagination->create_links();
     $this->data['title'] = "All Users";
     $this->data['template'] = 'admin/admin';
     $this->data['records'] = $this->admin_model->get_all_admin_users($data, FALSE);
     $this->load->view('common/main', $this->data);
 }
Exemplo n.º 19
0
 function index($offset = 0)
 {
     $this->load->model('Templatemodel');
     $this->load->library('pagination');
     $this->load->helper('text');
     if (!$this->checkAccess('MANAGE_TEMPLATE')) {
         $this->utility->accessDenied();
         return;
     }
     //Setup pagination
     $perpage = 50;
     $config['base_url'] = base_url() . "cms/template/index/";
     $config['uri_segment'] = 3;
     $config['total_rows'] = $this->Templatemodel->countAll();
     $config['per_page'] = $perpage;
     $this->pagination->initialize($config);
     //Get all Job
     $templates = array();
     $templates = $this->Templatemodel->listAll($offset, $perpage);
     //render view
     $inner = array();
     $inner['templates'] = $templates;
     $inner['pagination'] = $this->pagination->create_links();
     $page = array();
     $page['content'] = $this->load->view('cms/templates/listing', $inner, TRUE);
     $this->load->view($this->shellFile, $page);
 }
Exemplo n.º 20
0
 public function edit($id_param)
 {
     if ($this->session->userdata("logged_in") != "" && $this->session->userdata("tipe_user") == "superadmin") {
         $this->breadcrumb->append_crumb('Dashboard', base_url() . 'superadmin');
         $this->breadcrumb->append_crumb("Operator", base_url() . 'superadmin/operator');
         $this->breadcrumb->append_crumb("Update Operator", '/');
         $d['aktif_formatur_cabang'] = "";
         $d['aktif_mandat_cabang'] = "";
         $d['aktif_berita'] = "";
         $d['aktif_pesan_musyda'] = "";
         $d['aktif_list_download'] = "";
         $where['id_admin_cabang'] = $id_param;
         $get = $this->db->get_where("dlmbg_admin_cabang", $where)->row();
         $d['cabang'] = $this->db->get("dlmbg_cabang_profil");
         $d['id_cabang'] = $get->id_cabang;
         $d['nama_operator'] = $get->nama_operator;
         $d['username'] = $get->username;
         $d['password'] = $get->password;
         $d['email'] = $get->email;
         $d['id_param'] = $get->id_admin_cabang;
         $d['tipe'] = "edit";
         $this->load->view('bg_header', $d);
         $this->load->view('operator/bg_input');
         $this->load->view('bg_footer');
     } else {
         redirect("auth/user_login");
     }
 }
Exemplo n.º 21
0
 function upload()
 {
     $config['upload_path'] = './uploads/';
     /*这里的uploads是相对于index.php的,也就是入口文件,这个千万不要弄错哦!
     		否则就会报错"The upload path does not appear to be valid.";
     		*/
     $config['allowed_types'] = '*';
     /*我试着去上传其它类型的文件,这里一定要注意顺序!
     		A problem was encountered while attempting to move the uploaded file to the final destination.
     		这个错误一般是上传文件的文件名不能是中文名,这个很郁闷!还未解决,大家可以用其它方法,重新改一下文件名就可以解决了!  
     		$config['allowed_types'] = 'zip|gz|png|gif|jpg';(正确)
     		$config['allowed_types'] = 'png|gif|jpg|zip|gz';(错误)gif|jpg|png|txt|mac|pcs|pic|avd|mpeg|wav|zip|rar|mov|mp3|wmv
     		*/
     $config['max_size'] = '512000000000';
     $config['max_width'] = '4000';
     $config['max_height'] = '4000';
     $config['file_name'] = time();
     //文件名不使用原始名
     $this->load->library('upload', $config);
     if (!$this->upload->do_upload()) {
         $arr = array('error' => 1, 'url' => $this->upload->display_errors());
     } else {
         $data['upload_data'] = $this->upload->data();
         //文件的一些信息
         $arr = array('error' => 0, 'url' => base_url() . "./uploads/" . $data['upload_data']['file_name']);
     }
     echo json_encode($arr);
 }
Exemplo n.º 22
0
 public function do_change()
 {
     $token = $this->input->post("token");
     $pass = $this->input->post("password");
     $pass2 = $this->input->post("password2");
     $query = $this->db->get_where("users", array("token" => $token));
     if ($query->num_rows()) {
         $row = $query->row();
         if (strlen($pass) < 4) {
             $alert_msg = '<div class="alert alert-warning">Password too short.</div>';
             $this->load->view('forgot_pass_change', array('token' => $token, 'alert_msg' => $alert_msg));
         } else {
             if ($pass != $pass2) {
                 $alert_msg = '<div class="alert alert-warning">Passwords do not match.</div>';
                 $this->load->view('forgot_pass_change', array('token' => $token, 'alert_msg' => $alert_msg));
             } else {
                 $this->db->where(array('id' => $row->id));
                 $this->db->update("users", array('password' => ts_hash($pass), 'token' => random_string('unique')));
                 $alert_msg = '<div class="alert alert-success">Password changed successfully! Please return to <a href="' . base_url("login") . '">login</a> page.</div>';
                 $this->load->view('forgot_pass_change', array('alert_msg' => $alert_msg));
             }
         }
     } else {
         redirect("fpw?reason=verify_fail");
     }
 }
Exemplo n.º 23
0
 public function index()
 {
     if (!\App::isGranted('viewUser')) {
         redirect('admin/dashboard');
     }
     $userManager = $this->container->get('user.user_manager');
     $perpage = 1;
     $offset = $this->input->get('per_page') ? $this->input->get('per_page') : '';
     $users = $userManager->paginateUsers($offset, $perpage);
     $total = count($users);
     if ($total > $perpage) {
         $this->load->library('pagination');
         $config['base_url'] = base_url() . 'admin/user/index?';
         $config['total_rows'] = $total;
         $config['per_page'] = $perpage;
         $config['uri_segment'] = 3;
         $config['prev_link'] = 'Previous';
         $config['next_link'] = 'Next';
         $config['page_query_string'] = TRUE;
         $this->pagination->initialize($config);
         $this->templateData['pagination'] = $this->pagination->create_links();
     }
     $this->templateData['offset'] = $offset;
     $this->templateData['users'] = $users;
     $this->templateData['pageTitle'] = 'Users';
     $this->templateData['content'] = 'user/index';
     $this->load->view('backend/main_layout', $this->templateData);
 }
Exemplo n.º 24
0
 public function munculkan($id)
 {
     $this->load->database();
     $this->load->model("stan_model");
     $querydetail = $this->stan_model->getStandetail($id);
     $masukindums = '';
     $masukinfoto = '';
     $i = 1;
     foreach ($querydetail->result_array() as $row) {
         $newDate = date("d-m-Y", strtotime($row['tanggal_acara']));
         $masukindums = $masukindums . ' <div class="col-md-6 contact_right" >
             <h3>TANGGAL ACARA</h3>
            <h5>' . $newDate . '</h5> 
             <h3>DESKRIPSI STAN</h3>
             <h5>' . $row['deskripsi'] . '</h5>
             <h3>POTENSIAL</h3>
             <h5>' . $row['potensial'] . '</h5>
             <h3>FASILITAS</h3>
             <h5>' . $row['fasilitas'] . '</h5>
             </div>';
         $masukinfoto = $masukinfoto . '<img class="first-slide" src="' . base_url() . 'public/images/detail/' . $row['image_detail'] . '.jpg" alt="First slide">';
     }
     $this->session->set_flashdata('detail', $masukindums);
     $this->session->set_flashdata('foto', $masukinfoto);
     $this->load->view('header');
     $this->load->view('detail/content');
     $this->load->view('footer');
 }
Exemplo n.º 25
0
 function buy($id)
 {
     //Set variables for paypal form
     $paypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
     //test PayPal api url
     $paypalID = '*****@*****.**';
     //business email
     $returnURL = base_url() . 'paypal/success';
     //payment success url
     $cancelURL = base_url() . 'paypal/cancel';
     //payment cancel url
     $notifyURL = base_url() . 'paypal/ipn';
     //ipn url
     //get particular product data
     $product = $this->product->getRows($id);
     $userID = 1;
     //current user id
     $logo = base_url() . 'assets/images/codexworld-logo.png';
     $this->paypal_lib->add_field('business', $paypalID);
     $this->paypal_lib->add_field('return', $returnURL);
     $this->paypal_lib->add_field('cancel_return', $cancelURL);
     $this->paypal_lib->add_field('notify_url', $notifyURL);
     $this->paypal_lib->add_field('item_name', $product['name']);
     $this->paypal_lib->add_field('custom', $userID);
     $this->paypal_lib->add_field('item_number', $product['id']);
     $this->paypal_lib->add_field('amount', $product['price']);
     $this->paypal_lib->image($logo);
     $this->paypal_lib->paypal_auto_form();
 }
Exemplo n.º 26
0
 public function index()
 {
     $page = $this->uri->segment(3);
     $limit = 10;
     if (!$page) {
         $offset = 0;
     } else {
         $offset = $page;
     }
     $data['title'] = "Work o_0 Yudi Purwanto";
     $data['project'] = $this->frontend_model->generate_project($limit, $offset);
     $tot_hal = $this->db->get("project");
     $config['base_url'] = base_url() . 'project/index/';
     $config['total_rows'] = $tot_hal->num_rows();
     $config['per_page'] = $limit;
     $config['uri_segment'] = 3;
     $config['first_link'] = 'First';
     $config['last_link'] = 'Last';
     $config['next_link'] = 'Next';
     $config['prev_link'] = 'Prev';
     $this->pagination->initialize($config);
     $data["paginator"] = $this->pagination->create_links();
     $data['popular'] = $this->frontend_model->generate_popular($limit);
     $this->load->view('frontend/_header', $data);
     $this->load->view('frontend/_project/_home', $data);
     $this->load->view('frontend/_popular', $data);
     $this->load->view('frontend/_footer');
 }
Exemplo n.º 27
0
 public function insertar()
 {
     $data = array('tipo' => $this->input->post('tipo'), 'descripcion_larga' => $this->input->post('descripcion_larga'), 'descripcion_corta' => $this->input->post('descripcion_corta'));
     $this->session->set_flashdata('message', 'Nuevo tipo de documento creado correctamente');
     $this->M_tipo_documento->crear($data);
     redirect(base_url() . 'tipo_documento');
 }
Exemplo n.º 28
0
 public function cari()
 {
     $this->load->model('penjualan_model');
     $mode = $this->input->post('mode');
     $data = array('data' => $this->penjualan_model->laporanKeuangan(), 'urlCetak' => base_url($this->kelas . "/cetak"));
     $this->load->view($this->kelas . '/' . $mode, $data);
 }
Exemplo n.º 29
0
 function checkaccess($access)
 {
     $accesslevel = $this->session->userdata('accesslevel');
     if (!in_array($accesslevel, $access)) {
         redirect(base_url() . 'index.php/site?alerterror=You do not have access to this page. ', 'refresh');
     }
 }
Exemplo n.º 30
0
 public function index()
 {
     // set variables
     $data["menu1"] = $this->uri->segment(1);
     $data["menu2"] = $this->uri->segment(2);
     // set the category code
     if ($this->uri->segment(4) == '') {
         $data["category_code"] = POSIPAY_DEFAULT_CAT_CODE;
     } else {
         $data["category_code"] = $this->uri->segment(4);
     }
     // get category name
     $data['category'] = $this->posipay_model->get_category_name($data["category_code"]);
     // config variables for pagination
     $config = array();
     $config["base_url"] = base_url() . $data["menu1"] . "/" . $data["menu2"] . "/index/" . $data["category_code"];
     $config["total_rows"] = $this->posipay_model->record_count($data["category_code"]);
     $config["per_page"] = POSIPAY_RECORDCOUNT;
     $config["uri_segment"] = 5;
     $config["num_links"] = round($config["total_rows"] / $config["per_page"]);
     // initialize pagination
     $this->pagination->initialize($config);
     // get file lists
     $page = $this->uri->segment(5) ? $this->uri->segment(5) : 0;
     $data["results"] = $this->posipay_model->search_list($data["category_code"], $page);
     $data["pagination__links"] = $this->pagination->create_links();
     // call view
     $this->load->view("posipay/search_view", $data);
 }