This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/admin/editVendor.php

43 lines
1.2 KiB
PHP
Raw Normal View History

<?php
require("path.php");
require(BASE."include/incl.php");
require_once(BASE."include/vendor.php");
2004-03-15 16:22:00 +00:00
$aClean = array(); //array of filtered user input
$aClean['iVendorId'] = makeSafe($_REQUEST['iVendorId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
$aClean['sName'] = makeSafe($_REQUEST['sName']);
$aClean['sWebpage'] = makeSafe($_REQUEST['sWebpage']);
if(!$_SESSION['current']->hasPriv("admin"))
util_show_error_page_and_exit();
$oVendor = new Vendor($aClean['iVendorId']);
if($aClean['sSubmit'])
2004-03-15 16:22:00 +00:00
{
$oVendor->update($aClean['sName'],$aClean['sWebpage']);
util_redirect_and_exit(apidb_fullurl("vendorview.php"));
2004-03-15 16:22:00 +00:00
}
else
{
if($oVendor->iVendorId)
apidb_header("Edit Vendor");
else
apidb_header("Add Vendor");
// Show the form
echo '<form name="sQform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
$oVendor->OutputEditor();
echo '<tr valign=top><td class=color3 align=center colspan=2>',"\n";
echo '<input name="sSubmit" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '</td></tr>',"\n";
echo "</form>";
echo html_frame_end("&nbsp;");
2005-10-21 02:48:27 +00:00
apidb_footer();
2004-03-15 16:22:00 +00:00
}
?>