This commit is contained in:
steven 2025-08-11 22:23:30 +02:00
commit 72a26edcff
22092 changed files with 2101903 additions and 0 deletions

55
sms/class.gps.php Normal file
View file

@ -0,0 +1,55 @@
<?php
class gps {
private $ApiKey = false;
private $BaseUrl = 'https://api.plt-software.com/';
function __construct($apikey) {
$this->ApiKey = $apikey;
}
public function GpsCall($rest, $resource, $data)
{
if($rest == '' && $rest != 'json' && $rest != 'xml') die('Please provide valid REST type: xml/json!'); //check if $rest is xml or json
elseif(filter_var($this->BaseUrl.$rest.$resource, FILTER_VALIDATE_URL) == false) die('Provided Resource or MountUrl is not Valid!'); //check if https://api.mysms.com/$rest/$resource is valid url
elseif(!is_array($data)) die('Provide data is not an Array!'); //check if provided $data is valid array
else{
//insert api key into $data
$data['apiKey'] = $this->ApiKey;
$result = $this->curlRequest($rest.$resource, $data);
return $result;
}
}
private function curlRequest($resource, $data)
{
$json_encoded_data = json_encode($data);
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $this->BaseUrl.$resource);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json_encoded_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json;charset=utf-8',
'Content-Length: ' . strlen($json_encoded_data))
);
return curl_exec ($curl);
}
}
?>

209
sms/list_a_abr19a.php Normal file
View file

@ -0,0 +1,209 @@
<?php
// UTF8 erzwingen
@setlocale(LC_CTYPE, 'de_DE.utf8', 'de_DE.UTF-8', 'en_US.utf8', 'en_US.UTF-8', 'en_GB.utf8', 'en_GB.UTF-8', 'de_AT.utf8', 'de_AT.UTF-8', 'de_CH.utf8', 'de_CH.UTF-8');
if( function_exists('mb_internal_encoding') )
{
mb_internal_encoding('utf-8');
}
header('Content-type: text/html; charset=utf-8');
error_reporting(E_ALL); ini_set('display_errors',0);
require('lib/fpdf.php');
//--------------------------------
//-------------------- pdf starten
//--------------------------------
//-------------------- Variablenübergabe
//$firma= $_GET['id'];
$monat= $_GET['monat'];
$jahr = $_GET['jahr'];
//--------------------------------
class PDF extends FPDF {
function Header() {
// blau (0,160,230)
// Orange (240,150, 0)
// grau (200,200,200)
$this->SetFont('Helvetica','B',20);
$this->Image('template/images/jb_logo2.png', 120, 7);
$adr = $GLOBALS['mysql']->query_single("SELECT * FROM firmen WHERE id=11");
$this->SetFont('Helvetica','B',10); $this->SetTextColor(0,0,0); $this->SetFillColor(255,255,255);
$this->Cell(110,5,utf8_decode($adr['a1']." ".$adr['a2']),'0','1','L','0');
//$this->Cell(110,5,utf8_decode($adr['a2']),'0','1','L','0');
$this->Cell(110,5,utf8_decode($adr['a3']),'0','1','L','0');
$this->Cell(110,5,utf8_decode($adr['a4']),'0','1','L','1');
$this->SetFont('Helvetica','B',12);
$this->SetTextColor(0,160,230); $this->SetFillColor(240,150,0);
$this->Cell(110,8,"Monatsbericht Sachsen-Sonntag ".($_GET['monat'])." / ".($_GET['jahr']),'0','0','L','0');
$this->SetFont(''); $this->SetFont('Helvetica','B',10); $this->SetTextColor(0,0,0);
$this->Cell(80,4,'Seite '.$this->PageNo(),'0','0','R','0');
$this->Write(8,"\n");
}
function Footer() {
$this->SetY(-15);
$this->SetFont('Helvetica','I',6);
$this->Cell(190,3,'JB-Transport.de - Bautzner Str. 67 - 04347 Leipzig ***** Interne Liste - NON Public ***** by. F. Teichert 2011-2019','1','0','C','1');
}
}
$pdf = new PDF('P','mm','A4');
$pdf->AddPage();
$pdf->SetFont('Courier','B',10); $pdf->SetFont(''); $pdf->SetFillColor(255,255,255);
//--------------- neu 1. touren auslesen zu arbeitgeber , danach mit option die tourenliste
$keyfirma=0; $keytour=0; $firmapreis=0; $tourmenge=0; $abnahme=0; $abnahmepreis=0;
$abnahme=0;
$kg_grenze1=1500;
$kg_grenze2=750;
$preis_grund=100;
$preis_abnahme=65;
$preis_zweit=100;
$tempgewicht=0;
// $firmatouren = $GLOBALS['mysql']->query("SELECT * FROM touren WHERE afirma='".$firma."' ORDER BY typ");
$firmatouren = $GLOBALS['mysql']->query("SELECT * FROM touren WHERE typ=19 and aktiv=1 and afirma=11 ORDER BY ID"); $touranz=0; $touranzahl=0;
while($rowt = $firmatouren->fetch_assoc()) {
//echo'<pre>'; print_r($rowt); echo'</pre>';
//--------------- neu 1. touren auslesen zu arbeitgeber , danach mit option die tourenliste
$tourq = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE monat='".$monat."' AND jahr='".$jahr."' AND tour='".$rowt['id']."'");
$touranzahl=$tourq['num_rows'];
unset($tourx); $tourmenge=0;
$keytour++; $key=0;
//-----
$tourx = $GLOBALS['mysql']->query("SELECT * FROM tourenliste WHERE monat='".$monat."' AND jahr='".$jahr."' AND tour='".$rowt['id']."' ORDER BY time");
while($row = $tourx->fetch_assoc()) {
if($touranz==0) {
//---------------------------------------------------------- Tour anzeigen
$pdf->SetFont('Courier','B',10);
$pdf->Cell(20,4,utf8_decode($rowt['tour']),'T','0','L','0'); // Tour
$pdf->SetFont('Courier','',10);
$pdf->Cell(45,4,utf8_decode($rowt['infotitel']),'T','0','L','0');
}
else {
$pdf->SetFont('Courier','',10);
$pdf->Cell(20,4,utf8_decode(" "),'0','0','L','0'); // Tour
$pdf->Cell(45,4,utf8_decode(" "),'0','0','L','0');
}
//---------------------------------------------------------- nicht gefahren/ausgefallen
if($row['gewicht']==0) {
if($touranz==0) {
$pdf->Cell(20,4,utf8_decode($row['tag'].".".$row['monat'].".".$row['jahr']),'T','0','R','0');
$pdf->Cell(40,4,utf8_decode($row['gewicht']." kg"),'T','0','R','0');
$pdf->Cell(40,4,(sprintf("%01.2f",$toursumme))." Euro",'T','0','R','0');
} else {
$pdf->Cell(20,4,utf8_decode($row['tag'].".".$row['monat'].".".$row['jahr']),'0','0','R','0');
$pdf->Cell(40,4,utf8_decode($row['gewicht']." kg"),'0','0','R','0');
$pdf->Cell(40,4,(sprintf("%01.2f",$toursumme))." Euro",'0','0','R','0');
}
$touranz++;
}
//---------------------------------------------------------- Preisberechnung
else {
// -------------------------------- grundgewicht abziehen
$tempgewicht=$row['gewicht']-$kg_grenze1;
$toursumme=$preis_grund;
// restgewicht mehr als abnahme
if($tempgewicht>$kg_grenze1) { //---------------- 2. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 3. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 4. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 5. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 6. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 7. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze1) { //---------------- 8. Auto
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
if($tempgewicht>$kg_grenze2) { // keine Abnahme sonder volles Auto !!!!!!! Abnahme typ 2 über 50%
$tempgewicht=$tempgewicht-$kg_grenze1;
$toursumme=$toursumme+$preis_zweit;
}
// -------------------------------- Abnahme abziehen - 1/2 auto
if($tempgewicht>0) { // Abnahme
$tempgewicht=$tempgewicht-$kg_grenze2;
$toursumme=$toursumme+$preis_abnahme;
}
// -------------------------------- Tour anzeigen
if($touranz==0) {
$pdf->Cell(20,4,utf8_decode($row['tag'].".".$row['monat'].".".$row['jahr']),'T','0','R','0');
$pdf->Cell(40,4,utf8_decode($row['gewicht']." kg"),'T','0','R','0');
$pdf->Cell(40,4,(sprintf("%01.2f",$toursumme))." Euro",'T','0','R','0');
} else {
$pdf->Cell(20,4,utf8_decode($row['tag'].".".$row['monat'].".".$row['jahr']),'0','0','R','0');
$pdf->Cell(40,4,utf8_decode($row['gewicht']." kg"),'0','0','R','0');
$pdf->Cell(40,4,(sprintf("%01.2f",$toursumme))." Euro",'0','0','R','0');
}
// -------------------------------- preissammlung
$touranz++;
$typsumme=$typsumme+$toursumme;
$firmapreis=$firmapreis+$toursumme;
}
if($touranzahl==$touranz) {
if($touranz==1) {
$pdf->Cell(30,4,(sprintf("%01.2f",$typsumme))." Euro",'T','1','R','0');
} else {
$pdf->Cell(30,4,(sprintf("%01.2f",$typsumme))." Euro",'0','1','R','0');
}
$typsumme=0;
} else {
if($touranz==1) {
$pdf->Cell(30,4,utf8_decode(" "),'T','1','R','0');
} else {
$pdf->Cell(30,4,utf8_decode(" "),'0','1','R','0');
}
}
$toursumme=0;$tempgewicht=0;
} $touranz=0;
}
//gesamtsumme
// $pdf->Cell(25,8," ",'0','1','R','1');
$pdf->Cell(195,4," ",'0','1','R','1');
$pdf->Cell(195,4,"--------------",'0','1','R','1');
$pdf->Cell(108,4," ",'0','0','L','1');
$pdf->Cell(50,4,"Zwischensumme:",'0','0','R','1');
$pdf->Cell(37,4,(sprintf("%01.2f",$firmapreis))." Euro",'0','1','R','1');
/*
$steuer=$firmapreis*19/100;
$pdf->Cell(108,4," ",'0','0','L','1');
$pdf->Cell(50,4,"+19% MwSt.",'0','0','R','1');
$pdf->Cell(37,4,(sprintf("%01.2f",$steuer))." Euro",'0','1','R','1');
$betrag=$firmapreis+$steuer;
$pdf->Cell(108,4," ",'0','0','L','1');
$pdf->Cell(50,4,"Gesamtbetrag:",'0','0','R','1');
$pdf->Cell(37,4,(sprintf("%01.2f",$betrag))." Euro",'0','1','R','1');
if($betrag>9999) {
$pdf->Cell(195,4,"=============",'0','1','R','1');
} else {
$pdf->Cell(195,4,"==============",'0','1','R','1');
}
*/
//---------
$pdf->Output('Abr_SaSo_'.($monat).'_'.($jahr).'.pdf','I');
exit();
//---------
$pdf->Output('Abr_SaSo__'.($monat).'_'.($jahr).'.pdf','I');

113
sms/smstest.php Normal file
View file

@ -0,0 +1,113 @@
<?php
//------------------------------------------------- sms Verzeichnis -----------------------------------------------------
header("Content-Type: text/html; charset=utf-8");
error_reporting(E_ALL); ini_set('display_errors',1);
require('../lib/config.php');
session_name(CONFIG_SESSION); session_start();
require('../lib/mysql.class.php');
include_once('../lib/class.mysms.php');
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
date_default_timezone_set('Europe/London');
//----------------------------------------------------------------------------------------------------------------
//------------------------------------------------- abfragen -----------------------------------------------------
//----------------------------------------------------------------------------------------------------------------
$api_key = 'EPOcWC8smWfdOWNHzSLANw';
$mysms = new mysms($api_key);
$login_data = array('msisdn' => '4916094934507', 'password' => 'maxdata-01');
$login = $mysms->ApiCall('json', '/user/login', $login_data);
$user_info = json_decode($login);
$_SESSION['AuthToken'] = $user_info->authToken;
$mysms->setAuthToken($user_info->authToken);
$syncs = array('messageId' => 434478);
$syncsacks= array('messageId' =>"434478",'operation' =>"0");
//$syncs= json_encode($syncs);
$msisdn = "+4915756088154";
//$msisdn = "16094934507";
$mid="453659";
//-------------- funktioniert nach nummer . mit status
$req_data = array('apiKey' => $api_key,'authToken' => $_SESSION['AuthToken'],'address' => $msisdn,'offset' => 1,'limit' => 1); //providing
$ergebnis = $mysms->ApiCall('json', '/user/message/get/by/conversation', $req_data); //calling method ->ApiCall
$jsonrow=json_decode($ergebnis, true);
// echo "<pre>"; print_r($jsonrow); echo "</pre>";
//echo "<pre>"; print_r($jsonrow['messages']); echo "</pre>";
foreach($jsonrow['messages'] as $row) {
if(isset($row['incoming'])) { echo $row['incoming']; }
echo "<pre>"; print_r($row); echo "</pre>";
if($row['incoming'] == 1) {
$gelesen=$row['read'];
$smstest = $GLOBALS['mysql']->query_single("SELECT * FROM sms WHERE messageId='".$row['messageId']."'");
if($smstest['num_rows']!=0) {
$GLOBALS['mysql']->insert("UPDATE sms SET senddate='".substr($row['dateSent'], 0, -3)."' WHERE messageId='".$row['messageId']."'");
$GLOBALS['mysql']->insert("UPDATE sms SET statusdate='".substr($row['dateStatus'], 0, -3)."' WHERE messageId='".$row['messageId']."'");
$GLOBALS['mysql']->insert("UPDATE sms SET status='".$row['status']."' WHERE messageId='".$row['messageId']."'");
} else {
$smsname = $GLOBALS['mysql']->query_single("SELECT * FROM mitarbeiter WHERE handy='".$row['address']."'");
if($smsname['num_rows']!=0) { $ename=$smsname['name']; } else { $ename="unkown"; }
$GLOBALS['mysql']->insert("INSERT INTO sms (messageId,nummer,text,incoming,gelesen,status,senddate,statusdate,e_name)
VALUES(
'".$row['messageId']."',
'".$row['address']."',
'".$row['message']."',
'".$row['incoming']."',
'".$gelesen."',
'".$row['status']."',
'".substr($row['dateSent'], 0, -3)."',
'".substr($row['dateStatus'], 0, -3)."',
'".$ename."'
)");
}
} else {
}
}
// echo "<pre>"; print_r($jsonrow); echo "</pre>";
// $req_data = array('authToken' => $_SESSION['AuthToken'], 'address'=> $abfrage['nummer'], 'query'=> utf8_decode($abfrage['text']));
// $ergbniss = $mysms->ApiCall('json', '/user/message/search', $req_data);
// echo "<pre>"; print_r($ergebnis); echo "</pre>";
//-----------------------------------------------------------
//}
?>