Esempio n. 1
0
<?php

header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
require_once "service/SimplePdoLeadConnectService.php";
require_once "entity/Event.php";
require_once "functions.php";
$service = new SimplePdoLeadConnectService();
$inquiry = $service->loadInquiry($_GET['inquiry-key']);
saveEvent($_POST['DialCallStatus'], $_GET['vendor-id'], $inquiry->id);
$events = $service->loadEvents($inquiry->id);
$vendor_events = groupEventsByVendor($events);
initiateCallbacks($vendor_events);
?>
<Response>
    <Hangup />
</Response>
Esempio n. 2
0
$events = $service->loadEvents($inquiry->id);
?>

<Response>
    <?php 
if (count($events) > 0) {
    $vendor_events = groupEventsByVendor($events);
    $call_in_process = detectCallInProcess($vendor_events);
    if ($call_in_process == 1) {
        ?>
            <Say>Sorry. Another vendor has just connected a call to the prospect.</Say>
            <?php 
        scheduleCallback($params);
    } else {
        saveEvent("accepted", $vendor_id, $inquiry->id);
        if ($live == "true") {
            connectConference($sid, $params);
        } else {
            callProspect($phone, $params);
        }
    }
} else {
    saveEvent("accepted", $vendor_id, $inquiry->id);
    if ($live == "true") {
        connectConference($sid, $params);
    } else {
        callProspect($phone, $params);
    }
}
?>
</Response>
$file = '';
$method = '';
$path = '../jsonDB/';
if (isset($_POST['method'])) {
    $method = $_POST['method'];
}
if (isset($_POST['file'])) {
    $file = $path . $_POST['file'];
}
if (isset($_GET['id'])) {
    $file = $path . $_GET['event'];
    deleteEvent($file, $_GET['id']);
}
if ($method == 'saveEvent') {
    saveEvent($file);
} else {
    if ($method == 'deleteEvent') {
        $url = filter_input(INPUT_POST, 'url');
        deleteEvent($file, $url);
    }
}
function saveEvent($file)
{
    $eventJSON = filter_input(INPUT_POST, 'json');
    $to = filter_input(INPUT_POST, 'email');
    $deleteUrl = filter_input(INPUT_POST, 'deleteUrl');
    $username = filter_input(INPUT_POST, 'username');
    $email = '*****@*****.**';
    $subject = "Thank you for creating event";
    $message = "\nHello {$username},<br/>\nYou have successfully created an event! To remove the event click on the following link:<br/><br/>\n<a href='{$deleteUrl}'>{$deleteUrl}</a><br/><br/>\nBest Regards,<br/>\nTeam Rookies";
Esempio n. 4
0
 $startrow = getNextHBaseRow();
 if (DEBUG) {
     echo "Start row: {$startrow} \n";
 }
 $lastHBaseID = 0;
 // Get HBase pointer
 //$scanner = $client->scannerOpenWithStop("hogzilla_events",$startrow,"",
 $scanner = $client->scannerOpenWithStop("hogzilla_events", "", "", array("event:lower_ip", "event:upper_ip", "event:note", "event:signature_id", "event:lower_ip_str", "event:upper_ip_str", "event:ports", "event:title"), array());
 // Loop events to insert into MySQL/GrayLog
 while (true) {
     $row = $client->scannerGet($scanner);
     //if($lastHBaseID==0 and $startrow!=0) { $lastHBaseID=$startrow; continue; } /* dismiss the first */
     if (sizeof($row) == 0) {
         break;
     }
     saveEvent($row, $con, $cid++);
     $lastHBaseID = $row[0]->row;
     $client->deleteAllRow("hogzilla_events", $row[0]->row, array());
     if (DEBUG) {
         echo "Last HBaseID: {$lastHBaseID} \n";
     }
 }
 // Update last CID on MySQL, this counter will be used on last access
 if (MYSQL) {
     saveLastCID($sensorid, $cid, $con);
 }
 // Save last seen HBase event
 saveNextHBaseRow($lastHBaseID);
 // Close HBase scanner
 $client->scannerClose($scanner);
 /*
Esempio n. 5
0
}
$access_token = FB_ACCESS_TOKEN;
if (isset($_GET['ac'])) {
    $access_token = $_GET['ac'];
}
if (isset($argv[1])) {
    $access_token = $argv[1];
}
$fb = new Facebook\Facebook(['app_id' => FB_APP_ID, 'app_secret' => FB_APP_SECRET, 'default_graph_version' => 'v2.4']);
$fb->setDefaultAccessToken($access_token);
try {
    $facebookApi = new FacebookCustomApi();
    $pages = $facebookApi->getFacebookCustomApi();
    foreach ($pages as $p) {
        $response = $fb->get($p['FacebookID'] . "/events");
        $resp = json_decode($response->getBody(), true);
        foreach ($resp['data'] as $event) {
            $exists = Event::fbEventExists($event['id']);
            if (!$exists) {
                saveEvent($event, $p['FacebookID']);
            }
        }
    }
    exit;
} catch (Facebook\Exceptions\FacebookResponseException $e) {
    echo 'Graph returned an error: ' . $e->getMessage();
    exit;
} catch (Facebook\Exceptions\FacebookSDKException $e) {
    echo 'Facebook SDK returned an error: ' . $e->getMessage();
    exit;
}
Esempio n. 6
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoCalendar.class.php";
    //    include_once "modules/$module_name/libs/JSON.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "save_new":
            $content = saveEvent($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "edit":
            $content = viewForm_NewEvent($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "delete":
            $content = deleteEvent($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "save_edit":
            $content = saveEvent($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "get_lang":
            $content = getLanguages($arrLangModule, $arrConf);
            break;
        case "get_data":
            $content = getDataCalendar($arrLang, $pDB, $module_name, $arrConf);
            break;
        case "get_num_ext":
            $content = getNumExtesion($arrConf, $pDB, $arrLang);
            break;
        case "setData":
            $content = setDataCalendar($arrLang, $pDB, $arrConf);
            break;
        case "view_box":
            $content = viewBoxCalendar($arrConf, $arrLang, $pDB, $local_templates_dir, $smarty, $module_name);
            break;
        case "new_box":
            $content = newBoxCalendar($arrConf, $arrLang, $pDB, $local_templates_dir, $smarty, $module_name);
            break;
        case "delete_box":
            $content = deleteBoxCalendar($arrConf, $arrLang, $pDB, $module_name);
            break;
        case "download_icals":
            $content = download_icals($arrLang, $pDB, $module_name, $arrConf);
            break;
        case "get_contacts2":
            $content = getContactEmails2($arrConf);
            break;
        case "getTextToSpeach":
            $content = getTextToSpeach($arrLang, $pDB);
            break;
        case "display":
            $content = viewCalendarById($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "phone_numbers":
            // Include language file for EN, then for local, and merge the two.
            $arrLangModule = NULL;
            include_once "modules/address_book/lang/en.lang";
            $lang_file = "modules/address_book/lang/{$lang}.lang";
            if (file_exists("{$base_dir}/{$lang_file}")) {
                $arrLanEN = $arrLangModule;
                include_once $lang_file;
                $arrLangModule = array_merge($arrLanEN, $arrLangModule);
            }
            $arrLang = array_merge($arrLang, $arrLangModule);
            //solo para obtener los devices (extensiones) creadas.
            $dsnAsterisk = generarDSNSistema('asteriskuser', 'asterisk');
            $pDB_addressbook = new paloDB($arrConf['dsn_conn_database3']);
            $pDB_acl = new paloDB($arrConf['dsn_conn_database1']);
            $html = report_adress_book($smarty, $module_name, $local_templates_dir, $pDB_addressbook, $pDB_acl, $arrLang, $dsnAsterisk);
            $smarty->assign("CONTENT", $html);
            $smarty->assign("THEMENAME", $arrConf['mainTheme']);
            $smarty->assign("path", "");
            $content = $smarty->display("{$local_templates_dir}/address_book_list.tpl");
            break;
        default:
            // view_form
            $content = viewCalendar($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
    }
    return $content;
}
<?php

$file = '../events.json';
$eventJSON = $_POST['json'];
$method = $_POST['method'];
if ($method == 'saveEvent') {
    saveEvent($file, $eventJSON);
} else {
    if ($method == 'getEvents') {
        getEvents($file);
    }
}
function saveEvent($file, $eventJSON)
{
    file_put_contents($file, $eventJSON);
    echo 'success';
}
function getEvents($file)
{
}
<?php

header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
require_once "service/SimplePdoLeadConnectService.php";
require_once "entity/Inquiry.php";
require_once "functions.php";
// if the caller pressed anything but 1 send them back
if ($_REQUEST['Digits'] != '1') {
    header("Location: vendor-connect.php");
    die;
}
$inquiry_key = $_GET['inquiry-key'];
$vendor_id = $_GET['vendor-id'];
$service = new SimplePdoLeadConnectService();
$inquiry = $service->loadInquiry($inquiry_key);
$events = $service->loadEvents($inquiry->id);
saveEvent("callback", $vendor_id, $inquiry->id);
?>

<Response>
    <Say>Your call back has been scheduled. Goodbye.</Say>
</Response>

<?php 
$vendor_events = groupEventsByVendor($events);
initiateCallbacks($vendor_events);