MINI SHELL

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/industry/engine/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/pathumthani_integration/integration/application/industry/engine/index_report.php
<?
include("../../../../config/conndb_nonsession.inc.php");
$dbtemp_pobec = "temp_pobec_import";

$strSQL1  = "show tables";
//echo $strSQL1;
$Result1 = mysql_db_query($dbtemp_pobec,$strSQL1); 
while($Rs1 = mysql_fetch_assoc($Result1)){
	$temp_secid = substr($Rs1[Tables_in_temp_pobec_import],-4);
	$temp_secid1 .= ",".$temp_secid; 
}
$secid_sel = substr($temp_secid1,1,strlen($temp_secid1));
$strl = strlen($secid_sel);
$sub = substr($secid_sel,0,$strl/2); // ตัดเอา secid มา
//echo $sub;
$test_sql = 1;
if($test_sql == 1){
	$condition_sql = "  WHERE secid IN($sub) AND secid NOT LIKE '99%' ";
}else{
	$condition_sql = "  WHERE 1";
}

?>
<HTML><HEAD><TITLE>โปรแกรมนำเข้าข้อมูล POBEC</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
<LINK href="../../../../common/style.css" rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</HEAD>
<BODY>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" bgcolor="#000000"><table width="100%" border="0" cellspacing="1" cellpadding="3">
      <tr>
        <td colspan="5" align="left" bgcolor="A5B2CE"><a href="index.php"><img src="../../../../images_sys/home.gif" width="20" height="20" border="0" alt="กลับหน้าหลัก"></a>&nbsp;&nbsp;<strong>รายงานข้อมูลจำนวนบุคลากรในเขตและตำแหน่งว่าง</strong></td>
        </tr>
      <tr>
        <td width="6%" align="center" bgcolor="A5B2CE"><strong>ลำดับ</strong></td>
        <td width="35%" align="center" bgcolor="A5B2CE"><strong>สพท.</strong></td>
        <td width="22%" align="center" bgcolor="A5B2CE"><strong>บุคลากร</strong></td>
        <td width="19%" align="center" bgcolor="A5B2CE"><strong>ตำแหน่งว่าง</strong></td>
        <td width="18%" align="center" bgcolor="A5B2CE"><strong>รวม</strong></td>
      </tr>
	  <?
	  $strSQL = "SELECT * FROM  eduarea  $condition_sql  ORDER BY secname  ASC";
	//  echo $strSQL;
	  $Result = @mysql_db_query($dbnamemaster,$strSQL);
	  $i=0;
	  while($rs =@mysql_fetch_assoc($Result)){
	  
	  $i++;
	  ?>
      <tr>
        <td align="center" bgcolor="#FFFFFF"><?=$i?></td>
        <td align="left" bgcolor="#FFFFFF"><a href="report_school.php?sent_secid=<?=$rs[secid]?>&secname=<?=$rs[secname]?>"><?=$rs[secname]?></a></td>
        <td align="center" bgcolor="#FFFFFF">
		<?
		$strSQL_p = "SELECT COUNT(*) AS num_p FROM pobec_$rs[secid]  WHERE  IDCODE  <> '' AND NAME1 <> '' AND NAME2 <> ''";
		$Result_p = @mysql_db_query($dbtemp_pobec,$strSQL_p);
		$rs_p = @mysql_fetch_assoc($Result_p);
		$person_all = $rs_p[num_p];
		$per_sum_all += $person_all;
		echo number_format($person_all);
		?>		</td>
        <td align="center" bgcolor="#FFFFFF">
		<?
		
		$strSQL_pos = "SELECT COUNT(*) AS num_pos FROM pobec_$rs[secid]  WHERE  IDCODE  = '' AND NAME1 = '' AND NAME2 = ''";
		$Result_pos = @mysql_db_query($dbtemp_pobec,$strSQL_pos);
		$rs_pos = @mysql_fetch_assoc($Result_pos);
		$position_null = $rs_pos[num_pos];
		$pos_sum_all += $position_null;
		echo number_format($position_null);

		?>		</td>
        <td align="center" bgcolor="#FFFFFF"><? echo number_format(($position_null+$person_all)); ?></td>
      </tr>
	  <?
	  }
	  ?>
      <tr>
        <td colspan="2" align="center" bgcolor="#FFFFFF"><strong>รวม</strong></td>
        <td align="center" bgcolor="#FFFFFF"><?=number_format($per_sum_all)?></td>
        <td align="center" bgcolor="#FFFFFF"><?=number_format($pos_sum_all)?></td>
        <td align="center" bgcolor="#FFFFFF"><?=number_format($per_sum_all+$pos_sum_all);?></td>
      </tr>

    </table></td>
  </tr>
</table>

</BODY>
</HTML>

Anon7 - 2021