ruạṛ
<?php session_start(); require_once 'scripts-includes/universal.php'; require_once 'scripts-includes/display.php'; $connID = connect_to_db(); $code_id = is_numeric_id($_GET['code']); $discount = mysql_query("select * from discount_codes where code_id = '$code_id'"); head('products','Administration Panel'); if(!$discount || mysql_num_rows($discount)<1) { ?> <p class="center">Discount record not found</p> <?php } else { $d = mysql_fetch_assoc($discount); ?> <form name="edit_discount" id="edit_discount" action="processes/process-discount-edit.php" method="post" enctype="multipart/form-data" class="add"> <input type="hidden" name="code_id" value="<?php echo $code_id; ?>" /> <p class="center"> Code: <input name="code" id="code" type="text" size="8" value="<?php echo $d['code']; ?>" maxlength="8" /> Discount: <input name="discount" id="discount" type="text" size="3" value="<?php echo number_format($d['discount'],2); ?>" /> <label for="discount_type_%"><input name="discount_type" id="discount_type_%" type="radio" value="%" <?php echo ($d['discount_type']=='%') ? 'checked="checked"' : ''; ?> /> % </label> <label for="discount_type_$"><input name="discount_type" id="discount_type_$" type="radio" value="$" <?php echo ($d['discount_type']=='$') ? 'checked="checked"' : ''; ?> /> $ </label> Start: <input name="start_date" id="start_date" type="text" class="date" size="9" value="<?php echo date('Y-m-d',$d['start_date']); ?>" maxlength="10" /> End: <input name="finish_date" id="finish_date" type="text" class="date" size="9" value="<?php echo date('Y-m-d',$d['finish_date']); ?>" maxlength="10" /> <input type="submit" name="add" value="Update code" /> </p> </form> <?php } footer(); exit; ?>
cải xoăn