Changeset 409 for pro-violet-viettel/sourcecode/application/modules/admin
- Timestamp:
- Nov 5, 2014 9:30:07 AM (11 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 2 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/smstemplate.php
r405 r409 122 122 echo json_encode($result); 123 123 } 124 public function view User()124 public function viewSms() 125 125 { 126 126 $id=$this->uri->segment(4); 127 127 $this->load->model('Smstemplate_model'); 128 128 $data=$this->Smstemplate_model->getSmstemplate($id); 129 $this->load->view('smstemplate/view User',$data);130 } 131 public function edit User()129 $this->load->view('smstemplate/viewSms',$data); 130 } 131 public function editSms() 132 132 { 133 133 $id=$this->uri->segment(4); 134 134 $this->load->model('Smstemplate_model'); 135 135 $data=$this->Smstemplate_model->getSmstemplate($id); 136 $this->load->view('smstemplate/edit User',$data);137 } 138 public function dodelete User()136 $this->load->view('smstemplate/editSms',$data); 137 } 138 public function dodeleteSms() 139 139 { 140 140 $input=$this->input->post(); 141 $id=$input[' id'];141 $id=$input['sms_id']; 142 142 $this->load->model('Smstemplate_model'); 143 143 $data=$this->Smstemplate_model->delete($id); … … 145 145 echo json_encode($result); 146 146 } 147 public function delete User()147 public function deleteSms() 148 148 { 149 149 $id=$this->uri->segment(4); 150 150 $this->load->model('Smstemplate_model'); 151 151 $data=$this->Smstemplate_model->getSmstemplate($id); 152 $this->load->view('smstemplate/deleteUser',$data); 153 } 154 public function updateUser() 155 { 156 $input['activated']=0; 157 $input= array_merge($input,$this->input->post()); 158 $this->load->model('Smstemplate_model'); 159 if (strlen($input['full_name'])==0) 160 { 161 $result['errors'][]="Tên cá»ng tác viên khÃŽng ÄÆ°á»£c Äá» trá»ng"; 162 } 163 if (strlen($input['login_name'])==0) 164 { 165 $result['errors'][]="Tên ÄÄng nháºp khÃŽng ÄÆ°á»£c Äá» trá»ng"; 166 } 167 else 168 { 152 $this->load->view('smstemplate/deleteSms',$data); 153 } 154 public function updateSms() 155 { 156 157 $input= $this->input->post(); 158 $this->load->model('Smstemplate_model'); 159 if (strlen($input['sms_content'])==0) 160 { 161 $result['errors'][]="Ná»i dung tin nhắn khÃŽng ÄÆ°á»£c Äá» trá»ng"; 162 } 163 if (strlen($input['sms_reply'])==0) 164 { 165 $result['errors'][]="Tin nhắn trả vá» khÃŽng ÄÆ°á»£c Äá» trá»ng"; 166 } 167 else 168 { 169 /* 169 170 if ($this->Smstemplate_model->isExist(array('field'=>'login_name','value'=>$input['login_name'],'id'=>$input['id']))) 170 171 { 171 172 $result['errors'][]="Tên ÄÄng nháºp Äã ÄÆ°á»£c sá» dụng"; 172 173 } 173 } 174 if (strlen($input['cellphone'])==0) 175 { 176 $result['errors'][]="Sá» Äiá»n thoại khÃŽng ÄÆ°á»£c Äá» trá»ng"; 177 } 178 else 179 { 174 * 175 */ 176 } 177 if (strlen($input['service_id'])==0) 178 { 179 $result['errors'][]="Mã dá»ch vụ khÃŽng ÄÆ°á»£c Äá» trá»ng"; 180 } 181 else 182 { 183 /* 180 184 if ($this->Smstemplate_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone'],'id'=>$input['id']))) 181 185 { 182 186 $result['errors'][]="Sá» Äiá»n thoại Äã ÄÆ°á»£c sá» dụng"; 183 187 } 184 } 185 if (strlen($input['passwd'])==0) 186 { 187 //$result['errors'][]="Máºt khẩu khÃŽng ÄÆ°á»£c Äá» trá»ng"; 188 } 189 if ($input['passwd'] != $input['passwd2']) 190 { 191 $result['errors'][]="Máºt khẩu khÃŽng trùng nhau"; 192 } 188 * 189 */ 190 } 191 193 192 if (!isset($result['errors'])) 194 { 195 unset($input['passwd2']); 196 $input['passwd']=md5($input['activated']); 197 $input['updated_time']=date("Y-m-d H:i:s"); 193 { 198 194 $this->load->model('Smstemplate_model'); 199 $this->Smstemplate_model->update($input[' id'],$input);195 $this->Smstemplate_model->update($input['sms_id'],$input); 200 196 $result['success'] = 1; 201 197 } -
pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/deleteSms.php
r405 r409 12 12 13 13 <div class="modal-body"> 14 <form id="add_user" onsubmit="return false;" class="form-horizontal" role="form"> 14 <form id="delete_sms_<?php echo $sms_id;?>" onsubmit="return false;" class="form-horizontal" role="form"> 15 <input type="hidden" value="<?php echo $sms_id?>" name="sms_id" /> 15 16 <div class="form-group"> 16 17 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Mẫu tin nhắn </label> … … 60 61 61 62 <div class="space-4"></div> 62 63 <div class="form-group errors" id="add_sms_<?php echo $sms_id;?>"></div> 63 64 64 65 65 66 <div class="space-4"></div> 66 <div class="form-group errors" id=" add_user"></div>67 <div class="form-group errors" id="error_delete_sms_<?php echo $sms_id;?>"></div> 67 68 68 69 </div> 69 70 <div class="clearfix form-actions"> 70 71 <div class="col-md-offset-3 col-md-9"> 71 <a href="#" class="btn btn-primary" data-dismiss="modal">Äóng cá»a sá»</a> 72 <a href="#" class="btn btn-primary" onclick="return deletesms('<?php echo $sms_id;?>')">Xóa cá»ng tác viên nà y</a> 73 <a href="#" id="close_delete_sms_<?php echo $sms_id;?>" class="btn btn-primary" data-dismiss="modal">Äóng cá»a sá»</a> 72 74 73 75 -
pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/editSms.php
r405 r409 12 12 13 13 <div class="modal-body"> 14 <form id="add_user" onsubmit="return false;" class="form-horizontal" role="form"> 14 <form id="editSms_<?php echo $sms_id;?>" onsubmit="return false;" class="form-horizontal" role="form"> 15 <input type="hidden" name="sms_id" value="<?php echo $sms_id;?>"> 15 16 <div class="form-group"> 16 17 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Mẫu tin nhắn </label> … … 18 19 <div class="col-sm-9"> 19 20 <span class="input-icon"> 20 <input disabledname="sms_content" type="text" id="form-field-1" placeholder="Mẫu tin nhắn" value="<?php echo $sms_content;?>">21 <input name="sms_content" type="text" id="form-field-1" placeholder="Mẫu tin nhắn" value="<?php echo $sms_content;?>"> 21 22 <i class="icon-user blue"></i> 22 23 </span> … … 29 30 <div class="col-sm-9"> 30 31 <span class="input-icon"> 31 <input disabledname="sms_reply" type="text" id="form-field-1" placeholder="Tin trả lá»i" value="<?php echo $sms_reply;?>">32 <input name="sms_reply" type="text" id="form-field-1" placeholder="Tin trả lá»i" value="<?php echo $sms_reply;?>"> 32 33 <i class="icon-user blue"></i> 33 34 </span> … … 40 41 <div class="col-sm-9"> 41 42 <span class="input-icon"> 42 <input disabledname="service_id" type="text" id="form-field-1" placeholder="Mã dá»ch vụ" value="<?php echo $service_id;?>">43 <input name="service_id" type="text" id="form-field-1" placeholder="Mã dá»ch vụ" value="<?php echo $service_id;?>"> 43 44 <i class="icon-user blue"></i> 44 45 </span> … … 51 52 <div class="col-sm-9"> 52 53 <span class="input-icon"> 53 <input disabledname="commandcode" type="text" id="form-field-1" placeholder="Mã lá»nh" value="<?php echo $service_id;?>">54 <input name="commandcode" type="text" id="form-field-1" placeholder="Mã lá»nh" value="<?php echo $service_id;?>"> 54 55 <i class="icon-user blue"></i> 55 56 </span> … … 69 70 <div class="clearfix form-actions"> 70 71 <div class="col-md-offset-3 col-md-9"> 71 <a href="#" class="btn btn-primary" data-dismiss="modal">Äóng cá»a sá»</a> 72 <a href="#" class="btn btn-primary" onclick="return updatesms('<?php echo $sms_id;?>')">Cáºp nháºt</a> 73 <a href="#" class="btn btn-primary" id="close_edit_sms_<?php echo $sms_id;?>" data-dismiss="modal">Äóng cá»a sá»</a> 72 74 73 75 -
pro-violet-viettel/sourcecode/application/modules/admin/views/smstemplate/index.php
r406 r409 221 221 </div><!-- /.modal-dialog --> 222 222 <?php 223 $this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/ collaborator.js')));223 $this->load->view('layout/admin/footer', array('base_url' => $base_url, 'adminjs' => array('assets/js/admin/smstemplate.js'))); 224 224 ?>
Note: See TracChangeset
for help on using the changeset viewer.