コード例 #1
0
$page = ceil($total / $limit);
// เอา record ทั้งหมด หารด้วย จำนวนที่จะแสดงของแต่ละหน้า
/* เอาผลหาร มาวน เป็นตัวเลข เรียงกัน เช่น สมมุติว่าหารได้ 3 เอามาวลก็จะได้ 1 2 3 */
for ($i = 1; $i <= $page; $i++) {
    if ($_GET['page'] == $i) {
        //ถ้าตัวแปล page ตรง กับ เลขที่วนได้
        echo "<font color='#ff0000'>[<a href='?frm=delete_admin&start=" . $limit * ($i - 1) . "&page={$i}' style='text-decoration:none;'><B>{$i}</B></a>]</font>";
        //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1
    } else {
        echo "[<a href='?frm=delete_admin&start=" . $limit * ($i - 1) . "&page={$i}' style='text-decoration:none;'>{$i}</a>]";
        //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2
    }
}
?>
    
</td>
</tr>
</table>
<?php 
if ($_REQUEST['id'] != '') {
    $id = $_REQUEST['id'];
    $sql = "delete from {$table_admin} where ID='{$id}' ";
    mysql_query($sql) or die("Error sql delete table_admin");
    fn_refresh(0, "index.php?frm=delete_admin");
}
?>
    

</body>
</html>
コード例 #2
0
    $id = $_REQUEST['id'];
    $pic = $_REQUEST['pic'];
    $T_id = $_REQUEST['T_id'];
    unlink("picture_teacher/{$pic}");
    $sql = "delete from {$table_teacher} where ID='{$id}' ";
    mysql_query($sql) or die("Error sql delete table_teacher");
    $sql2 = "delete from {$table_easy_place} where T_id='{$T_id}' ";
    mysql_query($sql2) or die("Error sql delete table_easy_place");
    $sql3 = "delete from {$table_aptitude} where T_id='{$T_id}' ";
    mysql_query($sql3) or die("Error sql delete table_aptitude");
    if ($_REQUEST['type_t'] == 'TM') {
        $sql4 = "update schedule set id_teacher_m='' where id_teacher_m='{$T_id}' ";
        mysql_query($sql4);
    }
    if ($_REQUEST['type_t'] == 'TC') {
        $sql4 = "update schedule set id_teacher_c='' where id_teacher_c='{$T_id}' ";
        mysql_query($sql4);
    }
    if ($_REQUEST['type_t'] == 'TS') {
        $sql4 = "update schedule set id_teacher_s='' where id_teacher_s='{$T_id}' ";
        mysql_query($sql4);
    }
    fn_refresh(0, "index.php?frm=delete_teacher");
}
?>
    
</table>

</body>
</html>
コード例 #3
0
ファイル: delete_topic.php プロジェクト: virusfilm/Schedule
<?php

include "config/connect.php";
include "config/function_db.php";
include "config/function_gen.php";
//$id=$_GET['id'];
echo $id = $_REQUEST['id'];
$sql_s = "select Topic_Content from {$table_topic} where Topic_id='{$id}' ";
$query = mysql_query($sql_s) or die("Error");
$row = mysql_fetch_array($query);
// $pic=$row['Topic_Content'];
//unlink("file_lession/$pic");
// $sql="delete from $table_topic where Topic_id='$id' ";
// $result=mysql_query($sql) or die ("Error sql delete");
// if($result)
// {
//	echo "y";
// }
echo $sql = "delete from {$table_topic} where Topic_id='{$id}' ";
$result = mysql_query($sql) or die("Error sql delete");
if ($result) {
    fn_refresh(0, "index.php?frm=delete_topic");
}
コード例 #4
0
ファイル: delete_place.php プロジェクト: virusfilm/Schedule
<?php

include "config/connect.php";
include "config/function_db.php";
include "config/function_gen.php";
// $id=$_REQUEST['id'];
//$id=$_GET['id'];
//echo "111111111111111111111111111111111111";
//	 $sql="delete from $table_place where id='$id' ";
// $result=mysql_query($sql) or die ("Error sql delete");
//	 if($_REQUEST['id'] != '')
// {
$id = $_REQUEST['id'];
$sql = "delete from {$table_place} where id='{$id}' ";
$result = mysql_query($sql) or die("Error sql delete");
if ($result) {
    fn_refresh(0, "index.php?frm=delete_place");
}
//	}
/* if($result)
	 {
	 	echo "y";
	 }*/
コード例 #5
0
ファイル: delete_holiday.php プロジェクト: virusfilm/Schedule
<?php

include "config/connect.php";
include "config/function_db.php";
include "config/function_gen.php";
// $id=$_GET['id'];
// $sql="delete from $table_holiday where id='$id' ";
// $result=mysql_query($sql) or die ("Error sql delete");
// if($result)
// {
// 	echo "y";
// }
$id = $_REQUEST['id'];
$sql = "delete from {$table_holiday} where id='{$id}' ";
$result = mysql_query($sql) or die("Error sql delete");
if ($result) {
    fn_refresh(0, "index.php?frm=delete_holiday");
}
コード例 #6
0
ファイル: login.php プロジェクト: virusfilm/Schedule
                    $sqlO2 = "select * from s_admin  ";
                    $queryO2 = mysql_query($sqlO2);
                    $rowO2 = mysql_fetch_array($queryO2);
                    $status_s2 = $rowO2['s_status'];
                    if ($status_s2 == "1") {
                        echo '<SCRIPT language=JavaScript>  alert("ปิดปรับปรุง!! กรุณาลองใหม่ทุก 1 ขั่วโมง...");  </script>';
                        session_destroy();
                        break;
                    }
                    $condition = "(T_username ='******') AND (T_password ='******')";
                    $query = select_condition($type_user, $condition);
                    $row = mysql_fetch_array($query);
                    $name_login = "******" . $row['T_name'] . " " . $row['T_surname'];
                    $_SESSION['s_teacher_id'] = $row['ID'];
                    $_SESSION['s_type'] = $row['T_Type'];
                    $_SESSION['type_user'] = '******';
                }
            }
        }
    }
    $num = mysql_num_rows($query);
    if ($num != '') {
        $_SESSION['user_login'] = $name_login;
        fn_refresh(0, "index.php");
    } else {
        fn_alert("รหัสผ่านไม่ถูกต้อง");
    }
}
?>
</body>
</html>