Ejemplo n.º 1
0
<?php

/**
 * File Index
 * 
 * @filesource index.php
 * @author nama_prodi 
 * @package Web_Service_Tutorial
 * @subpackage WS_Client
 * @license MIT
 * @version 0.0.1
 */
require 'ws_client.php';
// call list propinsi WSC function
$ws_data = call_ws_list_prodi('', 0, 100);
$n = $ws_data['data_count'];
$prod_data = $ws_data['data'];
?>
<table border="1">
	<caption>Daftar Prodi di Kampus Ternama Indonesia</caption>
	<tr>
		<th>ID</th>
		<th>KODE</th>
		<th>NAMA</th>
		<th>FAK</th>
		<th>KAMPUS</th>
		<th>WEBSITE</th>
		<th>AKREDITASI</th>
		<th>ALAMAT</th>
		<th>LATITUDE</th>
		<th>LONGITUDE</th>
Ejemplo n.º 2
0
 * @filesource wsc_prod.php
 * @author Google Map | Mencari Prodi di Seluruh Kampus Ternama Indonesia
 * @package Web_Service_Tutorial
 * @subpackage WS_Client Service Call
 * @license MIT
 * @version 0.0.1
 */
require '../2.wsc/ws_client.php';
// Get parameters from URL
$v_prod_nama = isset($_REQUEST["nama_prodi"]) ? $_REQUEST["nama_prodi"] : '';
$v_prod_nama = '%' . $v_prod_nama . '%';
$v_prod_nama = (string) $v_prod_nama;
$v_page = 0;
$v_page_size = 100;
// call list prodinsi WSC function
$ws_data = call_ws_list_prodi($v_prod_nama, $v_page, $v_page_size);
$n = $ws_data['data_count'];
$prod_data = $ws_data['data'];
// Start XML file, create parent node
$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
for ($i = 0; $i < $n; $i++) {
    $jml = $prod_data[$i]['prod_jml_penduduk_pria'] + $prod_data[$i]['prod_jml_penduduk_wanita'];
    $node = $dom->createElement("marker");
    $newnode = $parnode->appendChild($node);
    $newnode->setAttribute("prod_nama", $prod_data[$i]['prod_nama']);
    $newnode->setAttribute("prod_ibukota", $prod_data[$i]['prod_ibukota']);
    $newnode->setAttribute("prod_penduduk", $jml);