<?php
session_start();
if (empty($_SESSION['token'])) {
header("location:login.php"); // jika belum login, maka dikembalikan ke file form_login.php
}
else {
include 'init.php';
//echo "token :".$_SESSION['token'];
				  require 'nusoap/nusoap.php';
				  require 'nusoap/class.wsdlcache.php';
				  $wsdl = 'http://localhost:8082/ws/live.php?wsdl';
				  //$wsdl = 'http://192.168.20.119:8082/ws/live.php?wsdl';
				  //$wsdl = 'http://175.184.251.212:8082/ws/live.php?wsdl';
				  $client = new nusoap_client($wsdl, true);
				  $proxy = $client->getProxy();
				  //echo $_SESSION['username'];
				  //echo $_SESSION['password'];
				  
				  @$user=$_SESSION['username'];
				  @$pass=$_SESSION['password'];
				  
				  $uname = $user;
				  $upass = $pass;
//					echo $uname."-".$upass;				  
//				  //@$username = $input_username;
//				  //@$password = $input_password;
				  @$gettoken = $proxy->GetToken($uname, $upass);
				  
				  @$_SESSION["token"]=$gettoken;
				  $token=$gettoken;
//echo "token sesi:".$token;
//
////			@$sp="npsn='".$username."'";
//			
////			@$result=$proxy->GetRecord($gettoken,'satuan_pendidikan',$sp);
////			echo "<br><br><br><br><br><br><br><br><br><br>";
////			var_dump($result);
////			@$id_sp=$result['result']['id_sp'];
////			@$nm_lemb=$result['result']['nm_lemb'];
////			@$_SESSION['id_sp']=$id_sp;
////			@$_SESSION['nm_lemb']=$nm_lemb;
////echo "<br> --------------------------------- -----------------------------------------------------------------------nama lembagaku : ".$nm_lemb;
//
//
//
$token=$_SESSION['token'];
                              # MENDAPATKAN PROFIL PERGURUAN TINGGI
                              $filter = '';
                              $order = '';
                              $limit = '';
                              $offset = 0;
                              $data = array('act'=>'GetProfilPT',
							  //$data = array('act'=>'GetProdi',
                              'token'=>$token,
                              'filter'=>$filter,
                              'order'=>$order,
                              'limit'=>$limit,
                              'offset'=>$offset,
                              );
                              //var_dump($data_sp);
                              $result_string = runWS($data, $ctype='xml');
							  //echo "<br><br><br><br><br><br>";
                              //var_dump($result_string);
                              $result = simplexml_load_string($result_string);
                              $result = json_decode(json_encode($result), true);
                              $coba=$result['data'];
                              $coba1=array_unique($coba);
							  foreach( $coba as $pt ){
									$nm_lemb=$pt['nama_perguruan_tinggi'];
									$id_sp=$pt['id_perguruan_tinggi'];
									
									}
                                @$_SESSION['id_sp']=$id_sp;
								@$_SESSION['nm_lemb']=$nm_lemb;
                                      //echo "id pt : ".$id_sp."- Nama PT : " .$nm_lemb;




}
?>
<Style type="text/css">
pre { background:#000037;
color:#FFF;}
</style>

