git.schokokeks.org
Repositories
Help
Report an Issue
bibweb.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
b45f49d
Branches
Tags
master
bibweb.git
internal
ajax_kunde_erstellen.php
Diverse Ă„nderungen im internen Bereich
Bernd Wurst
commited
b45f49d
at 2020-06-14 18:17:06
ajax_kunde_erstellen.php
Blame
History
Raw
<?php require_once 'lib/api.php'; require_once 'lib/tools.php'; // some sort of limit?! session_start(); $ret = ''; $data = array("kunde" => array(), "uuid" => ''); $fields = array("firma", "vorname", "nachname", "adresse", "plz", "ort"); foreach ($fields as $key) { if (isset($_GET[$key])) { $data['kunde'][$key] = $_GET[$key]; } } if (isset($_GET['telefon'])) { $data['kunde']['kontakt'] = array(); $data['kunde']['kontakt'][] = array( "typ" => "telefon", "wert" => $_GET['telefon']); } $data['uuid'] = chop(sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535))); $ret = api_call('kunde/neu', $data); if (!isset($ret['kunde'])) { return; } $ret['kunde']['html'] = adresse($ret['kunde'], 'kundendaten'); header('Content-Type: application/json'); echo json_encode($ret['kunde']);