Ignore:
Timestamp:
Jan 15, 2015 12:08:25 PM (10 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php

    r689 r695  
    215215        {
    216216                error_reporting(E_ALL);
     217
    217218                $this->load->model('Services_model');
    218219               
     
    221222                // get total page
    222223                $totalpage = 1;
     224
    223225                $default = $this->Services_model->getCollaborator(2,1,1);
     226               
     227                $data = mb_convert_encoding($default, 'UTF-8');
     228
    224229                if($default){
    225                         $xml = simplexml_load_string($default);
     230                        $xml = simplexml_load_string($data);
    226231                        $xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
    227232                        $xml = $xml->xpath('//S:Body')[0];
     
    230235                }
    231236               
    232                 $result = $this->Services_model->getCollaborator(2,1,$totalpage);
     237                var_dump($totalpage);
     238
     239                /*$result = $this->Services_model->getCollaborator(2,1,$totalpage);
    233240                if ($result){
    234241                        $xml = simplexml_load_string($result);
     
    258265                        $logMsg = date('Y-m-d H:i:s') . " Result is null \n";
    259266                        write_file('./log/sync_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
    260                 }
     267                }*/
    261268        }
    262269}
     270
     271        function fix_latin1_mangled_with_utf8_maybe_hopefully_most_of_the_time($str)
     272        {
     273                return preg_replace_callback('#[\\xA1-\\xFF](?![\\x80-\\xBF]{2,})#', 'utf8_encode_callback', $str);
     274        }
     275
     276        function utf8_encode_callback($m)
     277        {
     278                return utf8_encode($m[0]);
     279        }
Note: See TracChangeset for help on using the changeset viewer.