<?php
session_start();
if (empty($_SESSION['token'])) {
header("location:login.php"); // jika belum login, maka dikembalikan ke file form_login.php
}
else {

//echo $_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';
$client = new nusoap_client($wsdl, true);
$proxy = $client->getProxy();
//echo $_SESSION['username'];
//echo $_SESSION['password'];

@$input_username=$_SESSION['username'];
@$input_password=$_SESSION['password'];

$username = $input_username;
$password = $input_password;

//@$username = $input_username;
//@$password = $input_password;
@$gettoken = $proxy->GetToken($username, $password);

@$_SESSION["token"]=$gettoken;
@$token=$gettoken;
//echo $token;

@$sp="npsn='".$username."'";

@$result=$proxy->GetRecord($gettoken,'satuan_pendidikan',$sp);
@$id_sp=$result['result']['id_sp'];
@$nm_lemb=$result['result']['nm_lemb'];
@$_SESSION['id_sp']=$id_sp;
@$_SESSION['nm_lemb']=$nm_lemb;
//echo $nm_lemb;
}
?>
<Style type="text/css">
pre { background:#000037;
color:#FFF;}
</style>

