Location: PHPKode > projects > Gsys > treasury/set_early_amount.php
//Filename : set_early_amount.php
//Description : Set credit amount for early payments
//Author :  darc
//Last modified :  2006.01.12

    include '../includes/auth_ec.php';
    include '../includes/db.php';
    if($_POST['submitted'] == "TRUE")
        $amount = $_POST['amount'];
        $sql = "UPDATE `misc` SET `data` = '$amount' WHERE CONVERT( `misc`.`label` USING utf8 ) = 'early_credit_amount' LIMIT 1";
        $result = mysql_query($sql,$connection) or die(mysql_error());
        $success = "Early credit amount successfully updated to $amount.";
    $sql = "SELECT * FROM misc WHERE label = 'early_credit_amount'";
    $result = mysql_query($sql,$connection) or die(mysql_error());
    $row = mysql_fetch_array($result);
    $current_amount = $row['data'];

<title>Gsys :: Treasury Administration :: Set Early Credit Amount</title>
<link href="../includes/index.css" rel="stylesheet" type="text/css">
<body class="body">
<br />
<table width="810" height="626" border="0" align="center" cellpadding="15">
    <td height="128" colspan="2"><img src="../images/eg_banner.gif" width="810" height="172"></td>
    <td width="27%" height="488" valign="top"> <?php include '../includes/nav.inc'; ?></td>
   <td width="53%" valign="top">
            echo "<span class=\"success\">$success</span>\n<br /><br />\n";
    <strong><center>Set Early Credit Amount (Current Amount = $<?PHP echo $current_amount; ?>)</center></strong>
    <br />
    <!-- START FORM -->
        <form method="post" action="set_early_amount.php">
            <strong>Amount: $</strong>
            <input type="text" name="amount" size="2" />
            <br />
            <input type="hidden" name="submitted" value="TRUE" />
            <input type="submit" name="submit" value="Set Credit Amount" />
            <br />
    <!-- END FORM -->
    <br /><br />
        This form allows the treasurer to set the amount a user will be credited if a bill is paid early.  When the treasurer adds the payment they must check the 'Early Payment?' checkbox to denote the payment was early.
Return current item: Gsys