fbpx

personellistesi

$serv_username, 'password' => $serv_password ) ); $r = curl_exec( $ch ); if ( curl_errno( $ch ) ) { echo 'Error:' . curl_error( $ch ); } curl_close( $ch ); return $r; } function serviceExec( $url, $token ) { $ch_init = curl_init(); curl_setopt( $ch_init, CURLOPT_URL, $url ); curl_setopt( $ch_init, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch_init, CURLOPT_POST, true ); curl_setopt( $ch_init, CURLOPT_POSTFIELDS, array( 'token' => $token ) ); $result = curl_exec( $ch_init ); if ( curl_errno( $ch_init ) ) { echo 'Error:' . curl_error( $ch_init ); } curl_close( $ch_init ); return $result; } function stest() { header( 'Content-Type: application/json; charset=UTF-8' ); $token_json = serviceConnect(); $token_obj = json_decode( $token_json, false ); $res = serviceExec( 'https://services.arel.edu.tr/arelv3/restapi/cardsys/activecardlist', $token_obj->token ); $json = json_decode( $res ); var_dump( $json ); } $token_json = serviceConnect(); $token_obj = json_decode( $token_json, false ); $URL = 'https://services.arel.edu.tr/arelv3/restapi/arelhr/personelbilgileri/'; $Result = serviceExec( $URL, $token_obj->token ); echo "" . print_r( json_decode( $Result, true ), 1 ) . ""; die(); ?>