Пример #1
0
 $get_param = lang_get_param($cat_recipes_id);
 $dml = check_action($get_param['category_id'], $lang_code);
 if ($_POST['btn_save_lang_recipe'] == "Save Changes") {
     if (isset($default_check)) {
         if ($dml['rows'] > 0) {
             update_category_lang("default", $get_param['category_active'], $get_param['category_visibility'], $cat_recipes_id, $lang_code);
             $_SESSION['alert'] = "success";
             $_SESSION['msg'] = "Changes has been saved.";
         } else {
             insert_category_lang("default", $get_param['category_id'], $get_param['category_active'], $get_param['category_visibility'], $lang_code, $get_param['additional']);
             $_SESSION['alert'] = "success";
             $_SESSION['msg'] = "Changes has been saved.";
         }
     } else {
         if ($dml['rows'] > 0) {
             update_category_lang($cat_recipes_name, $get_param['category_active'], $get_param['category_visibility'], $cat_recipes_id, $lang_code);
             $_SESSION['alert'] = "success";
             $_SESSION['msg'] = "Changes has been saved.";
         } else {
             insert_category_lang($cat_recipes_name, $get_param['category_id'], $get_param['category_active'], $get_param['category_visibility'], $lang_code, $get_param['additional']);
             $_SESSION['alert'] = "success";
             $_SESSION['msg'] = "Changes has been saved.";
         }
     }
 } else {
     if ($_POST['btn_save_lang'] == "Delete") {
         delete_category_lang($cat_recipes_id);
         /*  
            }else if($_POST['btn_pop_category'] == "GO"){
               
         if($post_action = "Delete" and !empty($post_cat_id)){
Пример #2
0
// DEFAULT VALUE
$def_id         = $default_value['catgoery_id'];
$def_name       = $default_value['category_name'];
$def_desc       = $default_value['category_description'];
$def_level      = $default_value['category_level'];
$def_order      = $default_value['category_order'];
$def_active     = $default_value['category_active_status'];
$def_visibility = $default_value['category_visibility_status'];


// DUAL VALUE
$dual_param      = $_POST['cat_id'];
$dual_name       = addslashes($_POST['category_name']);
$dual_desc       = $def_desc;
$dual_level      = $def_level;
$dual_order      = $def_order;
$dual_active     = $def_active;
$dual_visibility = $def_visibility;


if(isset($_POST['btn_save_cat_lang'])){
   
   if($check_dml['rows'] > 0){
      update_category_lang($dual_name, $dual_param, $lang_code);
   }else{
	  insert_category_lang($dual_param, $dual_name, $def_desc, $def_level, $def_order, $def_active, $def_visibility, $lang_code);
   }
   
}
?>