Example #1
0
		<div id="history">
			<h2 id="players"></h2>
			<h3 id="gameid"></h3>
			<div id="gamebody"></div>
		</div>
		<div id="board">
			<div id="checkmsg"></div>
			<div id="statusmsg"></div>
			<div id="date"><?php 
echo date($CFG_LONGDATE);
?>
</div>
			<form name="gamedata" method="post" action="chess.php">
				<?php 
if ($promoting && (!$isPlayersTurn || $_SESSION['shared'])) {
    echo getPromotion();
}
if ($isUndoRequested) {
    echo getUndoRequest();
}
if ($isDrawRequested) {
    echo getDrawRequest();
}
?>
				<div id="chessboard"></div>
				<div id="gamebuttons">
					<span id="castle">To castle: click the king, then the rook on the castle side.
					<a href="#" class="help" onclick="window.open('./help/c960castling.html','help','resizable,scrollbars,width=550,height=500,top=50,left=50','_blank');return false;">?</a></span>
					<div>
						<span id="curmove">&nbsp;</span>
						<input type="button" id="btnUndo" class="button" value="Request Undo" disabled="disabled" />
<?php

/**
 * Created by PhpStorm.
 * User: Ryan
 * Date: 11/10/2015
 * Time: 11:19 AM
 */
require 'db_cn.inc';
require 'db_access.inc';
require 'update_promotion_ui.inc';
getPromotion();
function getPromotion()
{
    connect_and_select_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME);
    $promoCode = $_REQUEST['promoCode'];
    $sql = "SELECT PromoCode, Name, Description, AmountOff, PromoType\n        FROM   Promotion\n        WHERE  PromoCode = '" . $promoCode . "'";
    $error_message = "Could not successfully run query to get promotion data ({$sql}) from DB: ";
    $not_found_message = "Promotion with PromoCode ({$promoCode}) not found in DB";
    $row = get_unique_row($sql, $error_message, $not_found_message);
    $promoCode = $row["PromoCode"];
    $name = $row["Name"];
    $description = $row["Description"];
    $amountOff = $row["AmountOff"];
    $promoType = $row["PromoType"];
    ui_show_update_promotion_form($promoCode, $name, $description, $amountOff, $promoType);
}