Ignore:
Timestamp:
Apr 23, 2015 12:00:06 PM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/collaborator/controllers/user.php

    r883 r906  
    2222                        $this->load->view('collaborator/user/index', $data);
    2323                }else{
    24                         show_404();
     24                        $this->load->view(login);
    2525                }
    2626        }
     
    3232                        $collaborator = $collaborator_info['login_name'];
    3333                        $config['upload_path'] = './upload/uploads/';
    34                         $config['allowed_types'] = 'xls|xlsx';
    35                         /*$config['max_size']   = '100';
    36                         $config['max_width']  = '1024';
    37                         $config['max_height']  = '768';*/
    38                        
     34                        $config['allowed_types'] = '*';
    3935                        $this->load->library('upload', $config);
    4036                       
     
    4339                                $error = array('error' => $this->upload->display_errors('', ''));
    4440                                $data['success'] = 0;
    45                                 $data['process'] = $error;
     41                                $data['upload_error'] = $error;
    4642                        }
    4743                        else
     
    4945                                $data = array('upload_data' => $this->upload->data());
    5046                                $file = $data['upload_data']['full_path'];
    51                                 //$result = $this->processData($file);
    5247                                $process = $this->processData($file, $collaborator);
    5348                                if ($process){
    5449                                        $data['process'] = $process;
    55                                        
    5650                                }else{
    57                                         $data['process'] = null;
     51                                        $data['process'] = null;                               
    5852                                }
    5953                                $data['success'] = 1;
     
    6155                        $result = $this->load->view('collaborator/user/result', $data, true);
    6256                        echo json_encode($result);
     57
    6358                }else{
    64                         show_404();
     59                        $this->load->view('login');
    6560                }
    6661        }
     
    9388                $this->load->model('collaborator_model');
    9489                $data = $this->readExcelFile($file);
     90
    9591                $result = array();
    9692                $user = array();
     
    104100                                $user['district'] = $arrPD['district'];
    105101                                $user['school'] = $value['E'];
    106                                 $user['username'] = $this->services_model->formatPhoneNumber($value['F'], 2);
     102                                $user['username'] = $this->services_model->formatPhoneNumber((string)$value['F'], 2);
    107103                                $user['service'] = $value['G'];
    108104                                $user['amount'] = $value['H'];
    109105                                $user['collboratorId'] = $value['I'];
    110106                               
     107                               
    111108                                if ($user['username']){
    112109       
    113110                                        if (!preg_match('/^([0-9]{10,11}$)$/', $user['username'])) {
    114                                                 $result[$index]['success'] = 0;
    115                                                 $result[$index]['error'] = lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
    116                                                 $result[$index]['user'] = $user;
     111                                                $result[$index-1]['success'] = 0;
     112                                                $result[$index-1]['error'] = lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');
     113                                                $result[$index-1]['user'] = $user;
    117114                                        }else{
    118                                                 $result[$index] = $this->collaborator_model->processUser($user, $sentNumber);
    119                                                
    120                                                
     115                                                $result[$index-1] = $this->collaborator_model->processUser($user, $sentNumber);
    121116                                        }
    122                                         $result[$index]['date'] = date('d-m-Y H:i:s');
    123117                                }
    124118                               
    125119                        endforeach;
    126120                }
    127                
    128121                return $result;
    129122        }
Note: See TracChangeset for help on using the changeset viewer.