conn,$cfg_theme,$cfg_currency_symbol,$lang); if(!$sec->isLoggedIn()) { header ("location: ../login.php"); exit(); } //set default values, these will change if $action==update. $paid_with_value=''; $comment_value=''; $id=-1; //decides if the form will be used to update or add a user. $display->displayTitle("Update Sale"); if(isset($_GET['id'])) { $id=$_GET['id']; $tablename = "$cfg_tableprefix".'sales'; $result = mysql_query("SELECT * FROM $tablename WHERE id=\"$id\"",$dbf->conn); $row = mysql_fetch_assoc($result); $paid_with_value=$row['paid_with']; $comment_value=$row['comment']; } //creates a form object $f1=new form('process_update_sale.php','POST','sale','325',$cfg_theme,$lang); //creates form parts. echo "

$lang->updateSaleID $id
"; $option_values=array("$paid_with_value",'Cash','Check', 'Credit','Gift Certificate','Account','Other'); $option_titles=array("$paid_with_value",$lang->cash,$lang->check,$lang->credit,$lang->giftCertificate,$lang->account,$lang->other); $f1->createSelectField("$lang->paidWith:",'paid_with',$option_values,$option_titles,'130'); $f1->createInputField("$lang->saleComment:",'text','comment',"$comment_value",'24','180'); echo " "; $f1->endForm(); $dbf->closeDBlink(); ?>