Search Results

Search found 981 results on 40 pages for 'codeigniter 2'.

Page 15/40 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Codeigniter: simple form function

    - by Kevin Brown
    I'm stuck writing a simple form...I feel dumb. Here's my controller: function welcome_message(){ //Update welcome message $id = $this->session->userdata('id'); $profile['welcome_message'] = $this->input->post('welcome_message'); $this->db->update('be_user_profiles',$profile, array('user_id' => $id)); } And the html: <?php print form_open('home/welcome_message')?> <input type="checkbox" value="0" checked="false">Don't show me this again</input> <p> <input class="button submit" type="submit" class="close-box" value="Close" /> </p> <?php print form_close()?> Edit I simply need it to submit to a private function and return to the home page (page submitted from).

    Read the article

  • Validating forms with regex in codeigniter

    - by Alex
    How can I validate a form using regex in codeiginiter. I'd like to check the input against: ^([0-1][0-9]|[2][0-3]):([0-5][0-9])$ I'm assuming the best way is in some sort of callback. I tried a bunch of ideas on the web but I can't seem to get any working.

    Read the article

  • CodeIgniter: problem using foreach in view

    - by krike
    I have a model and controller who gets some data from my database and returns the following array Array ( [2010] => Array ( [year] => 2010 [months] => Array ( [0] => stdClass Object ( [sales] => 2 [month] => Apr ) [1] => stdClass Object ( [sales] => 1 [month] => Nov ) ) ) [2011] => Array ( [year] => 2011 [months] => Array ( [0] => stdClass Object ( [sales] => 1 [month] => Nov ) ) ) ) It shows exactly what it should show but the key's have different names so I have no idea on how to loop through the years using foreach in my view. Arrays is something I'm not that good at yet :( this is the controller if you need to know: function analytics() { $this->load->model('admin_model'); $analytics = $this->admin_model->Analytics(); foreach ($analytics as $a): $data[$a->year]['year'] = $a->year; $data[$a->year]['months'] = $this->admin_model->AnalyticsMonth($a->year); endforeach; echo"<pre style='text-align:left;'>"; print_r($data); echo"</pre>"; $data['main_content'] = 'analytics'; $this->load->view('template_admin', $data); }//end of function categories()

    Read the article

  • Order by Domain Extension Name using CodeIgniter Active Record Class

    - by allan
    $extension = “SUBSTRING_INDEX(domain_name, ‘.’, -1)”; $this->db->order_by($extension, “asc”); It says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘asc LIMIT 50’ at line 44 But its working when I didn’t used the $this-db-order_by Active Record Class such as this one: $this-db-query(“SELECT * FROM domain ORDER BY SUBSTRING_INDEX(domain_name, ‘.’, -1)”); Anyone please help me. Thanks.

    Read the article

  • form_dropdown in codeigniter

    - by Patrick
    I'm getting a strange behaviour from form_dropdown - basically, when I reload the page after validation, the values are screwed up. this bit generates 3 drop downs with days, months and years: $days = array(0 => 'Day...'); for ($i = 1; $i <= 31; $i++) { $days[] = $i; } $months = array(0 => 'Month...', ); for ($i = 1; $i <= 12; $i++) { $months[] = $i; } $years = array(0 => 'Year...'); for ($i = 2010; $i <= 2012; $i++) { $years[$i] = $i; echo "<pre>"; print_r($years); echo "</pre>";//remove this } $selected_day = (isset($selected_day)) ? $selected_day : 0; $selected_month = (isset($selected_month)) ? $selected_month : 0; $selected_year = (isset($selected_year)) ? $selected_year : 0; echo "<p>"; echo form_label('Select date:', 'day', array('class' => 'left')); echo form_dropdown('day', $days, $selected_day, 'class="combosmall"'); echo form_dropdown('month', $months, $selected_month, 'class="combosmall"'); echo form_dropdown('year', $years, $selected_year, 'class="combosmall"'); echo "</p>"; ...and generates this: <p><label for="day" class="left">Select date:</label><select name="day" class="combosmall"> <option value="0" selected="selected">Day...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select><select name="month" class="combosmall"> <option value="0" selected="selected">Month...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> </select><select name="year" class="combosmall"> <option value="0" selected="selected">Year...</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> </select></p> however, when the form is reloaded after validation, the same code above generates this: <!-- days and months... --> <select name="year" class="combosmall"> <option value="0" selected="selected">Year...</option> <option value="1">2010</option> <option value="2">2011</option> <option value="3">2012</option> </select> So basically the value start from 1 instead of 2010. The same happens to days and months but obviously it doesn't make any difference in this particular case as the values would start from 1 anyway. How can I fix this - and why does it happen? edit: validation rules are: $this->load->library('form_validation'); //...rules for other fields.. $this->form_validation->set_rules('day', 'day', 'required|xss_clean'); $this->form_validation->set_rules('month', 'month', 'required|xss_clean'); $this->form_validation->set_rules('year', 'year', 'required|xss_clean'); $this->form_validation->set_error_delimiters('<p class="error">', '</p>'); //define other errors if($this->input->post('day') == 0 || $this->input->post('month') == 0 || $this->input->post('year') == 0) { $data['error'] = "Please check the date of your event."; }

    Read the article

  • Codeigniter + ajax(jQuery) session problem

    - by faya
    Hello, I have a problem in server side retrieving session with using ajax post request. Here is my sample code: JavaScript: $(function() { $('.jid_hidden_data').submit(function() { var serialized = $(this).serialize(); var sUrl = "http://localhost/stuff"; $.ajax({ url: sUrl, type: "POST", data: serialized, success: function(data) { alert(data); } }) return false; }); }); CodeIngiter(PHP) side: function stuff() { $post_stuff = $this->input->post('my_stuff'); // WORKS PERFECTLY $user_id = $this->session->userdata('user_id'); // RETURNS NULL } Where commented returns NULL it should return users session data, because it really exists. What is the problem? Method post doesn't get cookies or what? Thanks for any help!

    Read the article

  • codeIgniter: pass parameter to a select query from previous query

    - by krike
    I'm creating a little management tool for the browser game travian. So I select all the villages from the database and I want to display some content that's unique to each of the villages. But in order to query for those unique details I need to pass the id of the village. How should I do this? this is my code (controller): function members_area() { global $site_title; $this->load->model('membership_model'); if($this->membership_model->get_villages()) { $data['rows'] = $this->membership_model->get_villages(); $id = 1;//this should be dynamic, but how? if($this->membership_model->get_tasks($id)): $data['tasks'] = $this->membership_model->get_tasks($id); endif; } $data['title'] = $site_title." | Your account"; $data['main_content'] = 'account'; $this->load->view('template', $data); } and this is the 2 functions I'm using in the model: function get_villages() { $q = $this->db->get('villages'); if($q->num_rows() > 0) { foreach ($q->result() as $row) { $data[] = $row; } return $data; } } function get_tasks($id) { $this->db->select('name'); $this->db->from('tasks'); $this->db->where('villageid', $id); $q = $this->db->get(); if($q->num_rows() > 0) { foreach ($q->result() as $task) { $data[] = $task; } return $data; } } and of course the view: <?php foreach($rows as $r) : ?> <div class="village"> <h3><?php echo $r->name; ?></h3> <ul> <?php foreach($tasks as $task): ?> <li><?php echo $task->name; ?></li> <?php endforeach; ?> </ul> <?php echo anchor('site/add_village/'.$r->id.'', '+ add new task'); ?> </div> <?php endforeach; ?> ps: please do not remove the comment in the first block of code!

    Read the article

  • PHP/Codeigniter processing a list with javascript

    - by user270797
    I have a list of items that the user can select. I want it to be more user friendly than standard checkboxes so I have seperate div's each with a unique id. When user clicks an item, I use javascript to display a tick on top of that item and change the style to show that it is highlighted. Im trying to work out how I can pass the list of id's when the form is submitted. Remember, if the user unticks an item, it should be removed from the list, I was thinking of using comma seperated values in a hidden text field but couldnt work out how to remove items from the start of the list if they were deselected

    Read the article

  • codeigniter and form action trailing / issue??

    - by alex
    Hi, I am having a bit of an issue with the way CI is dealing with /. In a regular form i notice that the following form action didn't work action="mydomain.com/ci-controller/login/" but this one does work action="mydomain.com/ci-controller/login" Strange but he it worked. But now i need this from a iframe, i the iframe i have a login form which sets the parents url to mydomain.com/ci-controller/login, but i get the same error as it was calling mydomain.com/ci-controller/login/ Could my problem be that the call from the iframe adds a trailing / which is not visible?? Any thoughts

    Read the article

  • Sending emails with CodeIgniter in a local XAMPP server

    - by KeyStroke
    Hi, I'm trying to send emails through localhost (XAMPP Windows 1.7.3 installation), but I've been trying for hours with no success. This is the last code I tried: $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => '[email protected]', 'smtp_pass' => 'mypassword', ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('[email protected]', 'My Name'); $this->email->to('[email protected]'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); if($this->email->send()) { echo 'Your email was sent.'; } else { show_error($this->email->print_debugger()); } Whenever I tried to load this the page shows that it's loading but nothing happens. Is there anything I need to setup in my server to insure email delivery? I messed with php.ini and sendmail's config a bit with no luck. And openSSL isn't available in case that matters. Any idea what's wrong?

    Read the article

  • CodeIgniter Error Log Info + Errors

    - by fatnjazzy
    Hi, IS there a way to save in the log, Info + Errors without debug? Howcome debug level apears with info? If i want to log info "Account id 4345 was deleted by Admin", why do i need to see all of these: DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Hooks Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 URI Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Router Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Output Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Input Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Global POST and COOKIE data sanitized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Language Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Loader Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config file loaded: config/safe_charge.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config file loaded: config/web_fx.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: loadutils_helper DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: objectsutils_helper DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: logutils_helper DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Helper loaded: password_helper DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Database Driver Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 cURL Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Language Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Config Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Account MX_Controller Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/pending_account_model.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/proccess_accounts_model.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/web_fx_model.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/trader_account_type_spreads.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 File loaded: ./modules/accounts/models/trader_accounts.php DEBUG - 2010-12-27 08:39:13 --> 192.168.200.32 Model Class Initialized Thanks

    Read the article

  • Codeigniter: Controller URI with Library

    - by Kevin Brown
    I have a working controller and library function, but I now need to pass a URI segment to the library for decision making, and I'm stuck. Controller: function survey($method) { $id = $this->session->userdata('id'); $data['member'] = $this->home_model->getUser($id); //Convert the db Object to a row array $data['manager'] = $data['member']->row(); $manager_id = $data['manager']->manager_id; $data['manager'] = $this->home_model->getUser($manager_id); $data['manager'] = $data['manager']->row(); if ($data['manager']->credits == '0') { flashMsg('warning',"You can't complete the assessment until your manager has purchased credit."); redirect('home','location'); } elseif ($data['manager']->test_complete == '3'){ flashMsg('warning',"You already completed the Assessment."); redirect('home','location'); } else{ $data['header'] = "Home"; $this->survey_form_processing->survey_form($this->_container,$data); } } Library: function survey_form($container) { if($method ==1){ $id = $this->CI->session->userdata('id'); // Setup fields for($i=1;$i<18;$i++){ $fields["a_".$i] = 'Question '.$i; } for($i=1;$i<17;$i++){ $fields["b_".$i] = 'Question '.$i; } $fields["company_name"] = "Company Name"; $fields['company_address'] = "company_address"; $fields['company_phone'] = "company_phone"; $fields['company_state'] = "company_state"; $fields['company_city'] = "company_city"; $fields['company_zip'] = "company_zip"; $fields['job_title'] = "job_title"; $fields['job_type'] = "job_type"; $fields['job_time'] = "job_time"; $fields['department'] = "department"; $fields['supervisor'] = "supervisor"; $fields['vision'] = "vision"; $fields['height'] = "height"; $fields['weight'] = "weight"; $fields['hand_dominance'] = "hand_dominance"; $fields['areas_of_fatigue'] = "areas_of_fatigue"; $fields['injury_review'] = "injury_review"; $fields['job_positive'] = "job_positive"; $fields['risk_factors'] = "risk_factors"; $fields['job_improvement_short'] = "job_improvement_short"; $fields['job_improvement_long'] = "job_improvement_long"; $fields["c_1"] = "Near Lift"; $fields["c_2"] = "Middle Lift"; $fields["c_3"] = "Far Lift"; $this->CI->validation->set_fields($fields); // Set Rules for($i=1;$i<18;$i++){ $rules["a_".$i]= 'hour|integer|max_length[2]'; } for($i=1;$i<17;$i++){ $rules["b_".$i]= 'hour|integer|max_length[2]'; } // Setup form default values $this->CI->validation->set_rules($rules); if ( $this->CI->validation->run() === FALSE ) { // Output any errors $this->CI->validation->output_errors(); } else { // Submit form $this->_submit(); } // Modify form, first load $this->CI->db->from('be_user_profiles'); $this->CI->db->where('user_id' , $id); $user = $this->CI->db->get(); $this->CI->db->from('be_survey'); $this->CI->db->where('user_id' , $id); $survey = $this->CI->db->get(); $user = array_merge($user->row_array(),$survey->row_array()); $this->CI->validation->set_default_value($user); // Display page $data['user'] = $user; $data['header'] = 'Risk Assessment Survey'; $data['page'] = $this->CI->config->item('backendpro_template_public') . 'form_survey'; $this->CI->load->view($container,$data); } else{ redirect('home','location'); } } My library function doesn't know what to do with Method...and I'm confused. Does it have something to do with instances in my library?

    Read the article

  • Problem with jquery ajax form on Codeigniter

    - by Code Burn
    Everytime I test the email is send correctly. (I have tested in PC: IE6, IE7, IE8, Safari, Firefox, Chrome. MAC: Safari, Firefox, Chrome.) The _POST done in jquery (javascript). Then when I turn off javascript in my browser nothing happens, because nothing is _POSTed. Nome: Jon Doe Empresa: Star Cargo: Developer Email: [email protected] Telefone: 090909222988 Assunto: Subject here.. But I keep recieving emails like this from costumers: Nome: Empresa: Cargo: Email: Telefone: Assunto: CONTACT_FORM.PHP <form name="frm" id="frm"> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Nome<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="Cnome" id="Cnome" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Empresa<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmpresa" id="CEmpresa" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Cargo</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CCargo" id="CCargo" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Email<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CEmail" id="CEmail" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Telefone</div> <div class="campoFormulario inputDeCampo" ><input class="texto textocinzaescuro" size="31" name="CTelefone" id="CTelefone" value=""/></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >Assunto<font style="color:#EE3063;">*</font></div> <div class="campoFormulario inputDeCampo" ><textarea class="texto textocinzaescuro" name="CAssunto" id="CAssunto" rows="2" cols="28"></textarea></div> <div class="campoFormulario nomeDeCampo texto textocinzaescuro" >&nbsp;</div> <div class="campoFormulario inputDeCampo" style="text-align:right;" ><input id="Cbutton" class="texto textocinzaescuro" type="submit" name="submit" value="Enviar" /></div> </form> <script type="text/javascript"> $(function() { $("#Cbutton").click(function() { if(validarForm()){ var Cnome = $("input#Cnome").val(); var CEmpresa = $("input#CEmpresa").val(); var CEmail = $("input#CEmail").val(); var CCargo = $("input#CCargo").val(); var CTelefone = $("input#CTelefone").val(); var CAssunto = $("textarea#CAssunto").val(); var dataString = 'nome='+ Cnome + '&Empresa=' + CEmpresa + '&Email=' + CEmail + '&Cargo=' + CCargo + '&Telefone=' + CTelefone + '&Assunto=' + CAssunto; //alert (dataString);return false; $.ajax({ type: "POST", url: "http://www.myserver.com/index.php/pt/envia", data: dataString, success: function() { $('#frm').remove(); $('#blocoform').append("<br />Obrigado. <img id='checkmark' src='http://www.myserver.com/public/images/estrutura/ok.gif' /><br />Será contactado brevemente.<br /><br /><br /><br /><br /><br />") .hide() .fadeIn(1500); } }); } return false; }); }); function validarForm(){ var error = 0; if(!validateNome(document.getElementById("Cnome"))){ error = 1 ;} if(!validateNome(document.getElementById("CEmpresa"))){ error = 1 ;} if(!validateEmail(document.getElementById("CEmail"))){ error = 1 ;} if(!validateNome(document.getElementById("CAssunto"))){ error = 1 ;} if(error == 0){ //frm.submit(); return true; }else{ alert('Preencha os campos correctamente.'); return false; } } function validateNome(fld){ if( fld.value.length == 0 ){ fld.style.backgroundColor = '#FFFFCC'; //alert('Descrição é um campo obrigatório.'); return false; }else { fld.style.background = 'White'; return true; } } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateEmail(fld) { var tfld = trim(fld.value); var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = '#FFFFCC'; //alert('Email é um campo obrigatório.'); return false; } else if (!emailFilter.test(tfld)) { //alert('Email inválido.'); fld.style.background = '#FFFFCC'; return false; } else if (fld.value.match(illegalChars)) { fld.style.background = '#FFFFCC'; //alert('Email inválido.'); return false; } else { fld.style.background = 'White'; return true; } } </script> FUNCTION ENVIA (email sender): function envia() { $this->load->helper(array('form', 'url')); $nome = $_POST['nome']; $empresa = $_POST['Empresa']; $cargo = $_POST['Cargo']; $email = $_POST['Email']; $telefone = $_POST['Telefone']; $assunto = $_POST['Assunto']; $mensagem = " Nome:".$nome." Empresa:".$empresa." Cargo:".$cargo." Email:".$email." Telefone:".$telefone." Assunto:".$assunto.""; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: no-reply' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail('[email protected]', $mensagem, $headers); }

    Read the article

  • if statement inside array : codeigniter

    - by ahmad
    Hello , I have this function to edit all fields that come from the form and its works fine .. function editRow($tableName,$id) { $fieldsData = $this->db->field_data($tableName); $data = array(); foreach ($fieldsData as $key => $field) { $data[ $field->name ] = $this->input->post($field->name); } $this->db->where('id', $id); $this->db->update($tableName, $data); } now I want to add a condition for Password field , if the field is empty keep the old password , I did some thing like that : function editRow($tableName,$id) { $fieldsData = $this->db->field_data($tableName); $data = array(); foreach ($fieldsData as $key => $field) { if ($data[ $field->name ] == 'password' && $this->input->post('password') == '' ) { $data[ 'password' ] => $this->input->post('hide_password'), //'password' => $this->input->post('hide_password'), } else { $data[ $field->name ] => $this->input->post($field->name) } } $this->db->where('id', $id); $this->db->update($tableName, $data); } but I get error ( Parse error: syntax error, unexpected T_DOUBLE_ARROW in ... ) Html , some thing like this : <input type="text" name="password" value=""> <input type="hidden" name="hide_password" value="$row->$password" /> umm , any help ? thanks ..

    Read the article

  • Im having trouble getting SWFUplader to play ball in my codeigniter application

    - by Purplefish32
    I have this peice of code in my handler.js, I'm getting the correct serverData value throught ajax, ( Well it's echoed correctly un the alert box) but no matter what, i just cant seem to enter either of the 'if' blocks. I have double checked the type and it is a string. Something is definetly funky. function uploadSuccess(file, serverData) { try { var progress = new FileProgress(file, this.customSettings.progressTarget); alert(serverData); if(serverData == "uploadSuccess") { progress.setComplete(); progress.setStatus("Completed"); progress.toggleCancel(false); } if(serverData == "uploadError") { progress.setError(); progress.toggleCancel(false); progress.setStatus("Error: X"); progress.toggleCancel(false); } } catch (ex) { this.debug(ex); } }

    Read the article

  • CodeIgniter Form Validation

    - by mmcglynn
    I am trying to set up validation on a simple contact form that is created using the form helper. No validation at all occurs. What is wrong? In the code below, the “good” keyword always shows, regardless of what is entered into the form, and the saved values set via set_value are never shown. Controller // Contact function contact() { $data['pageTitle'] = "Contact"; $data['bodyId'] = "contact"; $this->load->library('form_validation'); $config_rules = array ('email' => 'required','message' => 'required'); $this->form_validation->set_rules($config_rules); if ($this->form_validation->run() == FALSE) { echo "bad"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } else { echo "good"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } } View echo validation_errors(); echo form_open('events/contact'); // name echo form_label('Name', 'name'); $data = array ( 'name' => 'name', 'id' => 'name', 'maxlength' => '64', 'size' => '40', 'value' => set_value('name') ); echo form_input($data) . "\n<br />"; // email address echo form_label('Email Address', 'email'); $data = array ( 'name' => 'email', 'id' => 'email', 'maxlength' => '64', 'size' => '40', 'value' => set_value('email') ); echo form_input($data) . "\n<br />"; // message echo form_label('Message', 'message'); $data = array ( 'name' => 'message', 'id' => 'message', 'rows' => '8', 'cols' => '35', 'value' => set_value('message') ); echo form_textarea($data) . "\n<br />"; echo form_submit('mysubmit', 'Send Message'); echo form_close();

    Read the article

  • Seperate Configuration files for each user in codeigniter

    - by Dileep Dil
    is it possible to make Config files for each and every users? Currently i have a Config file named Siteconfig.php for global configuration. Now a user registered,so that i need a configuration file for that user. I have a BANNER ,user uploads images to the server and select some images for that banner. I want to store the names of the images in the configuration file,i know that database is another way. is there any wrong with this ? or is it possible to do this ? Thank you.

    Read the article

  • Codeigniter: Pass data to library funciton

    - by Kevin Brown
    I need my function to do one of two things based on the method variable, but I don't know how to get it done... My controller: function survey($method) { $id = $this->session->userdata('id'); $data['member'] = $this->home_model->getUser($id); $data['header'] = "Home"; $this->survey_form_processing->survey_form($this->_container,$data); } Library function: function survey_form($container,$method) { if($method == 1){ $this->CI->load->view($container,$data); } if($method == 2){ Do stuff... }

    Read the article

  • join 03 table in the database codeIgniter

    - by python
    with my table. person_id serial NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30), email character varying(50), username character varying(20) NOT NULL, "password" character varying(100) NOT NULL, gender character varying(10), dob date, accesslevel smallint NOT NULL, company_id integer NOT NULL,//Reference to table company position_id integer NOT NULL,//Reference to table position company_id serial NOT NULL, company_name character varying(80) NOT NULL, description character varying(255), address character varying(100) NOT NULL, In my controller ........................ // load data $persons = $this->person_model->get_paged_list(10,0); // generate table data $this->load->library('table'); $this->table->set_empty("&nbsp;"); $this->table->set_heading('No', 'FirstName', 'LastName','E-mail','Company''Gender', 'Date of Birth', 'Actions'); foreach ($persons as $person){ $this->table->add_row(++$i, $person->firstname, $person->lastname, $person->email, $person->company_name, //HOW CAN I GOT THE POSITION TITLE ?, strtoupper($person->gender)=='M'? 'Male':'Female', date('d-m-Y',strtotime($person->dob)), } My model <?php class Person_Model extends Model { private $person= 'person'; function Person(){ parent::Model(); } function list_all(){ $this->db->order_by('person_id','asc'); return $this->db->get($person); } function count_all(){ return $this->db->count_all($this->person); } function get_paged_list($limit = 0, $offset = 0) { $this->db->limit($limit, $offset); $this->db->select("person.*, company.company_name as company"); $this->db->from('person'); $this->db->join('company','person.company_id = company.company_id','left'); //MY QUESTION:? CAN I JOIN MORE WITH TABLE POSITION? $query = $this->db->get(); return $query->result(); } function get_by_id($id){ $this->db->where('person_id', $id); return $this->db->get($this->person); } function save($person){ $this->db->insert($this->person, $person); return $this->db->insert_id(); } function update($id, $person){ $this->db->where('person_id', $id); $this->db->update($this->person, $person); } function delete($id){ $this->db->where('person_id', $id); $this->db->delete($this->person); } } ?>

    Read the article

  • codeigniter problem login through IE, Safari, Chrome?

    - by kamal
    hi everyone, everything works fine in localhost but i have a problem login from other browsers like safari and chrome, in firefox its ok. may be it is because of htaccess or may be other. i tried a lot searching but come to no solution. my htaccess file look like this. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule> my server folder hirarchy looks like this public_html L application system css images .htaccess application/config/config.php looks like this $config['index_page'] = "index.php?"; $config['uri_protocol'] = 'QUERY_STRING'; any help?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >