Exemplo n.º 1
0
function SelectCondition($name, $select = '')
{
    $conditions = GetAllRows('code, c_description', '`condition`', "where type='C' order by lvl");
    //$conditions = array(array("P","Perfect"),array("E","Excellent"),array("G","Good"),array("F","Fair"),array("O","Poor"),array("B","Broken/Junk"));
    $output = "<select name=" . $name . ">";
    foreach ($conditions as $cond) {
        if ($select == $cond['code']) {
            $sel = 'selected';
        } else {
            $sel = '';
        }
        $output .= "<option " . $sel . " value='" . $cond['code'] . "'>" . $cond['c_description'] . "</option>";
    }
    $output .= "</select>";
    return $output;
}
Exemplo n.º 2
0
function AddGame()
{
    $game_console = GetAllRows('*', 'game_console_system');
    $game_genre = GetAllRows('*', 'game_genre');
    $game_media = GetAllRows('*', 'games_media');
    $game_publisher = GetAllRows('*', 'game_publisher');
    echo '<div>
	<form action="index.php?action=insert_game" method="post">
		Game name: <input type="text" name="g_name" value="" maxlength="255" /><br />
		Console: ' . SelectConsole($game_console, "console") . '<br />
		Release Date: <input type="text" name="date" value="" maxlength="255" /><br />
		Publisher:' . SelectPublisher($game_publisher, "pub") . ' <br />
		Beaten?: <input type="text" name="beat" value="" maxlength="255" /><br />
		Rank: <input type="text" name="rank" value="" maxlength="20" /><br />
		Genre: ' . SelectGenre($game_genre, "genre") . '<br />
		Players: <input type="text" name="plr" value="" maxlength="4" /><br />
		Media Type: ' . SelectMedia($game_media, "media") . ' <br />
		Other Info: <input type="text" name="info" value="" maxlength="255" /><br />
		<input type="hidden" name="action" value="insert_game" />
		<input type="submit" value="Submit" />
	<form> <br />';
}
Exemplo n.º 3
0
$sqldump = "-- " . $OrgName . " " . $SQLDumper . "\n";
$sqldump .= "-- version " . $VerInfo['iDB_Ver_SVN'] . "\n";
$sqldump .= "-- " . $iDBHome . "support/\n";
$sqldump .= "--\n";
$sqldump .= "-- Host: " . $Settings['sqlhost'] . "\n";
$sqldump .= "-- Generation Time: " . GMTimeGet('F d, Y \\a\\t h:i A', $_SESSION['UserTimeZone'], 0, $_SESSION['UserDST']) . "\n";
$sqldump .= "-- Server version: " . sql_server_info($SQLStat) . "\n";
$sqldump .= "-- PHP Version: " . phpversion() . "\n\n";
$sqldump .= "SET SESSION SQL_MODE='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO';\n\n";
$sqldump .= "--\n";
$sqldump .= "-- Database: \"" . $Settings['sqldb'] . "\"\n";
$sqldump .= "--\n\n";
$sqldump .= "-- --------------------------------------------------------\n\n";
while ($renee_s < $num) {
    $tnum = $num - 1;
    $trow = GetAllRows($TableNames[$renee_s]);
    $numz = count($trow);
    $kazuki_p = 0;
    $sqldump .= "--\n";
    $sqldump .= "-- Table structure for table \"" . $TableNames[$renee_s] . "\"\n";
    $sqldump .= "--\n\n";
    $sqldump .= $FullTable[$renee_s] . "\n";
    while ($kazuki_p < $numz) {
        $tnumz = $numz - 1;
        $srow = null;
        $srowvalue = null;
        $trownew = $trow[$kazuki_p];
        $trowname = array_keys($trownew);
        $nums = count($trownew);
        $il = 0;
        while ($il < $nums) {
Exemplo n.º 4
0
function CreDebView($is_data = false, $lot = -1, $data = '', &$sum_of = 0, $return = false)
{
    if ($lot == -1) {
        echo "error on lot#.";
        return false;
    }
    $summation_cr_db = 0;
    $all_cr = 0;
    $all_db = 0;
    if (!$is_data) {
        $data = GetAllRows('*', 'cre_deb', ' where lot=' . $lot);
    }
    $output = "Credit/Debit table<br />\r\n\t<table border='1'>\r\n\t\t<thead>\r\n\t\t\t<th>Transaction #</th>\r\n\t\t\t<th>Credit</th>\r\n\t\t\t<th>Debit</th>\r\n\t\t\t<th>Reason</th>\r\n\t\t</thead>\r\n\t\t<tbody>";
    foreach ($data as $cr_db) {
        $output .= "<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t" . $cr_db['cd_trans_num'] . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t" . $cr_db['credit'] . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t" . $cr_db['debit'] . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t" . $cr_db['cd_note'] . "\r\n\t\t\t\t</td>\r\n\t\t\t</tr>";
        $all_cr = $all_cr + $cr_db['credit'];
        $all_db = $all_db + $cr_db['debit'];
        $summation_cr_db = $summation_cr_db + ($cr_db['credit'] - $cr_db['debit']);
    }
    $output .= "</tbody>\r\n\t\t<tfoot>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\tAll Credit= \$" . $all_cr . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\tAll Debit= \$" . $all_db . "\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\tOver all Total= \$" . $summation_cr_db . "\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tfoot>\r\n\t</table>";
    $sum_of = $summation_cr_db;
    if (!$return) {
        echo $output;
    } else {
        return $output;
    }
}
Exemplo n.º 5
0
function GetItems($not_in = "'D','W'", $what = 'lot, item_description', $other = '')
{
    return GetAllRows($what, 'item', "where i_state not in(" . $not_in . ")" . $other);
}