<?php $resourceID = $_GET['resourceID']; $resource = new Resource(new NamedArguments(array('primaryKey' => $resourceID))); //used to get default currency $config = new Configuration(); $startDate = normalize_date($resource->currentStartDate); $endDate = normalize_date($resource->currentEndDate); //get all purchase sites for output in checkboxes $purchaseSiteArray = array(); $purchaseSiteObj = new PurchaseSite(); $purchaseSiteArray = $purchaseSiteObj->allAsArray(); //get all acquisition types for output in drop down $acquisitionTypeArray = array(); $acquisitionTypeObj = new AcquisitionType(); $acquisitionTypeArray = $acquisitionTypeObj->allAsArray(); //get purchase sites $sanitizedInstance = array(); $instance = new PurchaseSite(); $resourcePurchaseSiteArray = array(); foreach ($resource->getResourcePurchaseSites() as $instance) { $resourcePurchaseSiteArray[] = $instance->purchaseSiteID; } ?> <div id='div_resourceForm'> <form id='resourceForm'> <input type='hidden' name='editResourceID' id='editResourceID' value='<?php echo $resourceID; ?> '>
<tr> <td class='searchRow'><label for='searchPurchaseSiteID'><b>Purchase Site</b></label> <br /> <select name='search[purchaseSiteID]' id='searchPurchaseSiteID' style='width:150px'> <option value=''>All</option> <?php if ($search['purchaseSiteID'] == "none") { echo "<option value='none' selected>(none)</option>"; } else { echo "<option value='none'>(none)</option>"; } $display = array(); $purchaseSite = new PurchaseSite(); foreach ($purchaseSite->allAsArray() as $display) { if ($search['purchaseSiteID'] == $display['purchaseSiteID']) { echo "<option value='" . $display['purchaseSiteID'] . "' selected>" . $display['shortName'] . "</option>"; } else { echo "<option value='" . $display['purchaseSiteID'] . "'>" . $display['shortName'] . "</option>"; } } ?> </select> </td> </tr>