Path : /var/www/html/kpp2_salary_sa/salary5kppkpkpkp/
File Upload :
Current File : /var/www/html/kpp2_salary_sa/salary5kppkpkpkp/index_salary_backup.php

<?php

    function GenTxt($width) {
        $txt = "abcdefghijklmnopqrstuvwxyz";
        srand((double)microtime()*1000000);
        for ($i=0; $i<$width; $i++)
            $word .= $txt[rand()%strlen($txt)];
        return $word;
    }

    function GenNum($width) {
        $txt = "1234567890";
        srand((double)microtime()*1000000);
        for ($i=0; $i<$width; $i++)
            $num .= $txt[rand()%strlen($txt)];
        return $num;
    }

	function u2t($string) {
		global $Thai_Code;
		$res = "";

		$str = $string;
		if ($Thai_Code == "UTF-8")
			$res = $str;
		else {
			$res = "";
			for ($i = 0; $i < strlen($str); $i++) {
				if (ord($str[$i]) == 224) {
					$unicode = ord($str[$i+2]) & 0x3F;
					$unicode |= (ord($str[$i+1]) & 0x3F) << 6;
					$unicode |= (ord($str[$i]) & 0x0F) << 12;
					$res .= chr($unicode-0x0E00+0xA0);
					$i += 2;
				} else {
					$res .= $str[$i];
				}
			}
		}
		return $res;
	}

	function t2u($tis) {
		global $Thai_Code;
		$utf8 = "";

		if ($Thai_Code == "UTF-8") {
			for( $i=0 ; $i< strlen($tis) ; $i++ ){
				$s = substr($tis, $i, 1);
				$val = ord($s);
				if( $val < 0x80 ){
					$utf8 .= $s;
				} 
				elseif ((0xA1 <= $val and $val <= 0xDA) or (0xDF <= $val and $val <= 0xFB)) {
					$unicode = 0x0E00 + $val - 0xA0;
					$utf8 .= chr( 0xE0 | ($unicode >> 12) );
					$utf8 .= chr( 0x80 | (($unicode >> 6) & 0x3F) );
					$utf8 .= chr( 0x80 | ($unicode & 0x3F) );
				}
			}
		} else
			$utf8 = $tis;
		return $utf8;
	}
	
	$cmd = "";
	if (isset($_POST["cmd"])) $cmd = $_POST["cmd"];
	if ($cmd == "") { if (isset($_GET["cmd"])) $cmd = $_GET["cmd"]; }
	if ($cmd == "") $cmd = "none";
	if ($cmd == "login") {
		$usr = $_POST["usr"];
		$psw = $_POST["psw"];
		$mmt = $_POST["mmt"];
		$yyr = $_POST["yyr"];
	}

	if ($cmd == "upload") {
		$fil = $_FILES["fil"]["name"];
		$tmp = $_FILES["fil"]["tmp_name"];
		$MAX_FILE_SIZE = $_POST["MAX_FILE_SIZE"];
	}
	if ($cmd == "del")
		$fil = $_GET["fil"];

	if ($cmd == "signal") {
		$til = $_FILES["til"]["name"];
		$tmp = $_FILES["til"]["tmp_name"];
		$MAX_FILE_SIZE = $_POST["MAX_FILE_SIZE"];
		$yax = $_POST["yax"];
	}

	// ��س���䢢����ź���dz��� ����ʹ���ͧ�Ѻ�����ҹ��ԧ
	$adminuser = "admin";
	$adminpassword = "8204450";
	$company = "�ӹѡ�ҹࢵ��鹷�����֡�һ�ж��֡�ҡ�ᾧྪ� ࢵ �";
	$address = "������� 299 �.10 �.��ͧ��ا �.��ͧ��ا �.��ᾧྪ� 62120";
	$types_slip = 1;										// 1 = �ʴ�Ẻ�ú�ء��¡��		2 = �ʴ�੾����¡�÷��ӹǹ�Թ
	$types_bank = 2;									// 1 = �ʴ��Ţ�ѭ�ո�Ҥ��			2 = ����ʴ��Ţ�ѭ�ո�Ҥ��
	$app = "��������´�ѭ�ը����Թ�����͹";
	$folder = "./data/";								// ��������������Ѻ�红����� ��觵�ͧ���ҧ������������������

	$ThaiMonth = array("���Ҥ�", "����Ҿѹ��", "�չҤ�", "����¹", "����Ҥ�", "�Զع�¹",  "�á�Ҥ�", "�ԧ�Ҥ�", "�ѹ��¹", "���Ҥ�", "��Ȩԡ�¹", "�ѹ�Ҥ�");

//	 $Thai_Code = "tis-620";						// Standard Server (Linux and Window)
	 $Thai_Code = "UTF-8";
	// $Thai_Code = "Windows-874";		// For Window Server

	$File_Ext = ".upd";								// �Թ��͹
	// $File_Ext = ".sdt";								// �ӹҭ

	$idform = GenTxt(10).GenNum(10);

	$msg = "";
	if ($cmd == "login") {
		if (($usr == $adminuser) && ($psw == $adminpassword)) {
			$cmd = "admin";
		} else {
			$fi = "d".$mmt.$yyr.$File_Ext;
			if (file_exists($folder.$fi)) {
				$data = file($folder.$fi);
				$hhh = array("H", 11, 34);

//				$hh = $data[0];
//				$hhh = explode("|", $hh);
//				$dd = $data[1];
				$dd = $data[0];

				$hdd = explode("|", $dd);
//				$i = 2;
				$i = 1;
				$chk = 0;
				while (($i < count($data)) && ($chk == 0)) {
					$dd = $data[$i];
					$arr = explode("|", $dd);
					if (($usr == $arr[1]) && ($psw == $arr[2])) {
						$chk = 1;
						$cmd = "show";
					}
					$i++;
				}
				if ($chk == 0) {
					$cmd = "none";
					$msg = "<font color=#ff0000>����բ����Ţͧ��������˹�����������</font>";
				}
			} else {
				$cmd = "none";
				$msg = "<font color=#ff0000>����բ��������͹ �� ����˹�</font>";
			}
		}
	}
	if ($cmd == "upload") {
		$msg = "<br><div align=\"center\"><b>";
		if (move_uploaded_file($tmp, $folder.$fil))
//		copy($fil, $folder.$fil_name);
			$msg .= "Upload �������������º�������� ���꡷����� &quot;¡��ԡ&quot; ���͡�Ѻ�˹����ѡ";
		else
			$msg .= "���ѭ��㹡���Ѿ�������� �������ö Upload ��";
		$msg .= "</b></div><br><br>";
		$cmd = "admin";
	}
	if ($cmd == "del") {
		$cmd = "admin";
		if (file_exists($folder.$fil)) {
			unlink($folder.$fil);
		}
	}
	if ($cmd == "signal") {
		$msg = "<br><div align=\"center\"><b>";
		$cmd = "admin";
		$ext = $til;
		while (strpos($ext, ".") != 0) {
			$pst = strpos($ext, ".");
			$len = strlen($ext);
			$ext = substr($ext, $pst + 1, $len - $pst);
		}
		$flx = "signal".$yax.".".$ext;
		if (move_uploaded_file($tmp, $folder.$flx))
			$msg .= "Upload ����ٻ�Ҿ����繵����º��������";
		else
			$msg .= "���ѭ��㹡�� Upload �������繵� �������ö Upload ��";
		$msg .= "</b></div><br><br>";
	}

	echo "<html>\n<head>\n\t<title>: : : ".t2u($app)." : : :</title>\n";
	echo "\t<meta name=\"content-language\" content=\"th\">\n";
	echo "\t<meta http-equiv=\"cache-control\" content=\"max-age=0\">\n";
	echo "\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\n";
	echo "\t<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
	echo "\t<meta http-equiv=\"pragma\" content=\"no-cache\">\n";
	echo "\t<meta http-equiv=\"expires\" content=\"-1\">\n";
	echo "\t<meta http-equiv=\"content-type\" content=\"text/html; charset=$Thai_Code\">\n";
	echo "\t<style type=\"text/css\">\n";
	echo "\t\timg { border: none; }\n";
	echo "\t\thtml, body { margin: 0; padding: 0; text-align: center; height: 100%; background: #e0e0e0; font-size: 100%; font-family: Tahoma; color: #0000a0; font-size: 13px;  overflow: auto; }\n";
	echo "\t\ttable { background-color: #ffffff; border-style: solid; border-color: #808080; border-width: 0pt; border-collapse: collapse; empty-cells: hide; border-spacing: 1pt; box-shadow: 2px 2px 3px #888888;}\n";
	echo "\t\ttr { vertical-align: center; height: 23px;}\n";
	echo "\t\tth { color: #0000a0; font-family: Tahoma; font-size: 13px; font-weight: bold; white-space: nowrap; padding: 0 5px; height: 21px; text-align: center; border: 1px solid #d0d0d0; background-color: #e0e0e0;}\n";
	echo "\t\ttd { color: #0000a0; font-size: 13px; font-family: Tahoma; height: 21px; padding: 0 5px; }\n";
	echo "\t\tinput { background: #f0f0f0; color: #0000a0; font-family: Tahoma; font-size: 12px; font-weight: normal; padding: 2px; border: 1px solid #d0d0d0; vertical-align: middle; height: 21px; }\n";
	echo "\t\tinput:hover, input:focus { background-color: #f0f0f0; background-position: 0 -41px; border: 1px solid #0d0dd0; }\n";
	echo "\t\tselect { color: #0000A0; background-color: #f0f0f0; font-family: sans-serif; font-size: 12px; font-weight: normal; border: 1px solid #a0a0a0; padding: 2px; vertical-align: middle; }\n";
	echo "\tselect:hover, select:focus { background-color: #f0f0f0; border: 1px solid #0d0dd0; }\n";
	echo "\t\toption { padding-left: 0.2cm; vertical-align: middle; }\n";
	echo "\t\toption.disabled-option { color: graytext; font-weight: italic; }\n";
	echo "\t\t.btnlite { font-weight: bold; cursor: pointer; padding: 1px 5px; font-size: 1.0em; border-color: #e0e0e0; border-radius: 5px; border: 1px solid #a0a0a0; height: 27px; box-shadow: 2px 2px 3px #888888;}\n";
	echo "\t\tA:link { font-weight: bold; color: #0000a0; text-decoration: none;}\n";
	echo "\t\tA:visited { font-weight: bold; color: #0000a0; text-decoration: none; }\n";
	echo "\t\tA:active { font-weight: bold; color: #0000a0; text-decoration: none; }\n";
	echo "\t\tA:hover { font-weight: bold; color: #d00000; text-decoration: none; }\n";
	echo "\t\tA.clink:link { font-weight: bold; color: #0000a0; text-decoration: none; }\n";
	echo "\t</style>\n";
	echo "</head>\n";

	echo "<body><br>\n\t<center>\n";
	echo "<table style=\"width: 80%; border-top-left-radius:2em; border-top-right-radius:2em;\" cellpadding=\"0\" cellspacing=\"1\">\n";
	echo "<tr><td colspan=\"2\" align=\"center\"><b><h1>".t2u($app)."</h1></b>";
	if ($company != "") echo "<h2>".t2u($company)."</h2>\n";
	if ($cmd == "show") { 
		if (count($arr) > 51) echo "<h3><b>".t2u("˹���</b> $arr[51]")."</h3>\n";
		$mx = (int) ($mmt - 1);
		echo "<form name=\"$idform\" id=\"$idform\" method=\"post\" action=\"index_salary.php\" autocomplete=\"off\">\n";
		echo "\t<input type=\"hidden\" name=\"usr\" value=\"$usr\">\n";
		echo "\t<input type=\"hidden\" name=\"psw\" value=\"$psw\">\n";
		echo "\t<input type=\"hidden\" name=\"cmd\" value=\"login\">\n";
		echo "\t".t2u("��͹")."&nbsp;<select style=\"cursor: pointer;\" name=\"mmt\">\n";
		for ($i=0; $i<12; $i++) {
			echo "\t\t<option value=\"";
			$ii = $i + 1;
			if ($ii<10) echo "0";
			echo "$ii\"";
			if ($mx == $i) echo " selected";
			echo ">".t2u($ThaiMonth[$i])."</option>\n";
		}
		echo "</select>&nbsp;&nbsp;".t2u("�.�.")."&nbsp;<input type=\"text\" name=\"yyr\" size=\"5\" value=\"$yyr\">";
		echo "&nbsp;&nbsp;&nbsp;<input type=\"submit\" class=\"btnlite\" value=\"".t2u("���¡������")."\"></form>\n";
	} else echo "<br>";
	echo "</td></tr>\n";
	if ($cmd == "none") {
		echo t2u("<tr style=\" box-shadow: 0px 2px 3px #888888;\"><th width=\"50%\">��¡��</th><th>��������´</th></tr>\n");
		if ($msg != "") {
			echo t2u("<tr><td colspan=\"2\" align=\"center\"><br><b>$msg</b><br><br></td></tr>\n");
		}
		echo "<form name=\"$idform\" id=\"$idform\" method=\"post\" action=\"index_salary.php\" autocomplete=\"off\">\n";
		echo "<input type=\"hidden\" name=\"cmd\" value=\"login\">\n";
		echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
		echo t2u("<tr><td align=\"right\">����Ţ��ЪҪ� 13 ��ѡ</td>\n");
		echo "\t<td>&nbsp;<input type=\"text\" size=\"20\" name=\"usr\"></td></tr>\n";
		echo t2u("<tr><td align=\"right\">����Ţ�ѭ�ո�Ҥ�� 10 ��ѡ</td>\n");
		echo "\t<td>&nbsp;<input type=\"text\" size=\"20\" name=\"psw\"></td></tr>\n";
		echo t2u("<tr><td align=\"right\">���͡��͹</td>\n");
		echo "\t<td>&nbsp;<select style=\"cursor: pointer;\" name=\"mmt\">";

		$today = date("Y-m-d");
		$mon = (int) substr($today, 5, 2);
		$yer = (int) substr($today, 0, 4);
		for ($i=1; $i<13; $i++) {
			echo "\t\t<option value=\"";
			if ($i < 10) { echo "0"; }
			echo "$i\"";
			if ($mon == $i) { echo " selected"; }
			echo ">".t2u($ThaiMonth[$i - 1])."</option>\n";
		}
		echo "</select></td></tr>\n";
		$yer = $yer + 543;
		echo t2u("<tr><td align=\"right\">���� �.�.</td>\n");
		echo "\t<td>&nbsp;<input type=\"text\" name=\"yyr\" value=\"$yer\" size=\"5\"></td></tr>\n";
		echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
		echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"".t2u("  �觢�����  ")."\" class=\"btnlite\"></td></tr>\n";
		echo "</form>\n";
	}
	if ($cmd == "admin") {
		echo t2u("<tr style=\" box-shadow: 0px 2px 3px #888888;\"><th width=\"50%\">��¡��</th><th >��������´</th></tr>\n");
		if ($msg != "") {
			echo t2u("<tr><td class=\"txstyle\" colspan=\"2\">$msg</td></tr>\n");
		}
		echo "<form name=\"$idform\" id=\"$idform\" method=\"post\" action=\"index_salary.php\" enctype=\"multipart/form-data\"  autocomplete=\"off\">\n";
		echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000000\">\n";
		echo "<input type=\"hidden\" name=\"cmd\" value=\"upload\">\n";
		echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
		echo t2u("<tr><td class=\"txstyle\" align=\"right\">���͡�������������Թ��͹���͢������Ѻ�ͧ���� : </td>\n");
		echo "\t<td class=\"txstyle\" align=\"left\">&nbsp;<input type=\"file\" size=\"50\" name=\"fil\"></td></tr>\n";
		echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
		echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"  ".t2u("�觢�����")."   \" class=\"btnlite\">&nbsp;&nbsp;&nbsp;&nbsp;";
		echo "<input type=\"button\" value=\"    ".t2u("¡��ԡ")."    \" onclick=\"location.href='index_salary.php'\" class=\"btnlite\"><br><br></td></tr>\n";
		echo "</form>\n";

		echo "<form name=\"x$idform\" id=\"x$idform\" method=\"post\" action=\"index_salary.php\" enctype=\"multipart/form-data\" autocomplete=\"off\">\n";
		echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000000\">\n";
		echo "<input type=\"hidden\" name=\"cmd\" value=\"signal\">\n";
		echo "<tr><th colspan=\"2\" align=\"center\"><b>".t2u("����Ѿ�������繵��˹ѧ����Ѻ�ͧ���� �ô�Ѿ����ҹ��ҧ���")."</b></th></tr>\n";
		echo "<tr><td class=\"txstyle\" align=\"right\">".t2u("������������Ѻ����繵� : ")."</td>\n";
		$today = getdate();
		$yy = $today[year] + 542;
		echo "\t<td class=\"txstyle\" align=\"left\"><input type=\"text\" name=\"yax\" size=\"7\" value=\"$yy\"></td></tr>\n";
		echo "<tr><td class=\"txstyle\" align=\"right\">".t2u("���͡����ٻ�Ҿ����繵� : ")."</td>\n";
		echo "\t<td class=\"txstyle\" align=\"left\"><input type=\"file\" size=\"50\" name=\"til\"></td></tr>\n";
		echo "<tr><td align=\"center\" colspan=\"2\"><br><input type=\"submit\" value=\"".t2u("���������繵�")."\"  class=\"btnlite\"><br><br></td></tr></form>\n";
	
		echo "<tr><td colspan=\"2\" align=\"center\"><br>\n";
		echo "<table style=\"width: 98%;\" cellpadding=\"0\" cellspacing=\"1\">\n";
		echo t2u("<tr><th colspan=\"6\"  style=\" box-shadow: 0px 2px 3px #888888;\">��ª�����������ŷ����ѹ�֡�������</th></tr>\n");
		$i = 1;
		$dir = opendir($folder);
		while (($data = readdir($dir)) !== false) {
			if (($data != ".") && ($data != "..")) {
				if ($i == 1) { echo "<tr>"; }
				echo "<td class=\"txstyle\" width=\"16.66%\" align=\"left\">&nbsp;&nbsp;$data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[";
				echo t2u("<a onmouseover=\"status='�������� $data';return true;\" ");
				echo "style=\"TEXT-DECORATION: none\" onmouseout=\"status='';return true;\" ";
				echo "href=\"index_salary.php?cmd=del&fil=$data\">".t2u("ź")."</a>]";
				echo "</td>\n";
				$i++;
				if ($i == 7) { echo "</tr>\n"; $i = 1; }
			}
		}
		echo "</tr>\n";
		echo "</table><br></td></tr>\n";
	}
	if ($cmd == "show") {
		$bbk = $arr[2];
		$bbk = substr($bbk, 0, strlen($bbk) - 4)."xxxx";
		echo "<tr><td colspan=\"2\" bgcolor=\"#f0f0f0\" align=\"center\"><br>";
		echo "<table style=\"width: 98%;\" cellpadding=\"0\" cellspacing=\"1\">\n";
		if ($types_bank == 1) {
			echo t2u("<tr><th colspan=\"4\">&nbsp;&nbsp;<b>���� - ���ʡ��</b> : $arr[0]</th>\n");
			echo t2u("\t<th colspan=\"2\" align=\"right\"><b>�͹��Һѭ��</b> : $bbk&nbsp;&nbsp;</th></tr>\n");
		} else {
			echo t2u("<tr><th colspan=\"6\">&nbsp;&nbsp;<b>���� - ���ʡ��</b> : $arr[0]</th></tr>\n");
		}
		if ($types_slip == 1) {
			echo t2u("<tr style=\"box-shadow: 0px 2px 3px #888888;\"><th colspan=\"2\" align=\"center\"><b>��¡���Ѻ</b></th>\n");
			echo t2u("\t<th colspan=\"4\" align=\"center\"><b>��¡�è���</b></th></tr>\n");

			$pp = (int) ($hhh[2] / 2);
			$rr = (int) ($hhh[1]);
			if ($rr > $pp) { $ed = $rr; } else { $ed = $pp; }
			$rs = 3;
			$rp1 = $rr + $rs + 1;
			$rp2 = $rp1 + $pp;
			for ($i = 1; $i <= $ed; $i++) {
				echo "<tr>";
				if ($i <= $rr) {
					echo "<td align=\"left\" width=\"16.66%\">&nbsp;".t2u($hdd[$rs])."</td>\n";
					echo "\t<td align=\"right\" width=\"16.66%\">$arr[$rs]&nbsp;</td>\n";
				} else {
					echo "<td width=\"16.66%\" colspan=\"2\">&nbsp;</td>\n";
				}
				echo "\t<td align=\"left\" width=\"16.66%\">&nbsp;".t2u($hdd[$rp1])."</td>\n";
				echo "\t<td align=\"right\" width=\"16.66%\">$arr[$rp1]&nbsp;</td>\n";
				echo "\t<td align=\"left\" width=\"16.66%\">&nbsp;".t2u($hdd[$rp2])."</td>\n";
				echo "\t<td align=\"right\" width=\"16.66%\">$arr[$rp2]&nbsp;</td></tr>\n";
				$rs++;
				$rp1++;
				$rp2++;
			}
			if (($pp * 2) < $hhh[2]) {
				echo "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>";
				echo "<td align=\"left\">&nbsp;".t2u($hdd[$rp2])."</td><td align=\"right\">$arr[$rp2]&nbsp;</td></tr>\n";
				$rp2++;
			}
			$rs = $rr + 3;
			echo "<tr><th align=\"center\"><b>".t2u($hdd[$rs])."</b></th><th style=\"text-align: right;\"><b>$arr[$rs]&nbsp;</b></td>\n";
			echo "\t<th align=\"center\" colspan=\"3\" bgcolor=\"#f0f0f0\"><b>".t2u($hdd[$rp2])."</b></th><th style=\"text-align: right;\"><b>$arr[$rp2]</b>&nbsp;</th></tr>\n";
			$rp2++;
			$csp = 5;
			echo "<tr>\n";
			if (count($arr) > 53)
				$xc = 53;
			else
				$xc = count($arr);
			if ($xc = 53) {
				echo " <th style=\"text-align: left;\" colspan=\"2\"><b>".t2u("�ѹ������")."</b> : ".t2u($arr[$xc - 1])."</th>\n";
				$csp = 3;
			}
			echo "<th style=\"text-align: right;\" colspan=\"$csp\"><b>".t2u("�ʹ��������͹��Һѭ��")."</b></th><th style=\"text-align: right;\"><b>$arr[$rp2]</b>&nbsp;</th></tr>\n";
			if (count($arr) > 53) {
				echo "<tr><td colspan=\"6\"><table width=\"100%\"><tr><td colspan=\"8\"><b>".t2u("�ʹ��ѺŴ˹��������ʹ�͹��Һѭ�յ������˹���������º��з�ǧ�֡�Ҹԡ�� .- (�������ҵ�ǹ�仪����������)")."</b></td></tr>\n";
				$n = 1;
				$i = 53;
				echo "<tr>";
				while ($i < (count($arr) - 1)) {
					if ($n == 9) {
						$n = 1;
						echo "</tr><tr>";
					}
					echo "<td width=\"15%\" align=\"left\"><li>".t2u($arr[$i])."</li></td>";
					$i++;
					echo "<td width=\"10%\" align=\"right\">$arr[$i]</td>";
					$i++;
					$n = $n + 2;
				}
				echo "</tr></table></td></tr>\n";
			}
		} else {
			$rr = (int) $hhh[1];
			$pp = (int) $hhh[2];
			echo "<tr style=\"box-shadow: 0px 2px 3px #888888;\"><th colspan=\"6\">&nbsp;<b>".t2u("��¡���Ѻ")."</th></tr>\n";
			$rs = 0;
			for ($i = 0; $i < $rr; $i++) {
				$rp1 = $i + 3;
				$cc = (int) $arr[$rp1];
				if ($cc != 0) {
					if ($rs == 0) { echo "<tr>"; }
					echo "<td align=\"left\" width=\"16.66%\">&nbsp;".t2u($hdd[$rp1])."</td>\n\t<td align=\"right\" width=\"16.66%\">$arr[$rp1]&nbsp;</td>\n";
					$rs++;
					if ($rs == 3) { echo "</tr>"; $rs = 0; }
				}
			}
			if (($rs < 3) && ($rs != 0)) { $cc = (3 - $rs) * 2; echo "\t<td colspan=\"$cc\">&nbsp;</td></tr>\n"; }
			$rp1++;
			echo "<tr><th colspan=\"5\" align=\"right\"><b>".t2u("�����¡���Ѻ")."</b>&nbsp;</th>\n\t<th style=\"text-align: right;\"><b>$arr[$rp1]</b>&nbsp;</th></tr>\n";
			echo "<tr style=\"box-shadow: 0px 2px 3px #888888;\"><th colspan=\"6\">&nbsp;<b>".t2u("��¡���ѡ")."</th></tr>\n";
			$rs = 0;
			for ($i = 0; $i < $pp; $i++) {
				$rp1++;
				$cc = (int) $arr[$rp1];
				if ($cc != 0) {
					if ($rs == 0) { echo "<tr>"; }
					echo "<td align=\"left\" width=\"16.66%\">&nbsp;".t2u($hdd[$rp1])."</td>\n\t<td align=\"right\" width=\"16.66%\">$arr[$rp1]&nbsp;</td>\n";
					$rs++;
					if ($rs == 3) { echo "</tr>"; $rs = 0; }
				}
			}
			if (($rs < 3) && ($rs != 0)) { $cc = (3 - $rs) * 2; echo "\t<td colspan=\"$cc\">&nbsp;</td></tr>\n"; }
			$rp1++;
			echo "<tr><th colspan=\"5\" align=\"right\"><b>".t2u("�����¡���ѡ")."</b>&nbsp;</td>\n\t<th style=\"text-align: right;\"><b>$arr[$rp1]</b>&nbsp;</th></tr>\n";
			$rp1++;
			echo "<tr><th colspan=\"5\" align=\"right\"><b>".t2u("����Թ�͹��Һѭ��")."</b>&nbsp;</th>\n\t<th style=\"text-align: right;\"><b>$arr[$rp1]</b>&nbsp;</th></tr>\n";
			if (count($arr) > 53) {
				echo "<tr><td colspan=\"6\"><table width=\"100%\"><tr><td colspan=\"8\"><b>".t2u("�ʹ��ѺŴ˹�����������ö�ѡ � ���������ͪ���˹�������ؤ�ŷ������� �֧������������仪���������� .-")."</b></td></tr>\n";
				$n = 1;
				$i = 53;
				echo "<tr>";
				while ($i < (count($arr) - 1)) {
					if ($n == 9) {
						$n = 1;
						echo "</tr><tr>";
					}
					echo "<td width=\"15%\" align=\"left\"><li>".t2u($arr[$i])."</li></td>";
					$i++;
					echo "<td width=\"10%\" align=\"right\">$arr[$i]</td>";
					$i++;
					$n = $n + 2;
				}
				echo "</tr></table></td></tr>\n";
			}
		}
		echo "</table><br></td></tr>\n";
		echo "<tr><td colspan=\"2\" align=\"center\" bgcolor=\"#f0f0f0\"><br><input type=\"button\" value=\"".t2u("��Ѻ�˹����ѡ")."\" class=\"btnlite\"  onclick=\"location.href='index_salary.php'\">&nbsp;&nbsp;&nbsp;&nbsp;";

		echo "<input type=\"button\" value=\"     ".t2u("���������")."     \" class=\"btnlite\" onclick=\"javascript:window.open('./repslp";
		if ($types_slip == 2) echo "2";
		echo ".php?tag=$usr&fd=$folder&fi=$mmt$yyr&bk=$types_bank&cm=".t2u($company)."', '_blank')\">";

//		echo "<input type=\"button\" value=\"     ���������     \" class=\"btnlite\" onclick=\"javascript:window.open('./repslp.php?tag=$usr&fd=$folder&fi=$mmt$yyr&cm=$company', '_blank')\">";
		echo "<br><br></td></tr>\n";
		echo "<tr><td colspan=\"2\" align=\"center\" bgcolor=\"#f0f0f0\">\n";
		echo "<table style=\"width: 98%;\" cellpadding=\"0\" cellspacing=\"1\">\n";
		echo "<tr style=\"box-shadow: 0px 2px 3px #888888;\"><th>&nbsp;<b>".t2u("��¡��˹ѧ����Ѻ�ͧ�����ѡ � ������")." .-</b></th></tr>\n";
		echo "<tr><td width=\"100%\">\n";
		$flg = 0;
		$dir = opendir($folder);
		while (($data =readdir($dir)) !== false) {
			if (($data != ".") && ($data != "..")) {
				if (substr($data, 0, 3) == "tax") {
					$yy = substr($data, 3, 4);
					$ff = substr($data, 3, strpos($data, ".") - 3);
					echo "<li><a onmouseover=\"status='".t2u("�����˹ѧ����Ѻ�ͧ��")." $yy'; return true;\" onmouseout=\"status=''; return true;\" style=\"TEXT-DECORATION: none\" href=\"reppdf.php?fd=$folder&fi=$ff&id=$usr&th=$Thai_Code\" target=\"_blank\">".t2u("�������§ҹ˹ѧ����Ѻ�ͧ�����ѡ � ������ ������ $ff �����Ẻ Pdf")."</a></li>\n";
					$flg = 1;
				}
			}
		}
		if ($flg == 0) echo "<br><div align=\"center\"><b>* * * ".t2u("�ѧ�������¡��˹ѧ����Ѻ�ͧ�����ѡ � ������")." * * *</b></div><br><br>\n";
		echo "</td></tr></table><br></td></tr>\n";
	}
 	echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";

	// Create by ...
	echo "<tr><td colspan=\"2\" align=\"right\"><br><hr width=\"98%\" noshade style=\"height: 1px; color: #a0a0a0; box-shadow: 2px 2px 3px #888888;\">".t2u($address)."&nbsp;&nbsp;&nbsp;<br>";
	echo "Create by : <a onmouseover=\"status='".t2u("�Դ�����Ũҡ���䫵�")." http://msglive.org';return true;\" ";
	echo "style=\"TEXT-DECORATION: none\" onmouseout=\"status='';return true;\" ";
	echo "href=\"http://msglive.org\" target=\"_blank\">http://msglive.org</a> Version 3.3.2 &copy;2555-2565.&nbsp;&nbsp;<br>All style support in IE9+, Firefox, Chrome, Safari, and Opera.&nbsp;&nbsp;<br><br></td></tr>\n";
	echo "</table></center><br><br></body></html>\n";
?>