-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathsearch.php
61 lines (49 loc) · 1.55 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
require_once('./php/UIHandler.php');
require_once('./php/APIHandler.php');
include('./php/Session.php');
$ui = \creamy\UIHandler::getInstance();
$api = \creamy\APIHandler::getInstance();
$user = \creamy\CreamyUser::currentUser();
if(isset($_POST['search_contacts'])){
$output = $ui->GetContacts($_SESSION['user'], $_POST['search_contacts'], $_POST['disposition'], $_POST['list'], $_POST['address'], $_POST['city'], $_POST['state'], 500, $_POST['search_customers']);
echo $output;
}
if(isset($_POST['search_recordings'])){
$search_phone = $_POST['search_recordings'];
$agent_filter = "";
$start = "";
$end = "";
if(isset($_POST['agent_filter'])){
$agent_filter = $_POST['agent_filter'];
}
if(isset($_POST['start_filterdate'])){
if($_POST['start_filterdate'] != ""){
$start = date('Y-m-d H:i:s', strtotime($_POST['start_filterdate']));
}else{
$start = "";
}
}
if(isset($_POST['end_filterdate'])){
if($_POST['end_filterdate'] != ""){
$end = date('Y-m-d H:i:s', strtotime($_POST['end_filterdate']));
}else{
$end = "";
}
}
$postfields = array(
"goAction" => "goGetCallRecordingList",
"requestDataPhone" => $search_phone,
//if(!empty($start))
//"start_filterdate" => $start,
"end_filterdate" => $end,
"agent_filter" => $agent_filter
);
if($start !== "")
$postfields["start_filterdate"] = $start;
$output = $api->API_Request("goCallRecordings", $postfields);
// var_dump($postfields);
$table_list = $ui->getListAllRecordings($output);
echo $table_list;
}
?>