本文整理汇总了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 {
示例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/>";