Example #1
0
 */
// Get the Category the new lot will be in
$cat_id_in = (int) $_GET['cat_id'];
// Get the lot id. If it doesn't exist or is 0, then this is a new lot
$id = (int) $_GET['lot_id'];
// Is this an existing item or a new one?
if ($id) {
    // Get the existing information for an existing item
    $item = Lot::getLot($id);
    // set up the category dropdown, setting up the selected option for existing records
    $cat_dropdown = Category::getCat_DropDown($item->getCat_id());
} else {
    // Set up for a new item
    $item = new Lot();
    // set up the category dropdown, setting up the selected option for existing records
    $cat_dropdown = Category::getCat_DropDown($cat_id_in);
}
?>
<h1>Lot Maintenance</h1>

<form action="index.php?content=lots&cat_id=<?php 
echo $cat_id_in;
?>
&sidebar=catnav" 
  method="post" name="maint" id="maint">

    <fieldset class="maintform">
      <legend><?php 
echo $id ? 'Id: ' . $id : 'Add a Lot';
?>
</legend>