clear("wmessage"); } if (isset($_POST['wm_update'])) { $data = $tp->toDB($_POST['data']); $wm_title = $tp->toDB($_POST['wm_caption']); $wmId = intval($_POST['wm_id']); welcome_adminlog('02', $wmId, $wm_title); //$message = ($sql->db_Update("generic", "gen_chardata ='{$data}',gen_ip ='{$wm_title}', gen_intdata='".$_POST['wm_active']."' WHERE gen_id=".$wmId." ")) ? LAN_UPDATED : LAN_UPDATED_FAILED; if ($sql->update("generic", "gen_chardata ='{$data}',gen_ip ='{$wm_title}', gen_intdata='".$_POST['wm_active']."' WHERE gen_id=".$wmId." ")) { $mes->addSuccess(LAN_UPDATED); } else { $mes->addError(LAN_UPDATED_FAILED); } } if (isset($_POST['wm_insert'])) { $wmtext = $tp->toDB($_POST['data']); $wmtitle = $tp->toDB($_POST['wm_caption']); welcome_adminlog('01', 0, $wmtitle); //$message = ($sql->db_Insert("generic", "0, 'wmessage', '".time()."', ".USERID.", '{$wmtitle}', '{$_POST['wm_active']}', '{$wmtext}' ")) ? LAN_CREATED : LAN_CREATED_FAILED ; if ($sql->db_Insert("generic", "0, 'wmessage', '".time()."', ".USERID.", '{$wmtitle}', '{$_POST['wm_active']}', '{$wmtext}' ")) { $mes->addSuccess(LAN_CREATED); } else { $mes->addError(LAN_CREATED_FAILED); } } if (isset($_POST['updateoptions'])) { $changed = FALSE; foreach (array('wm_enclose','wmessage_sc') as $opt) { $temp = intval($_POST[$opt]); if ($temp != $pref[$opt]) { $pref[$opt] = $temp; $changed = TRUE; } } if ($changed) { save_prefs(); welcome_adminlog('04', 0, $pref['wm_enclose'].', '.$pref['wmessage_sc']); } else { $mes->addInfo(LAN_NOCHANGE_NOTSAVED); } } if (isset($_POST['main_delete'])) { $del_id = array_keys($_POST['main_delete']); welcome_adminlog('03', $wmId, ''); if ($sql->delete("generic", "gen_id='".$del_id[0]."' ")) { $mes->addSuccess(LAN_DELETED); } else { $mes->addError(LAN_DELETED_FAILED); } } $ns->tablerender($caption, $mes->render() . $text); // Show Existing ------- if ($action == "main" || $action == "") { if ($wm_total = $sql->select("generic", "*", "gen_type='wmessage' ORDER BY gen_id ASC")) { $wmList = $sql->db_getList(); $text = $frm->open('myform_wmessage','post',e_SELF); $text .= "
".LAN_ID." | ".WMLAN_02." | ".LAN_VISIBILITY." | ".LAN_OPTIONS." |
---|---|---|---|
".$row['gen_id']." | ".strip_tags($tp->toHTML($row['gen_ip']))." | ".r_userclass_name($row['gen_intdata'])." | ".ADMIN_EDIT_ICON." |