Server IP : 119.59.102.212 / Your IP : 18.188.54.133 Web Server : Apache/2 System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64 User : yangkam ( 1022) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/news/ |
Upload File : |
<?php if($p_id_hide!="") { $id_hide=trim($p_id_hide); } if($p_id_show!="") { $id_show=trim($p_id_show); } if($p_id_delss!="") { $id_delss=trim($p_id_delss); } $date=date("d"); $month=date("m"); $year=date("Y"); $yearthai=$year+543; $datenow=$yearthai.$month.$date; fieldset_top("ข่าวประชาสัมพันธ์ (ภายใน)"); //###################### สำหรับ Admin ####################### // Hide - Show news if($id_hide!="") { update_query("cms_news","status","0","id",$id_hide); include('coremain/connec_out.php'); $sql="UPDATE cms_news SET status='0' WHERE id='$id_hide' and id_tumbon='$_SESSION[id_tumbon]'"; $result=mysql_query($sql); refresh_page(0,"index.php"); mysql_close($handle_out); include("$_SESSION[web_name]/connect.php"); } if($id_show!="") { update_query("cms_news","status","1","id",$id_show); include('coremain/connec_out.php'); $sql="UPDATE cms_news SET status='1' WHERE id='$id_show' and id_tumbon='$_SESSION[id_tumbon]'"; $result=mysql_query($sql); refresh_page(0,"index.php"); mysql_close($handle_out); include("$_SESSION[web_name]/connect.php"); } // Delete News if($id_delss!="") { delete_query("pic1","pic2","pic3","pic4","files","cms_news","id",$id_delss); } // ########################แสดงข่าวประชาสัมพันธ์ภายในหน่วยงาน ################### echo"<table width='98%' border='0' cellpadding='0' cellspacing='0' valign=top>"; $count_news=0; if($_SESSION[admin_web]=="admin" or (id_top_permission("news"))){ $sql="select id, topic ,LEFT(fulltexts, 255) as b,pic1,status,state from cms_news WHERE id_type='1' and id_sub='99999' order by orders desc Limit 3"; }else{ $sql="select id, topic ,LEFT(fulltexts, 255) as b,pic1,status,state from cms_news WHERE id_type='1' and status='1' and id_sub='99999' and date_line>='$datenow' order by orders desc Limit 3"; } $result=mysql_query($sql); while($data = mysql_fetch_array($result)){ // ######################## แสดงหัวข้อข่าว และเนื้อหาข่าว echo"<tr>"; echo" <td width='20%' height='100' valign='top'>"; if($data['pic1']!="") { box_picture_firstpage($data['pic1'],"index.php?mod=news_full&id_news=$data[id]&path=news"); } else { box_nopicture_firstpage("index.php?mod=news_full&id_news=$data[id]&path=news"); } echo"</td>"; echo"<td width='3%' valign='top'></td>"; echo"<td width='75%' height='100' valign='top'>"; echo"<img SRC='coremain/images/marker.gif'> "; echo"<a href='index.php?mod=news_full&id_news=$data[id]&path=news'><b>$data[topic]</b></a> "; if($count_news<=1) echo"<img SRC='coremain/images/news.gif'>"; echo"<br> "; $num_msg = mb_strlen($data['b'], 'utf-8');//mb_substr($data[b],0,100,'UTF-8') $message = $num_msg > 100 ? mb_substr($data['b'], 0, 100, 'UTF-8').'...' : $data['b']; echo strip_tags($message); echo"</td>"; echo"</tr>"; // ################## สำหรับ Admin #################### if($_SESSION[admin_web]=="admin" or (id_top_permission("news"))){ echo"<tr>"; echo "<td colspan='3' align=right>"; // show - hide if($data[status]=='1') { box_hide("index.php?id_hide=$data[id]"); } else { box_show("index.php?id_show=$data[id]"); } // update box_update("index.php?mod=news_update&id_update=$data[id]&path=news"); // delete box_delete("index.php?id_delss=$data[id]","del_popup"); // จำนวนผู้เข้าชม number_format(box_counter($data[state]),'0'); echo"</td>"; echo "</tr>"; } echo '<tr><td colspan="3"><br/></td></tr>'; $count_news++; } echo"</table>"; // ####################### ข้อมูลย้อนหลัง if($count_news>="3"){ echo"<table width='100%' border='0' align=center>"; echo"<tr> "; echo"<td align=center><img src='coremain/images/arrow.gif' border='0'>"; echo " <a href='index.php?mod=news_old&id_type=1&id_sub=$id_sub&path=news'>ข่าวย้อนหลัง</a></td>"; echo "</tr>"; echo "</table>"; } fieldset_down(); ?>