codeigniter

CodeIgniter avoid redundancy of Admin app

My CodeIgniter setup follows the usual scheme -- a user app, and a second app called 'admin' that is one directory-level down. As I understand things, it's presumed the end-user will want his/her own interface, probably one with less public access; so you have 'admin'. But Model and Library functions will often be the same for both....

CodeIgniter works on any virtual hosting service but IPOWER???

I've been working on a case using Pyrocms, a CI-based CMS, on my local WAMP server for couple months. Recently, I'm starting to deploy on client's webhosting server of IPOWER (www.ipower.com). The installation process stops after step one. And the error message is below. ON CHROME Error 101 (net::ERR_CONNECTION_RESET) I've also t...

CodeIgniter: View doesn't load if I use die() function.

Hi, I have the following code. Checks if the user is logged in or not. When the variable $is_logged_in is not set or is False, I load a message view. Unfortunately, at the same time the system loads the restricted content view. So I used die() function, and now only shows a blank page. What can I do to only load the message view when t...

CI + AJAX, Double posting + refreshing of page

Hi So I have a normal form with 1 textarea and two hidden inputs, which I would like to post via AJAX to a CI controller I have that inserts the information into the database. The problem I'm having is that a) the page action is still called and the output of the controller is displayed and b) because the initial AJAX request is still ...

Will caching be appropriate for this scenario?

Hi folks, So I have a PHP CodeIgniter webapp and am trying to decide whether to incorporate caching. Please bear with me on this one, since I'll happily admit I don't fully understand caching! So the first user loads up a page of user submitted-content. It takes 0.8 seconds (processing) to load it 'slow'. The next user then loads up ...

Codeigniter active record with several like or?

Hey.. I've run into a problem using several "like" in my sql-query (generated with Codeigniter's activerecord): SELECT * FROM (`posts`) WHERE `city` LIKE '%test%' AND `title` LIKE '%%' OR `text` LIKE '%%' Thing is, it appears to read this query as if there was a parenthesis around the first like and the second like, but I want there t...

Import javascript in php

Hi, How can i import javascript in php? No matter what i try, i can't seem to get the buttons in my page to trigger the events in javascript. This is my javascript file content: function addRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var col...

Codeigniter DB settings - why 127.0.0.1 works, localhost doesn't

Hello all On my Unix web server, I have two MySQL database servers running. One on port 3306, and another on 3307. I wanted to specify the port number of database to connect in /config/database.php of codeigniter. I tried this.... $database['hostname'] = "localhost:3307"; This did not work. The webapp connected to database on port 3...

Uploading multiple files per field and storing in a db with codeigniter

Hi, I have a form which uploads multiple file fields into a db using codeigniter. I need to be able to upload multiple files for each field. I understand that this could be achieved using some jquery magic, however, my problem is how do I intercept the multiple files and what is the best way to store them in my database? At the minute...

Get values from html table using codeigniter

Hi, How can I get the values from a html table and pass that to a controller in codeigniter? I'm passing an array to a view. I walk that array and display its content in a table where the user can alter the table. For example, adding a row, or deleting one, but changing values is a possibility too. But then the user saves the data by pr...

Retrieve second table as subarray in codeigniter query

I have two tables A & B, and B has a many:1 relationship with A. When querying rows from A I'd also like to have corresponding B records returned as an array and added to the result array from A, so I end up with something like this: A-ROW field field B-ITEMS item1 item2 item3 Is there a clean way to do th...

pls help me setting uo codeigniter and phpunit

I have created few simple apps in codeigniter never tested it. Can anyone give me some links or explain how to setup codeigniter with phpunit ? Many thanks ...

How do you customize/style codeigniter errors?

I'm trying to customize the CSS/HTML for error message displays in codeigniter so I can apply a tag too each and style them up. I tried to Google this and search the manual but must have been searching for the wrong terms - can anyone help me out? ...

Datamapper (Overzealous Edition), Codeigniter and Has Many Clarification

Firstly, I would like to just it out there that I am an ORM noob. I've never used an ORM in my life and have reached a point in my day-to-day developing that I need to do some crazy advanced relationships that I believe Datamapper Overzealous Edition can help me with as I am using Codeigniter. In my database I have the following tables;...

codeigniter thumbnail creation

what should be the height and width i should specify while creating thumbnail for my profile image. I show the thumbnail with a 40px * 40px image container ...

notifying the user about successful update in codeigniter

Hi Guys, i'm using these two lines to update my table using codeigninter active records $this->db->where('reference_number', $reference); $this->db->update('patient', $data); what i want to de is to check weather it successfully updates the table and according to that i want to give a notification to the user, how can i check the su...

Passing 2 types of array variables in codeigniter view files

Hello friends If i have $data[] array and $another_data[] in controller how do we pass both type of data in view files ? provided that codeigniter implementation is like $this->load->view('view_page', $data) ...

.htaccess Issues, Virtual Subdomains & Codeigniter

Hello guys, basically my problem is this. I have set up a system that accepts wildcard subdomains, and rewrites them to a single CodeIgniter installation. There is a controller called dispatcher that takes the arguments that it requires, as well as being passed the subdomain being used in the URL. My problem is this: I need to create Re...

Checkboxes and Image Uploads not in $_POST var?

I have a form. In the form, there is an image upload plus a series of checkboxes. I am trying to loop through the $_POST vars to process them. When I do foreach($_POST as $key => $value){echo "$key $value"; } I only get 'input' $_POST vars outputted. The checkbox values and the image upload value are not. I am utilizing Code Ignit...

functionality similar to twitter using codeigniter

Hi Guys, I will first tell you my scenario, in my problem there are two users of the system one who is using the system to register people to it, and another person who use the system to check the registered users in the system. this is a hospital scenario, people register at the registration desk and in the registration order doctor c...