<?php 
session_start(); //开着身份验证，以
include("../sql/conn.php"); /////写
header("Content-type: text/html; charset=utf-8"); 
$llym = $_SERVER["HTTP_REFERER"];
?>

<?php
if ($_GET['tjx']=="tjx")
{


	 $result = mysql_query("SELECT * FROM ".$b_qz."_ks_name where name ='".$_POST['name']."' ");
	 if (mysql_num_rows($result) != 0 )//检查库里是否有这个用户名
	 {
     echo "<script>alert('名称重复！');</script>";
	 }else{
	 mysql_query("INSERT INTO ".$b_qz."_ks_name (name, user, time1, bz) VALUES ('".$_POST['name']."','".$_SESSION['user_1']."','".$noww."', '".$_POST['bz']."')");
	 }

mysql_query("INSERT INTO ".$b_qz."_text (user, ip1, time1, dm, ting) VALUES ('".$_SESSION['user_1']."','".$iipp."','".$noww."', 'cj_ks_name','创建考试')");

echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
exit;
}
?>









<?php
if($_GET['xg']=='xg')
{
		
		mysql_query("UPDATE ".$b_qz."_ks_name SET 
		name = '".$_POST["name"]."',
		bz = '".$_POST["bz"]."',
		tk = '".$_POST["tk"]."',
		dan = '".$_POST["dan"]."',
		duo = '".$_POST["duo"]."',
		pan = '".$_POST["pan"]."',
		dan_f = '".$_POST["dan_f"]."',
		duo_f = '".$_POST["duo_f"]."',
		pan_f = '".$_POST["pan_f"]."',
		time_z = '".$_POST["time_z"]."',
		mf = '".$_POST["mf"]."'
		WHERE id = '".$_GET['id']."'");
		
		mysql_query("INSERT INTO ".$b_qz."_text (user, ip1, time1, dm, ting) VALUES 
		('".$_SESSION['user_1']."','".$iipp."','".$noww."', 'kaoshi_xg','修改考试资料')");

		 echo "<script>alert('修改成功！');</script>";
		 echo "<meta http-equiv=refresh content=0.1;url=".$llym." >";
		 exit;

}
?>






<?php include("../sql/close.php"); /////写?>
