?
Path : /home/admin/public_html/modules-bak/blog/ |
Current File : /home/admin/public_html/modules-bak/blog/add_group_do.php |
<? session_start(); require_once('../../../config.php'); require_once('../../../libs/MySql.php'); require_once('function.php'); $db=new MySql; function add_category(){ global $db; //$ck=$db->getRow('content_cat',"WHERE CatName='{$_POST[CatName]}' "); //if($ck[CatName]==""){ if($_POST[CatName]!="") { $adddata=Array( 'CatName'=>$_POST['CatName'], 'CatParentID'=>$_POST['parent'], 'CatURL'=>genURLCat($_POST[CatName]), ); if ($_SESSION["la"] == 1){ if($db->Insert('content_cat',$adddata)){ $id=mysql_insert_id(); echo"<center><br>บันทึกข้อมูลสำเร็จ</center> <script language=\"JavaScript\"> window.parent.frames[0].location = \"list_group.php\"; </script> <meta http-equiv=\"refresh\" content=\"1;url=com_new_group.php?parent=$parent\">"; echo "<script language=\"JavaScript\"> window.open('../../../wHtAccess.php?CatID={$id}'); </script>"; }else{ $error="ไม่สามารถบันทึกข้อมูลได้ในขณะนี้ค่ะ"; echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n"; exit(0); } }else{ if($db->Insert('content_cat_en',$adddata)){ $id=mysql_insert_id(); echo"<center><br>บันทึกข้อมูลสำเร็จ</center> <script language=\"JavaScript\"> window.parent.frames[0].location = \"list_group.php\"; </script> <meta http-equiv=\"refresh\" content=\"1;url=com_new_group.php?parent=$parent\">"; echo "<script language=\"JavaScript\"> window.open('../../../wHtAccess.php?CatID={$id}'); </script>"; }else{ $error="ไม่สามารถบันทึกข้อมูลได้ในขณะนี้ค่ะ"; echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n"; exit(0); } } } else { $error="กรอกข้อมูลไม่ครบค่ะ"; echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n"; exit(0); }//จบ ตรวจสอบว่าข้อมูลครบหรือไม /* } else { //ข้อมูลมีในฐานข้อมูลหรือป่าว $error="ชื่อหมวดหมู่ซ้ำกับของเดิม"; echo "<SCRIPT>alert(\"$error\"); window.history.back(); </SCRIPT>\n"; exit(0); } //จบข้อมูลมีในฐานข้อมูลหรือป่าว*/ }//end ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE><?echo $cfg['site_name'];?></TITLE> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META content="" name=Keywords> <META content="<? echo $cfg['site_name'];?>" name="Description"> <META content="<? echo $cfg['site_name'];?>" name="Author"> <META content="<? echo $cfg['site_name'];?>" name="Copyright"> <? add_category(); ?>