English

Mengambil dan menampilkan ID foto seseorang dengan data pribadi lengkap berdasar PID-nya

Skrip klien berikut akan mengambil foto ID seseorang dan data pribadi lengkap berdasar PID yang anda berikan dan menampilkannya di tabel. (Pls. scroll down)

pilih sebuah nomor PID dari 10000000 sampai 10000004, masukkan kedalam kotak inpute dan tekan "Mulai Demo". Catatan jika anda memasukkan nilai yang salah atau jika PID tidak ada di database remote, sebuah pesan error akan ditampilkan.

 
// Load the library
require('ixr_library.inc.php');

// Create the client and connect to the remote server
$client = new IXR_Client('http://www.care2x.net/foundry/modules/hxp/server.php');

// Create the header and supply the username and password
$header['usr'] = 'hxp';
$header['pw'] = 'hxp';

// Set the PID
$PID = $HTTP_GET_VARS['pid'];

// Call the remote procedure for the foto ID's URL
if (!$client->query('Person.PhotoID.URL', $header, $PID)){
	
	// If error, show info
	echo ('An error occured - '.$client->getErrorCode().' : '.$client->getErrorMessage();

}else{
	// Get the result
	$response = $client->getResponse();
	
	// Print an html image tag
	echo "<img src=\"$response\">";
}

// Call the remote procedure for the person demographics
if (!$client->query('Person', $header, $PID)){
	
	// If error, show info
	echo ('An error occured - '.$client->getErrorCode().' : '.$client->getErrorMessage();

}else{

	// Get the result
	$response = $client->getResponse();

	// Display the result
	echo '<TABLE BORDER=0>';

	while(list($x,$v) = each($response)){
		echo "<TR><TD>$x</TD><TD>$v</TD></TR>";
	}

	echo '</TABLE>';
}

pilih sebuah nomor PID dari 10000000 sampai 10000004, masukkan kedalam kotak inpute dan tekan "Mulai Demo". Catatan jika anda memasukkan nilai yang salah atau jika PID tidak ada di database remote, sebuah pesan error akan ditampilkan.


©2004 HXP All rights reserved