isLoggedIn())
{
header ("location: ../../login.php");
exit();
}
$display=new display($dbf->conn,$cfg_theme,$cfg_currency_symbol,$lang);
$display->displayTitle("$lang->manageDiscounts");
$f1=new form('manage_discounts.php','POST','discounts','475',$cfg_theme,$lang);
$f1->createInputField("$lang->searchForDiscount",'text','search','','24','375');
$f1->endForm();
$tableheaders=array("$lang->rowID","$lang->itemName","$lang->percentOff","$lang->comment","$lang->updateDiscount","$lang->deleteDiscount");
$tablefields=array('id','item_id','percent_off','comment');
if(isset($_POST['search']))
{
$search=$_POST['search'];
echo "$lang->searchedForDiscount: $search";
$display->displayManageTable("$cfg_tableprefix",'discounts',$tableheaders,$tablefields,'percent_off',"$search",'percent_off');
}
else
{
$display->displayManageTable("$cfg_tableprefix",'discounts',$tableheaders,$tablefields,'','','percent_off');
}
$dbf->closeDBlink();
?>