本文整理匯總了PHP中OpenVBX::addJS方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::addJS方法的具體用法?PHP OpenVBX::addJS怎麽用?PHP OpenVBX::addJS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenVBX
的用法示例。
在下文中一共展示了OpenVBX::addJS方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
<?php
if (count($_POST)) {
foreach ($_POST['keys'] as $k => $v) {
if (empty($v)) {
unset($_POST['keys'][$k]);
unset($_POST['status'][$k]);
}
}
PluginData::set('orders', array('keys' => $_POST['keys'], 'status' => $_POST['status']));
}
$settings = PluginData::get('orders', array('keys' => array(), 'status' => array()));
# print_r( $settings );
$statusArray = array('shipped' => 'Shipped', 'fullfillment' => 'Sent to Fullfillment', 'processing' => 'Processing');
OpenVBX::addJS('script.js');
?>
<div class="vbx-plugin orders-applet">
<form method="post">
<h2>Order Tracker</h2>
<p>Enter an order ID, without spaces. For example, <code>1234</code> instead of <code>123 4</code>.</p>
<table class="vbx-orders-grid options-table">
<thead>
<tr>
<td>Order ID</td>
<td>Status</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<?php
foreach ($settings->keys as $i => $key) {
示例2: date
?>
","<?php
echo date('d-M-Y', $subscriber->joined);
?>
"
<?php
}
die;
}
}
if (!empty($_POST['name'])) {
$ci->db->insert('subscribers_lists', array('tenant' => $tenant_id, 'name' => htmlentities($_POST['name'])));
}
$lists = $ci->db->query(sprintf('SELECT id, name FROM subscribers_lists WHERE tenant = %d', $tenant_id))->result();
$flows = OpenVBX::getFlows(array('tenant_id' => $tenant_id));
OpenVBX::addJS('subscriptions.js');
?>
<style>
.vbx-subscriptions h3 {
font-size: 16px;
font-weight: bold;
margin-top: 0;
}
.vbx-subscriptions .list,
.vbx-subscriptions .subscriber {
clear: both;
width: 95%;
overflow: hidden;
margin: 0 auto;
padding: 5px 0;
border-bottom: 1px solid #eee;
示例3: foreach
foreach ($subscribers as $subscriber) {
$ci->db->insert('outbound_queue', array('tenant' => $tenant_id, 'number' => $subscriber->value, 'type' => $type, 'time' => $time, 'callerId' => $callerId, 'data' => json_encode(array('message' => $_POST['message']))));
}
} elseif ('call' == $type) {
$flow = OpenVBX::getFlows(array('id' => $_POST['flow'], 'tenant_id' => $tenant_id));
if ($flow && count($subscribers) && $flow[0]->values['data']) {
foreach ($subscribers as $subscriber) {
$ci->db->insert('outbound_queue', array('tenant' => $tenant_id, 'number' => $subscriber->value, 'type' => $type, 'time' => $time, 'callerId' => $callerId, 'data' => json_encode(array('id' => $flow[0]->values['id'], 'name' => $flow[0]->values['name']))));
}
}
}
}
$lists = $ci->db->query(sprintf('SELECT id, name FROM subscribers_lists WHERE tenant = %d', $tenant_id))->result();
$flows = OpenVBX::getFlows(array('tenant_id' => $tenant_id));
OpenVBX::addJS('jquery-ui-1.7.3.custom.min.js');
OpenVBX::addJS('schedule.js');
OpenVBX::addCSS('jquery-ui-1.7.3.custom.css');
?>
<style>
.vbx-schedule form {
display: none;
padding: 20px 5%;
background: #eee;
border-bottom: 1px solid #ccc;
}
.vbx-schedule h3 {
font-size: 16px;
font-weight: bold;
margin-top: 0;
}
</style>
示例4: array
$ci->db->delete('polls_responses', array('poll' => $remove));
}
die;
}
if ($poll = intval($_REQUEST['poll'])) {
echo $ci->db->query(sprintf('SELECT data FROM polls WHERE tenant=%d AND id=%d', $tenant_id, $poll))->row()->data;
die;
}
if (($name = htmlentities($_POST['name'])) && ($options = $_POST['option']) && is_array($options)) {
foreach ($options as &$option) {
$option = htmlentities($option);
}
$ci->db->insert('polls', array('tenant' => $tenant_id, 'name' => $name, 'data' => json_encode($options)));
}
$polls = $ci->db->query(sprintf('SELECT id, name, data, (SELECT COUNT(id) FROM polls_responses WHERE polls_responses.poll=polls.id) AS responses FROM polls WHERE tenant=%d', $tenant_id))->result();
OpenVBX::addJS('polls.js');
?>
<style>
.vbx-polls h3 {
font-size:16px;
font-weight:bold;
margin-top:0;
}
.vbx-polls .poll,
.vbx-polls div.option {
clear:both;
width:95%;
overflow:hidden;
margin:0 auto;
padding:5px 0;
border-bottom:1px solid #eee;
示例5: implode
<audio id="notify">
<?php
// Find plugin location to correctly link sound file
$file = "assets/notify.mp3";
$found_plugin_dir = false;
$plugin_dir = "plugins";
$plugin = OpenVBX::$currentPlugin;
$info = $plugin->getInfo();
$path = $info['plugin_path'] . '/' . $file;
$plugin_dir = implode('/', array('plugins', $info['dir_name'], $file));
$is_ssl_proto = false;
switch (true) {
case !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off':
$is_ssl_proto = true;
break;
case !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https':
$is_ssl_proto = true;
break;
}
$base_url = "http" . ($is_ssl_proto ? 's' : '') . "://" . $_SERVER['HTTP_HOST'] . rtrim(WEB_ROOT, '/') . '/';
?>
<source src="<?php
echo $base_url . $plugin_dir;
?>
"></source>
</audio>
<?php
OpenVBX::addJS('js/index.js');
OpenVBX::addJS('js/jquery.light.js');
示例6: base_url
<span>Save</span>
</button>
<a class="delete_creds_btn" href="#">Delete</a>
<div class="system_msg"></div>
</div>
<div style="clear:both;"></div>
</div><!-- #zendesk_api_access -->
</div>
<script>
var base_url = '<?php
echo base_url();
?>
';
var plugin_url = '<?php
echo $plugin_url;
?>
';
var plugin_dir = '<?php
echo $plugin['dir_name'];
?>
';
</script>
<?php
OpenVBX::addJS('config.js');
?>
<?php
}
示例7: array
<?php
if (count($_POST)) {
PluginData::set('settings', array('api_key' => $_POST['api_key'], 'card_prompt' => $_POST['card_prompt'], 'month_prompt' => $_POST['month_prompt'], 'year_prompt' => $_POST['year_prompt'], 'require_cvc' => isset($_POST['require_cvc']), 'cvc_prompt' => $_POST['cvc_prompt']));
}
$settings = PluginData::get('settings', array('api_key' => null, 'card_prompt' => "Please enter your credit card number followed by the pound sign.", 'month_prompt' => "Please enter the month of the card's expiration date followed by the pound sign.", 'year_prompt' => "Please enter the year of the expiration date followed by the pound sign.", 'require_cvc' => true, 'cvc_prompt' => "Please enter the card's security code followed by the pound sign."));
if (is_object($settings)) {
$settings = get_object_vars($settings);
}
OpenVBX::addJS('stripe.js');
?>
<style>
.vbx-stripe form {
padding: 20px 5%;
}
.vbx-stripe form p {
margin: 20px 0;
}
</style>
<div class="vbx-content-main">
<div class="vbx-content-menu vbx-content-menu-top">
<h2 class="vbx-content-heading">Stripe Settings</h2>
</div>
<div class="vbx-table-section vbx-stripe">
<form method="post" action="">
<fieldset class="vbx-input-container">
<p>
<label class="field-label">API Key<br/>
<input type="password" name="api_key" class="medium" value="<?php
echo htmlentities($settings['api_key']);
?>
示例8: explode
die;
}
$user = OpenVBX::getCurrentUser();
$tenant_id = $user->values['tenant_id'];
$queries = explode(';', file_get_contents(dirname(__FILE__) . '/db.sql'));
foreach ($queries as $query) {
if (trim($query)) {
$ci->db->query($query);
}
}
if (!empty($_POST['remove'])) {
$ci->db->delete('outbound_queue', array('id' => intval($_POST['remove']), 'tenant' => $tenant_id));
die;
}
$events = $ci->db->query(sprintf('SELECT id, number, type, time, callerId, data FROM outbound_queue WHERE tenant=%d ORDER BY time ASC', $tenant_id))->result();
OpenVBX::addJS('queue.js');
?>
<style>
.vbx-queue h3 {
font-size: 16px;
font-weight: bold;
margin-top: 0;
}
.vbx-queue .event {
clear: both;
width: 95%;
overflow: hidden;
margin: 0 auto;
padding: 5px 0;
border-bottom: 1px solid #eee;
}
示例9: array
<?php
/*
Dashboard for vbx-intelligence
display a list of calls
poll the ajax file for new calls
when a call is clicked, pass the call data to each widget and display
*/
include_once 'plugins/vbx-intelligence/applets/vbx-intelligence/widgets.php';
OpenVBX::addJS('pages/intel_js.php');
$intelCalls = (array) PluginStore::get('IntelCalls', array());
// hack to handle ajax requests
if (!empty($_REQUEST['ajax'])) {
include_once 'ajax.php';
exit;
}
if (!empty($_REQUEST['clearData'])) {
$temp = PluginStore::set('IntelCalls', array());
//clear data
echo "<script>document.location.href='vbx-intelligence-dashboard';</script>";
exit;
}
?>
<!-- maps library -->
<script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
<div class="vbx-content-menu vbx-content-menu-top">
<h2 class="vbx-content-heading">VBX-Intelligence Dashboard</h2>
<ul class="phone-numbers-menu vbx-menu-items-right"> </ul>
</div>