<?php
header("content-type:text/html;charset=utf-8");
session_start();
error_reporting(0);
if(!isset($_SESSION['admin_name'])){
   exit; 
}
include "../sql.php";
$hid=$_GET['hid'];
if($hid==1){
    $id=$_GET['id'];
    $sql="delete from tb_tot where id='{$id}'";
    if(mysql_query($sql)){
        echo "<script>alert('删除成功！');location='../index.php';</script>";
    }else{
        echo "<script>alert('删除失败！')；history.back();</script>";
    }
}else{
    $check=$_GET['checkbox'];
    for($i=0;$i<=count($check);$i++){
        $sql="delete from tb_tot where id='{$check[$i]}'";
        if(mysql_query($sql)){
            echo "<script>alert('删除成功！');location='../index.php';</script>";
        }else{
            echo "<script>alert('删除失败！')；history.back();</script>";
        }   
    }
}
?>