2013-10-28 3 views
0

i는 개인 정보 여기 CodeIgniter를 제출 아약스 경고 성공

을 제출이 양식은 내보기입니다했다

<?php $attributes=a rray('autocomplete'=>"off", 'id' => 'theForm');?> 
<?php echo form_open_multipart('employee/personaldetails', $attributes); ?> 
<div class="row"> 
<div class="span3 offset1"> 
    <label>First Name</label> 
    <input onkeypress="return fnAllowAlpha(event);" maxlength="50" type="text" value="<?php echo $info['first_name']; ?>" name="first_name" disabled> 
    <input type="hidden" value="<?php echo $info['employee_image']; ?>" name="employee_image" disabled> 
</div> 
<div class="span3"> 
    <label>Middle Name</label> 
    <input onkeypress="return fnAllowAlpha(event);" maxlength="50" type="text" value="<?php echo $info['middle_name']; ?>" name="middle_name" disabled> 
</div> 
<div class="span3"> 
    <label>Last Name</label> 
    <input onkeypress="return fnAllowAlpha(event);" maxlength="50" type="text" value="<?php echo $info['last_name']; ?>" name="last_name" disabled> 
</div> 
<div class="span1"> 
    <div class="down1"> 
     <button type="submit" class="button-orange" id="btnSave" style="display:none;">Save</button> 
    </div> 
</div> 

CONTROLLER

$this->load->model('mdl_employee','emp'); 
$id = $this->session->userdata('id'); 
$P1 = $this->input->post('first_name'); 
$P2 = $this->input->post('middle_name'); 
$P3 = $this->input->post('last_name'); 
$this->emp->update_myinfo($id, $P1, $P2, $P3); 

내가 잘 모릅니다

public function update_myinfo($id, $P1, $P2, $P3){ 
    $employee_data = array(
      'first_name' => $P1, 
      'middle_name' => $P2, 
      'last_name' => $P3); 
$this->db->where('employee_id', $id); 
$this->db->update('employee', $employee_data); 
} 

모델 아약스 사용법. 성공 여부에 관계없이 아약스에 경고하고 싶습니다. 내 데이터베이스를 업데이 트한 후 .. 그냥 새로운 프로그래머

답변