本文整理汇总了PHP中Subscriber::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::get方法的具体用法?PHP Subscriber::get怎么用?PHP Subscriber::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_form
function print_form($post_data, $errors)
{
$sub = new Subscriber();
try {
$msisdn = $_GET['id'];
$sub->get($msisdn);
} catch (SubscriberException $e) {
echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
echo "<span style='font-size: 20px; color: red;'>" . _("ERROR GETTING SUBSCRIBER INFO!") . "<br/> " . $e->getMessage() . " </span><br/><br/><br/><br/>";
echo "<a href='#' onclick=\"parent.jQuery.fancybox.close()\"><button class='b1'>" . _("Close") . "</button></a>";
}
?>
<br/>
<div id="stylized" class="myform">
<form id="form" name="form" method="post" action="subscriber_delete.php">
<h1><?php
echo _("Delete Subscriber");
?>
</h1><br/>
<input type="hidden" name="msisdn" value="<?php
echo $sub->msisdn;
?>
" />
<?php
echo _("Confirm deletion of");
?>
<?php
echo $sub->name;
?>
<?php
echo $sub->msisdn;
?>
<button type="submit" name="delete_subscriber"><?php
echo _("Delete");
?>
</button>
<div class="spacer"></div>
</form>
</div>
<?php
}
示例2: elseif
$number = $_POST['number'];
$bulk_send = $_POST['bulk_send'];
if ($message == "") {
$error_txt .= _("SMS text is empty") . "<br/>";
}
if ($number == "" && !isset($bulk_send)) {
$error_txt .= _("SMS number is empty") . "<br/>";
}
}
if (isset($_POST['send_sms']) && $error_txt != "") {
print_form(1, $error_txt);
} elseif (isset($_POST['send_sms']) && $error_txt == "") {
$sub = new Subscriber();
$ret = 0;
try {
$sub->get($_POST['number']);
} catch (SubscriberException $e) {
echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
echo "<span style='font-size: 20px; color: red;'>" . _("ERROR SENDING SMS!") . "</br>" . $e->getMessage() . " </span><br/><br/><br/><br/>";
echo "<a href='send_sms.php'><button class='b1'>" . _("Go Back") . "</button></a>";
$ret = 1;
}
if ($ret == 0) {
if (isset($_POST['bulk_send'])) {
try {
$sms = new SMS();
$sms->send_broadcast($_POST['message'], $_POST['bulk_send']);
echo "<img src='img/true.png' width='150' height='150' /><br/><br/>";
echo "<span style='font-size: 20px;'>" . _("BROADCAST MESSAGE IS BEING SENT!") . "</span><br/><br/><br/><br/>";
echo "<a href='send_sms.php'><button class='b1'>" . _("Go Back") . "</button></a>";
} catch (SMSException $e) {
示例3: export_csv
public function export_csv($num)
{
$subscribers = Subscriber::get();
if ($num == 1) {
$file_name = date('Y_m_d_H_i') . '_subscribers' . '.csv';
$file = fopen('exports/' . $file_name, 'w');
$field_names = false;
foreach ($subscribers as $row) {
if (!$field_names) {
fputcsv($file, array_keys($row->toArray()));
$field_names = true;
}
fputcsv($file, $row->toArray());
}
fclose($file);
$path = asset('exports/' . $file_name);
return Response::json(array('file' => $path));
}
}
示例4: function
'type' : 'iframe',
'onClosed' : function() {
parent.location.reload(true);
}
});
},
"sAjaxSource": "subscribers_processing.php"
} );
});
</script><br/>
<?php
try {
$sub = new Subscriber();
$unpaid_subscribers = $sub->get('unpaid_subscription');
$unauthorized_subscribers = $sub->get('unauthorized');
$paid_subscribers = $sub->get('paid_subscription');
$online = $sub->get('online');
$offline = $sub->get('offline');
echo "<div>";
echo "<div class='left_box' style='margin-left:10px;'>" . _("Unpaid subscription") . ": <b>{$unpaid_subscribers}</b></div>";
echo "<div class='left_box'>" . _("Unauthorized") . ": <b>{$unauthorized_subscribers}</b></div>";
echo "<div class='left_box'>" . _("Paid subscription") . ": <b>{$paid_subscribers}</b></div>";
echo "<div class='left_box'>" . _("Online") . ": <b>{$online}</b></div>";
echo "<div class='left_box'>" . _("Offline") . ": <b>{$offline}</b></div>";
echo "</div>";
} catch (SubscriberException $e) {
}
?>
示例5: print_form
function print_form($post_data, $errors)
{
$firstname = $_POST['firstname'] != '' ? $_POST['firstname'] : '';
$callerid = $_POST['callerid'] != '' ? $_POST['callerid'] : '';
$sub = new Subscriber();
try {
$msisdn = $_GET['id'];
$sub->get($_GET['id']);
$name = $_POST['firstname'] != '' ? $_POST['firstname'] : $sub->name;
$callerid = $_POST['callerid'] != '' ? $_POST['callerid'] : $sub->msisdn;
$location = $_POST['location'] != '' ? $_POST['location'] : $sub->location;
} catch (PDOException $e) {
echo "<img src='img/false.png' width='200' height='170' /><br/><br/>";
echo "<span style='font-size: 20px; color: red;'>" . _("ERROR GETTING SUBSCRIBER INFO!") . $e->getMessage() . " </span><br/><br/><br/><br/>";
echo "<a href='provisioning.php'><button class='b1'>Go Back</button></a>";
}
try {
$loc = new Configuration();
$locations = $loc->getLocations();
} catch (ConfigurationException $e) {
echo " Error getting locations";
}
?>
<br/>
<div id="stylized" class="myform">
<form id="form" name="form" method="post" action="subscriber_edit.php">
<h1><?php
echo _("Edit Subscriber");
?>
</h1><br/>
<input type="hidden" name="sip_id" value="<?php
echo $msisdn;
?>
" />
<span style='color: red; font-size: 12px;'><?php
echo $errors;
?>
</span><br/>
<label><?php
echo _("Name");
?>
<span class="small"><?php
echo _("Subscriber Name");
?>
</span>
</label>
<input type="text" name="firstname" id="firstname" value="<?php
echo $name;
?>
"/>
<label><?php
echo _("Subscriber number");
?>
<span class="small"><?php
echo _("Subscriber number");
?>
</span>
</label>
<input type="text" name="callerid" id="callerid" value="<?php
echo $callerid;
?>
"/>
<?php
if (count($locations) > 1) {
?>
<label><?php
echo _("Location");
?>
<span class="small"><?php
echo _("Subscriber location");
?>
</span>
</label>
<?php
echo "<select name='location' id='location'>";
foreach ($locations as $rloc) {
if ($location == $rloc->name) {
echo "<option value='" . $rloc->name . "' selected='selected'>" . $rloc->name . "</option>";
} else {
echo "<option value='" . $rloc->name . "'>" . $rloc->name . "</option>";
}
}
echo "</select>";
}
?>
<label><?php
echo _("Subscription Paid");
?>
<span class="small"><?php
echo _("Check for yes uncheck for no");
?>
</span>
</label><br/><br/>
//.........这里部分代码省略.........