Esempio n. 1
0
 /**
  * breakMobileRow
  * @return string
  * @author Nixus
  **/
 private function breakMobileIntoGroup()
 {
     $mobileGroup = array();
     $m = $n = 1;
     foreach ($this->mobile as $val) {
         if (checkMobileNumber($val)) {
             $mobileGroup[$m] = $val;
             $n++;
             if ($n % 100 == 0) {
                 $m++;
             }
         }
     }
     return $mobileGroup;
 }
Esempio n. 2
0
 /**
  * @param unknown_type $mobile
  * @param unknown_type $country_details
  */
 public static function checkMobileNumberNew(&$mobile, $country_details = array())
 {
     global $logger, $currentorg, $request_type;
     if ($mobile == '1111111') {
         return true;
     }
     $logger->debug('Mobile To Check : ' . $mobile);
     $mobile = self::cleanInteger($mobile);
     $logger->debug('Mobile To Check : ' . $mobile);
     //if character is le
     if (strlen($mobile) <= 5) {
         $logger->debug('mobile number with length 5 or less so rejected : ');
         return false;
     }
     if (!isset($currentorg)) {
         require_once "common_func.php";
         //intl/currentorg not enabled, use defalult checking [ not possible ]
         return checkMobileNumber($mobile);
         # pick up from common_func.php in www/portal/lib/
     }
     if (!is_array($country_details) || is_array($country_details) && count($country_details) < 1) {
         $country_details = $currentorg->getCountryDetailsForMobileCheck();
         $logger->debug('configured country details : ' . print_r($country_details, true));
     }
     //first check for the country details
     $default_country_details = self::getDefaultCountryDetails($country_details);
     $status = self::matchMobileRegexForCountry($mobile, $default_country_details, true);
     if ($status) {
         return true;
     }
     //check all other countries that is configured except Other that would be done at end
     foreach ($country_details as $country_detail) {
         $country = array_values($country_detail);
         $details = $country[0];
         //it would be checked at the end
         if ($details['short_name'] == 'OTH') {
             continue;
         }
         $status = self::matchMobileRegexForCountry($mobile, $details);
         if ($status) {
             return true;
         }
     }
     //now is time for other country
     $other_country_details = self::getOtherCountryDetails($country_details);
     $status = self::matchMobileRegexForCountry($mobile, $other_country_details);
     if ($status) {
         return true;
     }
     $mobile = '';
     $logger->debug('@@@Invalid Mobile Number@@@');
     return false;
 }