123 lines
4.0 KiB
PHP
123 lines
4.0 KiB
PHP
<?php
|
|
$PARENT_SCRIPTNAME='prm_system.php';
|
|
include_once 'script_auth.php';
|
|
|
|
include_once 'class/PregReplaceCallbackClass.php';
|
|
include_once 'init/initialisation_parameter.php';
|
|
|
|
$ora_obj = new ORAConnectionClass('init/ORA_INIT.php');
|
|
$ora_res = $ora_obj->ORA_PConnect();
|
|
if (!$ora_res){
|
|
echo "<BR>Error : " . htmlspecialchars($ora_obj->last_error_msg) . "<br>";
|
|
exit();
|
|
}
|
|
initParamTemplate();
|
|
|
|
$result = getList($ora_obj);
|
|
echo $result;
|
|
|
|
unset($_SESSION['TEMPLATE_ARRAY_ADDR']);
|
|
if ($ora_obj->conn) {
|
|
$ora_obj->ORA_Close();
|
|
#echo "connection closed.<br>";
|
|
}
|
|
|
|
function initParamTemplate(){
|
|
$paramTemplate['ELEMENT'] = <<< params
|
|
<tr id="tr<<COUNTER>>" class="font11" onmouseover="changeColor(this,'#FFFF99');" onmouseout="changeColor(this,'#F7F7F7');" onclick="javascript:modifyData('<<PARAMID>>', '<<TGL_UPDATE>>');">
|
|
<td width=35 align=right><<COUNTER>>.</td>
|
|
<td align=left><<PARAMDESC>></td>
|
|
<td align=left><<PARAMTYPE>></td>
|
|
<td align=left><<PARAMVALUE>></td>
|
|
</tr>
|
|
params;
|
|
|
|
$paramTemplate['CONTAINER'] = <<< params
|
|
<table width="100%" cellpadding="2" cellspacing="1" border="0" style="layout:auto">
|
|
<tr>
|
|
<td align=left class="orangetitle" nowrap>Parameter Aplikasi</td>
|
|
<td align=right>
|
|
<button id="PRINT_BTN" name="printData" class="print">
|
|
<img src="images/icon_printer.gif" width="12" height="12">
|
|
<span id="AddBtnLink" class="font10"> Print </span>
|
|
</button>
|
|
<input type="hidden" name="ACTION">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<table width="100%" cellpadding="2" cellspacing="1" border="0" style="layout:auto">
|
|
<tr class="table_form_header">
|
|
<th align=left width=35>No.</th>
|
|
<th align=left>Parameter</th>
|
|
<th align=left>Tipe Data</th>
|
|
<th align=left>Nilai</th>
|
|
</tr>
|
|
<<LIST>>
|
|
</table>
|
|
</tr>
|
|
</table>
|
|
params;
|
|
|
|
$paramTemplate['NORESULT'] = <<< params
|
|
<table width="100%" cellpadding="2" cellspacing="1" border="0" style="layout:auto">
|
|
<tr>
|
|
<td align=left class="orangetitle" nowrap>Parameter Aplikasi</td>
|
|
<td align=right>
|
|
<input type="hidden" name="ACTION">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<table width="100%" cellpadding="2" cellspacing="1" border="0" style="layout:auto">
|
|
<tr class="table_form_header">
|
|
<th align=left width=35>No.</th>
|
|
<th align=left>Parameter</th>
|
|
<th align=left>Tipe Data</th>
|
|
<th align=left>Nilai</th>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" class="font12BRed" align=center>NO DATA FOUND</td>
|
|
</tr>
|
|
</table>
|
|
</tr>
|
|
</table>
|
|
params;
|
|
|
|
$_SESSION['TEMPLATE_ARRAY_ADDR'] = &$paramTemplate;
|
|
}
|
|
|
|
function getList(&$ora_obj){
|
|
$templObj = new PregReplaceCallbackClass('');
|
|
$templObj->SetTemplateArray('TEMPLATE_ARRAY_ADDR');
|
|
|
|
$paramSQL = <<< sql
|
|
SELECT paramid, paramdesc, paramvalue,
|
|
decode(paramtype, 'N', 'Numeric', 'I', 'Integer', 'S', 'String', 'D','Date', 'Character') paramtype,
|
|
TO_CHAR(tgl_update, 'YYYYMMDDHH24MISS') tgl_update
|
|
FROM prm_system
|
|
WHERE flag_oto = 'O'
|
|
AND updateable = '1'
|
|
ORDER BY paramid
|
|
sql;
|
|
|
|
$paramArray = $ora_obj->ORA_SelectData($paramSQL,null,null,OCI_FETCHSTATEMENT_BY_ROW);
|
|
$_SESSION['ARRAY_ADDR_VAR'] = &$variable_array;
|
|
|
|
if ($ora_obj->nrows>0) {
|
|
foreach ($paramArray as $pkey => $pval) {
|
|
$variable_array['COUNTER']++;
|
|
foreach ($pval as $tkey => $tval) {
|
|
$variable_array[$tkey] = htmlspecialchars($tval);
|
|
}
|
|
$templObj->SetFormatName('ELEMENT');
|
|
$list .= $templObj->PregReplaceCallback();
|
|
}
|
|
$variable_array['LIST'] = $list;
|
|
$templObj->SetFormatName('CONTAINER');
|
|
$result = $templObj->PregReplaceCallback();
|
|
} else {
|
|
$templObj->SetFormatName('NORESULT');
|
|
$result = $templObj->PregReplaceCallback();
|
|
}
|
|
return $result;
|
|
}
|
|
?>
|