// External variables $submit = $_REQUEST['submit']; if (empty($submit)) { // Show add product form include APPLICATION_INCPATH . 'htmlheader.inc.php'; $_SESSION['formerrors']['add_software'] = NULL; echo "<h2>" . icon('skill', 32) . " "; echo "{$strNewSkill}</h2>"; echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup></h5>"); echo "<form name='addsoftware' action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strVendor}:</th><td>"; if ($_SESSION['formdata']['add_software']['vendor'] != '') { echo vendor_drop_down('vendor', $_SESSION['formdata']['add_software']['vendor']) . "</td></tr>\n"; } else { echo vendor_drop_down('vendor', $software->vendorid) . "</td></tr>\n"; } echo "<tr><th>{$strSkill}: <sup class='red'>*</sup></th><td><input maxlength='50' name='name' size='30' /></td></tr>\n"; echo "<tr><th>{$strLifetime}:</th><td>"; echo "<input type='text' name='lifetime_start' id='lifetime_start' size='10' "; if ($_SESSION['formdata']['add_software']['lifetime_start'] != '') { echo "value='{$_SESSION['formdata']['add_software']['lifetime_start']}'"; } echo " /> "; echo date_picker('addsoftware.lifetime_start'); echo " {$strTo}: "; echo "<input type='text' name='lifetime_end' id='lifetime_end' size='10'"; if ($_SESSION['formdata']['add_software']['lifetime_end'] != '') { echo "value='{$_SESSION['formdata']['add_software']['lifetime_end']}'"; } echo "/> ";
$submit = $_REQUEST['submit']; if (empty($submit)) { // Show add product form include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_product'); clear_form_errors('add_product'); echo "<h2>" . icon('product', 32) . " "; echo "{$strNewProduct}</h2>"; echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</h5>"; echo "<form action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table align='center'>"; echo "<tr><th>{$strVendor}<sup class='red'>*</sup></th><td>"; if ($_SESSION['formdata']['add_product']['vendor'] != '') { echo vendor_drop_down('vendor', $_SESSION['formdata']['add_product']['vendor']) . "</td></tr>\n"; } else { echo vendor_drop_down('vendor', 0) . "</td></tr>\n"; } echo "<tr><th>{$strProduct}<sup class='red'>*</sup></th><td><input maxlength='50' name='name' size='40' "; if ($_SESSION['formdata']['add_product']['name'] != '') { echo "value=" . $_SESSION['formdata']['add_product']['name']; } echo " /></td></tr>\n"; echo "<tr><th>{$strDescription}</th>"; echo "<td>"; echo "<textarea name='description' cols='40' rows='6'>"; if ($_SESSION['formdata']['add_product']['description'] != '') { echo $_SESSION['formdata']['add_product']['description']; } echo "</textarea>"; echo "</td></tr>"; echo "</table>\n";
if (empty($action) or $action == 'edit') { $title = $strEditSkill; // Show add product form include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo "<h2>" . icon('skill', 32) . " "; echo "{$title}</h2>"; $sql = "SELECT * FROM `{$dbSoftware}` WHERE id='{$id}' LIMIT 1"; $result = mysql_query($sql); if (mysql_error()) { trigger_error(mysql_error(), E_USER_WARNING); } while ($software = mysql_fetch_object($result)) { echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</h5>"; echo "<form name='editsoftware' action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_action(\"{$strAreYouSureMakeTheseChanges}\")'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strVendor}:</th><td>" . vendor_drop_down('vendor', $software->vendorid) . "</td></tr>\n"; echo "<tr><th>{$strSkill}: <sup class='red'>*</sup></th><td><input maxlength='50' name='name' size='30' value='{$software->name}' /></td></tr>"; echo "<tr><th>{$strLifetime}:</th><td>"; echo "<input type='text' name='lifetime_start' id='lifetime_start' size='10' value='"; if ($software->lifetime_start > 1) { echo date('Y-m-d', mysql2date($software->lifetime_start)); } echo "' /> "; echo date_picker('editsoftware.lifetime_start'); echo $strTo . ": "; echo "<input type='text' name='lifetime_end' id='lifetime_end' size='10' value='"; if ($software->lifetime_end > 1) { echo date('Y-m-d', mysql2date($software->lifetime_end)); } echo "' /> "; echo date_picker('editsoftware.lifetime_end');
echo $html; // echo "<hr />"; // echo "<pre>{$csv}</pre>"; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; } } else { html_redirect($_SERVER['PHP_SELF'], FALSE, $strNoResults); } break; default: include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo "<h2>{$strSiteProductsMatrix}</h2>"; echo "<form name='report' action='{$_SERVER['PHP_SELF']}' method='post'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strVendor}</th>"; echo "<td>" . vendor_drop_down('vendor', 0) . "</td></tr>\n"; echo "<tr><th>{$strEarliestExpiry}</th>"; echo "<td><input maxlength='100' id='min_expire' name='min_expire' size='10' type='text' value=\"" . date('Y-m-d') . "\" /> "; echo date_picker('report.min_expire'); echo "</td></tr>\n"; echo "<tr><th>{$strLatestExpiry}</th>"; echo "<td><input maxlength='100' id='max_expire' name='max_expire' size='10' type='text' value=\"" . date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1)) . "\" /> "; echo date_picker('report.max_expire'); echo "</td></tr>\n"; echo "<tr><th>{$strOutput}:</th>"; echo "<td>"; echo "<select name='output'>"; echo "<option value='screen'>{$strScreen}</option>"; echo "<option value='csv'>{$strCSVfile}</option>"; echo "</select>"; echo "</td></tr>\n";
} else { $title = $strEditProduct; include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo "<h2>" . icon('product', 32) . " "; echo "{$title}</h2>\n"; echo "<form action='{$_SERVER['PHP_SELF']}' method='post' >"; echo "<table align='center' class='vertical'>"; $sql = "SELECT * FROM `{$dbProducts}` WHERE id='{$id}' "; $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error: " . mysql_error(), E_USER_WARNING); } $row = mysql_fetch_object($result); echo "<tr><th>{$strVendor}: <sup class='red'>*</sup></th>"; echo "<td>"; echo vendor_drop_down('vendor', $row->vendorid); echo "</td></tr>"; echo "<tr><th>{$strName}: <sup class='red'>*</sup></th>"; echo "<td>"; echo "<input class='textbox' maxlength='255' name='name' size='40' value='{$row->name}' />"; echo "</td></tr>"; echo "<tr><th>{$strDescription}:</th>"; echo "<td>"; echo "<textarea name='description' cols='40' rows='6'>{$row->description}</textarea>"; echo "</td></tr>"; echo "<tr><th>{$strTags}:</th>"; echo "<td><textarea rows='2' cols='30' name='tags'>" . list_tags($id, TAG_PRODUCT, false) . "</textarea></td></tr>\n"; echo "</table>"; echo "<input type='hidden' name='productid' value='{$id}' />"; echo "<input type='hidden' name='action' value='save' />"; echo "<p align='center'><input type='submit' value='{$strSave}' /></p>";