示例#1
0
        $error_txt .= _("Reseller number") . " 2 " . _("is empty") . "<br/>";
    }
    if ($amount == "" || $amount == 0 || !is_numeric($amount)) {
        $error_txt .= _("Invalid amount") . "<br/>";
    }
}
if (isset($_POST['add_credit']) && $error_txt != "") {
    print_form(1, $error_txt);
} elseif (isset($_POST['add_credit']) && $error_txt == "") {
    // get some data out based on user input
    $callerid = $_POST['callerid1'];
    $amount = $_POST['amount'];
    echo "<center>";
    $cred = new Credit();
    try {
        $cred->add_to_reseller($callerid, $amount);
        echo "<img src='img/true.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px;'>" . _("Credit of") . " <b>{$amount}</b> " . _("pesos successfully added to reseller") . " <b>{$callerid}</b>.</span><br/><br/><br/>";
        echo "<a href='resellers_credit.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    } catch (CreditException $e) {
        echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px; color: red;'>" . _("ERROR UPDATING BALANCE!") . "<br/>" . $e->getMessage() . " </span><br/><br/><br/><br/>";
        echo "<a href='resellers_credit.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    }
    echo "</center>";
} else {
    print_form(0, '');
}
?>

		</div>