|
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 : |
<?
session_start();
$pagename="graph";
?>
<!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=windows-874" />
<title>รายงาน ตัวชี้วัด</title>
<link href="../libary/style.css" type="text/css" rel="stylesheet">
<link href="../hr_report/images/style.css" type="text/css" rel="stylesheet">
</head>
<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>
<?
include("header.php");
include("../../config/config_epm.inc.php");
?>
<body>
<form name="form1" id="form1">
</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="26"><div align="center"><span style="font-weight:900"> รายงานเปรียบเทียบตัวชี้วัด</span></div></td>
</tr>
<tr></tr>
</table>
<div align="center">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
ปีพ.ศ.
<select name="sel_year" id="sel_year">
<?
$yyyy = date("Y")+543;
//echo "<option selected>$yyyy</option>";
while((date("Y")+543)-$yyyy <= 15)
{
if($rs[y_text]==$yyyy)
{
echo "<option value='".$yyyy."' selected>$yyyy</option>";
}
else
{
echo "<option value='".$yyyy."'>$yyyy</option>";
}
$yyyy--;
}
?>
</select>
และ
<select name="sel_year2" id="sel_year2">
<?
$yyyy = date("Y")+543;
//echo "<option selected>$yyyy</option>";
while((date("Y")+543)-$yyyy <= 15)
{
if($rs[y_text]==$yyyy)
{
echo "<option value='".$yyyy."' selected>$yyyy</option>";
}
else
{
echo "<option value='".$yyyy."'>$yyyy</option>";
}
$yyyy--;
}
?>
</select>
</div> <div align="left">
</select>
</div></td>
</tr>
</table>
</div>
<div align="center">
<!--###paging###-->
<!--
<table width="70%" border="0">
<tr>
<td width="65%" align="left">
<?php
$strSQL = "SELECT * FROM indicator ORDER BY createdtime";
$rsConn = mysql_db_query($dbname,$strSQL);
$all_row = mysql_num_rows($rsConn);
$board_row_per_page = 10;
$total_page = ceil($all_row/$board_row_per_page);
$page = ($_GET['page'])?$_GET['page']:1;
$page = ($page > $total_page)?$total_page:$page;
$page = ($page <= 0)?1:$page;
$limit_start = ($page==1)?0:(($page*$board_row_per_page)-$board_row_per_page);
$limit_end = $board_row_per_page;
if($View==''){
//$strSQL .= " LIMIT ".$limit_start.", ".$limit_end;
$num = $limit_start ;
}
if(isset($cols)&&isset($sort)){
$solink="&cols=$cols&sort=$sort";
}
$text_search = ($_GET['b_search'])?"b_search=ค้นหา&letter_code_search=".$_GET['letter_code_search']."&letter_code2_search=".$_GET['letter_code2_search']."&letter_name_search=".$_GET['letter_name_search']."&letter_secname_search=".$_GET['letter_secname_search']."&LetterType_search=".$_GET['LetterType_search']."&name_search=".$_GET['name_search']."&letter_surname_search=".$_GET['letter_surname_search']."&date_order=".$_GET['date_order']."&date_order2=".$_GET['date_order2']:"";
$prev_page = $page - 1; $prev_page = ($prev_page <= 1)?1:$prev_page;
$prev = "self.location='".$PHP_SELF."?".$text_search."&search=$search&page=$prev_page$link$solink'";
$next_page = $page + 1; $next_page = ($next_page >= $total_page)?$total_page:$next_page;
$next = "self.location='".$PHP_SELF."?".$text_search."&search=$search&page=$next_page$link$solink'";
$prev_Tenpage=$page-$board_row_per_page;$prev_Tenpage=($prev_Tenpage<= 1)?1:$prev_Tenpage;
$prevTen = "self.location='".$PHP_SELF."?".$text_search."&search=$search&page=$prev_Tenpage$link$solink'";
$nextTenPage=$page+$board_row_per_page;$next_TenPage=($next_TenPage >= $total_page)?$total_page:$next_TenPage;
$nextTen = "self.location='".$PHP_SELF."?".$text_search."&search=$search&page=$nextTenPage$link$solink'";
?>
<? if($View==""){$Klink="?".$text_search."&View=All"; $CSh="ข้อมูลทั้งหมด"; $Klink2="?".$text_search."&View=";}else{$Klink="?".$text_search."&View=";$CSh="ข้อมูล ".$board_row_per_page." รายการล่าสุด";$Klink2="?".$text_search."&View=All";}?>
ทั้งหมด <b> <font color="#CC0000">
<?=number_format($all_row);?>
</font> </b> รายการ
<? if($View==""){?>
แบ่งเป็น <b><font color="#0033CC">
<?=number_format($total_page);?>
</font></b> หน้า
<? }?>
<a href="<?=$Klink?>"><img src="img/Search-Add.gif" alt="<?=$CSh?>" width="16" height="16" border="0" /></a>
<? if($View==''){?>
<? if($page==1){?>
<img src="img/page_div_icon/xFirst.gif" />
<? }else{?>
<img src="img/page_div_icon/First.gif" align="absmiddle" border="0" width="10" height="12" onclick="<?=$prevTen;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<? if($page==1){?>
<img src="img/page_div_icon/xPrevious.gif" />
<? }else{?>
<img src="img/page_div_icon/Previous.gif" align="absmiddle" border="0" width="7" height="12" onclick="<?=$prev;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<?php
$board_link_num = $board_row_per_page;
$ii = 1;
if ( $board_link_num > $total_page ){
$loop_page = $total_page;
} else {
$bx = ceil($board_link_num / 2);
$pp = $page - $bx;
$pn = $page + $bx;
$loop_page = $pn;
$ii = $pp;
if ( $total_page <= $loop_page ) {
$loop_page = $total_page;
$ii = $loop_page - ($board_link_num -1);
}
if ( $ii < 1 ) {
$ii = 1;
$loop_page = $ii + ($board_link_num -1);
}
}
for($i=$ii;$i<=$loop_page;$i++){
if ( $i==$page || !$page ) {
$txt = "<b>$i</b>";
} else {
$txt = $i;
}
?>
<a href="<?=$PHP_SELF;?>?Sort=<?=$Sort;?>&search=<?=$search?>&<?=$text_search?>&page=<?=$i;?>"><?=$txt;?>
</a>
<?
} # for
?>
<? if($page==$loop_page){?>
<img src="img/page_div_icon/xNext.gif" />
<? }else{?>
<img src="img/page_div_icon/Next.gif" align="absmiddle" border="0" width="7" height="12" onClick="<?=$next;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<? if($page==$loop_page){?>
<img src="img/page_div_icon/xLast.gif" />
<? }else{?>
<img src="img/page_div_icon/Last.gif" align="absmiddle" border="0" width="10" height="12" onClick="<?=$nextTen;?>" onMouseOver="style.cursor='hand';"/>
<? } }#End View=
?> </td>
<td width="35%" align="right"><a href="insert_master.php">
</td>
</tr>
</table>
-->
<!--############-->
<table id="table1" width="70%" border="0" cellspacing="1" cellpadding="0" bgcolor="#666666" >
<tr>
<td width="55" height="20" style="background-image:url(img/bgheader-2.png)"><div align="center">
<input name="chk_indicator" id="chk_indicator" type="checkbox" value="" onclick="checkAll();"/>
</div></td>
<td style="background-image:url(img/bgheader-2.png)"><div align="center"><span style="color:#CCCCCC;font-weight:900">ตัวชี้วัด</span></div></td>
</tr>
<?
//$sql_select = "SELECT i.* FROM indicator i INNER JOIN indicator_detail d ON i.runid=d.indicator_id ORDER BY d.runid";
$res = mysql_db_query($dbname,$strSQL);
$i=0;
while($rs=mysql_fetch_assoc($res))
{
?>
<tr style="background-image:url(img/bgheader-3.png)"><td>
<div align="center">
<input id="chk_indicator_<?=$i?>" name="chk_indicator_<?=$i?>" type="checkbox" value="" />
</div></td>
<td>
<div align="left"> <?=$rs[index_name]?><input type="hidden" name="h_runid_<?=i?>" id="h_runid_<?=$i?>" value="<?=$rs[runid]?>"/></div> </td></tr>
<?
$i++;
}
?>
</table>
</div>
<br />
<div align="center">
<input type="button" name="btn_report1" id="btn_report1" value="แสดงรายงาน" onclick="return previewReport(this)"/>
</div>
</form>
</body>
</html>
<script type="text/javascript">
function previewReport(o)
{
if(isTableCheck())
{
v = getRunId();
sel_year = document.getElementById("sel_year");
sel_year2 = document.getElementById("sel_year2");
year1 = sel_year.options[sel_year.options.selectedIndex].value;
year2 = sel_year2.options[sel_year2.options.selectedIndex].value;
//return;
mywindow = window.open("bargraph.php?runid="+v+"&year1="+year1+"&year2="+year2,"","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,width=900,height=550");
//mywindow = window.open("bargraph.php?runid="+v+"&year1="+year1+"&year2="+year2,"","width=900,height=550");
if(window.focus)
{
mywindow.focus();
}
}
else
{
alert("กรุณาเลือกตัวชี้วัดอย่างน้อย 1 ค่า");
return false
}
return true;
}
function isTableCheck()
{
rowcount = document.getElementById("table1").rows.length;
otable = document.getElementById("table1");
for(i=0;i<rowcount;i++)
{
check = document.getElementById("chk_indicator_"+i);
if(check)
{
if(check.checked)
{
return true;
}
}
}
return false;
}
function checkAll()
{
rowcount = document.getElementById("table1").rows.length;
checkall = document.getElementById("chk_indicator");
// alert(checkall);
if(checkall.checked)
{
bool = 'checked';
}
else
{
bool = '';
}
for(i=0;i<rowcount;i++)
{
check = document.getElementById("chk_indicator_"+i);
if(check)
{
check.checked = bool;
}
}
}
function getRunId()
{
rowcount = document.getElementById("table1").rows.length;
v="";
for(i=0;i<rowcount;i++)
{
check = document.getElementById("chk_indicator_"+i);
h_run_id = document.getElementById("h_runid_"+i);
if(check)
{
if(check.checked)
{
v+=""+h_run_id.value+",";
//alert(v);
}
}
}
if(v!="")
{
//alert(v.length);
v = v.substr(0,v.length-1);
}
return v;
}
</script>