init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
38
scripts/ajax/telefon.php
Normal file
38
scripts/ajax/telefon.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
//echo "<pre>"; print_r($gpsdata); echo "</pre>";
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
$api_key = 'OvHiwonvVKneoYttEOE64g'; // Jörg
|
||||
$mysms = new mysms($api_key);
|
||||
$login_data = array('msisdn' => '491783481356', 'password' => 'laden');
|
||||
//----------------------------------------------
|
||||
$login = $mysms->ApiCall('json', '/user/login', $login_data);
|
||||
$user_info = json_decode($login);
|
||||
$_SESSION['AuthToken'] = $user_info->authToken;
|
||||
$mysms->setAuthToken($user_info->authToken);
|
||||
//----------------------------------------------
|
||||
$req_data = array('apiKey' => $api_key,'authToken' => $_SESSION['AuthToken']); //providing
|
||||
$ergebnis = $mysms->ApiCall('json', '/user/call/count/unread', $req_data);
|
||||
$jsonrow=json_decode($ergebnis);
|
||||
//----------------------------------------------
|
||||
$req_data = array('apiKey' => $api_key,'authToken' => $_SESSION['AuthToken'],'limit' => 1); //providing
|
||||
$data = $mysms->ApiCall('json', '/user/call/get', $req_data);
|
||||
$jsondata=json_decode($data);
|
||||
$abfrage = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE handy='".$jsondata->calls[0]->address."' OR tel2='".$jsondata->calls[0]->address."'");
|
||||
if($abfrage['num_rows']!=0) { $info['name']=$abfrage['name']; } else { $info['name']='****/********'; }
|
||||
//echo "ID :".$jsonrow->calls[0]->callId;
|
||||
//echo "Nr :".$jsonrow->calls[0]->address;
|
||||
//echo "ID :".$jsonrow->calls[0]->status;
|
||||
$info['dauer']=$jsondata->calls[0]->duration;
|
||||
$info['status']=$jsondata->calls[0]->status;
|
||||
$info['time']=substr($jsondata->calls[0]->dateCall, 0, -3);
|
||||
|
||||
//echo "<pre>"; print_r($ergebnis); echo "</pre>";
|
||||
//----------------------------------------------
|
||||
|
||||
|
||||
$template->assign('unread', $jsonrow->unreadCount);
|
||||
$template->assign('data', $data);
|
||||
$template->assign('info', $info);
|
||||
$template->assign('content', 'tpl/ajax/telefon.tpl');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue