Changeset 708


Ignore:
Timestamp:
Jan 27, 2015 11:57:20 AM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

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

    r695 r708  
    212212        }
    213213       
    214         public function collaborator ()
    215         {
     214public function collaborator ()
     215        {
     216               
    216217                error_reporting(E_ALL);
    217218
     
    222223                // get total page
    223224                $totalpage = 1;
    224 
     225               
    225226                $default = $this->Services_model->getCollaborator(2,1,1);
    226                
    227                 $data = mb_convert_encoding($default, 'UTF-8');
    228 
    229                 if($default){
     227                $data = mb_convert_encoding($default, 'UTF-8', 'ISO-8859-1');
     228               
     229                if($data){
    230230                        $xml = simplexml_load_string($data);
    231231                        $xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
    232                         $xml = $xml->xpath('//S:Body')[0];
     232                       
     233                        $xml = $xml->xpath('//S:Body');
     234                        $xml = $xml[0];
     235
    233236                        $xml->registerXPathNamespace("ns2", "http://process.wsim.viettel.com/");
    234                         $totalpage = (int)$xml->xpath('//return//totalpage')[0];
    235                 }
    236                
    237                 var_dump($totalpage);
    238 
    239                 /*$result = $this->Services_model->getCollaborator(2,1,$totalpage);
    240                 if ($result){
    241                         $xml = simplexml_load_string($result);
     237                       
     238                        $totalpage = $xml->xpath('//return//totalpage');
     239                        $totalpage = (int)$totalpage[0];
     240                }
     241               
     242               
     243                $result = $this->Services_model->getCollaborator(2,1,$totalpage);
     244                //var_dump($result);
     245                $data = mb_convert_encoding($result, 'UTF-8', 'ISO-8859-1');
     246               
     247               
     248                if ($data && $data != -1){
     249                        $xml = simplexml_load_string($data);
    242250                        $xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
    243                         $xml = $xml->xpath('//S:Body')[0];
     251                        $xml = $xml->xpath('//S:Body');
     252                        $xml = $xml[0];
    244253                        $xml->registerXPathNamespace("ns2", "http://process.wsim.viettel.com/");
    245254                        $lst = $xml->xpath('//return//lst');
     
    265274                        $logMsg = date('Y-m-d H:i:s') . " Result is null \n";
    266275                        write_file('./log/sync_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
    267                 }*/
     276                }
    268277        }
    269278}
Note: See TracChangeset for help on using the changeset viewer.