Ignore:
Timestamp:
Mar 27, 2015 9:49:55 AM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r822 r838  
    449449         */
    450450        public function formatPhoneNumber ($phoneNumber, $direction = 1) {
     451                $result = $phoneNumber;
    451452                $aryMatch = array();
    452453                if (preg_match('/^(84)([0-9]{9,10})$/', $phoneNumber, $aryMatch) == 1 && $direction == 1) {
     
    461462                else if (preg_match('/^(0)([0-9]{9,10})$/', $phoneNumber, $aryMatch) == 1 && $direction == -1) {
    462463                        $result = '84'. $aryMatch[2];
     464                }
     465                else if (preg_match('/^[1,9]([0-9]{8,9})$/', $phoneNumber, $aryMatch) == 1 && $direction = 2) {
     466                        $result = '0'. $phoneNumber;
    463467                }
    464468               
     
    473477                                                                                                                                                                                                district = "'.$data['district'].'",
    474478                                                                                                                                                                                                email = "'.$data['email'].'",
    475                                                                                                                                                                                                 full_name = "'.$data['full_name'].'",
     479                                                                                                                                                                                                full_name = "'.$data['full_name'].'",
     480                                                                                                                                                                                                passwd = "'.$data['passwd'].'",
    476481                                                                                                                                                                                                cellphone = "'.$data['cellphone'].'",
    477482                                                                                                                                                                                                precinct = "'.$data['precinct'].'",
Note: See TracChangeset for help on using the changeset viewer.