Skip to content

Instantly share code, notes, and snippets.

@Moketronics
Created February 28, 2012 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moketronics/1934879 to your computer and use it in GitHub Desktop.
Save Moketronics/1934879 to your computer and use it in GitHub Desktop.
Create new tile entry page - in progress
<?php
$sPage_title = 'Add New Tile';
include ('./includes/header.html');
require_once('../../../mysql_connect.php');
?>
<script type="text/javascript">
$("#manufacturer_list").click(function(){ $("#series_list").removeAttr('disabled');});
</script>
<h1 id="mainhead">Use this form to add tiles!</h1>
<div class="form_area">
<form action="add-tile.php" method="POST" name="addtileform">
<h2>New Tile:</h2>
<table>
<tbody>
<tr>
<td><label for="sTile_name">Name: <span class="error">*</span></label></td>
<td><input type="text" name="sTile_name" size="80" maxlength="100" /></td>
</tr>
<tr>
<td><label for="iTile_price">Price: <span class="error">*</span></label></td>
<td><input type="text" name="iTile_price" size="7" maxlength="7" /> ($)</td>
</tr>
<tr>
<td><label for="iQuantity">Quantity: <span class="error">*</span></label></td>
<td><input type="text" name="iQuantity" size="7" maxlength="6" /></td>
</tr>
<tr>
<td><label for="iOld_quantity">Old Lot Sub-Quantity:</label></td>
<td><input type="text" name="iOld_quantity" size="7" maxlength="6" /></td>
</tr>
<tr>
<td><label for="iNom_height">Nominal Height: <span class="error">*</span></label></td>
<td><input type="text" name="iNom_height" size="7" maxlength="8" /> inches</td>
</tr>
<tr>
<td><label for="iNom_width">Nominal Width: <span class="error">*</span></label></td>
<td><input type="text" name="iNom_width" size="7" maxlength="8" /> inches</td>
</tr>
<tr>
<td><label for="iNom_thick">Nominal Thickness: <span class="error">*</span></label></td>
<td><input type="text" name="iNom_thick" size="7" maxlength="8" /> inches</td>
</tr>
<tr>
<td><label for="iExact_height">Exact Height:</label></td>
<td><input type="text" name="iExact_height" size="7" maxlength="6" /> mm</td>
</tr>
<tr>
<td><label for="iExact_width">Exact Width:</label></td>
<td><input type="text" name="iExact_width" size="7" maxlength="6" /> mm</td>
</tr>
<tr>
<td><label for="iBox_tile_count">Tiles per box: <span class="error">*</span></label></td>
<td><input type="text" name="iBox_tile_count" size="7" maxlength="6" /></td>
</tr>
<tr>
<td><label for="iLocal_supply">External Supplier Time:</label></td>
<td>
<select name="iLocal_supply">
<option value="NULL">Choose new order time period</option>
<option value="0">A few days</option>
<option value="1">1-2 weeks</option>
<option value="2">2-3 weeks</option>
<option value="3">3-4 weeks</option>
<option value="4">4+ weeks</option>
</select>
</td>
</tr>
<tr>
<td><label for="iRating">MOHS / PEI Rating: <span class="error">*</span></label></td>
<td>
<select name="iRating" disabled="disabled">
<option value="NULL">Choose a rating</option>
<option value="0">Option 1</option>
<option value="1">Option 2</option>
<option value="2">Option 3</option>
<option value="3">Option 4</option>
<option value="4">Option 5</option>
<option value="4">Option 6</option>
<option value="4">Option 7</option>
<option value="4">Option 8</option>
<option value="4">Option 9</option>
<option value="4">Option 10</option>
</select>
</td>
</tr>
<tr>
<td><label for="iManufacturer">Manufacturer: <span class="error">*</span></label></td>
<td>
<select name="iManufacturer" id="manufacturer_list">
<option value="NULL">Choose a manufacturer</option>
<?php
$result = mysql_query('SELECT manufacturer_id, manufacturer_name FROM manufacturer');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t\t<option value=\"" . $row['manufacturer_id'] . '">' . $row['manufacturer_name'] . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="iCountry">Country: <span class="error">*</span></label></td>
<td>
<select name="iCountry">
<option value="NULL">Choose a country</option>
<?php
$result = mysql_query('SELECT country_id, country_name FROM country');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t\t<option value=\"" . $row['country_id'] . '">' . $row['country_name'] . "</option>\n";
}
?>
</select>
</td>
<tr>
<td><label for="iSeries">Series:</label></td>
<td>
<select name="iSeries" id="series_list" disabled="disabled">
<option value="0">Choose a series</option>
<?php
$result = mysql_query('SELECT series_id, series_name, manufacturer_id FROM series');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t\t<option value=\"" . $row['series_id'] . '" name="' . $row['manufacturer_id'] . '">' . $row['series_name'] . "</option>\n";
}
?>
</select> (If applicable)
</td>
</tr>
<tr>
<td><label for="iColour_primary">Primary Colour: <span class="error">*</span></td>
<td>
<select name="iColour_primary">
<option value="NULL">Choose a colour</option>
<?php
$result = mysql_query('SELECT colour_id, colour_name FROM colour');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t\t<option value=\"" . $row['colour_id'] . '">' . $row['colour_name'] . "</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="aColour_secondary">Secondary Colours:</td>
<td>
<?php
$result = mysql_query('SELECT colour_id, colour_name FROM colour');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t<input type=\"checkbox\" name=\"aColour_secondary\" value=\"" . $row['colour_id'] . '" /> ' . $row['colour_name'] . '<br />';
}
?>
</td>
</tr>
<tr>
<td><label for="aSealant">Recommended Sealant:</td>
<td>
<?php
$result = mysql_query('SELECT sealant_id, sealant_name FROM sealant');
while ($row = mysql_fetch_array($result)) {
echo "\t\t\t\t\t\t<input type=\"checkbox\" name=\"aSealant\" value=\"" . $row['sealant_id'] . '" /> ' . $row['sealant_name'] . '<br />';
}
?>
</td>
</tr>
</tr>
</tbody>
</table>
<p><input type="submit" name="preview" value="Preview new tile" /> <input type="submit" name="submitted" value="Add new tile" /> (neither of these do anything yet)</p>
</form>
</div>
<h3>Notes:</h3>
<p>This will be a form for adding a new tile entry to the database</p>
<p>Not much else to say about it.</p>
<?php
include ('./includes/footer.html');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment