Posts

Showing posts with the label codeigniter

how to reduce speed of datatable

how to reduce speed of datatable Here is my code i am using jquey datatable i am fetching records from 1 table only but it's take hardly 5 sec to load records when i am trying to search records at that time at that time it's take 14 sec how to reduce data fetching sec i am already use searchDelay: 10 for reduce speed but still i am facing same problem. Controller : function customer_is_com_wise_datatable(){ $post_data = $this->input->post(); $id = $this->session->userdata('teen_is_logged_in')['customer_id']; $query = $this->app_model->get_categories_customer_list($id); $parent_data = $this->array_flatten($query,null); $customer_id_arr = array(); if(!empty($parent_data)){ foreach ($parent_data as $parent){ $customer_id_arr = $parent['customer_id']; } } $config['table'] = 'customers c'; $c...

CodeIgnitor Add to Cart does not insert data in Cart array where name has a special character

CodeIgnitor Add to Cart does not insert data in Cart array where name has a special character I am trying to integrate add to cart in CodeIgnitor. Now the problem is that whenever I try to add a data to the cart it only inserts data whose name in the database field does not have a special character and ignores data whose name in the database field has a special character. For example, if the product name coming from database is Jeans & Top it will ignore it whereas it will accept if it is Jeans Top instead. I tried using & instead of & in the database but same problem. Do I need to escape it somewhere in the controller? If yes, how? I am new to CI. Please help me. Controller: public function add() { $id = $this->input->post('id'); $product = $this->products_model->get($id); $data = array( 'id' => $id, 'name' => $product->pro_name, 'qty' => 1, 'price' => $product->pro_pr...

Codeigniter - Date format - Form Validation

Codeigniter - Date format - Form Validation I'm using codeigniter with PHP . I'm using following form, PHP <?php echo form_open('/register/create_new', $form_params); ?> DOB: <input type="text" id="dob" name="reg[dob]"> <input type="submit" value="Create Account" /> </form> here, #dob is in dd-mm-yyyy format. #dob dd-mm-yyyy my validation code is, array( 'field' => 'reg[dob]', 'label' => 'DOB', 'rules' => 'required' ) How can i set the rules for correct date validation? rules If possible - consider using separate dropdown menus for day month year . Less errors for your users, especially with the month and day mixups that can happen. – cartalot Jan 16 '13 at 16:26 ...

Want to close popup window after form submit

Want to close popup window after form submit I want to close child popup window after form submit and go to parent window where this child window fire and refresh this parent window. Parent window code(where i want to open popup window) function selectParticipants(id) { window.open('<?php echo base_url(); ?> trainings/get_paticipant_list/' + id, 'popup', 'width=1000,height=600'); } here i open a child window. popup window code(where i submit form data then close this window at a time) <form method="post" name="participant_form" action ="<?php echo base_url();?>trainings/add_participant/" onsubmit="Setvalues();"> </form> function Setvalues() { document.forms['participant_form'].submit(); opener.training_participant_select(); window.close(); } Here i want to close this popup window after form submit and reload parent window,but if i use onsubmit or oncli...