Exemplo n.º 1
0
<?
require_once("inc_security.php");	//check quyền them sua xoa
checkAddEdit("delete");

$fs_redirect=base64_decode(getValue("url","str","GET",base64_encode("listing.php")));
$record_id		= getValue("record_id","int","GET",0);

checkRowUser($fs_table,$field_id,$record_id,$fs_redirect);	//kiểm tra quyền sửa xóa của user xem có được quyền ko


//kiểm tra xóa hết cấp con chưa mới có thể xóa cấp cha
$db_select = new db_query("SELECT mnu_id FROM " . $fs_table . " WHERE mnu_parent_id = " . $record_id);
if($row=mysql_fetch_assoc($db_select->result)){
	echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
	echo '<script language="javascript">alert("Bạn phải xóa hết danh mục con của danh mục này! \\nBạn mới có thể xóa danh mục này!");</script>';
	redirect($fs_redirect);
	exit();
}

//Delete data with ID
$db_delete = new db_query("DELETE FROM " . $fs_table . " WHERE mnu_id = " . $record_id);
redirect($fs_redirect);
?>
Exemplo n.º 2
0
<?
include ("inc_security.php"); 
//check quyền them sua xoa
checkAddEdit("delete");
$record_id=getValue("record_id");
$sql="";
$type=getValue("type","str","GET","",1);
$value=getValue("value");
$filed="adm_active";
switch($type){
	case "adm_active":
		$filed="adm_active";
	break;
	case "adm_delete":
		$filed="adm_delete";
	break;
}
$url=base64_decode(getValue("url","str","GET",base64_encode("listing.php")));

$fs_redirect	= base64_decode(getValue("returnurl","str","GET",base64_encode("listing.php")));
$record_id		= getValue("record_id","int","GET");
$field_id		= "adm_id";
//kiểm tra quyền sửa xóa của user xem có được quyền ko
checkRowUser($fs_table,$field_id,$record_id,$fs_redirect);
$db_category	= new db_execute("UPDATE " . $fs_table . " SET " . $filed . " = " . $value . " WHERE lang_id = " . $_SESSION["lang_id"] . " AND adm_id=" . $record_id);
unset($db_category);
redirect($url);
?>
Exemplo n.º 3
0
<? //generate by dinhtoan@finalstyle.com
require_once("inc_security.php");
checkAddEdit("edit");	//check quyền them sua xoa

$returnurl = base64_decode(getValue("returnurl","str","GET",base64_encode("listing.php")));
//Khai bao Bien
$errorMsg = "";
$iQuick = getValue("iQuick","str","POST","");
if ($iQuick == 'update'){
	$record_id = getValue("record_id", "arr", "POST", "");
	if($record_id != ""){
		for($i=0; $i<count($record_id); $i++){
			checkRowUser($fs_table,$field_id,$record_id[$i],$returnurl);
			$errorMsg="";		
			$myform = new generate_form();	//Call Class generate_form();
			$myform->removeHTML(0);	//Loại bỏ chuc nang thay the Tag Html
			//Insert to database
			# $myform->add("mnu_type","mnu_type" . $record_id[$i],0,0,"",1,"",0,"");
			$myform->add("mnu_name","mnu_name" . $record_id[$i],0,0,"",1,"",0,"");
			$myform->add("mnu_order","mnu_order" . $record_id[$i],0,0,"",0,"",0,"");
			$myform->add("mnu_check","mnu_check" . $record_id[$i],0,0,"",0,"",0,"");
			$myform->add("mnu_link","mnu_link" . $record_id[$i],0,0,"",0,"",0,"");
			# $myform->add("mnu_target","mnu_target" . $record_id[$i],0,0,"",0,"",0,"");
			

			//Add table
			$myform->addTable($fs_table);
			
			if($array_config["image"]==1){
				$upload_pic = new upload("picture" . $record_id[$i], $fs_filepath, $extension_list, $limit_size);
				if ($upload_pic->file_name != ""){
Exemplo n.º 4
0
$add				= "add.php";
$listing			= "listing.php";
$edit				= "edit.php";
$after_save_data	= getValue("after_save_data", "str", "POST", $listing);

$errorMsg 			= "";		//Warning Error!
$action				= getValue("action", "str", "POST", "");
$fs_action			= getURL();
$record_id			= getValue("record_id");

$sta_strdate		= getValue("sta_strdate", "str", "POST", date("d/m/Y"));
$sta_strtime		= getValue("sta_strtime", "str", "POST", date("H:i:s"));
$sta_date			= convertDateTime($sta_strdate, $sta_strtime);

#+
checkRowUser($fs_table,$field_id,$record_id,$listing);

#+
#+ Goi class generate form
$myform = new generate_form();	//Call Class generate_form();
$myform->removeHTML(0);	//Loại bỏ chức năng không cho điền tag html trong form
#+
#+ Khai bao bang du lieu
$myform->addTable($fs_table);	// Add table
#+
#+ Khai bao thong tin cac truong
$myform->add("sta_category_id", "sta_category_id", 1, 0, 0, 1, "Bạn chưa chọn danh mục.", 0, "");
$myform->add("sta_title", "sta_title", 0, 0, "", 1, "Bạn chưa nhập tiêu đề.", 0, "");
$myform->add("sta_order", "sta_order", 1, 0, 0, 1, "Thứ tự phải lớn hơn hoặc bằng 0.", 0, "");
$myform->add("sta_date", "sta_date", 1, 1, 0, 0, "", 0, "");
$myform->add("sta_description", "sta_description", 0, 0, "", 0, "", 0, "");
Exemplo n.º 5
0
<?
require_once("config_security.php");

//check quyền them sua xoa
checkAddEdit("delete");

$url=base64_decode(getValue("url","str","GET",base64_encode("listing.php")));
$record_id		= getValue("record_id","int","GET",0);

//kiểm tra quyền sửa xóa của user xem có được quyền ko
checkRowUser($fs_table,$field_id,$record_id,$url);

//Delete pictues with ID
//delete_file($fs_table,"ban_id",$record_id,"ban_picture",$fs_filepath);
//Update ban_picture field width NULL value
$db_delete = new db_execute("UPDATE " . $fs_table . " SET ban_picture = '' WHERE con_lang_id = " .$record_id);
unset($db_delete);
redirect($url);
?>