Hello. I am creating my php system that will be used mainly to spread information and managing large database of users. Let say i have my main "team" settings, and i want to have site where user (admin) can set up team data like "coordinator" or "manager" etc. I want to keep that simple, so admin can set up specific roles (they are stored in database under table team_settings with specific fields like team_manager etc.) by providing username/visible name.
Here is my question. I assume i will need to use jQuery to do simple "quick search" to choose specific user, but here is the deal. How to put this one in my form, that after choosing person, when i post the form i will store user_id in specific table field?
So mainly - how to set up user_id in my field when input will have user name instead?
I am looking for any person that had faced mailing problems while using codeigniter or pure php. My problem is - my shared hosting have 30 sec execution time on PHP scripts, so i need to send email, mobile text message and IM message in this time. Of course i can use cron to accomplish that, but the question is: Do anyone now any sort of extern API that i can use to send my bulk email? It will be same message (maybe with some variables, nothing more) send to about 150 users maximum.
I just need to call same methods from my controllers and return different objects - when it is requested by AJAX it should return HTML, but when I call it (or my user) manually, it should load the view. How can i accomplish that?
Thanks in advance for all of your replies. May The Force Be With You.
Answer for question 3, as I didn't understand the first two.
Simple way of using a function in two different ways:
Send an additinal parameter with ajax request like: ajax=true
(either post or get request). when a normal request post/get will be posted, it will not be there. So just have a check that whehter aN ajax
named variable exist in post/get request and process data accordingly. IF AJAX FOUND, do not load view, and echo $HTML;
else $this->load->view('viewname');
Hope that helps.
After searching the user, when clicking on the edit user are you editing on the same page on a popup or navigating to different page for editing. If you are using same page, store the username in a Javascript global variable and post it while posting other edited details. If you using different page you can pass the username or user_id in the url segment and can use this as a parameter inside the controller function.
http://yoursite.com/controller/functionName/username or id
function functionName($username) { //do validate the $username and useit //if posted update ot display the edit form }
You can use some email queue concept. Where you insert all the generated emails to a queue table and with status off course. Then process them in a cron job in preferable limit so that it will not exceed the 30second limit. I am have included the same concept for the Codeigniter websites generated using thephpcode.com