我在网页上进行编码,并从Web服务检索数据,但是仍然缺少编码吗?因为当我单击“下载Data Dukcapil / Ambil Data Dukcapil”按钮时,它没有出现在我的页面上
在页面newpatient.php
$btngetdukcapil = "<input type='button' value='Ambil Data DUKCAPIL' onclick='getdukcapil(this,event)'/><span id='datadukcapil'></span>"
<tr><td class='tblfrmfieldname'>No. KTP/SIM</td><td class='tblfrmfieldvalue'><input type='text' style='width:200px;' id='ext_id' value='$ext_id'/> $btngetdukcapil</td>
功能是
function getdukcapil(d,e){
var ext_id = _gel('ext_id').value;
if(ext_id==''){
alert('Masukkan No KTP dengan benar dan lengkap !!!');
_gel('ext_id').focus();
return;
}
_gel('datadukcapil').innerHTML = progress_span().innerHTML;
pajx_app_getdukcapil(ext_id,function(_data) {
var data = recjsarray(_data);
if(data[0]=='TIDAKADADATA'){
alert('No KTP tidak ada dalam Sistem DUKCAPIL');
_gel('datadukcapil').innerHTML = '';
_gel('ext_id').focus();
return;
}
ajax_patient.php上的另一页 具有功能
/*DUKCAPIL*/
function app_getdukcapil($args){
list($ext_id) = $args;
$arrstatus = array(1=>"sng",2=>"mar",3=>"wid");
$arrreligion = array(1=>1,2=>3,3=>2,4=>5,5=>4,6=>"");
$username="username";
$password="password";
$url = 'http://soadev.jakarta.go.id/rest/gov/dki/dukcapil/ws/getNIK?app=RSUD&pget=SIMRSUD&pusr=rsud.tebet&nik='.$ext_id.'';
$context = stream_context_create(array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode("$username:$password")
)
));
$json = file_get_contents($url, false, $context);
return $data = json_decode($json, true);
}
为什么当我键入NIK“ $ ext_id”并单击“下载数据dukcapil”按钮时,它不会出现在“ newpatient.php”页面上,而仅加载“进度跨度”?