Exemplo n.º 1
0
<?php

error_reporting(E_ALL);
ini_set('display_error', 1);
if ($_POST) {
    require_once 'pegawai.php';
    $pegawai = new Pegawai();
    $data = $_POST['pegawai'];
    $res = $pegawai->update($data);
    if ($res) {
        header('Location: index.php?update=success');
    } else {
        header('Location: edit.php?nip=' . $data['nip'] . '&update=failed');
    }
}
require_once 'nusoap/lib/nusoap.php';
$url = 'http://localhost/8/server.php?wsdl';
$client = new nusoap_client($url, 'WSDL');
$nip = isset($_GET["nip"]) ? $_GET["nip"] : '';
$result = $client->call('get_pegawai', array('nip' => $nip));
var_dump($result);
$data = json_decode($result);
?>
<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="POST">
<table align="center" cellpadding="4" cellspacing="0">
  <?php 
foreach ($data as $key => $value) {
    ?>