provaapp

array( "user_name" => $username, "password" => md5($password), "version" => "1" ), "application_name" => "RestTest", "name_value_list" => array(), ); /* echo "
";
                        print_r($login_parameters);
                        echo "
"; */ $login_result = call("login", $login_parameters, $url); $session_id = $login_result->id; echo "
$session_id
"; $search_by_module_parameters = array("session" => $session_id, 'search_string' => 'gnslsn77s16h501s', 'modules' => array('a001_Soci',), 'offset' => 0, 'max_results' => 0, 'id' => '', 'select_fields' => array('id'), 'favorites' => false ); $search_by_module_result = call('search_by_module', $search_by_module_parameters, $url); $id_di_cf_ricercato = $search_by_module_result->entry_list[0]->records[0]->id->value; echo "
---------$id_di_cf_ricercato
"; echo "
";
                        print_r($search_by_module_result);
                        echo "
"; $parametro="case_number"; $id="2288a308-8c04-69de-f6ef-5736f44decb3"; $get_entry_list_parameters = array( //session id 'session' => $session_id, 'module_name' => "Cases", 'query' => " cases.id = '$id' ", 'order_by' => "", 'offset' => '0', 'select_fields' => array( $parametro, ), 'max_results' => '10', 'deleted' => '0', 'Favorites' => false, ); $get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url); $risultato = $get_entry_list_result->entry_list[0]->name_value_list->$parametro->value; echo "
--------------$risultato
--------------"; echo '
';
    print_r($get_entry_list_result);
    echo '
'; $get_relationships_parameters = array( 'session' => $session_id, 'module_name' => 'a001_Soci', 'module_id' => $id_di_cf_ricercato, 'link_field_name' => 'a001_soci_cases_1', 'related_module_query' => "", 'related_fields' => array('first_name','last_name','data_sottoscrizione_contratt_c','campo_utenza_1_descrizione_c','id','data_invio_reclamo_c','azienda_controparte_c','status','date_entered','stato_richiesta_c'), 'related_module_link_name_to_fields_array' => array( ), 'related_module_link_name_to_fields_array'=>array( array( 'name' => 'a001_Soci', 'value' => array( 'id', 'first_name', 'last_name', ), ), ), 'deleted' => 0, 'offset' => 0, ); $casedata = call("get_relationships", $get_relationships_parameters, $url); echo "
";
                        print_r($casedata);
                        echo "
"; echo "
------------------------------------------------------------------------------------------------------------

"; $id="6170eaa9-7b9b-29bd-4369-573efa196354"; echo elabora_info_user($session_id,$id,"first_name",$url); ?>
$sessione, 'module_name' => "a001_Soci", 'query' => " a001_soci.id = '$id' ", 'order_by' => "", 'offset' => '0', 'select_fields' => array( 'first_name', ), 'max_results' => '10', 'deleted' => '0', 'Favorites' => false, ); $get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url); $risultato = $get_entry_list_result->entry_list[0]->name_value_list->first_name->value; echo "
--------------qui------------
"; echo "
";
    print_r( $get_entry_list_parameters);
    echo "
"; echo "
";
    print_r( $get_entry_list_result);
    echo "
"; return "-------aaaaaaaaaaaaaaaaaaaaaaa----".$risultato; } function elabora_info_casi ($sessione,$id,$campo) { $get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url); $risultato = $get_entry_list_result->entry_list[0]->name_value_list->$campo->value; return $risultato; } function login_data() { global $url; global $username; global $password; if ($_SERVER['HTTP_HOST'] === "dev9.algores.it") { //$url = "http://dev17.algores.it/service/v4_1/rest.php"; $url = "http://gestionale.mdc.it/service/v4_1/rest.php"; $username = "algores"; $password = "Siamoimejo.77"; } if ($_SERVER['HTTP_HOST'] === "www.difesadelcittadino.it") { $url = "http://gestionale.mdc.it/service/v4_1/rest.php"; $username = "algores"; $password = "Siamoimejo.77"; } } //function to make cURL request function call($method, $parameters, $url) { echo "----qui2--$method--$parameters-$url"; ob_start(); $curl_request = curl_init(); curl_setopt($curl_request, CURLOPT_URL, $url); curl_setopt($curl_request, CURLOPT_POST, 1); curl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($curl_request, CURLOPT_HEADER, 1); curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0); $jsonEncodedData = json_encode($parameters); $post = array( "method" => $method, "input_type" => "JSON", "response_type" => "JSON", "rest_data" => $jsonEncodedData ); curl_setopt($curl_request, CURLOPT_POSTFIELDS, $post); $result = curl_exec($curl_request); curl_close($curl_request); $result = explode("\r\n\r\n", $result, 2); $response = json_decode($result[1]); ob_end_flush(); return $response; } ?>