/home/banprang/domains/plai.go.th/public_html/coremain/module/calendar/delete.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
session_start
();
//include("../../function.php");
//admin_web_carlenda("index.php");
echo "<title>: : : ปฎิทินกิจกรรม : : :</title>";
echo
"<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
echo
"<link href='style.css' rel='stylesheet' type='text/css'>";
include(
"../../../$_SESSION[web_name]/connect.php");
import_request_variables('pG''p_');
if(
$p_date!="")                                        {         $date=trim($p_date);                }
if(
$p_month!="")                                    {         $month=trim($p_month);                }
if(
$p_year!="")                                        {         $year=trim($p_year);                }
if(
$p_id_dels!="")                                    {         $id_dels=trim($p_id_dels);            }


// ทำการลบ file ออกจากระบบ
$sql="select file from cms_calendar where id='$id_dels'";
$result=mysql_query($sql);
$data=mysql_fetch_row($result);
        if(
$data[0]!="")
        {
        
unlink("../../../$_SESSION[web_name]/module_calendar/$data[0]");
        }

//loop  delete calendar
$sql2 "delete from cms_calendar where id='$id_dels'";
$result2 mysql_query($sql2);
?>

            <table width='100%' border='0' cellspacing='1' bgcolor='aaaaaa' align='center' cellpadding='0'>
                    <tr> 
                          <td bgcolor="#FFFFFF" height="290" valign="top">
                                    <?
                                    
echo "<center><br><br><br><br><br>ข้อมูลได้ถูกลบเรียบร้อยแล้ว</center>";
                                    echo
"<meta http-equiv='refresh' content='0; url=showevent.php?date=$date&month=$month&year=$year'>";
                                    
?>
                             </td>
                   </tr>
</table>