Example #1
0
 public function iGetRangeC1($sIp)
 {
     $location = $this->sGetLocation($sIp);
     $head = Ko_Tool_Str::SConvert2UTF8(substr($location, 0, 4));
     if (isset(self::$s_aChineseMainlandPrefix[$head])) {
         return self::RANGE_C1_CHINESEMAINLAND;
     } else {
         if (isset(self::$s_aHkmotwPrefix[$head])) {
             return self::RANGE_C1_HKMOTW;
         }
     }
     return self::RANGE_C1_FOREIGN;
 }
Example #2
0
File: XList.php Project: nuaazdh/ko
 private function _vMain_Get($aReq)
 {
     switch ($aReq['sXSAction']) {
         case 'insert':
             $this->_sHtml = $this->_sGetXInsert($aReq);
             break;
         case 'update':
             $this->_sHtml = $this->_sGetXUpdate($aReq);
             break;
         case 'delete':
             $this->_sHtml = $this->_sGetXDelete($aReq);
             break;
         case 'detail':
             $this->_sHtml = $this->_sGetXDetail($aReq);
             break;
         case 'download':
             if ($this->_bGetXDownload($aReq, $this->_sHtml, $sDownloadFilename)) {
                 if ($this->_bPageIsGb() != $this->_bIsGb()) {
                     if ($this->_bIsGb()) {
                         $sDownloadFilename = Ko_Tool_Str::SConvert2UTF8($sDownloadFilename);
                     } else {
                         $sDownloadFilename = Ko_Tool_Str::SConvert2GB18030($sDownloadFilename);
                     }
                 }
                 header('Content-Length: ' . strlen($this->_sHtml));
                 header('Content-Type: application/octet-stream');
                 header('Content-Disposition: attachment;filename="' . $sDownloadFilename . '"');
                 echo $this->_sHtml;
                 exit;
             }
             break;
         default:
             $this->_sHtml = $this->_sGetXList($aReq);
             break;
     }
 }