コード例 #1
0
    }
    if ($amount == "") {
        $error_txt .= _("Initial balance is empty") . "<br/>";
    }
}
if (isset($_POST['add_reseller']) && $error_txt != "") {
    print_form(1, $error_txt);
} elseif (isset($_POST['add_reseller']) && $error_txt == "") {
    // no error process form
    $msisdn = $_POST['msisdn'];
    $pin = $_POST['pin'];
    $amount = $_POST['amount'];
    echo "<center>";
    $reseller = new Reseller();
    try {
        $reseller->set($msisdn, $pin, $amount);
        $reseller->create();
        echo "<img src='img/true.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px;'>" . _("Reseller number") . ": <b>{$pin}</b> " . _("Successfully provisioned with an initial balance of") . " {$amount}<br/><br/>";
        echo "<a href='resellers_provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    } catch (ResellerException $e) {
        echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px; color: red;'>" . _("ERROR PROVISIONING RESELLER!") . " </span><br/>" . $e->getMessage() . "<br/><br/><br/>";
        echo "<a href='resellers_provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    }
    echo "</center>";
} else {
    print_form(0, '');
}
?>