<?php /** * Created by PhpStorm. * User: ning-pc * Date: 15/8/16 * Time: 下午3:18 */ require_once '../include.php'; $act = $_REQUEST['act']; $id = $_REQUEST['id']; if ($act == 'logout') { logout(); } elseif ($act == 'addAdmin') { $msg = addAdmin(); } elseif ($act == 'editAdmin') { $msg = editAdmin($id); } elseif ($act == 'delAdmin') { $msg = delAdmin($id); } ?> <h1><?php echo $msg; ?> </h1>
//need to create this file. it's not part of the SVN. It needs to have $password_eldritchSQL and $AES_ENC_KEY include 'CGAdminPasswords.php'; if (isset($_POST['ID'])) { if (isset($_POST['TYPE'])) { $eldritchSQL = mysql_pconnect($hostname_eldritchSQL, $username_eldritchSQL, $password_eldritchSQL) or trigger_error(mysql_error(), E_USER_ERROR); mysql_select_db($database_eldritchSQL) or trigger_error(mysql_error(), E_USER_ERROR); $currID = $_POST['ID']; $type = $_POST['TYPE']; if ($type == "QD") { delQD($currID); } else { if ($type == "QDSUB") { delQDSub($currID); } else { if ($type == "ADMIN") { delAdmin($currID); } else { if ($type == "USER") { delUser($currID); } } } } mysql_close($eldritchSQL); } } function delQD($currID) { if ($currID != "") { $response1 = mysql_query("DELETE FROM CGDB_QD_SUBITEM WHERE QD_ID = " . $currID) or trigger_error("Error removing sub-items for ID " . $currID . ": " . mysql_error(), E_USER_ERROR); $response2 = mysql_query("DELETE FROM CGDB_QD WHERE ID = " . $currID) or trigger_error("Error removing QD for ID " . $currID . ": " . mysql_error(), E_USER_ERROR);
<?php require_once '../include.php'; $act = $_REQUEST['act']; @($id = $_REQUEST['id']); if ($act == "logout") { $mes = logout(); } elseif ($act == "addAdmin") { $mes = addAdmin(); } elseif ($act == "editAdmin") { $mes = editAdmin($id); } elseif ($act == "delAdmin") { $mes = delAdmin($id); } elseif ($act == "addCate") { $mes = addCate(); } elseif ($act == "delCate") { $mes = delCate($id); } elseif ($act == "editCate") { $mes = editCate($id); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <?php if ($mes) {
}elseif ($act == "addAdmin") { $mes = addAdmin(); } */ switch ($act) { case 'logout': logout(); break; case 'addAdmin': $mes = addAdmin(); break; case 'editAdmin': $mes = editAdmin($_REQUEST['id']); break; case 'delAdmin': $mes = delAdmin($_REQUEST['id']); break; } ?> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php if ($mes) { echo $mes; } ?>