SchedaPersona)>0){ $rec = $LoggedAccount->SchedaPersona; }else { $rec = SchedaPersona::Load(); } // $rec = SchedaPersona::Load(); //$row = Utils::ObjectToArray($rec); exit(json_encode($rec)); } function loadVisuraImpresa(){ global $LoggedAccount; $partitaIva = $_REQUEST['cf']; //ClusterDb::Exists($partitaIva);exit(); $rec = VisuraImpresa::Load($partitaIva); $ricevo = ClusterDb::getIdFromCodiceFiscale(trim($partitaIva)); $cluster_db = new ClusterDb($ricevo); $rec['c_attivita'] = $cluster_db->ATECO; $visura = new VisuraImpresaCustom(); $visura->PIVA_IMPRESA = $partitaIva; $visura->VIMPRESA = json_encode($rec); $visura->Save(); $imprese_persona = $LoggedAccount->SchedaPersona->imprese_persona; $matches = false; foreach ($imprese_persona as $value) { if(trim($value->c_fiscale) == trim($partitaIva)){ $matches = true; } } if(!$matches){ exit(json_encode(array())); } exit(json_encode($rec)); } function listSediOperative(){ $partitaIva = $_REQUEST['cf']; //ClusterDb::Exists($partitaIva);exit(); $rec = VisuraImpresa::Load($partitaIva); //Utils::print_array($rec);exit(); exit(json_encode($rec['sedi_operative'])); } function test(){ $partitaIva = $_REQUEST['cf']; $cf = $_REQUEST['cf']; //ClusterDb::Exists($partitaIva);exit(); //$rec = VisuraImpresa::Load($partitaIva); $options = array( 'trace'=> 1, 'exceptions'=> false, 'cache_wsdl'=>WSDL_CACHE_NONE, 'login'=> IC_WSDL_USR, 'password'=> IC_WSDL_PSW ); $client = new MySoapClient(IC_WSDL_URL, $options); $request = array( 'richiestaVisuraImpresaCustom' => array('tipoServizioStr' => 'VISURA_REGSIC', 'codiceFiscale' => $partitaIva)); //$request = array( 'RichiestaSchedaPersonaCustom' => array('tipoServizio' => 'SCHEDA_RAPPR', 'codiceFiscalePersona' => $cf)); try { $client->__soapCall('visuraImpresaCustom', $request); //$client->__soapCall('schedaPersonaCustom', $request); $response = $client->__getLastResponse(); //Utils::print_array($response);exit(); //$response = str_replace("",'',$response); ///My Invalid Symbol //$response = str_ireplace(array('SOAP-ENV:','SOAP:'),'',$response); //$xml = new SimpleXMLElement($response); //echo htmlentities($response);exit(); $objDOM = new DOMDocument(); $objDOM->loadXML($response); $vi = new VisuraImpresa($objDOM); $return = Utils::ObjectToArray($vi); Utils::print_array($return);exit(); } catch (Exception $exc) { echo $exc->getTraceAsString(); } exit(json_encode($rec)); }