| Server IP : 172.67.187.206 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/myoffice/2566/modules_22222/tkk2/ |
Upload File : |
<?
CheckUser($_SESSION['user_user'], $_SESSION['user_pwd']);
?>
<?php
include 'includes/connect.php';
?>
<link href="style.css" rel="stylesheet" type="text/css">
<script language="JavaScript1.2">
<!--
window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>
<script type="text/javascript">
function myoffice(val, group_num)
{
if(val==true)
{
document.getElementById("group"+group_num+"").style.display="";
}
else
{
document.getElementById("group"+group_num+"").style.display="none";
}
}
</script>
<script type="text/javascript">
function myoffice1(val, group_num)
{
if(val==true)
{
document.getElementById("group1"+group_num+"").style.display="";
}
else
{
document.getElementById("group1"+group_num+"").style.display="none";
}
}
</script>
<script>
function checkall(formname,checkname,thestate){
var el_collection=eval("document.forms."+formname+"."+checkname)
for (c=0;c<el_collection.length;c++)
el_collection[c].checked=thestate
}
</script>
<script language="JavaScript">
//******************************************
function checkregis() {
if(document.myform.TOPIC.value=="") {
alert("กรุณาใส่ชื่อเรื่อง") ;
document.myform.TOPIC.select() ;
return false ;
}
if(document.myform.NAMECOM.value=="") {
alert("กรุณากรอกวันเดือนปี") ;
document.myform.NAMECOM.select() ;
return false ;
}
//********************************************
}
</script>
<TABLE align="center" cellSpacing=0 cellPadding=0 width=1000 height=500 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<?
if($_GET[op] == "tkk3_add" AND $_GET[action] == "add"){
//////////////////////////////////////////// กรณีเพิ่ม Database
if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
// CheckUser($_SESSION['user_user']);
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE username='".$_SESSION['user_user']."' ");
$arr[user] = $db->fetch($res[user]);
$FILE = $_FILES['files1'];
$FILE = $_FILES['files2'];
$FILE = $_FILES['files3'];
$FILE = $_FILES['files4'];
if (!$_POST[CATEGORY] OR !$_POST[TOPIC] OR !$_POST[NAMECOM]){
echo "<script language='javascript'>" ;
echo "alert('กรุณากรอกข้อมูลต่างๆให้ครบถ้วน หรือไฟล์มีขนาดใหญ่กว่า 2 MB')" ;
echo "</script>" ;
echo "<script language='javascript'>javascript:history.back()</script>";
exit();
}
//==========================================================================================
//======================================================== BEGIN ===== UPLOAD 1 ============
//==========================================================================================
// นำฟังก์ชั่น Ramdom password มาใช้เพื่อกำหนดชื่อไฟล์ป้องกันการซ้ำกัน
if($_FILES["files1"]["tmp_name"] != "")
{
$upload = $_FILES["files1"]["tmp_name"];
$upload_file = $_FILES["files1"]["type"];
require 'includes/gen_file_name.php';
$now=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND ($upload_file!="application/x-zip-compressed") AND ($upload_file!="application/octet-stream")){
echo "<script language='javascript'>" ;
echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
echo "</script>" ;
echo "<script language='javascript'>javascript:history.back()</script>";
exit();
}
$path="data/tkk3"; //ที่อยู่ที่จะ upload ไปไว้
$files1newcon = strstr($files1_name,'.'); //ตัดเอาเฉพาะนามสกุลของไฟล์
$new1_upload = $passw.$now.$files1newcon;
copy($_FILES["files1"]["tmp_name"], "$path/$new1_upload");
//======================================================== END ======= UPLOAD 4 ============
// เร่อม
if($_FILES["files2"]["tmp_name"] != "")
{
$upload = $_FILES["files2"]["tmp_name"];
$upload_file = $_FILES["files2"]["type"];
require 'includes/gen_file_name.php';
$now=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND ($upload_file!="application/x-zip-compressed") AND ($upload_file!="application/octet-stream")){
echo "<script language='javascript'>" ;
echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
echo "</script>" ;
echo "<script language='javascript'>javascript:history.back()</script>";
exit();
}
// echo random_password(8);
$path="data/tkk3"; //ที่อยู่ที่จะ upload ไปไว้
$files2newcon = strstr($files2_name,'.'); //ตัดเอาเฉพาะนามสกุลของไฟล์
$new2_upload = $passw.$now.$files2newcon;
copy($_FILES["files2"]["tmp_name"], "$path/$new2_upload");
//======================================================== END ======= UPLOAD 2 ============
// เร่อม
if($_FILES["files3"]["tmp_name"] != "")
{
$upload = $_FILES["files3"]["tmp_name"];
$upload_file = $_FILES["files3"]["type"];
require 'includes/gen_file_name.php';
$now=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND ($upload_file!="application/x-zip-compressed") AND ($upload_file!="application/octet-stream")){
echo "<script language='javascript'>" ;
echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
echo "</script>" ;
echo "<script language='javascript'>javascript:history.back()</script>";
exit();
}
// echo random_password(8);
$path="data/tkk3"; //ที่อยู่ที่จะ upload ไปไว้
$files3newcon = strstr($files3_name,'.'); //ตัดเอาเฉพาะนามสกุลของไฟล์
$new3_upload = $passw.$now.$files3newcon;
copy($_FILES["files3"]["tmp_name"], "$path/$new3_upload");
//======================================================== END ======= UPLOAD 3============
// เร่อม
if($_FILES["files4"]["tmp_name"] != "")
{
$upload = $_FILES["files4"]["tmp_name"];
$upload_file = $_FILES["files4"]["type"];
require 'includes/gen_file_name.php';
$now=$gen_file_name;
//ตรวจสอบชนิดของไฟล์
if (( $upload_file!="application/pdf" ) AND ($upload_file!="application/msword") AND ($upload_file!="application/vnd.ms-excel") AND ($upload_file!="application/vnd.openxmlformats-officedocument.wordprocessingml.document") AND ($upload_file!="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") AND ($upload_file!="application/x-zip-compressed")AND ($upload_file!="application/octet-stream")){
echo "<script language='javascript'>" ;
echo "alert('กรุณาใช้ไฟล์ .pdf .doc .xls .zip ')" ;
echo "</script>" ;
echo "<script language='javascript'>javascript:history.back()</script>";
exit();
}
// echo random_password(8);
$path="data/tkk3"; //ที่อยู่ที่จะ upload ไปไว้
$files4newcon = strstr($files4_name,'.'); //ตัดเอาเฉพาะนามสกุลของไฟล์
$new4_upload = $passw.$now.$files4newcon;
copy($_FILES["files4"]["tmp_name"], "$path/$new4_upload");
//======================================================== END ======= UPLOAD 4 ============
}
}
}
//ทำการเพิ่มข้อมูลลงดาต้าเบส
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$db->add_db(TB_TKK3,array(
"category"=>",".implode(",", $_POST[CATEGORY]).",",
"cat"=>"$_POST[CAT]",
"topic"=>"$_POST[TOPIC]",
"namecom"=>"$_POST[NAMECOM]",
"posted"=>"$_POST[POSTED]",
"post_date"=>"".TIMESTAMP."",
"update_date"=>"".TIMESTAMP."",
"enable_comment"=>"$_POST[ENABLE_COMMENT]",
"full_text"=>"$new1_upload",
"full_texts"=>"$new2_upload",
"full_textu"=>"$new3_upload",
"full_texto"=>"$new4_upload"));
$db->closedb ();
} else {
//ทำการเพิ่มข้อมูลลงดาต้าเบส
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$db->add_db(TB_TKK3,array(
"category"=>",".implode(",", $_POST[CATEGORY]).",",
"cat"=>"$_POST[CAT]",
"topic"=>"$_POST[TOPIC]",
"namecom"=>"$_POST[NAMECOM]",
"posted"=>"$_POST[POSTED]",
"post_date"=>"".TIMESTAMP."",
"update_date"=>"".TIMESTAMP."",
"enable_comment"=>"$_POST[ENABLE_COMMENT]"));
$db->closedb ();
}
//ทำการสร้างไฟล์ text ของข่าวสาร
$Filename = TIMESTAMP.".txt";
$txt_name = "data/tkk3text/".$Filename."";
$txt_open = @fopen("$txt_name", "w");
@fwrite($txt_open, "".$_POST[DETAIL]."");
@fclose($txt_open);
$ProcessOutput .= "<BR><BR>";
$ProcessOutput .= "<CENTER><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการเพิ่ม เข้าสู่ระบบเรียบร้อยแล้ว</B></FONT><BR><BR>";
$ProcessOutput .= "<meta http-equiv=\"refresh\" content=\"1 ;url=?name=tkk3&file=bookperson&op=tkk3_read&category=".$arr[user][id]."\">";
$ProcessOutput .= "</CENTER>";
$ProcessOutput .= "<BR><BR>";
}else{
//กรณีไม่ผ่าน
$ProcessOutput = $PermissionFalse ;
}
echo $ProcessOutput ;
}
else if($_GET[op] == "tkk3_add"){
//////////////////////////////////////////// กรณีเพิ่ม Form
if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
// CheckUser($_SESSION['user_user']);
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE username='".$_SESSION['user_user']."' ");
$arr[user] = $db->fetch($res[user]);
//ดึงค่า
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[tkk2] = $db->select_query("SELECT * FROM ".TB_TKK2." WHERE id='".$_GET[id]."' ");
$arr[tkk2] = $db->fetch($res[tkk2]);
$db->closedb ();
?>
<FORM NAME="myform" METHOD=POST ACTION="?name=tkk3&file=addbook&op=tkk3_add&action=add" enctype="multipart/form-data" id="myform">
<BR>
<TABLE width=850 height="80" align="center" background="images/124.jpg" border=0 cellPadding=0 cellSpacing=0>
<TR>
<TD align="center" vAlign=top><B>ระบบส่งหนังสือเวียนภายใน</B>
</TD>
</TR>
<TR>
<TD vAlign=top>
<TABLE width=800 height="80" align="center" border=0 cellPadding=0 cellSpacing=0>
<TR>
<TD vAlign=top>
<BR>
<B> เรื่อง:</B>
<INPUT TYPE="text" NAME="TOPIC" size="100" VALUE="<?=$arr[tkk2][topic];?>" >
<BR><BR>
<B> รายละเอียด:</B><BR>
<?
include("FCKeditor/fckeditor.php") ;
$oFCKeditor = new FCKeditor('DETAIL') ;
$oFCKeditor->BasePath = 'FCKeditor/' ;
$oFCKeditor->Width = '98%' ;
$oFCKeditor->Height = '200' ;
$oFCKeditor->Value = $TextContent ;
$oFCKeditor->Create() ;
?>
<BR><BR>
<B> กลุ่มที่ส่ง:<select NAME="NAMECOM">
<option value=""></option>
<?
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE level='11' and status='3' ORDER BY id ");
while ($arr[user] = $db->fetch($res[user])){
echo "<option value=\"".$arr[user][category_name]."\"";
echo ">".$arr[user][category_name]."</option>";
}
$db->closedb ();
?>
</TD>
</TR>
<TR>
<TD>
<BR>
<B>ส่งถึง :</B> <img src="images/arrow_nn.gif"><input type="checkbox" id='v100' onclick="myoffice(this.checked, 'A')" />ข้าราชการครูและบุคลากร
<div id="groupA" style="display:none;">
<TABLE width=700 height="80" align="center" border=0 cellPadding=0 cellSpacing=0>
<a href="javascript:checkall('myform','v100',true)">เลือกทั้งหมด</a>
<a href="javascript:checkall('myform','v100',false)">เอาออกทั้งหมด</a> <BR>
<?
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[category] = $db->select_query("SELECT * FROM ".TB_WORKING_CAT." ORDER by id ");
while ($arr[category] = $db->fetch($res[category])){
?>
<TR>
<TD WIDTH="600"vAlign=top>
<font color=blue><B><u><input type="checkbox" id='v100' onclick="myoffice(this.checked, '<?=$arr[category][id];?>')" /><?=$arr[category][category_name];?><BR></u></B></font>
<div id="group<?=$arr[category][id];?>" style="display:none;">
<TABLE WIDTH="600" align="center" bgcolor="#FFFFcd" border=0 cellspacing="0" cellpadding="0">
<tr>
<?
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE working='".$arr[category][id]."' and status='1' ORDER BY id ");
while ($arr[user] = $db->fetch($res[user])){
?>
<td width="25%" valign="top">
<input type="checkbox" name="CATEGORY[]" id='v100' value="<?=$arr[user][id];?>"><b> <?=$arr[user][category_name];?></b>
<?
$count++;
if (($count%2) == 0) { echo "<TR><TD></TD></TR>"; $count=0;
} else{
echo "</TD>";
}
?>
<?
}
$db->closedb ();
?>
</tr>
</table>
</div>
<?
}
?>
</td>
</tr>
</table>
</div>
</TD>
<TABLE width=600 height="80" align="center" border=0 cellPadding=0 cellSpacing=0>
<TR>
<TD vAlign=top>
<BR>
<?
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[user] = $db->select_query("SELECT * FROM ".TB_user." WHERE username='".$_SESSION['user_user']."' ");
$arr[user] = $db->fetch($res[user]);
?>
<INPUT TYPE="hidden" NAME="ENABLE_COMMENT" size="5" VALUE="1">
<INPUT TYPE="hidden" NAME="POSTED" VALUE="<?=$arr[user][category_name];?>" readonly style=\"color: #FF0000">
<INPUT TYPE="hidden" NAME="CAT" VALUE="<?=$arr[user][id];?>" readonly style=\"color: #FF0000">
<br><font face="MS Sans serif" ><b>ไฟล์แนบที่ 1 : <input type="file" name="files1" size="50"><font face="MS Sans serif"><br>
<br><font face="MS Sans serif" ><b>ไฟล์แนบที่ 2 : <input type="file" name="files2" size="50"><font face="MS Sans serif"><br>
<br><font face="MS Sans serif" ><b>ไฟล์แนบที่ 3 : <input type="file" name="files3" size="50"><font face="MS Sans serif"><br>
<br><font face="MS Sans serif" ><b>ไฟล์แนบที่ 4 : <input type="file" name="files4" size="50"><font face="MS Sans serif"><br><br>
<center><INPUT TYPE="submit" value=" บันทึกการส่ง" name="submit"style="background-color:#FFFF99"></center>
</td>
</tr>
</tr>
</table>
<br>
</FORM>
<BR><BR>
<?
}else{
//กรณีไม่ผ่าน
echo $PermissionFalse ;
}
}else if($_GET[op] == "tkk3_del" AND $_GET[action] == "multidel"){
//////////////////////////////////////////// กรณีลบ Multi
if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
while(list($key, $value) = each ($_POST['list'])){
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
$res[tkk3] = $db->select_query("SELECT * FROM ".TB_TKK3." WHERE id='".$value."' ");
$arr[tkk3] = $db->fetch($res[tkk3]);
$db->del(TB_TKK3," id='".$value."' ");
@unlink("tkk3data/".$arr[tkk3][post_date].".txt");
@unlink("tkk3icon/".$arr[tkk3][post_date].".jpg");
@unlink("tkk3/".$arr[tkk3][full_text]);
$db->closedb ();
}
}else{
}
}
else if($_GET[op] == "tkk3_del"){
//////////////////////////////////////////// กรณีลบ Form
if(CheckLevelUser($_SESSION['user_user'],$_GET[op])){
$db->connectdb(DB_NAME,DB_USERNAME,DB_PASSWORD);
// $db->del(TB_TKK3," id='".$_GET[id]."' ");
$res[tkk3] = $db->select_query("SELECT * FROM ".TB_TKK3." WHERE id='".$_GET[id]."' ");
$arr[tkk3] = $db->fetch($res[tkk3]);
$db->del(TB_TKK3," id='".$_GET[id]."' ");
@unlink("tkk3data/".$arr[tkk3][post_date].".txt");
@unlink("tkk3icon/".$arr[tkk3][post_date].".jpg");
@unlink("tkk3/".$arr[tkk3][full_text]);
$db->closedb ();
$ProcessOutput .= "<BR><BR>";
$ProcessOutput .= "<CENTER><A HREF=\"?name=user&file=main\"><IMG SRC=\"images/icon/login-welcome.gif\" BORDER=\"0\"></A><BR><BR>";
$ProcessOutput .= "<FONT COLOR=\"#336600\"><B>ได้ทำการลบเรียบร้อยแล้ว</B></FONT><BR><BR>";
$ProcessOutput .= "<A HREF=\"?name=user&file=tkk3\"><B>กลับหน้า จัดการขุมความรู้</B></A>";
$ProcessOutput .= "</CENTER>";
$ProcessOutput .= "<BR><BR>";
}else{
//กรณีไม่ผ่าน
$ProcessOutput = $PermissionFalse ;
}
echo $ProcessOutput ;
}
?>
<!-- user -->
</TD>
</TR>
</TBODY>
</TABLE>