Ejemplo n.º 1
0
<?php

header("Content-type: text/xml\n");
error_reporting(E_NONE);
include "chirbit.php";
$user = AppletInstance::getUserGroupPickerValue('chirbit-controller');
$user_id = $user->values["id"];
$chirbit_username = PluginStore::get("chirbit_username_{$user_id}", "");
$chirbit_password = PluginStore::get("chirbit_password_{$user_id}", "");
$prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
$after = AppletInstance::getAudioSpeechPickerValue('after');
$title = AppletInstance::getValue("title", "");
$response = new Response();
if (isset($_REQUEST['RecordingUrl'])) {
    chirbit_post($chirbit_username, $chirbit_password, $_REQUEST['RecordingUrl'], $title);
    $verb = AudioSpeechPickerWidget::getVerbForValue($after, null);
    $response->append($verb);
    $response->addHangup();
} else {
    $verb = AudioSpeechPickerWidget::getVerbForValue($prompt, null);
    $response->append($verb);
    $response->addRecord();
}
$response->Respond();
Ejemplo n.º 2
0
<?php

$ci =& get_instance();
$user_id = $ci->session->userdata('user_id');
$foursquare_username = PluginStore::get("foursquare_username_{$user_id}", "");
$foursquare_password = PluginStore::get("foursquare_password_{$user_id}", "");
if (isset($_REQUEST['savebutton'])) {
    PluginStore::set("foursquare_username_{$user_id}", $_REQUEST['username']);
    PluginStore::set("foursquare_password_{$user_id}", $_REQUEST['password']);
    $foursquare_username = $_REQUEST['username'];
    $foursquare_password = $_REQUEST['password'];
}
?>
<div class="vbx-content-main">
    <?php 
$store = PluginStore::getKeyValues();
?>
    <div class="vbx-content-menu vbx-content-menu-top">
        <h2 class="vbx-content-heading">FourSquare Account</h2>
    </div>

    <div class="vbx-content-container">
		<div class="vbx-content-section">
        <h3>Store Your Credentials</h3>
			<form action="" class="vbx-form">
			<div class="vbx-input-container">

			<label class="field-label">Username 
				<input name="username" size="30" value="<?php 
echo $foursquare_username;
?>
Ejemplo n.º 3
0
<?php

/* 
	ajax.php
	this file is polled to feed incoming call data to the dashboard
	return call data as a json array
*/
$intelCalls = (array) PluginStore::get('IntelCalls', array());
$toShow = isset($_REQUEST['toShow']) ? $_REQUEST['toShow'] : '';
if ($toShow == "") {
    // return all calls
    $toReturn = $intelCalls;
} else {
    // return all calls more recent than the specified time
    $toReturn = array();
    foreach ($intelCalls as $call) {
        if ($call->time > $toShow) {
            array_push($toReturn, $call);
        }
    }
}
//header('Content-type: application/json');
?>

<?php 
echo json_encode($toReturn);
Ejemplo n.º 4
0
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $sResponse = curl_exec($ch);
    $xml = new SimpleXMLElement($sResponse);
    if ($xml->Result[0] != null) {
        $lat = $xml->Result[0]->Latitude;
        $lon = $xml->Result[0]->Longitude;
    }
} catch (Exception $e) {
    $err = $err . " {$e}";
}
// Create an associative array of incoming call properties
$callInfo = array();
$callInfo["city"] = $city;
$callInfo["state"] = $state;
$callInfo["caller"] = $caller;
$callInfo["called"] = $called;
$callInfo["sid"] = $CallGuid;
$callInfo["lat"] = (string) $lat;
$callInfo["lon"] = (string) $lon;
$callInfo["time"] = time();
$callInfo["date"] = getdate();
$callInfo["err"] = $err;
// append our array of call props to to a plugin-managed variable
$intelCalls = PluginStore::get('IntelCalls', array());
// get our array of calls or default to new array if undefined
array_push($intelCalls, $callInfo);
PluginStore::set('IntelCalls', $intelCalls);
// respond with nothing
$response = new Response();
$response->addRedirect(AppletInstance::getDropZoneUrl('next'));
$response->Respond();
Ejemplo n.º 5
0
<?php

include "foursquare_api.php";
$user = AppletInstance::getUserGroupPickerValue('4sq-venue-controller');
$user_id = $user->values["id"];
$foursquare_username = PluginStore::get("foursquare_username_{$user_id}", "");
$foursquare_password = PluginStore::get("foursquare_password_{$user_id}", "");
$default = AppletInstance::getDropZoneUrl('no-venue-default-action');
$response = new Response();
if (!empty($foursquare_username)) {
    $lastVenue = getLastVenue($foursquare_username, $foursquare_password);
    $venues = AppletInstance::getValue('venues[]');
    $venue_options = AppletInstance::getDropZoneUrl('venue-options[]');
    $found = false;
    if (is_array($keys)) {
        foreach ($venues as $id => $value) {
            if ($value == $lastVenue) {
                $response->addRedirect($venue_options[$id]);
                $found = true;
            }
        }
    }
    if (!$found) {
        $response->addRedirect($default);
    }
} else {
    $response->addRedirect($default);
}
$response->Respond();
Ejemplo n.º 6
0
/*
	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>

<div class="vbx-table-section"> 
	<div style="padding:10px;">