Changeset 884 for pro-violet-viettel


Ignore:
Timestamp:
Apr 7, 2015 2:17:28 PM (10 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/sourcecode
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/language/message/messages_lang.php

    r883 r884  
    9292$lang['_SBG_MO_CHARGING_FAIL_MSG'] = 'Loi, khong thanh toan duoc tu tai khoan goc';
    9393$lang['_SBG_MO_AMOUNT_WRONG_FORMAT_MSG'] = 'So tien nap khong hop le. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
     94
     95$lang['_SBG_MO_AMOUNT_LESS_THAN_MIN_VALUE_MSG'] = 'So tien nap nho nhat la 5000d. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
     96
    9497$lang['_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'] = 'So dien thoai Khach hang khong hop le. Vui long kiem tra lai hoac LH 01662860000 de biet them chi tiet';
    9598$lang['_SBG_MO_SUPPORT_VIETTEL_MSG'] = 'Soan bai giang Online la DV cho phep ban tao cac noi dung phuc vu giang day. De dang ky su dung DV nhan tin theo cu phap SBG DK. Vui long truy cap http://soanbaigiang.smas.vn hoac LH 01662860000 de biet them chi tiet';
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php

    r883 r884  
    55/**
    66 * Home Class
     7 * @todo Control main actions
     8 * @see index()
     9 * @see singin()
     10 * @see signout()
    711 *
    812 * @author dzungnv02
     
    1822        }
    1923       
     24        /**
     25         * function index
     26         * @todo checked is sign-in then redirect to lecture page else redirect to sign-in page
     27         */
    2028        public function index() {
    2129                $user_info = $this->session->userdata ( 'userInfo' );
     
    4149        }
    4250       
     51        /**
     52         * function signin
     53         * @todo Execute sign-in action
     54         */
    4355        public function signin() {
    4456                $username = $this->input->post ( 'username', TRUE );
     
    8395        }
    8496       
     97        /**
     98         * funtion signout
     99         * @todo Execute signout action
     100         */
    85101        public function signout() {
    86102                //$this->session->sess_destroy ();
     
    92108        }
    93109       
    94         public function register() {
    95                 $this->load->model ( 'user_model' );
    96                 $collaborator = '0979947802';
    97                 $serviceID = 1;
    98                 $username = '0978618113';
    99                 $commandcode = 'commandcode1';
    100                 $info = 'ABCD';
    101                 // $receiveTime = time();
    102                 $receiveTime = date ( "Y-m-d H:i:s" );
    103                 $data = $this->user_model->register ( $username, $collaborator );
    104                 echo $data;
    105         }
    106        
    107         public function change_profile() {
    108                 $this->load->model ( 'user_model' );
    109                 $sentNumber = '0979947802';
    110                 $serviceID = 1;
    111                 $password = '2933369';
    112                 $commandcode = "SBG";
    113                 $receiveID = '0977274183';
    114                 $info = "SBG TD";
    115                 $receiveTime = date ( "Y-m-d H:i:s" );
    116                 $status = 0;
    117                 $data = $this->user_model->changeProfile ( $sentNumber, $receiveID, $password, $status );
    118                 echo $data;
    119         }
    120        
    121         public function change_password() {
    122                 $this->load->model ( 'user_model' );
    123                 $sentNumber = '0979947802';
    124                 $password = '935322';
    125                 $data = $this->user_model->changePassword ( $sentNumber, $password );
    126                 echo $data;
    127         }
    128        
    129         public function register_vip() {
    130                 $this->load->model ( 'user_model' );
    131                 $sentNumber = '0979947802';
    132                 $p_code = 1;
    133                 $serviceID = 1;
    134                 $commandcode = "SBG";
    135                 $vipNum = 1;
    136                 $mainAccBalanced = 15000;
    137                 $info = "SBG DK VIP1";
    138                 $receiveTime = date ( "Y-m-d H:i:s" );
    139                 $status = 0;
    140                 $data = $this->user_model->registerVip ( $sentNumber, $p_code );
    141                 echo $data;
    142         }
    143        
    144         public function recharge_account() {
    145                 $this->load->model ( 'user_model' );
    146                 $sentNumber = '0979947802';
    147                 $receiveID = '01662860000';
    148                 $serviceID = 1;
    149                 $commandcode = "SBG";
    150                 $vipNum = 1;
    151                 $mainAccBalanced = 15000;
    152                 $amount = 1000;
    153                 $info = "SBG NAP 10000";
    154                 $status = 0;
    155                 $receiveTime = date ( "Y-m-d H:i:s" );
    156                 $data = $this->user_model->rechargeAccount ( $sentNumber, $amount );
    157                 //$data = $this->user_model->insertPaidlog($sentNumber, $sentNumber, 2, $amount, $receiveTime);
    158                 echo $data;
    159         }
    160        
    161         public function is_viettel($number) {
     110        /**
     111         * function is_viettel
     112         * @param string $number
     113         * @return 1:true;0:false
     114         * @todo checked the phone number is viettel subscriber
     115         */
     116        private function is_viettel($number) {
    162117                $viettel = array (
    163118                                '096',
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php

    r821 r884  
    66/**
    77 * Lecture Class
    8  *
     8 * @todo Show lecture editor software
    99 * @author dzungnv02
    1010 *
     
    1212class Lecture extends MX_Controller {
    1313
     14        /**
     15         * function __construct
     16         * @todo constructor of class
     17         */
    1418    public function __construct() {
    1519        parent::__construct();
     
    1822    }
    1923
     24    /**
     25     * function index
     26     * @todo Show lecture editor
     27     */
    2028    public function index() {
    2129        $this->load->model('User_model');
  • pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php

    r883 r884  
    11<?php
    2 
    32if (!defined('BASEPATH'))
    43    exit('No direct script access allowed');
    54
     5/**
     6 * Class User
     7 * @todo Execute actions of user
     8 *
     9 * @see function profile
     10 * @see function packageRegister
     11 * @see function finishRegisterPackage
     12 * @see function regpackage
     13 * @see function update_info
     14 * @see function update_user
     15 * @see function change_password
     16 * @see function trade_history
     17 * @see function getUserInfor
     18 * @see function adminUpdateUser
     19 * @see function regis_history
     20 * 
     21 * @author dungnv02
     22 *
     23 */
    624class User extends MX_Controller {
    725
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php

    r714 r884  
    212212        }
    213213       
     214        public function getCollaborators () {
     215                $client = new SoapClient($this->config->item('bccs_service_url'), array(  'trace'      => true,
     216                'exceptions' => true,
     217             ));
     218                $username = $this->config->item('bccs_username');
     219                $password = $this->config->item('bccs_password');
     220                $wscode = 'getListShopAndStaftInfo';
     221               
     222                $input = new Input($username, $password, $wscode/* , 2, 1,5000 */);
     223                $param = new Param();
     224               
     225                $params = array(
     226                                "Input" => $input,
     227                                "rawData" => "rawData",
     228                                "Param" => $param,
     229                );
     230               
     231                var_dump($params);
     232
     233                $response = $client->__soapCall("gwOperation", array($params));
     234                var_dump($response);
     235        }
     236       
    214237       
    215238}
    216239
     240
     241class Input {
     242        function Input ($user, $pass, $wscode/*,  $type, $page, $displaypage */) {
     243                $this->user = $user;
     244                $this->pass = $pass;
     245                $this->wscode = $wscode;
     246                $this->param = null;
     247                $this->rawData = '';
     248                /* $this->type = $type;
     249                 $this->page = $page;
     250                $this->displaypage = $displaypage; */
     251        }
     252}
     253
     254class Param {
     255        function Param () {
     256                $this->name = '';
     257                $this->value = '';
     258        }
     259}
    217260        function fix_latin1_mangled_with_utf8_maybe_hopefully_most_of_the_time($str)
    218261        {
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r883 r884  
    2626if ( ! defined('_SBG_CHARGING_NUMBER_NOT_REGISTED'))    define('_SBG_CHARGING_NUMBER_NOT_REGISTED', 501);
    2727if ( ! defined('_SBG_CHARGING_MAX_VALUE'))                              define('_SBG_CHARGING_MAX_VALUE', 50000);
     28if ( ! defined('_SBG_CHARGING_MIN_VALUE'))                              define('_SBG_CHARGING_MIN_VALUE', 5000);
    2829
    2930
     
    4041if ( ! defined('_SBG_GET_COLLABORATOR_FAIL'))                   define('_SBG_GET_COLLABORATOR_FAIL', -1);
    4142
    42 Class Services_model extends CI_Model 
     43Class Services_model extends CI_Model
    4344{
    4445        private $_arySmsMO = array(
     
    5253                _SBG_MO_SUPPOR_SERVICE          => array('pattern' => '/^(SBG)([[:blank:]])(HD)$/'),
    5354                _SBG_MO_UNSUBSCRIBE_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HUY)$/')
    54         );     
    55        
     55        );
     56
    5657        public function __construct(){
    5758                parent::__construct();
     
    5960                $this->lang->load('messages', 'message');
    6061        }
    61        
     62
    6263        /**
    6364         * messageAnalys
    64          * 
     65         *
    6566         * @todo Analysis content of incoming message
    66          * 
     67         *
    6768         * @param String $message - coming SMS
    6869         * @return multitype:Ambigous <string, multitype> multitype:multitype
     
    7071        public function messageAnalys ($message)
    7172        {
    72                 $aryMatched = array(); 
     73                $aryMatched = array();
    7374                $aryContent = array();
    7475                $result = FALSE;
    75                
     76
    7677                foreach ($this->_arySmsMO as $case => $pattern)
    7778                {
     
    8283                        }
    8384                }
    84                
     85
    8586                $case = (bool)$result ? $case:_SBG_MO_SYNTAX_ERR;
    86                
     87
    8788                foreach($aryMatched as $k => $val) {
    88                         if ($k > 1) $aryContent[] = $val;                       
    89                 }
    90                
     89                        if ($k > 1) $aryContent[] = $val;
     90                }
     91
    9192                return array('case' => $case, 'content' => $aryContent);
    9293        }
    93        
     94
    9495        /**
    9596         * processMORequest
    96          * 
     97         *
    9798         * @todo process action analysed from messageAnalys
    98          * 
     99         *
    99100         * @param unknown $sentNumber
    100101         * @param unknown $message
    101102         * @return string
    102103         */
    103         public function processMORequest ($sentNumber, $message, &$mtBody = null) 
     104        public function processMORequest ($sentNumber, $message, &$mtBody = null)
    104105        {
    105106                $debugMsg = $message."\n";
    106                
     107
    107108                $sentNumber = $this->formatPhoneNumber($sentNumber);
    108                
     109
    109110                $smsReturn = '';
    110                 $aryMOAnalys = $this->messageAnalys($message);         
     111                $aryMOAnalys = $this->messageAnalys($message);
    111112                $case = $aryMOAnalys['case'];
    112113                $aryContents = isset($aryMOAnalys['content']) ? $aryMOAnalys['content']: null;
    113114                $this->load->model('frontend/user_model', 'objUserModel');
    114115                $debugMsg .= $case;
    115                
     116
    116117                switch ($case) {
    117118                        case _SBG_MO_REGISTER:
     
    123124                                        }
    124125                                }
    125                                
    126                                 $userName = isset($aryContents[0]) ? $this->formatPhoneNumber($aryContents[0]) : $sentNumber; 
     126
     127                                $userName = isset($aryContents[0]) ? $this->formatPhoneNumber($aryContents[0]) : $sentNumber;
    127128                                $collaborator = isset($aryContents[0]) ? $sentNumber:null;
    128129                                $collaboratorMsg = '';
    129                                
     130
    130131                                $sms = $this->objUserModel->register($userName, $collaborator, $collaboratorMsg);
    131                                
     132
    132133                                if ($case == _SBG_MO_REGISTER_FOR) {
    133134                                        $smsReturn = $collaboratorMsg;
     
    137138                                                $sendMT = $this->sendMT($this->formatPhoneNumber($userName, -1), $mtBody);
    138139                                        }
    139                                                                                
     140
    140141                                }
    141142                                else {
     
    149150                                        break;
    150151                                }
    151                                
     152
    152153                                $oldPhoneNumber = $this->formatPhoneNumber($aryContents[0]);
    153154                                $password = $aryContents[1];
    154155                                $smsReturn = $this->objUserModel->changeProfile($sentNumber, $oldPhoneNumber, $password);
    155                                
     156
    156157                                $arySMS = explode('|', $smsReturn);
    157158                                $changeResult = (int)$arySMS[0];
    158                                
     159
    159160                                $aryPatterns = array('/:sentNumber:/');
    160161                                $sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_USER_OLD_PHONENUM_CHANGE_SUCCESS_MSG'));
     
    168169                                $p_code = $aryContents[0];
    169170                                $smsReturn = $this->objUserModel->registerVip($sentNumber, $p_code, $packageData);
    170                                
     171
    171172                                $arySmsReturn = explode('|', $smsReturn);
    172173                                $result = $arySmsReturn[0];
     
    179180                                        for ($i = 1; $i <= $count; $i++) {
    180181                                                $value = $amount > _SBG_CHARGING_MAX_VALUE ? _SBG_CHARGING_MAX_VALUE : $amount;
    181                                                 $amount -= $value;                                                     
     182                                                $amount -= $value;
    182183                                                $result = $this->chargeRootAccountProcess($sentNumber, $value, $sentNumber.' paid for SBG');
    183                                         }       
     184                                        }
    184185
    185186                                        if ($result == _SBG_CHARGING_SUCCESS) {
     
    199200                        case _SBG_MO_PAY_TO_ACCOUNT_FOR:
    200201                                error_log(date('Y-m-d H:i:s').' -- DATA: '. var_export($aryContents, TRUE).' -- CASE: '. $case . "\n", 3, '/srv/www/sbg/log/pay.log');
     202
    201203                                $userName = isset($aryContents[1]) ? $this->formatPhoneNumber($aryContents[1]) : $sentNumber;
    202204                                if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR && !preg_match('/^(09\d{8}|01\d{9})$/', $userName)) {
     
    204206                                        break;
    205207                                }
    206                                
     208
    207209                                $amount = $aryContents[0];
    208210                                if (!preg_match('/^[0-9]{3,}$/', $amount)) {
     
    210212                                        break;
    211213                                }
    212                                
     214
     215                                if ((int)$amount < _SBG_CHARGING_MIN_VALUE) {
     216                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_AMOUNT_LESS_THAN_MIN_VALUE_MSG');
     217                                        break;
     218                                }
     219
    213220                                $result =$this->chargeRootAccountProcess($sentNumber, $amount, $sentNumber.' paid for SBG');
    214                                
     221
    215222                                if ($result == _SBG_CHARGING_SUCCESS) {
    216223                                        $smsReturn = $this->objUserModel->rechargeAccount($userName, $amount);
     
    228235                                }
    229236                                else if ($result == _SBG_CHARGING_FAIL_NOT_ENOUGH) {
    230                                         //$aryPatterns = array ('/:amount:/');
    231237                                        $aryPatterns = array ('/:sentNumber:/');
    232238                                        $smsReturn = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_CHARGING_FAIL_NOT_ENOUGH_MSG'));
    233                                         /*
    234                                         if ($case == _SBG_MO_PAY_TO_ACCOUNT_FOR) {
    235                                                 $aryPatterns = array ('/:amount:/', '/:username:/');
    236                                                 $smsReturn = preg_replace($aryPatterns, array($amount, $userName), lang('_SBG_MO_CHARGING_FAIL_NOT_ENOUGH_FOR_MSG'));
    237                                         }*/
    238239                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn;
    239240                                }
    240241                                else if ($result == _SBG_CHARGING_FAIL_MORETHAN_LIMIT) {
    241                                         $aryPatterns = array ('/:sendid:/');
     242                                        /* $aryPatterns = array ('/:sendid:/');
    242243                                        $smsReturn = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_CHARGING_FAIL_MORETHAN_LIMIT_MSG'));
    243                                         $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn;
     244                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn; */
     245
     246
     247
     248
    244249                                }else if ($result == _SBG_CHARGING_FAIL_NOT_VIETTEL || $result == _SBG_CHARGING_NUMBER_NOT_EXISTED || $result == _SBG_CHARGING_NUMBER_NOT_AVAILABLE) {
    245250                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_CHARGING_FAIL_NOT_VIETTEL_MSG');
    246                                 }                               
     251                                }
    247252                                else {
    248253                                        $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_CHARGING_FAIL_MSG');
    249254                                }
    250255                                break;
     256
    251257                        case _SBG_MO_SUPPOR_SERVICE:
    252                                 //$smsReturn = '1|'.lang('_SBG_MO_SUPPORT_MSG');
    253258                                if ($this->isViettel($sentNumber)){
    254259                                        $smsReturn = '1|'.lang('_SBG_MO_SUPPORT_VIETTEL_MSG');
     
    257262                                }
    258263                                break;
     264
    259265                        case _SBG_MO_UNSUBSCRIBE_SERVICE:
    260266                        case _SBG_MO_SYNTAX_ERR:
     
    263269                                break;
    264270                }
    265                
     271
    266272                $aryTmp = explode('|', $smsReturn);
    267273                $mtBody = $aryTmp[1] . "\n" . $mtBody;
    268                
     274
    269275                return $smsReturn.'|'.$case;
    270276        }
    271        
    272        
     277
     278
    273279        /**
    274280         * cardPaidProcess
    275          * 
     281         *
    276282         * @todo Call Topup webservice to check and lock prepaid-card
    277283         * @param Array $aryCardInfo
     
    279285         * @return string
    280286         */
    281         public function cardPaidProcess ($aryCardInfo, &$aryTopupResult = array()) 
     287        public function cardPaidProcess ($aryCardInfo, &$aryTopupResult = array())
    282288        {
    283289                $url = $this->config->item('topup_service_url');
    284290                $action = 'http://tempuri.org/ITopupService/TopUp';
    285291                $xml = $this->load->view('topup', $aryCardInfo, true);
    286                
     292
    287293                $client = new nusoap_client($url);
    288294                $client->useHTTPPersistentConnection();
    289295                $client->soap_defencoding = 'UTF-8';
    290296                $client->operation = $action;
    291                
     297
    292298                $result = $client->send($xml, $action);
    293                
     299
    294300                if ($client->fault) {
    295301                        return _SBG_CARD_PAY_FAIL;
    296302                }
    297                
     303
    298304                $keys = array_keys($result);
    299                
     305
    300306                $aryTopupResult = $result[$keys[0]];
    301307
     
    308314                        return _SBG_CARD_PAY_FAIL;
    309315                }
    310                
     316
    311317                return _SBG_CARD_PAY_SUCCESS;
    312318        }
    313        
     319
    314320        /**
    315321         * chargeRootAccountProcess
    316          * 
     322         *
    317323         * @todo Call charging webservice to charged fee from phone root account
    318324         * @param String $sentID
     
    321327         * @return string|number
    322328         */
    323         public function chargeRootAccountProcess ($sentID, $amount = 0, $contents = '') 
     329        public function chargeRootAccountProcess ($sentID, $amount = 0, $contents = '')
    324330        {
    325331                $url = $this->config->item('charging_service_url');
    326332                $username = $this->config->item('charging_username');
    327333                $password = $this->config->item('charging_password');
    328                 $action = 'http://tempuri.org/processCharging';         
    329                
     334                $action = 'http://tempuri.org/processCharging';
     335
    330336                $aryParams = array(
    331337                                'user' => $username,
     
    345351                        return _SBG_CHARGING_FAIL;
    346352                }
    347                
    348                 $aryErrs = array (      _SBG_CHARGING_FAIL_NOT_ENOUGH, 
    349                                                         _SBG_CHARGING_FAIL_NOT_VIETTEL, 
     353
     354                $aryErrs = array (      _SBG_CHARGING_FAIL_NOT_ENOUGH,
     355                                                        _SBG_CHARGING_FAIL_NOT_VIETTEL,
    350356                                                        _SBG_CHARGING_FAIL_MORETHAN_LIMIT,
    351357                                                        _SBG_CHARGING_NUMBER_NOT_EXISTED,
     
    354360                                                        _SBG_CHARGING_GENERAL_ERROR,
    355361                                                        _SBG_CHARGING_NUMBER_NOT_REGISTED);
    356                
    357                 if (in_array((int)$result['processChargingResult'], $aryErrs)) 
    358                         return (int)$result['processChargingResult'];           
    359                
     362
     363                if (in_array((int)$result['processChargingResult'], $aryErrs))
     364                        return (int)$result['processChargingResult'];
     365
    360366                return _SBG_CHARGING_SUCCESS;
    361367        }
    362        
     368
    363369        /**
    364370         * sendMT
    365          * 
     371         *
    366372         * @todo Calling MT webservice to send a SMS to a phone number
    367373         * @param String $receiverID
     
    372378        {
    373379                $aryMatch = array();
    374                
     380
    375381                if (preg_match('/^(0)([0-9]{9,10})$/', $receiverID, $aryMatch) == 1) {
    376382                        $receiverID = '84'. $aryMatch[2];
    377383                }
    378                
     384
    379385                $username = $this->config->item('mt_username');
    380386                $password = $this->config->item('mt_password');
    381387                $action = 'http://tempuri.org/InsertMT';
    382                
     388
    383389                $aryParams = array(
    384390                                'User' => $username,
     
    393399                                'Info' => $message
    394400                );
    395                
     401
    396402                $xml = $this->load->view('services/mt', $aryParams, true);
    397403                $url = $this->config->item('mt_service_url');
     
    401407                $client->operation = $action;
    402408                $result = $client->send($xml, $action);
    403                
     409
    404410                if ($client->fault || (int)$result['InsertMTResult'] != 1) {
    405411                        return _SBG_SEND_MT_FAIL;
    406412                }
    407                
     413
    408414                return _SBG_SEND_MT_SUCCESS;
    409415        }
    410        
     416
    411417        public function getCollaborator ($type = 2, $page = 10, $displaypage = 1) {
    412418                $action = 'http://tempuri.org/InsertMT';
     
    423429                                'displaypage' => $displaypage
    424430                );
     431
    425432                $xml = $this->load->view('bscc', $aryParams, true);
    426                
     433
    427434                $client = new nusoap_client($url);
    428435                $client->useHTTPPersistentConnection();
    429436                $client->soap_defencoding = 'UTF-8';
    430437                $client->decode_utf8 = false;
    431                
     438
    432439                $client->operation = $action;
    433440                $result = $client->send($xml, $action);
     
    435442                        return _SBG_GET_COLLABORATOR_FAIL;
    436443                }
    437                
     444
    438445                return $result['Result']['original'];
    439446        }
    440        
     447
    441448        /**
    442449         * formatPhoneNumber
    443          * 
     450         *
    444451         * @todo format phone number to prefix 0 or 84
    445452         * @param String $phoneNumber
     
    465472                        $result = '0'. $phoneNumber;
    466473                }
    467                
     474
    468475                return $result;
    469476        }
    470        
    471        
     477
     478
    472479        public function syncCollaborator($data){
    473480                if ($data){
    474                         $sql = $this->db->insert_string('tblcollaborator', $data) . ' ON DUPLICATE KEY UPDATE address = "'.$data['address'].'", 
    475                                                                                                                                                                                                 code = "'.$data['code'].'", 
    476                                                                                                                                                                                                 district = "'.$data['district'].'", 
    477                                                                                                                                                                                                 email = "'.$data['email'].'", 
     481                        $sql = $this->db->insert_string('tblcollaborator', $data) . ' ON DUPLICATE KEY UPDATE address = "'.$data['address'].'",
     482                                                                                                                                                                                                code = "'.$data['code'].'",
     483                                                                                                                                                                                                district = "'.$data['district'].'",
     484                                                                                                                                                                                                email = "'.$data['email'].'",
    478485                                                                                                                                                                                                full_name = "'.$data['full_name'].'",
    479486                                                                                                                                                                                                passwd = "'.$data['passwd'].'",
    480                                                                                                                                                                                                 cellphone = "'.$data['cellphone'].'", 
    481                                                                                                                                                                                                 precinct = "'.$data['precinct'].'", 
     487                                                                                                                                                                                                cellphone = "'.$data['cellphone'].'",
     488                                                                                                                                                                                                precinct = "'.$data['precinct'].'",
    482489                                                                                                                                                                                                province = "'.$data['province'].'",
    483490                                                                                                                                                                                                created_time = "'.$data['created_time'].'",
     
    499506                }
    500507        }
    501        
     508
    502509        public function deleteCollaborator($id){
    503510                $sql = "DELETE FROM tblcollaborator WHERE id = ". $id;
     
    511518                }
    512519        }
    513        
     520
    514521        public function getAllCollaboratorID(){
    515522                $sql = "Select id from tblcollaborator";
     
    522529                }
    523530        }
    524        
     531
    525532        public function isViettel($number) {
    526533                $prefixViettel = array (
  • pro-violet-viettel/sourcecode/assets/js/grid.js

    r694 r884  
    7676                                }
    7777                        }
     78                       
    7879                       
    7980                        var nodeDblClick = function (node) {
  • pro-violet-viettel/sourcecode/assets/js/manager.js

    r775 r884  
    549549
    550550                    });
     551                   
    551552                    $(document).on('drop dragover', function (e) {
    552553                        e.preventDefault();
    553554                    });
     555                   
    554556                    function formatFileSize(bytes) {
    555557                        if (typeof bytes !== 'number') {
Note: See TracChangeset for help on using the changeset viewer.