function enable_image_crud($table = 'photos', $url_field = '', $upload_path = '', $order_field = 'pos', $title_field = '')
 {
     // get config file
     $this->config->load('crud');
     $params = $this->config->item('image_crud');
     // create CRUD object
     $this->load->library('image_CRUD');
     $crud = new image_CRUD();
     // basic settings
     $crud->set_table($table);
     // [Required] field name of image path (e.g. "image_url")
     $url_field = empty($url_field) ? $params['url_field'] : $url_field;
     $crud->set_url_field($url_field);
     // [Required] if "upload_path" parameter is empty, map to subfolder with <table> name, e.g. "assets/uploads/photos"
     $upload_path = empty($upload_path) ? $params['upload_dir'] . $table : $params['upload_dir'] . $upload_path;
     $crud->set_image_path($upload_path);
     // [Optional] field name of image order (e.g. "pos")
     if (!empty($order_field)) {
         $crud->set_ordering_field($order_field);
     } else {
         if (empty($order_field) && !empty($params['order_field'])) {
             $crud->set_ordering_field($params['order_field']);
         }
     }
     // [Optional] field name of image caption (e.g. "caption")
     if (!empty($title_field)) {
         $crud->set_title_field($title_field);
     } else {
         if (empty($title_field) && !empty($params['title_field'])) {
             $crud->set_title_field($params['title_field']);
         }
     }
     // other custom logic to be done in child controllers
     return $crud;
 }
 protected function generate_image_crud($table, $url_field, $upload_path, $order_field = 'pos', $title_field = '')
 {
     // create CRUD object
     $this->load->library('Image_crud');
     $crud = new image_CRUD();
     $crud->set_table($table);
     $crud->set_url_field($url_field);
     $crud->set_image_path($upload_path);
     // [Optional] field name of image order (e.g. "pos")
     if (!empty($order_field)) {
         $crud->set_ordering_field($order_field);
     }
     // [Optional] field name of image caption (e.g. "caption")
     if (!empty($title_field)) {
         $crud->set_title_field($title_field);
     }
     // other custom logic to be done outside
     $this->mCrud = $crud;
     return $crud;
 }
Esempio n. 3
0
 function simple_photo_gallery()
 {
     $image_crud = new image_CRUD();
     $image_crud->unset_upload();
     $image_crud->unset_delete();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('url');
     $image_crud->set_table('example_4')->set_image_path('assets/uploads');
     $output = $image_crud->render();
     $this->_example_output($output);
 }
Esempio n. 4
0
 function tampilfoto()
 {
     $image_crud = new image_CRUD();
     $image_crud->unset_upload();
     $image_crud->unset_delete();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('url');
     $image_crud->set_table('gallery_foto')->set_image_path('assets/uploads');
     $output = $image_crud->render();
     $this->foto_output($output);
 }
Esempio n. 5
0
 function simple_photo_gallery()
 {
     $carpeta = (string) $this->tank_auth->get_username();
     $image_crud = new image_CRUD();
     $image_crud->unset_upload();
     $image_crud->unset_delete();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('url');
     $image_crud->set_table('example_4')->set_image_path('assets/uploads/' . $carpeta);
     $output = $image_crud->render();
     $this->_example_output($output);
 }
Esempio n. 6
0
 function tambahfoto()
 {
     $image_crud = new image_CRUD();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('url');
     $image_crud->set_title_field('title');
     $image_crud->set_table('gallery_foto')->set_ordering_field('priority')->set_image_path('assets/uploads');
     $output = $image_crud->render();
     $this->tambah_foto($output);
 }
Esempio n. 7
0
 function pessoa_fotos()
 {
     $image_crud = new image_CRUD();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('foto');
     $image_crud->set_title_field('descricao');
     $image_crud->set_table('foto')->set_ordering_field('priority')->set_image_path('assets/uploads')->set_relation_field('pessoa_id');
     //$ci->db->where('animal_ani_id', $idAni);
     //Access_Helper::verificaAcesso(Access_Helper::ANIMAL, $image_crud);
     $output = $image_crud->render();
     $this->_foto_output($output);
 }
 function gallery($gal_id = 1)
 {
     $upload_path = "../assets/uploads/gallery/packages/";
     //        /* code before */
     //        //I check the existence of the folder
     //        if( !is_dir($upload_path) )// if not exist
     //           mkdir($upload_path);// i create
     //        /* image crud instance */
     $this->load->library('image_CRUD');
     $image_crud = new image_CRUD();
     $image_crud->set_primary_key_field('image_id');
     $image_crud->set_title_field('image_title');
     $image_crud->set_url_field('image_url');
     $image_crud->set_table('images')->set_relation_field('image_category')->set_ordering_field('image_order');
     $image_crud->set_image_type('image_type', 'package');
     $image_crud->set_image_path($upload_path);
     $output = $image_crud->render();
     if (!is_numeric($gal_id)) {
         $this->session->set_flashdata('error', 'please click on gallery icon form packages list');
         redirect('packages');
     }
     $package_name = @$this->db->select('package_title')->get_where('packages', array('package_id' => $gal_id))->row()->package_title;
     if ($image_crud->get_state_name() == 'list') {
         if (!$package_name) {
             $this->session->set_flashdata('error', 'please click on gallery icon form packages list');
             redirect('packages');
         }
     }
     $data = array('main_content' => 'image_list', 'output' => $output, 'pagetitle' => 'Image Gallery of ' . $package_name, 'pagedesc' => 'Gallery', 'contenttitle' => 'Image Gallery', 'js_files' => array(), 'css_files' => array());
     $this->load->view('gc_admin_wrapper', $data);
 }
Esempio n. 9
0
 public function image()
 {
     $image_crud = new image_CRUD();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('url');
     $image_crud->set_table('example_1')->set_image_path('assets/uploads');
     $output = $image_crud->render();
     $this->_principal($output);
 }
Esempio n. 10
0
 function profile($username = "")
 {
     $this->authentication->verify('user', 'edit');
     $data = $this->users_model->get_data_row($username);
     $data['provinsi_option'] = $this->crud->provinsi_option($data['propinsi']);
     $data['title_group'] = "Dashboard";
     $data['title_form'] = "Pendaftar Baru (detail profil)";
     $user['username'] = $username;
     $image_crud = new image_CRUD();
     $image_crud->unset_upload();
     $image_crud->unset_delete();
     $image_crud->set_primary_key_field('id');
     $image_crud->set_url_field('filename');
     $image_crud->set_table('app_users_gallery')->set_relation_field('username')->set_relation_value($username)->set_ordering_field('priority')->set_image_path('public/gallery')->set_draganddrop(false);
     $output = $image_crud->render();
     // print_r($output);
     $data['output'] = $output->output;
     $data['content'] = $this->parser->parse("users/profile", $data, true);
     $this->template->show($data, "home");
 }
Esempio n. 11
0
 public function slider()
 {
     $image_crud = new image_CRUD();
     $image_crud->set_table('sliders');
     $image_crud->set_url_field('image_url');
     $image_crud->set_title_field('caption');
     $image_crud->set_ordering_field('urutan')->set_image_path('assets/uploads/sliders');
     $output = $image_crud->render();
     $output->title = 'Kelola Slide Show';
     $this->template->load('template/template_main', 'admin/contents', $output);
 }