当前位置: 首页>>代码示例>>PHP>>正文


PHP Subscriber::set方法代码示例

本文整理汇总了PHP中Subscriber::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::set方法的具体用法?PHP Subscriber::set怎么用?PHP Subscriber::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subscriber的用法示例。


在下文中一共展示了Subscriber::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

    print_form(1, $error_txt);
} elseif (isset($_POST['add_subscriber']) && $error_txt == "") {
    // no error process form
    $firstname = $_POST['firstname'];
    $callerid = $_POST['callerid'];
    $location = $_POST['location'];
    // get internal prefix
    $site = new Configuration();
    $info = $site->getSite();
    $internalprefix = $info->postcode . $info->pbxcode;
    $new_num = "{$internalprefix}{$callerid}";
    echo "<center>";
    $amount = 0;
    $sub = new Subscriber();
    try {
        $sub->set("", $callerid, $firstname, 1, $amount, "", "", $location);
        $ret = $sub->create();
        echo "<img src='img/true.png' width='200' height='170' /><br/><br/>";
        if ($ret != "") {
            echo "<span style='font-size: 20px;'>" . _("Subscriber already exists! New subscriber number") . ": <b>{$ret}</b> " . _("Successfully provisioned with an initial balance of") . " {$amount}<br/><br/>";
        } else {
            echo "<span style='font-size: 20px;'>" . _("Subscriber number") . ": <b>{$callerid}</b> " . _("Successfully provisioned with an initial balance of") . " {$amount}<br/><br/>";
        }
        echo "<a href='provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    } catch (SubscriberException $e) {
        echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px; color: red;'>" . _("ERROR PROVISIONING SUBSCRIBER!") . " </span><br/>" . $e->getMessage() . "<br/><br/><br/>";
        echo "<a href='provisioning.php'><button class='b1'>" . _("Go Back") . "</button></a>";
    }
    echo "</center>";
} else {
开发者ID:infercom2,项目名称:rccn,代码行数:31,代码来源:provisioning.php

示例2: elseif

    if ($firstname == "") {
        $error_txt .= _("Name is empty") . "<br/>";
    }
    if ($callerid == "" || strlen($callerid) != 11) {
        $error_txt .= _("Subscriber number is invalid") . "<br/>";
    }
}
if (isset($_POST['edit_subscriber']) && $error_txt != "") {
    print_form(1, $error_txt);
} elseif (isset($_POST['edit_subscriber']) && $error_txt == "") {
    echo "<center>";
    $sub = new Subscriber();
    try {
        #$sub->get($_POST['msisdn']);
        if ($_POST['authorized'] == 1) {
            $sub->set("", $callerid, $firstname, 1, "", "", "", $location);
        } else {
            $sub->set("", $callerid, $firstname, 0, "", "", "", $location);
        }
        if ($_POST['subscription_status'] == 1) {
            $sub->subscription_status = 1;
        } else {
            $sub->subscription_status = 0;
        }
        $sub->edit();
        echo "<img src='img/true.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px;'>" . _("Subscriber number") . ": <b>{$callerid}</b> " . _("successfully modified") . "<br/><br/>";
        echo "<a href='#'  onclick=\"parent.jQuery.fancybox.close()\"><button class='b1'>" . _("Close") . "</button></a>";
    } catch (SubscriberException $e) {
        echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
        echo "<span style='font-size: 20px; color: red;'>" . _("ERROR SAVING SUBSCRIBER!") . " " . $e->getMessage() . " </span><br/><br/><br/><br/>";
开发者ID:infercom2,项目名称:rccn,代码行数:31,代码来源:subscriber_edit.php


注:本文中的Subscriber::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。