Advance Search In Codeigniter

i am do searching in codeigniter an its work using this query$this->db->where("(h_name LIKE '".$term."%' )");i would like to advanced this search like dataTable in codeigniter any way to improve the query serch all letter from the word please help me?...Read more

Show data from multiple checkbox in codeigniter

i hope all of you can help me to solve my application problemmy problem is when i would like to show data from my multiple checkbox , data success to show but just showing my first data that i have check.example is i check data 1 , data 2 , data 3, but the only data 1 are showing on my page.my controller : function comparison() { if ($this->input->post('submit')) { foreach ($id_product = $this->input->post('id_product') as $rm) { $show_compare = $this->Compare->start_compare($rm); ...Read more

display - How to load database data to table using codeigniter

I want to display my database record in a table, but I don't get it. I don't know whats wrong in my code but it displays empty result. I have attached my model and view. I am using codeigniter framework. Any help would be much appreciated.. Here is my model:public function display_data(){ $query = $this->db->query("SELECT * FROM sales_rep_tbl;"); if($query->num_rows > 0){ $this->table->set_heading( "SR_Code", "SR_Fname" ); foreach($query->result() as $r...Read more

Unable to download pdf file from the server in codeigniter

I am using the following codes in my controller to download pdf files which are stored in a folder inside application folder in codeigniter. In the view page I have a button, upon clicking it, it redirects to this controller and then it download the file. It downloads blank page(pdf).Looking forward to any suggestion. $filePath = APPPATH.'invoice/'."Let's Sunday#".$this->uri->segment(4).".pdf"; if(!empty($filePath) && file_exists($filePath)){ header("Content-Type: application/octet-stream"); header("Content-...Read more

codeigniter - Fpdi setting background pdf or image code igniter

In my project I am saving scanned documents to either pdf or image format. Now After scanning I am creating a barcode of the file. Then I want to print to print the scanned docs together with the barcode. Now I am using fpdi for generating the pdf file that I will put the scanned document into together with the barcode. I want to set the scanned documents as background of the pdf and then just add the barcode above the scanned document. I am using:Code IgniterFpdfTcpdfI used the code below:$pdf = new Fpdi();$pdf->SetTitle($filename);$pdf->...Read more

CodeIgniter: How to get Controller, Action, URL information

I have these URLs:http://backend.domain.com/system/setting/edit/12 http://backend.domain.com/product/edit/1How to get controller name, action name from these URLs. I'm CodeIgniter newbie. Are there any helper function to get this infoEx:$params = helper_function( current_url() )Where $params becomes something like array ( 'controller' => 'system/settings', 'action' => 'edit', '...'=>'...')...Read more

codeigniter - Display value in view

In this codeigniter model i have this query testing if value entered in input exists in database.. function get_search_form() { $match = $this->input->post('search1'); $this->db->where('numero',$match); $this->db->where('inscris','non'); $q = $this->db->get('transaction'); if($q->num_rows()>0) { foreach($q->result() as $row) { $data[] = $row; } return $data; }}Behold the controller i'd like to display value grabbed in input in view inscription.php functio...Read more

dynamic - Codeigniter: Is calling a model from a helpler a bad idea?

I have a menu on my page that is loaded on every page. The menu data is fetched from the database through a model. My first thought was to call the model from the controller, and then pass it to the view on every page. But that results in "messy" code, if i ever forget to pass the menu data to the view, it will result in an ugly error (or just no menu items).So i came up with the solution of fetching the menu items through a helper, and then just call the helper function from the view. It makes more sense, because i only have the code in one pl...Read more

image manipulation - CodeIgniter Upload and Resize Problem

I have spent days trying to make this work based on the examples in the documentation but I am missing something or I am just STUPID!I have a CMS application where users upload an image for display in a very fixed layout. We do not want to limit the file size of the uploaded image but would rather "process" it after it arrives.The image needs to be 615px wide but some of the images uploaded directly from digital cameras are 2500X2000 and bigger so this is CRITICAL.I pieced together the code from the manual and the image is successfully being up...Read more

file - How to upload two images into two fields using codeigniter

I want to upload two or more pictures using one form in separate fields into database using Codeigniter.but here only one is uploading .. can anyone please help me with it..My controllerclass Products extends CI_Controller { public function __construct() { // Call the CI_Model constructor parent::__construct(); $this->load->model('Product_model'); } public function save() { $config['upload_path'] = './uploads/'; $config...Read more