init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
57
scripts/telefon18.php
Normal file
57
scripts/telefon18.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
//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);
|
||||
$json2=json_decode($ergebnis);
|
||||
//----------------------------------------------
|
||||
$req_data = array('apiKey' => $api_key,'authToken' => $_SESSION['AuthToken'],'limit' => 100); //providing
|
||||
$data = $mysms->ApiCall('json', '/user/call/get', $req_data);
|
||||
$jsonrow=json_decode($data, true); $k=0;
|
||||
foreach($jsonrow['calls'] as $row) {
|
||||
//----- umbauen arraysearch
|
||||
$abfrage = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE handy='".$row['address']."' OR tel2='".$row['address']."'");
|
||||
if($abfrage['num_rows']!=0) {
|
||||
$info[$k]['name']=$abfrage['name'];
|
||||
} else {
|
||||
// $info[$k]['name']=$row['address'];
|
||||
$info[$k]['name']='****/********';
|
||||
}
|
||||
$info[$k]['dauer']=$row['duration'];
|
||||
$info[$k]['status']=$row['status'];
|
||||
$info[$k]['incoming']=$row['incoming'];
|
||||
$info[$k]['read']=$row['read'];
|
||||
$info[$k]['time']=substr($row['dateCall'], 0, -3);
|
||||
$k++;
|
||||
//echo "<pre>"; print_r($row); echo "</pre>";
|
||||
|
||||
//-------------------------
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
$lmid=18;
|
||||
$mitarbeiter = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE id='".$lmid."' AND handy!='' ");
|
||||
//--------------------------------- auslesen SMS
|
||||
$smsdata = $GLOBALS['mysql']->query_array("SELECT * FROM log_sms WHERE nummer='".$mitarbeiter['handy']."' ORDER BY senddate DESC limit 50");
|
||||
$template->assign('mitarbeiter', $mitarbeiter);
|
||||
$template->assign('smsdata', $smsdata);
|
||||
//echo "<pre>"; print_r($ergebnis); echo "</pre>";
|
||||
//----------------------------------------------
|
||||
|
||||
|
||||
$template->assign('unread', $json2->unreadCount);
|
||||
$template->assign('data', $data);
|
||||
$template->assign('info', $info);
|
||||
$template->assign('content', 'tpl/telefon18.tpl');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue