<!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=utf-8" /> <title>PDF LIST</title> </head> <body> <form action="fileSend.php" method="post" enctype="multipart/form-data" name="frmMain"> <? include "connectdb.php"; $strSQL ="SELECT * FROM pdf"; $objQuery = mysql_query($strSQL); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 20; $Page = $_GET["page"]; if(!$_GET["page"]) { $Page =1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages = 1; } else if(($Num_Rows % $Per_Page) ==0) { $Num_Pages = ($Num_Rows/$Per_Page); } else { $Num_Pages=($Num_Rows/$Per_Page)+1; $Num_Pages=(int)$Num_Pages; } $Getl .= "order by id DESC LIMIT $Page_start, $Per_Page"; $query = mysql_query($strSQL); ?> <table width="1500" border="1" cellpadding="0"> <tr> <th width="300"> <div align="center">Files ID </div></th> <th width="300"> <div align="center">Book Name </div></th> <th width="300"> <div align="center">Volume </div></th> <th width="1000"> <div align="center">description </div></th> <th width="500"> <div align="center">File Name </div></th> <th width="30"> <div align="center">Select</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?=$objResult["id"];?></div></td> <td><div align="center"><?=$objResult["bookName"];?></div></td> <td><div align="center"><?=$objResult["volume"];?></div></td> <td><div align="center"><?=$objResult["description"];?></div></td> <td><center><a href="myfile/<?=$objResult["name"];?>"><?=$objResult["name"];?></a></center></td> <td align="center"><input type="checkbox" name="chkSel[]" value="myfile/<?=$objResult["name"];?>"></td> </tr> <? } ?> </table> <br /> <input type="submit" name="btnSend" value="Send"> <br /> <br /> Total <?=$Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } mysql_close($con); ?> <br /> <a href="backOffice.php">Back</a> </form> </body> </html>
<!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=utf-8" /> <title>Untitled Document</title> </head> <body> <? set_time_limit(0); include 'connectdb.php'; $SQL = "SELECT * FROM member"; $objQuery = mysql_query ($SQL); $Num_Rows = mysql_num_rows($objQuery); //$address = array('[email protected]', '[email protected]'); $mailTo = ""; $strSid = md5(uniqid(time())); for($i=1;$i=$Num_Rows;$i++) { if($Num_Rows !="") { $strSQL = "SELECT email FROM member "; $strSQL .="WHERE userId =".$i; $result = mysql_query($strSQL); while($member = mysql_fetch_array($result)) { $mailTo .=$member['email']; $strSubject ="Test send Email file PDF"; $strMessage = "File Pdf สำหรับ Member"; $strHeader = "From: [email protected]"; for ($b=0;$b<count($_POST["chkSel"]);$b++) { if($_POST["chkSel"][$b] !="") { $strFilesName = $_POST["chkSel"][$b]; $strContent = chunk_split(base64_encode(file_get_contents($_POST["chkSel"][$b]))); $strHeader .= "--".$strSid."\n"; $strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n"; $strHeader .= "Content-Transfer-Encoding: base64\n"; $strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n"; $strHeader .=$strContent."\n\n"; } } $flgSend = mail($mailTo,$strSubject,$strMessage,$strHeader); } } } if ($flgSend) { echo "Email Sending".$mailTo.""; } else { echo "Email Can't Send"; } ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง