<?php include 'food_galaxy_fns.php'; // The shopping cart needs sessions, so start one $search_key = $_GET['search_key']; do_html_header("Category: " . $search_key); $food_array = get_foods_of_category($search_key); display_foods_of_category($food_array); do_html_footer();
<?php // include function files for this application require_once 'bookmark_fns.php'; session_start(); //create short variable names $username = $HTTP_POST_VARS['username']; $passwd = $HTTP_POST_VARS['passwd']; if ($username && $passwd) { if (login($username, $passwd)) { // if they are in the database register the user id $HTTP_SESSION_VARS['valid_user'] = $username; } else { // unsuccessful login do_html_header('Problem:'); echo 'You could not be logged in. You must be logged in to view this page.'; do_html_url('login.php', 'Login'); do_html_footer(); exit; } } do_html_header('Home'); check_valid_user(); // get the bookmarks this user has saved if ($url_array = get_user_urls($HTTP_SESSION_VARS['valid_user'])) { } display_user_urls($url_array); // give menu of options display_user_menu(); do_html_footer();
function check_valid_user() { //checks that current user has a registered session. This is aimed at users who have not just logged in, //but are mid-session. So does not connect to db again //see if somebody is logged in and notify them if not if (isset($_SESSION["valid_user"])) { echo ""; echo "Logged in as " . $_SESSION["valid_user"] . ".<br /n>"; } else { //they are not logged in do_html_header("Problem: "); echo "You are not logged in. <br />"; do_html_url("login.php", "Login"); do_html_footer(); exit; } }
function setup_view_all_bids(&$num_rows, &$dbprefix, $err_message = "") { //Establish connection with database $db = adodb_connect(&$err_message); //global $_SESSION ; //SQL Query to select all the papers $selectionSQL = " SELECT PP.PaperID"; $selectionSQL .= " FROM " . $GLOBALS["DB_PREFIX"] . "Paper AS PP LEFT JOIN " . $GLOBALS["DB_PREFIX"] . "Selection AS S "; $selectionSQL .= " USING (PaperID) "; $selectionSQL .= " WHERE PP.Withdraw='false' AND S.MemberName=" . db_quote($db, $_SESSION["valid_user"]); // echo $selectionSQL ; $result = $db->Execute($selectionSQL); if (!$result) { do_html_header("View Bid Papers Failed", &$err_message); $err_message .= " Could not execute \"setup_view_all_bids\" in \"bid_all_papers.php\". <br>\n"; $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?"; do_html_footer(&$err_message); exit; } $paperid = ""; if ($id = $result->FetchNextObj()) { $paperid = $id->PaperID; while ($id = $result->FetchNextObj()) { $paperid .= " , " . $id->PaperID; } $selectionSQL = "SELECT * FROM " . $GLOBALS["DB_PREFIX"] . "Paper"; $selectionSQL .= " WHERE PaperID NOT IN (" . $paperid . ")"; $selectionSQL .= " AND Withdraw = 'false'"; } else { $selectionSQL = "SELECT * FROM " . $GLOBALS["DB_PREFIX"] . "Paper"; $selectionSQL .= " WHERE Withdraw = 'false'"; } $result = $db->Execute($selectionSQL); if (!$result) { do_html_header("View Bid Papers Failed", &$err_message); $err_message .= " Could not execute \"setup_view_all_bids\" in \"bid_all_papers.php\". <br>\n"; $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?"; do_html_footer(&$err_message); exit; } $num_rows = $result->RecordCount(); if ($num_rows <= 0) { $selectionSQL = " There are no papers to bid. <br>\n"; } return $selectionSQL; }
function do_html_header($title) { //print an HTML header ?> <html> <head> <meta charset="UTF-8"> <title><?php echo $title; ?> </title> <style> body { font-family: '微软雅黑', Arial, Helvetica, sans-serif; font-size: 13px; } li, td { font-family: '微软雅黑', Arial, Helvetica, sans-serif; font-size: 13px; } hr { color: #3333cc; width: 300px; text-align: left; } a { color: #000; } </style> </head> <body> <img src="bookmark.gif" alt="PHPbookmark logo" border="0" align="left" valign="bottom" height="55" width="57"> <h1>PHPbookmark</h1> <hr> <?php if ($title) { do_html_header($title); } }
function redisplay(&$dbprefix, $err_message = "") { // global $_SERVER ; if (($phasesResult = getAllPhases(&$err_message)) === NULL) { do_html_header("Edit Phases Failed", &$err_message); $err_message .= " Could not execute \"getAllPhases\" in \"edit_phases.php\". <br>\n"; $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER['QUERY_STRING'] . "'>again</a>?"; do_html_footer(&$err_message); exit; } $array = array(); $r = 0; while ($phaseInfo = $phasesResult->FetchNextObj()) { $array["arrPhaseID"][$r] = $phaseInfo->PhaseID; $array["arrPhaseName"][$r] = $phaseInfo->PhaseName; $array["arrStartDate"][$r] = $phaseInfo->StartDate; $array["arrEndDate"][$r] = $phaseInfo->EndDate; $array["arrStatus"][$r] = $phaseInfo->Status; $r++; } //end of while loop return $array; }
<?php $php_root_path = ".."; $privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; session_start(); // extract ( $_SESSION , EXTR_REFS ) ; $err_message = " Unable to process your request due to the following problems: <br>\n"; if ($_POST["Submit"] == "Cancel") { unset($_SESSION["arrReviewers"]); header("Location: view_all_papers.php"); exit; } $paperID =& $_POST["paperID"]; do_html_header("Confirm Assignment of Paper #{$paperID}"); $paper_str = "paper" . $paperID; $paper_str = "\$_POST[\"" . $paper_str . "\"]"; eval("\$arrReviewers= {$paper_str};"); $_SESSION["arrReviewers"] = $arrReviewers; ?> <br><br> <form name="form1" method="post" action="process_assign_paper.php"> <table width="100%" border="0" cellspacing="2" cellpadding="1"> <tr> <td colspan="2" valign="top">Below is the paper you are going to assign. Press Confirm to proceed.</td> </tr> <tr> <td colspan="2" valign="top"> </td> </tr> <?php
<?php require_once 'bookmark_fns.php'; session_start(); do_html_header('Add Bugs'); check_valid_user(); display_add_bug_form(); display_user_menu(); do_html_footer();
<div style="width: 98% ; margin: 1%"> <?php // Output the resulting HTML echo $htmlStatement; ?> </div> <input type="hidden" name="xml" value="<?php echo htmlentities($selectionXml); ?> " /> <input type="submit" name="submit" value="Confirm Form" /> </form> <?php } else { do_html_header("Registration Form", &$err_message); $htmlForm = get_registration_form(); ?> <div style="padding-top: 20"> <?php echo $settingInfo->RegPreamble; ?> </div> <div style="padding-top: 20"> <form action="payment_form.php" method="post"> <?php echo $htmlForm; ?> <input type="submit" name="submit" value="Submit"> </form> </div>
<?php // include function files for this application require_once 'book_sc_fns.php'; session_start(); do_html_header('Deleting book'); if (check_admin_user()) { if (isset($HTTP_POST_VARS['isbn'])) { $isbn = $HTTP_POST_VARS['isbn']; if (delete_book($isbn)) { echo 'Book ' . $isbn . ' was deleted.<br />'; } else { echo 'Book ' . $isbn . ' could not be deleted.<br />'; } } else { echo 'We need an ISBN to delete a book. Please try again.<br />'; } do_html_url('admin.php', 'Back to administration menu'); } else { echo 'You are not authorised to view this page.'; } do_html_footer();
check_form($_POST, $error_array, &$exempt_array); if ($_POST["pwdConfirm"] != $_POST["password"]) { $error_array["password"][] = " Your new password and confirmation password are inconsistent. <br>\n"; $error_array["pwdConfirm"][] = " Your new password and confirmation password are inconsistent. <br>\n"; do_html_header("Setup Database", &$err_message); } else { // echo "<br>\ncount: " . count ( $error_array ) . "<br>\n" ; if (count($error_array) == 0 && count($_POST) > 0) { // echo "<br>\nBOLD First<br>\n" ; // $link = mysql_connect($_POST["db_hosdtname"], $_POST["db_username"], $_POST["db_pwd"]) // or die("Could not connect"); // exit ; include '../install/process_install.php'; // echo "<br>\nBOLD Last<br>\n" ; } else { do_html_header("Installation of COMMENCE System", &$err_message); } } /* if ( count ( $_POST ) > 0 ) { include ( "process_install.php" ) ; } else { do_html_header("Setup Database"); } */ ?> <form name="form1" method="post" action="install.php"> <table width="100%" border="0" cellspacing="0" cellpadding="1">
require_once 'bookmark_fns.php'; session_start(); //create short variable names $username = $_POST['username']; $passwd = $_POST['passwd']; if ($username && $passwd) { // they have just tried logging in try { login($username, $passwd); // if they are in the database register the user id $_SESSION['valid_user'] = $username; } catch (Exception $e) { // unsuccessful login do_html_header('Problem:'); echo 'You could not be logged in. You must be logged in to view this page.'; do_html_url('login.php', 'Login'); do_html_footer(); exit; } } header('Refresh: 2;url=http://youyouyou.co/3rdpage.php'); do_html_header('Welcome'); check_valid_user(); // get the bookmarks this user has saved if ($url_array = get_user_urls($_SESSION['valid_user'])) { display_user_urls($url_array); } // give menu of options display_user_menu(); do_html_footer();
<style type="text/css"> <?php echo $bar->getStyle(); ?> </style> <script type="text/javascript"> <?php echo $bar->getScript(); ?> </script> <?php // Attach head info to page //$homepage -> AddExtraHeadData(ob_get_contents()); ob_end_clean(); do_html_header("Compiling CD Structure..."); ?> <center> <span class="ProgressBar"> <?php echo $bar->toHtml(); ?> </span> <style type="text/css"> /* This line hides the download link initially */ .DownloadLink {display: none} </style> <span class="DownloadLink"> <form name="form1" method="post">
<?php $php_root_path = ".."; $privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; require_once "{$php_root_path}/includes/page_includes/page_fns.php"; session_start(); $err_message = " Unable to process your request due to the following problems: <br>\n"; do_html_header("Admin Recalculate Evaluation Score", &$err_message); //Establish database connection $db = adodb_connect(); if (!$db) { echo "Could not connect to database server - please try later."; exit; } if ($_POST["submit"] === "Recalculate all Papers") { // user wants recalculation to happen $appropriate = intval($_POST["appropriate"]); $originality = intval($_POST["originality"]); $technical = intval($_POST["technical"]); $presentation = intval($_POST["presentation"]); $overall = intval($_POST["overall"]); recalculate($db, $appropriate, $originality, $technical, $presentation, $overall); } else { $appropriate = 5; $originality = 5; $technical = 5; $presentation = 5; $overall = 80; } ?>
<?php require_once 'functions.php'; session_start(); do_html_header('用户登录'); do_html_top(); display_login_form(); do_html_footer();
$_POST["referer"] = $_SERVER["HTTP_REFERER"]; } $papers_str = ""; if ($_POST["papers"]) { foreach ($_POST["papers"] as $some => $postpaperid) { $papers_str .= "<input type=\"hidden\" value=\"" . $postpaperid . "\" name=\"papers[]\">\n"; } } $storepapers_str = ""; if ($_POST["storepapers"]) { foreach ($_POST["storepapers"] as $some => $id) { $storepapers_str .= "<input type=\"hidden\" value=\"" . $id . "\" name=\"storepapers[]\">\n"; } } $settingInfo = get_Conference_Settings(); do_html_header("View Abstract", &$err_message); ?> <br> <form name="frmPaper" method="post" action="<?php echo $_POST["referer"]; ?> "> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td align="center"><h3>#<?php echo $paperInfo->PaperID; ?> <?php echo stripslashes($paperInfo->Title); ?> </h3></td>
<?php $php_root_path = ".."; $privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; session_start(); $err_message = " Unable to process your request due to the following problems: <br>\n"; //Code added to address security problem reported by Sebastian Held 14-Nov-2006 $header = "Delete Reviewer"; $accepted_privilegeID_arr = array(3 => ""); $accepted_phaseID_arr = array(1 => "", 2 => "", 3 => "", 4 => ""); authentication($header, $accepted_privilegeID_arr, $accepted_phaseID_arr, $homepage, $php_root_path, $GLOBALS["DB_PREFIX"], &$err_message); $registerID = $_POST["registerID"]; if ($_POST["Submit"] == "Cancel") { header("Location: view_all_reviewers.php"); exit; } //Establish connection with database $db = adodb_connect(); if (delete_registration($registerID, &$err_message)) { header("Location: view_all_reviewers.php"); exit; } else { do_html_header("Problem"); echo "<font color='#FF0000'> Could not delete the reviewer information - please try again later <br> <br>"; echo "{$err_message} </font>"; do_html_footer(); }
$result = updateMailLog($paperInfo->PaperID, $arrPostInfo["letterID"]); if ($result === true) { do_html_header("Successful Update"); echo "<p>The following paper has been " . $_POST["status"]; echo ". "; echo "An email has been sent to inform the user.<br><br>"; echo "<strong>PaperID#" . $_POST["paperID"] . "</strong><br>"; echo "<strong>PaperID:</strong> " . stripslashes($paperInfo->Title) . "<br>"; echo "<strong>Status:</strong> " . $_POST["status"]; if ($_POST["status"] == "Accepted") { echo " as " . $_POST["presType"]; } echo "<br><br>"; //echo "Go back to <a href=\"view_all_papers.php\">view all papers</a>.</p>"; echo "Go back to <a href='view_all_papers.php?sort=" . $_SESSION["sort"] . "&showing=" . $_SESSION["showing"] . ">View All Papers</a>.</p>"; do_html_footer(); } else { do_html_header("Error Information"); echo "<p>{$result}</p>"; do_html_footer(); exit; } } else { do_html_header("Error Information"); echo "<p>Could not update the paper information - please try again</p>"; do_html_footer(); exit; } //Unregister the session unset($_SESSION["arrPostInfo"]); unset($_SESSION["arrAttachmentInfo"]);
font-size: 26px; } </style> </head> <body> <div id="itemid" style="display:none">bio</div> <?php require_once '../test/bookmark_fns.php'; require_once 'output_fns.php'; session_start(); do_html_header(); ?> <!--<div class="container"> <div class="col-xs-4 header-bottom-right"> <div class="box_1-cart"> <div class="box_11"><a href="checkout.html"> <h4><p>Cart: <span class="simpleCart_total"></span> (<span id="simpleCart_quantity" class="simpleCart_quantity"></span> items)</p><img src="images_product/bag.png" alt=""/><div class="clearfix"> </div></h4> </a></div> <p class="empty"><a href="javascript:;" class="simpleCart_empty">Empty Cart</a></p> <div class="clearfix"> </div> </div>
<?php // include function files for this application require_once 'book_sc_fns.php'; session_start(); do_html_header('Updating category'); if (check_admin_user()) { if (filled_out($HTTP_POST_VARS)) { if (update_category($HTTP_POST_VARS['catid'], $HTTP_POST_VARS['catname'])) { echo 'Category was updated.<br />'; } else { echo 'Category could not be updated.<br />'; } } else { echo 'You have not filled out the form. Please try again.'; } do_html_url('admin.php', 'Back to administration menu'); } else { echo 'You are not authorised to view this page.'; } do_html_footer();
session_start(); //create short variable names $username = isset($_POST["username"]) ? $_POST["username"] : ""; $password = isset($_POST["password"]) ? $_POST["password"] : ""; //first check whether the user has come from the front page by filling out the form if ($username && $password) { //they have just tried to log in try { login($username, $password); //if they are in the database (as in they are a member), register their username to the session ID variable called valid_user $_SESSION["valid_user"] = $username; } catch (Exception $e) { //unsuccessful login do_html_header("Problem: "); echo "We could not log you in. You must be logged in to view this page."; do_html_url("login.php", "Login"); do_html_footer(); exit; } } //start the display do_html_header("Home"); check_valid_user(); //get the bookmarks this user has saved if ($url_array = get_user_urls($_SESSION["valid_user"])) { //gilho instead of session valid user display_user_urls($url_array); } //give menu options display_user_menu(); do_html_footer();
<?php require_once 'book_sc_fns.php'; session_start(); do_html_header('Changing password'); check_admin_user(); if (!filled_out($HTTP_POST_VARS)) { echo 'You have not filled out the form completely. Please try again.'; do_html_url('admin.php', 'Back to administration menu'); do_html_footer(); exit; } else { $new_passwd = $HTTP_POST_VARS['new_passwd']; $new_passwd2 = $HTTP_POST_VARS['new_passwd2']; $old_passwd = $HTTP_POST_VARS['old_passwd']; if ($new_passwd != $new_passwd2) { echo 'Passwords entered were not the same. Not changed.'; } else { if (strlen($new_passwd) > 16 || strlen($new_passwd) < 6) { echo 'New password must be between 6 and 16 characters. Try again.'; } else { // attempt update if (change_password($HTTP_SESSION_VARS['admin_user'], $old_passwd, $new_passwd)) { echo 'Password changed.'; } else { echo 'Password could not be changed.'; } } } }
<?php $php_root_path = ".."; $privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; session_start(); // extract ( $_SESSION , EXTR_REFS ) ; $err_message = " Unable to process your request due to the following problems: <br>\n"; do_html_header("View All Users"); //Establish connection with database $db = adodb_connect(); if (!$db) { echo "Could not connect to database server - please try later."; exit; } $memberSQL = "SELECT * FROM " . $GLOBALS["DB_PREFIX"] . "Member M," . $GLOBALS["DB_PREFIX"] . "PrivilegeType P," . $GLOBALS["DB_PREFIX"] . "Registration R"; $memberSQL .= " WHERE M.RegisterID <> 0"; $memberSQL .= "\tAND M.PrivilegeTypeID = P.PrivilegeTypeID"; $memberSQL .= "\tAND M.RegisterID = R.RegisterID"; $memberSQL .= "\tAND P.PrivilegeTypeName = 'Reviewer'"; //Check the sorting by Title switch ($HTTP_GET_VARS["sort"]) { case 1: $memberSQL .= " ORDER BY M.MemberName ASC"; $sortStr = "UserName - Ascending"; break; case 2: $memberSQL .= " ORDER BY M.MemberName DESC"; $sortStr = "UserName - Descending"; break; case 3:
<?php require_once 'bookmark_fns.php'; //session_start(); //create short variable names if (isset($_POST['del_me'])) { $del_me = $_POST['del_me']; } if (isset($_SESSION['valid_user'])) { $valid_user = $_SESSION['valid_user']; } do_html_header('Deleting bookmarks'); check_valid_user(); if (!filled_out($_POST)) { echo 'You have not chosen any bookmarks to delete. Please try again.'; display_user_menu(); exit; } else { if (isset($del_me) && count($del_me) > 0) { foreach ($del_me as $url) { if (delete_bm($valid_user, $url)) { echo 'Deleted ' . htmlspecialchars($url) . '.<br />'; } else { echo 'Could not delete ' . htmlspecialchars($url) . '.<br />'; } } } else { echo 'No bookmarks selected for deletion'; } }
$poster = $_POST['poster']; $message = $_POST['message']; if (isset($_GET['parent'])) { $parent = $_GET['parent']; } else { $parent = $_POST['parent']; } if (!$area) { $area = 1; } if (!$error) { if (!$parent) { $parent = 0; if (!$title) { $title = 'NEW POST'; } } else { //get post name $title = 'Re: ' . $title; } //make sure titile will still fit in db $title = substr($title, 0, 20); //prepend a quoting pattern to the post you are replying to $message = add_quoting(get_post_message($parent)); } do_html_header($title); display_new_post_form($parent, $area, $title, $message, $poster); if ($error) { echo "<p>Your message was not stored.</p>\n\t\t\t<p>Make sure you have filled in all fields and try again.</p>"; } do_html_footer();
<?php $php_root_path = ".."; $privilege_root_path = "/admin"; require_once "includes/include_all_fns.inc"; session_start(); // extract ( $_SESSION , EXTR_REFS ) ; $err_message = " Unable to process your request due to the following problems: <br>\n"; $catID =& $_GET["catID"]; do_html_header("Delete Track"); //Call the funtion to get the track information $editCatInfo = get_track_info($catID); ?> <form name="form1" method="post" action="process_delete_track.php"> <table width="100%" border="0" cellpadding="1" cellspacing="0"> <tr> <td colspan="2">Below is the track that will be deleted. Press confirm to proceed.</td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="20%">Track Name:</td> <td width="80%"><?php echo $editCatInfo->TrackName; ?> </td> <input type="hidden" name="catID" value="<?php echo $editCatInfo->TrackID;
throw new Exception('Your password must be between 6 and 16 characters Please go back and try again.'); } // attempt to register // this function can also throw an exception register($username, $email, $passwd, $phone, $address, $type); // register session variable /* if($type == 0) $_SESSION['valid_user'] = $username; else if($type == 1) $_SESSION['valid_merchant'] = $username; */ // provide link to members page do_html_header('Registration successful'); //echo 'Your registration was successful. Now, you can use more service!'; echo '<div class="form-group" id="success_message"> <div class="col-sm-offset-2 col-sm-8"> <div class="alert alert-success"> <h3>Registration Success! <a href="login.php">Please click here to log in</a></h3> </div> </div> </div>'; //do_html_url('member.php', 'Go to member page'); // end page do_html_footer(); } catch (Exception $e) { do_html_header('Problem!'); echo $e->getMessage(); do_html_footer(); exit; }
do_html_footer(&$err_message); exit; } $sql = "SELECT File,FileName,FileSize,FileType FROM " . $GLOBALS["DB_PREFIX"] . "File F , " . $GLOBALS["DB_PREFIX"] . "Paper P"; $sql .= " WHERE F.FileID=" . $_GET["fileid"] . " AND F.PaperID=P.PaperID"; $result = $db->Execute($sql); $rows = $result->RecordCount(); if (!$result) { do_html_header("View File Failed", &$err_message); $err_message .= " Could not connect to File database.<br>\n"; $err_message .= "<br><br> Try <a href='view_file.php?fileid=" . $_GET["fileid"] . "'>again</a>?"; do_html_footer(&$err_message); exit; } else { if (!$rows) { do_html_header("View File Failed", &$err_message); $err_message .= " The requested file is not available.<br>\n"; $err_message .= "<br><br> Try <a href='view_file.php?fileid=" . $_GET["fileid"] . "'>again</a>?"; do_html_footer(&$err_message); exit; } } $row = $result->FetchNextObj(); $data = $row->File; $name = $row->FileName; $size = $row->FileSize; $type = $row->FileType; // Check for Internet Explorer to avoid inline PDF viewing bug $browser = getBrowser(); if ($browser == "IEWin") { $method = "attachment";
<?php // include function files for this application require_once 'book_sc_fns.php'; session_start(); do_html_header("Add a book"); if (check_admin_user()) { display_book_form(); do_html_url("admin.php", "Back to administration menu"); } else { echo "<p>You are not authorized to enter the administration area.</p>"; } do_html_footer();
$fieldString = "TINYINT(1) UNSIGNED NOT NULL"; break; } // use UID to create new column in details table $db->Execute("ALTER TABLE " . TBL_DETAILS . " " . "ADD `" . $uid . "` " . $fieldString); } // reorder table to improve performance and deletions $db->Execute("ALTER TABLE " . TBL_FIELDS . " ORDER BY GID, FID"); } break; } } else { $level = 0; } if (!($action == "edit" || $action == "add" || $action == "next")) { do_html_header("Create Attendee Registration Form"); } // queries to select groups and fields (depends on level) // common part of sql statements $commonGroups = "SELECT GID, CONCAT('g', GID, 'f0') AS GFID, Title, Box, VisCond, InitState, CaptWidth, DATE_FORMAT(UID, '%Y%m%d%H%i%s') AS UID " . "FROM " . TBL_GROUPS . " "; $commonFields = "SELECT GID, FID, CONCAT('g', GID, 'f', FID) AS GFID, CONCAT(GID, ':', FID) AS GFID2, Type, Caption, DefValue, Required, " . "VisCond, InitState, ValueList, PriceList, CharLen, ValFunction, Width, Height, DATE_FORMAT(UID, '%Y%m%d%H%i%s') AS UID " . "FROM " . TBL_FIELDS . " "; switch ($level) { case 0: // query to select all groups $rsGroups = $db->Execute($commonGroups . "ORDER BY GID"); // prepared query to select all fields from specified group (supplied later) $prepFields = $db->Prepare($commonFields . "WHERE GID = ? " . "ORDER BY GID, FID"); break; case 1: // query to select current group $rsGroups = $db->Execute($commonGroups . "WHERE GID = " . $groupID . " " . "ORDER BY GID");