|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /home/pathumthani_integration/integration/application/indicator/ |
Upload File : |
<?
header("Content-Type: text/html; charset=windows-874");
session_start() ;
set_time_limit(0) ;
#START
###### This Program is copyright Sapphire Research and Development co.,ltd ########
$ApplicationName = "PMQA";
$module_code = "indicator";
$process_id = "master_insert";
$VERSION = "1";
$BypassAPP = true;
###################################################################
## Public Sector Management Quality Award (PMQA)
###################################################################
## Version : 20100617.001 (Created/Modified; Date.RunNumber)
## Created Date : 20010-06-17 09:00
## Created By : MR.WORASAK JENCHAROENPOKAI
## E-mail :
## Tel. :
## Company : Sappire Research and Development Co.,Ltd. (C)All Right Reserved
###################################################################
include("../../config/config_epm.inc.php");
//include("../../common/common_competency.inc.php");
//include("../../common/class_create_temp.php");
include("function.inc.php");
if($_GET[runid])
{
$unique_id = $_GET[runid];
}
else
{
$unique_id = getUniqueId();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<link href="../libary/style.css" type="text/css" rel="stylesheet">
<link href="../hr_report/images/style.css" type="text/css" rel="stylesheet">
<title>การวัด การวิเคราะห์ และการจัดการความรู้ </title>
<style type="text/css">
<!--
A:link {
FONT-SIZE: 12px;color: #000000; FONT-FAMILY: Tahoma, "Microsoft Sans Serif";TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:visited {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:active {
FONT-SIZE: 12px; COLOR: #014d5f; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:hover {
FONT-SIZE: 12px; COLOR: #f3960b; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
.style1 {color: #FF0000}
-->
</style>
<script language="javascript">
function mOvr(src,clrOver){
if (!src.contains(event.fromElement)) src.bgColor = clrOver;
}
function mOut(src,clrIn){
if (!src.contains(event.toElement)) src.bgColor = clrIn;
}
function trim(text)
{
return text.replace( /^\s+|\s+$/g, "" );
}
function Inint_AJAX() {
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {} //IE
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
alert("XMLHttpRequest not supported");
return null;
}
function dochange(src,index_name) {
var req = Inint_AJAX();
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
document.getElementById(src).innerHTML=req.responseText; //รับค่ากลับมา
}
}
};
req.open("GET", "ajax.checkdup.php?index_name="+index_name); //สร้าง connection
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
req.send(null); //ส่งค่า
}
function checkdup(form)
{
if(form.h_old_index.value!=form.txt_index.value)
{
dochange('label_dup',form.txt_index.value);
}
else
{
document.getElementById("label_dup").innerHTML = "";
}
}
function CheckIsIE()
{
if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;}
else { return false; }
}
function PrintThisPage()
{
if (CheckIsIE() == true)
{
parent.iframe1.focus();
parent.iframe1.print();
}
else
{
window.frames['iframe1'].focus();
window.frames['iframe1'].print();
}
}
function CheckForm ( form ) {
if ( trim(form.txt_index.value) == "" ) {
alert("กรุณาป้อน ตัวชี้ัวัด");
form.txt_index.focus();
return false;
} else if ( trim(form.txt_source.value) == "" ) {
alert("กรุณาป้อน แหล่งข้อมูล/หน่วยงานที่รับผิดชอบ");
form.txt_source.focus();
return false;
} else {
if(trim(form.h_runid.value=="")) // case new insert
{
dochange('label_dup',form.txt_index.value)
if(document.getElementById("label_dup").innerHTML !="")
{
if(!confirm("คำเืตือน : พบตัวชี้วัดดังกล่าว ในระบบ ยืนยันบันทึกข้อมูล ?"))
{
return false;
}
}
}
return true;
}
}
</script>
</head>
<body>
<? include("header.php"); ?>
<?
if($_POST['Submit']){
$runid = $_POST['unique_id'];
$index_name=$_POST['txt_index'];
$source=$_POST['txt_source'];
$upd_freq=$_POST['sel_freq'];
$remark=$_POST['txt_remark'];
$sql="";
$chk_year="";
$affected_rows=0;
$sql = "SELECT * FROM indicator WHERE runid='$runid'";
$result = mysql_db_query($dbname,$sql);
$rownum = mysql_num_rows($result);
if($rownum>0)
{
$sql = "UPDATE indicator SET index_name='$index_name',source='$source',upd_freq='$upd_freq',remark='$remark' ";
$sql.= "WHERE runid='$runid'";
}
else
{
$sql = "INSERT INTO indicator(runid,index_name,source,upd_freq,remark,createdtime)";
$sql.= "VALUES('$runid','$index_name','$source','$upd_freq','$remark',now());";
}
$ret = mysql_db_query($dbname,$sql);
if($ret>0)
{
$affected_rows++;
}
if($affected_rows > 0)
{
print"<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">\n";
exit();
}
}
else
{
$sql_select = "SELECT * FROM indicator WHERE runid='$unique_id'";
$res_indicator = mysql_query($sql_select);
$rs_indicator = mysql_fetch_assoc($res_indicator);
}
?>
<p align="center"><strong>การวัด การวิเคราะห์ และการจัดการความรู้ </strong></p>
<script language="JavaScript">
<!--
/*
function CreateXmlHttp(){
//Creating object of XMLHTTP in IE
try {
XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(oc) {
XmlHttp = null;
}
}
//Creating object of XMLHTTP in Mozilla and Safari
if(!XmlHttp && typeof XMLHttpRequest != "undefined") {
XmlHttp = new XMLHttpRequest();
}
} // end function CreateXmlHttp
function chkRepeat() {
if ( form1.letter_code.value && form1.letter_code2.value ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.chk_cmdlid_repeat.php?cmdCode1="+form1.letter_code.value+"&cmdCode2="+form1.letter_code2.value+"&SecID="+form1.secid.value, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText; //alert(res);
if ( res == "false" ) {
alert("เลขที่คำสั่งซ้ำ\nพบเลขที่ "+form1.letter_code.value+"/"+form1.letter_code2.value+" อยู่ในระบบแล้ว\nกรุณาตรวจสอบ");
form1.letter_code.focus();
}
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการแสดงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
}
}
*/
//-->
var gFiles = 0;
function addFile()
{
var li = document.createElement('li');
li.setAttribute('id', 'file-' + gFiles);
li.innerHTML = '<input name="ref_name[]" type="text" id="ref_name" size="50"><span onclick="removeFile(\'file-' + gFiles + '\')" style="cursor:pointer;">ลบ <img src=../hr3/hr_report/bimg/profile_expanded.gif border=0></span>';
document.getElementById('files-root').appendChild(li);
gFiles++;
}
function removeFile(aId)
{
var obj = document.getElementById(aId);
obj.parentNode.removeChild(obj);
}
</script>
<form id="form1" name="form1" method="post" action="" onSubmit="return CheckForm(this)">
<table width="100%" border="0">
<tr>
<td width="30%" height="25" align="right"><span class="style1">*</span> ตัวชี้วัด</td>
<td width="62%"></div><input name="txt_index" value="<?=$rs_indicator[index_name]?>" type="text" id="txt_index" size="100" onfocus="this.select();" onblur="checkdup(form1);" /><br /><div id="label_dup" class="style1"></td>
<td width="11%"></td>
</tr>
<tr>
<td align="right"><span class="style1">*</span> แหล่งข้อมูล/หน่วยงานที่รับผิดชอบ</td>
<td><input name="txt_source" type="text" id="txt_source" size="100" value="<?=$rs_indicator[source]?>" /></td>
<td> </td>
</tr>
<tr>
<td align="right"><span class="style1">*</span> ความถี่ในการ Update ข้อมูล</td>
<td><select name="sel_freq" id="sel_freq">
<?
$res = mysql_query("select * from indicator_frequency");
while($rs = mysql_fetch_assoc($res))
{
if($rs_indicator[upd_freq] == $rs[runid]){
echo "<option value=\"$rs[runid]\" selected>".$rs[freq_name]."</option>";
}
else{
echo "<option value=\"$rs[runid]\">".$rs[freq_name]."</option>";
}
}
?>
</select></td>
<td> </td>
</tr>
<tr>
<td align="right">หมายเหตุ</td>
<td><input name="txt_remark" type="text" id="txt_remark" size="100" value="<?=$rs_indicator[remark]?>" onfocus="this.select();" /></td>
<td> </td>
</tr>
<tr>
<td colspan="3" height="26" style="background-image:url(img/bgheader-2.png)" > <span style="color:#CCCCCC;font-weight:900">ข้อมูลผลการดำเนินการย้อนหลัง และปีปัจจุบัน</span></td>
</tr>
<tr>
<td colspan="3" align="center">
<div bgcolor="#4260A9" width="100%"><iframe src="insert_detail.php?indicator_id=<?=$unique_id?>" width="100%" height="350" frameborder="0" hspace="0" marginwidth="0" vspace="0" name="iframe_detail" id="iframe_detail" style="z-index:9999"></iframe>
</div></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" name="Submit" value="บันทึก"/>
<input type="button" name="Submit3" onclick="window.location='index.php'"value="ยกเลิก" /></td>
</tr>
</table>
<!--###hidden value###-->
<input type="hidden" name="unique_id" value="<?=$unique_id;?>"/>
<input type="hidden" name="h_runid" value="<?=$_GET[runid];?>"/>
<input type="hidden" name="h_old_index" value="<?=$rs_indicator[index_name]?>"/>
</form>
</body>
</html>