Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
129 righe
3.4 KiB
129 righe
3.4 KiB
<?php |
|
|
|
switch($_REQUEST['action']) |
|
{ |
|
|
|
case "loadSchedaPersona": |
|
loadSchedaPersona(); |
|
break; |
|
case "loadVisuraImpresa": |
|
loadVisuraImpresa(); |
|
break; |
|
case "listSediOperative": |
|
listSediOperative(); |
|
break; |
|
case "test": |
|
test(); |
|
break; |
|
} |
|
exit(); |
|
|
|
|
|
|
|
function loadSchedaPersona(){ |
|
global $LoggedAccount; |
|
|
|
if(count($LoggedAccount->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)); |
|
} |
|
|
|
|