codeigniter

Reading an XLS file with codeigniter 2.0

送分小仙女□ 提交于 2019-12-23 04:54:20
问题 I've got the following problem. I am trying to read an excel 97 - 2003 (XLS) file. The file is located within the codeigniter folder. Currently i am using the spreadsheet_excel_reader.php library to read the XLS file. Unfortunately i cannot get it working, it does recognize the XLS file and also reads the file, but when it's done parsing the file, it returns NULL This is what my method looks like. $CI =& get_instance(); $this->data_file = "./xls/BolFeed.xls"; //The XLS file and folder //$CI-

Problems using session + validation on CodeIgniter php

回眸只為那壹抹淺笑 提交于 2019-12-23 04:47:15
问题 Im working on CodeIgniter Framework. I used the library session without problems, getting data like this $this->session->usserdata('IdUsuario') this is ok. But after uses form_validation : public function verify_password() { $this->load->library('form_validation'); $this->form_validation->set_rules('Password', 'Contraseña', 'required|trim|callback_correct_password'); $this->form_validation->set_rules('Password1', 'Nueva ontraseña', 'required|trim'); $this->form_validation->set_rules(

CodeIgniter - ses_destroy() uses a LOT of CPU

我的梦境 提交于 2019-12-23 04:41:56
问题 I have a web-application written in CodeIgniter, and for the most part everything seems fairly reasonable. However, I've noticed extremely high CPU usage when a user logs out. My logout function in my auth controller is as follows: function logout() { $goto = $SERVER['HTTP-REFERER']; $this->session->sess_destroy(); if (!$goto) $goto = "/"; header('location: '.$goto); } Normally, this is perfectly fine and fast. The strange thing is that when linked to from a particular sub-page this function

Send data from controller to pop up modal using bootstrap codeigniter

限于喜欢 提交于 2019-12-23 04:26:13
问题 Hello I was going to make a forgot password function using modal bootstrap.. before I have made it without pop up modal.. I do know how to pass the data.. but now I don't know how to send data from controller to pop up modal.. Here is my code: <div id="forgot-password" class="modal hide fade in" style="display: none; "> <div class="modal-header" style="background-color:#f39c12; color:#fff;"> <h3 id="helpModalLabel"> Forgot Password</h3> </div> <div class="modal-body"> <form class="form

Ajax post not working codeigniter

蹲街弑〆低调 提交于 2019-12-23 04:24:14
问题 I am using codeigniter 3.1 Ajax post not working and i am getting 403 (Forbidden) in console. [POST http://localhost/test/post 403 (Forbidden)] HTML <div class="post"> <input type="text" id="data1" name="data1" value=""> <input type="text" id="data2" name="data2" value=""> </div> <button id="post">Submit</button> JAVASCRIPT $('#post').on('click', function () { var value1=$("#data1").val(); var value2=$("#data2").val(); $.ajax({ url: window.location.href+'/post', type: "POST", data:"{'data1':'

Codeigniter: Validation not happenning because of tinymce textarea

╄→гoц情女王★ 提交于 2019-12-23 04:18:13
问题 I am using tinymce as textarea And i am submitting my form using AJAX. My textarea is not validating because of this tinymce plugin. And if i remove this plugins from that textarea then this textarea is validating correctly. Why this mess? Please help me to get out from this problem. My VIEW page <script src="http://static.tinymce.com/tinymce/js/4.0b1/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", height: 300, theme_advanced_font_sizes: "10px

jquery + table row edit - String problem

孤人 提交于 2019-12-23 04:17:07
问题 I've one problem with editing a row... I wanted to use a button to enter edit mode in the table (generated from php array (data taken from mysql)) I have two rows for each data: <tr class="dataline"> <td><?=$row->id; ?></td> <td><?=$row->pl>0 ? '<div id="gain">' . $row->pl .'</div>' : '<div id="loss">' . $row->pl . '</div>';?></td> <td><div id="reason"><?=$row->reason;?></div></td> <td><div id="comment"><?=$row->comment;?></div></td> <td><div id="date"><?=$row->cdate; ?><br /><?=$row->ctime;

Group results after join?

别说谁变了你拦得住时间么 提交于 2019-12-23 04:15:23
问题 So, I have three tables. Movies , movies_genres and genres . I want to get a movie by its Id, and also join its genres in the result. I managed to join the results, but it doesn't display as i want it to. I'm not sure if what I'm asking is possible. This is my query: SELECT `movies`.*, GROUP_CONCAT(genres.id) AS genre_id, GROUP_CONCAT(genres.name) AS genre_name FROM (`movies`) INNER JOIN `movies_genres` ON `movies_genres`.`movie_id` = `movies`.`id` INNER JOIN `genres` ON `genres`.`id` =

Load more data from database with Codeigniter and Ajax

流过昼夜 提交于 2019-12-23 04:04:27
问题 I need help with a button for loading more data from the database. I've found examples, but too bad ones. Here is what I have so far: The Ajax: $('#revendas_conteudo .btn_carregar_mais').on('click', function(e) { $.ajax({ url: '/auto/carros/load_more', data: { offset: $('#offset').val(), limit: $('#limit').val() }, success: function(data) { $('#revendas_conteudo .lista_estoque').append(data); } }); }); My Controller method calling the Model load_more : public function load_more() { $offset =

Codeigniter: user defined helper function does not load

浪尽此生 提交于 2019-12-23 03:59:09
问题 I made a custom helper extending the system string_helper.php. I placed it in my /application/helpers directory, called it MY_string_helper.php as required, unit-tested its functions. Now, when I try to call one of its functions from a model, it does not work. The functions in the default string helper work, instead. It looks like my extension is not loaded for some reasons. Thanks a lot, and happy holidays. Edit: even funnier. I saved the file as categories_helper.php in the system/helpers