Bernd Wurst commited on 2020-06-10 18:22:57
Zeige 12 geänderte Dateien mit 814 Einfügungen und 0 Löschungen.
| ... | ... |
@@ -0,0 +1,213 @@ |
| 1 |
+ |
|
| 2 |
+@import url("https://mosterei-wurst.de/wp-content/fonts/fonts.css");
|
|
| 3 |
+ |
|
| 4 |
+body {
|
|
| 5 |
+ font-family: linux_biolinum_o; |
|
| 6 |
+ font-size: 150%; |
|
| 7 |
+ background-color: #ffa; |
|
| 8 |
+} |
|
| 9 |
+ |
|
| 10 |
+.auftrag-kopf {
|
|
| 11 |
+ display: flex; |
|
| 12 |
+ width: 100%; |
|
| 13 |
+ align-items: stretch; |
|
| 14 |
+ margin-bottom: 1em; |
|
| 15 |
+} |
|
| 16 |
+ |
|
| 17 |
+.auftrag-kopf > div {
|
|
| 18 |
+ border: 1px solid black; |
|
| 19 |
+ border-radius: 5px; |
|
| 20 |
+ padding: 0.5em; |
|
| 21 |
+} |
|
| 22 |
+ |
|
| 23 |
+.auftrag-kopf div.kundendaten_aktionen {
|
|
| 24 |
+ border: none; |
|
| 25 |
+} |
|
| 26 |
+ |
|
| 27 |
+.auftrag-kopf div.kundendaten_aktionen button {
|
|
| 28 |
+ display: block; |
|
| 29 |
+ margin-bottom: 1em; |
|
| 30 |
+} |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+.navbutton {
|
|
| 34 |
+ margin: 2em; |
|
| 35 |
+} |
|
| 36 |
+ |
|
| 37 |
+div.lieferart {
|
|
| 38 |
+ display: flex; |
|
| 39 |
+ |
|
| 40 |
+} |
|
| 41 |
+div.lieferart > p {
|
|
| 42 |
+ text-align: center; |
|
| 43 |
+ padding: 0.2em; |
|
| 44 |
+ margin: 0.2em; |
|
| 45 |
+ border: 1px solid #040; |
|
| 46 |
+} |
|
| 47 |
+ |
|
| 48 |
+p.gitterbox {
|
|
| 49 |
+ |
|
| 50 |
+} |
|
| 51 |
+ |
|
| 52 |
+img.gitterbox {
|
|
| 53 |
+ width: 67px; |
|
| 54 |
+ height: 50px; |
|
| 55 |
+} |
|
| 56 |
+ |
|
| 57 |
+img.anhaenger {
|
|
| 58 |
+ width: 86px; |
|
| 59 |
+ height: 50px; |
|
| 60 |
+} |
|
| 61 |
+ |
|
| 62 |
+.auftrag-container, .unterauftrag-container {
|
|
| 63 |
+ display: flex; |
|
| 64 |
+ flex-direction: row; |
|
| 65 |
+ flex-wrap: wrap; |
|
| 66 |
+ align-items: stretch; |
|
| 67 |
+} |
|
| 68 |
+a.auftrag, div.unterauftrag {
|
|
| 69 |
+ border: 1px solid #007900; |
|
| 70 |
+ border-radius: 5px; |
|
| 71 |
+ padding: 0.5em; |
|
| 72 |
+ margin: 1em; |
|
| 73 |
+ color: #000; |
|
| 74 |
+ text-decoration: none; |
|
| 75 |
+} |
|
| 76 |
+a.auftrag:hover {
|
|
| 77 |
+ background-color: #ccffcc; |
|
| 78 |
+} |
|
| 79 |
+ |
|
| 80 |
+a.auftrag.incomplete:hover {
|
|
| 81 |
+ background-color: #ffcccc; |
|
| 82 |
+} |
|
| 83 |
+ |
|
| 84 |
+.auftrag.incomplete {
|
|
| 85 |
+ border: 1px dotted #777; |
|
| 86 |
+} |
|
| 87 |
+ |
|
| 88 |
+.auftrag h4 {
|
|
| 89 |
+ font-weight: bold; |
|
| 90 |
+ font-size: 110%; |
|
| 91 |
+} |
|
| 92 |
+ |
|
| 93 |
+.auftrag > .unterauftrag {
|
|
| 94 |
+ border: none; |
|
| 95 |
+ border-radius: 0; |
|
| 96 |
+ border-top: 1px dotted black; |
|
| 97 |
+ padding: 0em; |
|
| 98 |
+ margin: 0em; |
|
| 99 |
+} |
|
| 100 |
+ |
|
| 101 |
+.unterauftrag .lieferart {
|
|
| 102 |
+ min-height: 1.5em; |
|
| 103 |
+} |
|
| 104 |
+ |
|
| 105 |
+.auftrag .kundenname {
|
|
| 106 |
+ font-size: 60%; |
|
| 107 |
+} |
|
| 108 |
+ |
|
| 109 |
+#banner {
|
|
| 110 |
+ width: 100%; |
|
| 111 |
+ background-color: #007900; |
|
| 112 |
+ padding: 0.5em; |
|
| 113 |
+ overflow: hidden; |
|
| 114 |
+} |
|
| 115 |
+ |
|
| 116 |
+ |
|
| 117 |
+#banner-back {
|
|
| 118 |
+ width: 65px; |
|
| 119 |
+ text-align: left; |
|
| 120 |
+ float: left; |
|
| 121 |
+} |
|
| 122 |
+ |
|
| 123 |
+#banner-headline {
|
|
| 124 |
+ width: 100%; |
|
| 125 |
+ min-height: 65px; |
|
| 126 |
+ text-align: center; |
|
| 127 |
+ color: #ffc; |
|
| 128 |
+} |
|
| 129 |
+#banner-headline h1 {
|
|
| 130 |
+ display: inline; |
|
| 131 |
+} |
|
| 132 |
+ |
|
| 133 |
+#banner-logo {
|
|
| 134 |
+ float: right; |
|
| 135 |
+ width: 244px; |
|
| 136 |
+ text-align: right; |
|
| 137 |
+} |
|
| 138 |
+ |
|
| 139 |
+#banner-clear {
|
|
| 140 |
+ clear: both; |
|
| 141 |
+ height: 0px; |
|
| 142 |
+ width: 100%; |
|
| 143 |
+ padding: 0; |
|
| 144 |
+ margin: 0; |
|
| 145 |
+} |
|
| 146 |
+ |
|
| 147 |
+h1, h2, h3 {
|
|
| 148 |
+ font-family: "Caveat Brush"; |
|
| 149 |
+} |
|
| 150 |
+@media(min-width:992px){
|
|
| 151 |
+ h1 {
|
|
| 152 |
+ font-size: 250%; |
|
| 153 |
+ } |
|
| 154 |
+ |
|
| 155 |
+ h1.termsheader {
|
|
| 156 |
+ font-size: 200%; |
|
| 157 |
+ } |
|
| 158 |
+ .modal-dialog {
|
|
| 159 |
+ max-width: 700px; |
|
| 160 |
+ } |
|
| 161 |
+} |
|
| 162 |
+ |
|
| 163 |
+@media(max-width: 991px) {
|
|
| 164 |
+ #banner-headline {
|
|
| 165 |
+ clear: both; |
|
| 166 |
+ } |
|
| 167 |
+ |
|
| 168 |
+ .modal-footer button, |
|
| 169 |
+ .modal-footer a {
|
|
| 170 |
+ max-width: 50%; |
|
| 171 |
+ font-size: 100%; |
|
| 172 |
+ } |
|
| 173 |
+ |
|
| 174 |
+} |
|
| 175 |
+ |
|
| 176 |
+ |
|
| 177 |
+ |
|
| 178 |
+.modal-body.terms {
|
|
| 179 |
+ text-align: left; |
|
| 180 |
+ max-height: 500px; |
|
| 181 |
+ overflow-y: auto; |
|
| 182 |
+} |
|
| 183 |
+ |
|
| 184 |
+input, textarea, .form-control {
|
|
| 185 |
+ font-size: 120%; |
|
| 186 |
+} |
|
| 187 |
+ |
|
| 188 |
+input.btn[type=submit] {
|
|
| 189 |
+ white-space: normal !important; |
|
| 190 |
+ min-height: 5em; |
|
| 191 |
+} |
|
| 192 |
+ |
|
| 193 |
+input[type=submit] {
|
|
| 194 |
+ width: 100%; |
|
| 195 |
+} |
|
| 196 |
+ |
|
| 197 |
+.btn {
|
|
| 198 |
+ font-size: 120%; |
|
| 199 |
+} |
|
| 200 |
+ |
|
| 201 |
+.btn-light, .btn-light:hover {
|
|
| 202 |
+ border-color: black; |
|
| 203 |
+ margin-bottom: 0.5em; |
|
| 204 |
+} |
|
| 205 |
+ |
|
| 206 |
+.container {
|
|
| 207 |
+ max-width: 100%; |
|
| 208 |
+} |
|
| 209 |
+ |
|
| 210 |
+#footer {
|
|
| 211 |
+ margin-top: 5em; |
|
| 212 |
+} |
|
| 213 |
+ |
| ... | ... |
@@ -0,0 +1,155 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once 'lib/api.php'; |
|
| 3 |
+session_start(); |
|
| 4 |
+ |
|
| 5 |
+$handle = null; |
|
| 6 |
+if (isset($_GET['handle'])) {
|
|
| 7 |
+ $handle = $_GET['handle']; |
|
| 8 |
+} else {
|
|
| 9 |
+ $random = base64_encode(md5(microtime())); |
|
| 10 |
+ $handle = substr(str_replace(array('+', '=', '/'), '', $random), 0, $handle_length);
|
|
| 11 |
+} |
|
| 12 |
+ |
|
| 13 |
+$data = array("handle" => $handle);
|
|
| 14 |
+ |
|
| 15 |
+$ret = api_call('auftrag/lesen', $data);
|
|
| 16 |
+$a = $ret['auftrag']; |
|
| 17 |
+ |
|
| 18 |
+if (isset($_GET['handle']) && $a['revision'] == 0) {
|
|
| 19 |
+ echo "Fehler im System"; |
|
| 20 |
+ die(); |
|
| 21 |
+} |
|
| 22 |
+ |
|
| 23 |
+ |
|
| 24 |
+ |
|
| 25 |
+$previous = 'unbestaetigte.php'; |
|
| 26 |
+$headline = 'Auftrag bestätigen'; |
|
| 27 |
+$content = ''; |
|
| 28 |
+ |
|
| 29 |
+$content .= '<h3>Kundendaten</h3>'; |
|
| 30 |
+$content .= '<div class="auftrag-kopf">'; |
|
| 31 |
+$addr = array(); |
|
| 32 |
+if (isset($a['kundendaten']['firma'])) {
|
|
| 33 |
+ $addr[] = $a['kundendaten']['firma']; |
|
| 34 |
+} |
|
| 35 |
+if (isset($a['kundendaten']['vorname'])) {
|
|
| 36 |
+ $addr[] = $a['kundendaten']['vorname'].' '.$a['kundendaten']['nachname']; |
|
| 37 |
+} else {
|
|
| 38 |
+ $addr[] = $a['kundendaten']['nachname']; |
|
| 39 |
+} |
|
| 40 |
+if (isset($a['kundendaten']['adresse'])) {
|
|
| 41 |
+ $addr[] = $a['kundendaten']['adresse']; |
|
| 42 |
+} |
|
| 43 |
+if (isset($a['kundendaten']['ort'])) {
|
|
| 44 |
+ $addr[] = $a['kundendaten']['plz'].' '.$a['kundendaten']['ort']; |
|
| 45 |
+} |
|
| 46 |
+$addr[] = $a['kundendaten']['telefon']; |
|
| 47 |
+ |
|
| 48 |
+$name = $a['name']; |
|
| 49 |
+if (!$name) {
|
|
| 50 |
+ $name .= $a['telefon']; |
|
| 51 |
+} |
|
| 52 |
+ |
|
| 53 |
+$content .= '<div class="kundendaten_auftrag">'.implode('<br>', $addr).'
|
|
| 54 |
+<div class="auftragname_input"> |
|
| 55 |
+<label for="name"><em>Name für den Auftrag</em></label><br><input type="text" placeholder="Name" value="'.$name.'"><br> |
|
| 56 |
+<button class="btn btn-secondary" id="name_save" label="Name speichern">Speichern</button> |
|
| 57 |
+</div> |
|
| 58 |
+</div>'; |
|
| 59 |
+ |
|
| 60 |
+$addr = array(); |
|
| 61 |
+if (isset($a['kundennr'])) {
|
|
| 62 |
+ $addr[] = 'Kundennummer: '.$a['kundennr']; |
|
| 63 |
+ $data = array("kundennr" => $a['kundennr']);
|
|
| 64 |
+ $ret = api_call('kunde/laden', $data);
|
|
| 65 |
+ if (isset($ret['kunde'])) {
|
|
| 66 |
+ if (isset($ret['kunde']['firma'])) {
|
|
| 67 |
+ $addr[] = $ret['kunde']['firma']; |
|
| 68 |
+ } |
|
| 69 |
+ if (isset($ret['kunde']['vorname'])) {
|
|
| 70 |
+ $addr[] = $ret['kunde']['vorname'].' '.$ret['kunde']['nachname']; |
|
| 71 |
+ } else {
|
|
| 72 |
+ $addr[] = $ret['kunde']['nachname']; |
|
| 73 |
+ } |
|
| 74 |
+ if (isset($ret['kunde']['adresse'])) {
|
|
| 75 |
+ $addr[] = $ret['kunde']['adresse']; |
|
| 76 |
+ } |
|
| 77 |
+ if (isset($ret['kunde']['ort'])) {
|
|
| 78 |
+ $addr[] = $ret['kunde']['plz'].' '.$ret['kunde']['ort']; |
|
| 79 |
+ } |
|
| 80 |
+ foreach ($ret['kunde']['kontakt'] as $kk) {
|
|
| 81 |
+ $addr[] = ucwords($kk['typ']).': '.$kk['wert'].($kk['notizen'] ? ' ('.$kk['notizen'].')' : '');
|
|
| 82 |
+ } |
|
| 83 |
+ } else {
|
|
| 84 |
+ $addr[] = '<em>Fehler beim Abrufen der Kundendaten</em>'; |
|
| 85 |
+ } |
|
| 86 |
+} else {
|
|
| 87 |
+ $addr[] = '<em>Keinem Kundenkonto zugeordnet</em>'; |
|
| 88 |
+} |
|
| 89 |
+ |
|
| 90 |
+$content .= '<div class="kundendaten_aktionen"> |
|
| 91 |
+ <button id="kunde_zum_auftrag" title="Fehlende Daten von Kundendaten übernehmen" class="btn btn-secondary"><----</button><br> |
|
| 92 |
+ <button id="auftrag_zum_kunde" title="abweichende Daten in den Kundendaten aktualisieren" class="btn btn-secondary">----></button> |
|
| 93 |
+ |
|
| 94 |
+</div>'; |
|
| 95 |
+$content .= '<div class="kundendaten_kunde">'.implode('<br>', $addr).'<br><button class="btn btn-secondary" id="kunde_suchen">Kunde suchen</button></div>';
|
|
| 96 |
+$content .= '</div>'; |
|
| 97 |
+ |
|
| 98 |
+$content .= '<div class="unterauftrag-container">'; |
|
| 99 |
+foreach ($a['bestellung'] as $best) {
|
|
| 100 |
+ // Evtl. Mehrere Posten in dieser Bestellung |
|
| 101 |
+ $content .= '<div class="unterauftrag">'; |
|
| 102 |
+ |
|
| 103 |
+ $obst = array(); |
|
| 104 |
+ foreach ($best['gitterbox'] as $gb) {
|
|
| 105 |
+ $img = '<img class="gitterbox" src="/assets/images/gitterbox.png"><br>'; |
|
| 106 |
+ if ($gb['id']) {
|
|
| 107 |
+ $img .= 'GB #'.$gb['id']; |
|
| 108 |
+ } else {
|
|
| 109 |
+ $img .= 'Gitterbox'; |
|
| 110 |
+ } |
|
| 111 |
+ $obst[] = '<p class="gitterbox">'.$img.'</p>'; |
|
| 112 |
+ } |
|
| 113 |
+ foreach ($best['anhaenger'] as $anh) {
|
|
| 114 |
+ $img = '<img class="anhaenger" src="/assets/images/anhaenger.png"><br>'; |
|
| 115 |
+ if (isset($anh['kennz'])) {
|
|
| 116 |
+ $img .= ' <strong>'.$anh['kennz'].'</strong> '; |
|
| 117 |
+ } else {
|
|
| 118 |
+ $img .= ' <em>Anhänger</em>'; |
|
| 119 |
+ } |
|
| 120 |
+ $obst[] = '<p class="anhaenger">'.$img.'</p>'; |
|
| 121 |
+ } |
|
| 122 |
+ $content .= '<div class="lieferart">'.implode('', $obst).'</div>';
|
|
| 123 |
+ // Gebrauchte |
|
| 124 |
+ if ($best['gebrauchte']) {
|
|
| 125 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>JA</strong></p>'; |
|
| 126 |
+ } else {
|
|
| 127 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>NEIN</strong></p>'; |
|
| 128 |
+ } |
|
| 129 |
+ // Neue |
|
| 130 |
+ $neue = array(); |
|
| 131 |
+ if (count($best['neue']) == 1) {
|
|
| 132 |
+ $key = array_keys($best['neue']); |
|
| 133 |
+ if ($key[0] != 'sonstiges') {
|
|
| 134 |
+ $neue[] = 'Nur/Zuerst <strong>'.$key[0].'</strong>'; |
|
| 135 |
+ } |
|
| 136 |
+ } else {
|
|
| 137 |
+ foreach ($best['neue'] as $key => $val) {
|
|
| 138 |
+ $neue[] = '<strong>'.$key.'</strong>: '.$val; |
|
| 139 |
+ } |
|
| 140 |
+ } |
|
| 141 |
+ if (isset($best['neue']['sonstiges'])) {
|
|
| 142 |
+ $neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
|
| 143 |
+ } |
|
| 144 |
+ $content .= '<div class="neue"><p>'.implode('</p><p>', $neue).'</p></div>';
|
|
| 145 |
+ if (isset($best['anmerkungen'])) {
|
|
| 146 |
+ $content .= '<div class="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</div>'; |
|
| 147 |
+ } |
|
| 148 |
+ $content .= '</div>'; // Unterauftrag |
|
| 149 |
+} |
|
| 150 |
+ |
|
| 151 |
+$content .= '</div>'; // unterauftrag-container |
|
| 152 |
+$content .= '</form>'; |
|
| 153 |
+ |
|
| 154 |
+include "template.php"; |
|
| 155 |
+ |
| ... | ... |
@@ -0,0 +1,14 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once 'lib/api.php'; |
|
| 3 |
+session_start(); |
|
| 4 |
+ |
|
| 5 |
+$headline = 'Auftragsverwaltung'; |
|
| 6 |
+$content = ''; |
|
| 7 |
+ |
|
| 8 |
+$content .= '<div class="navbutton"><a class="btn btn-primary" href="unbestaetigte.php">Neue Aufträge bestätigen</a></div>'; |
|
| 9 |
+$content .= '<div class="navbutton"><a class="btn btn-primary" href="presse.php">Aufträge für die Presse verwalten</a></div>'; |
|
| 10 |
+$content .= '<div class="navbutton"><a class="btn btn-primary" href="abfueller.php">Aufträge für den Abfüller verwalten</a></div>'; |
|
| 11 |
+ |
|
| 12 |
+ |
|
| 13 |
+include "template.php"; |
|
| 14 |
+ |
| ... | ... |
@@ -0,0 +1,55 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+require_once dirname(__DIR__).'/config.php'; |
|
| 4 |
+ |
|
| 5 |
+$config['debug'] = false; |
|
| 6 |
+//$config['debug'] = true; |
|
| 7 |
+if (array_key_exists('debug', $_GET)) {
|
|
| 8 |
+ $config['debug'] = true; |
|
| 9 |
+} |
|
| 10 |
+ |
|
| 11 |
+$curl = curl_init(); |
|
| 12 |
+ |
|
| 13 |
+curl_setopt_array($curl, array( |
|
| 14 |
+ CURLOPT_RETURNTRANSFER => true, |
|
| 15 |
+ CURLOPT_ENCODING => "", |
|
| 16 |
+ CURLOPT_MAXREDIRS => 10, |
|
| 17 |
+ CURLOPT_TIMEOUT => 30, |
|
| 18 |
+ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
|
| 19 |
+ CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
|
|
| 20 |
+ CURLOPT_CUSTOMREQUEST => "POST")); |
|
| 21 |
+ |
|
| 22 |
+ |
|
| 23 |
+function api_call($path, $data) |
|
| 24 |
+{
|
|
| 25 |
+ global $curl; |
|
| 26 |
+ global $config; |
|
| 27 |
+ |
|
| 28 |
+ if ($config['debug']) {
|
|
| 29 |
+ echo '<pre>API-Call: '.$config['api_url'].$path."\n"; |
|
| 30 |
+ print_r($data); |
|
| 31 |
+ echo '</pre>'; |
|
| 32 |
+ } |
|
| 33 |
+ |
|
| 34 |
+ $data['authtoken'] = $config['api_token']; |
|
| 35 |
+ curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); |
|
| 36 |
+ curl_setopt($curl, CURLOPT_URL, $config['api_url'].$path.($config['debug'] ? '?debug' : '')); |
|
| 37 |
+ |
|
| 38 |
+ $response = curl_exec($curl); |
|
| 39 |
+ $err = curl_error($curl); |
|
| 40 |
+ |
|
| 41 |
+ $ret = @json_decode($response, true); |
|
| 42 |
+ if ($config['debug'] && $ret) {
|
|
| 43 |
+ echo '<pre>API response'; |
|
| 44 |
+ print_r($ret); |
|
| 45 |
+ echo '</pre>'; |
|
| 46 |
+ } |
|
| 47 |
+ if ($config['debug'] && (!isset($ret['status']) || $ret['status'] == 'error')) {
|
|
| 48 |
+ echo '<pre>API-Error-Response:'; |
|
| 49 |
+ echo $response; |
|
| 50 |
+ echo '</pre>'; |
|
| 51 |
+ } |
|
| 52 |
+ return $ret; |
|
| 53 |
+} |
|
| 54 |
+ |
|
| 55 |
+ |
| ... | ... |
@@ -0,0 +1,106 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once 'lib/api.php'; |
|
| 3 |
+session_start(); |
|
| 4 |
+ |
|
| 5 |
+$data = array("filter" => array(
|
|
| 6 |
+ "subFilterConnective" => 'OR', |
|
| 7 |
+ "subFilter" => array( |
|
| 8 |
+ array("field" => "produktionsdatum", "value" => null),
|
|
| 9 |
+ ))); |
|
| 10 |
+ |
|
| 11 |
+$auftraege = api_call('auftrag/liste', $data);
|
|
| 12 |
+ |
|
| 13 |
+$headline = 'Offene Aufträge'; |
|
| 14 |
+$content = ''; |
|
| 15 |
+ |
|
| 16 |
+$content .= '<div class="auftrag-container">'; |
|
| 17 |
+ |
|
| 18 |
+foreach ($auftraege["auftraege"] as $a) {
|
|
| 19 |
+ $name = $a['name']; |
|
| 20 |
+ if (!$name) {
|
|
| 21 |
+ $name .= $a['telefon']; |
|
| 22 |
+ } |
|
| 23 |
+ |
|
| 24 |
+ $kdname = ''; |
|
| 25 |
+ if (isset($a['kundennr'])) {
|
|
| 26 |
+ $data = array("kundennr" => $a['kundennr']);
|
|
| 27 |
+ $ret = api_call('kunde/laden', $data);
|
|
| 28 |
+ if (isset($ret['kunde'])) {
|
|
| 29 |
+ $kdname .= '#'.$ret['kunde']['kundennr'].': '; |
|
| 30 |
+ if (isset($ret['kunde']['firma'])) {
|
|
| 31 |
+ $kdname .= $ret['kunde']['firma']; |
|
| 32 |
+ } else {
|
|
| 33 |
+ $kdname .= $ret['kunde']['nachname']; |
|
| 34 |
+ if (isset($ret['kunde']['vorname'])) {
|
|
| 35 |
+ $kdname .= ', '.$ret['kunde']['vorname']; |
|
| 36 |
+ } |
|
| 37 |
+ } |
|
| 38 |
+ if (isset($ret['kunde']['ort'])) {
|
|
| 39 |
+ $kdname .= ' ('.$ret['kunde']['ort'].')';
|
|
| 40 |
+ } |
|
| 41 |
+ } |
|
| 42 |
+ } |
|
| 43 |
+ |
|
| 44 |
+ $incomplete = ''; |
|
| 45 |
+ if (! $a['status']['bestellt']) {
|
|
| 46 |
+ $incomplete = ' incomplete'; |
|
| 47 |
+ } |
|
| 48 |
+ $content .= '<div class="auftrag'.$incomplete.'"> |
|
| 49 |
+ <h4>'.$name.'</h4>'; |
|
| 50 |
+ if ($kdname) {
|
|
| 51 |
+ $content .= '<p class="kundenname">'.$kdname.'</p>'; |
|
| 52 |
+ } |
|
| 53 |
+ foreach ($a['bestellung'] as $best) {
|
|
| 54 |
+ // Evtl. Mehrere Posten in dieser Bestellung |
|
| 55 |
+ $content .= '<div class="unterauftrag">'; |
|
| 56 |
+ $obst = ''; |
|
| 57 |
+ if (count($best['gitterbox']) == 1) {
|
|
| 58 |
+ $obst .= "1 Gitterbox"; |
|
| 59 |
+ } elseif (count($best['gitterbox']) > 1) {
|
|
| 60 |
+ $obst .= count($best['gitterbox'])." Gitterboxen"; |
|
| 61 |
+ } |
|
| 62 |
+ /* Wenn wir die Gitterbox-IDs nutzen, dann sowas: |
|
| 63 |
+ foreach ($best['gitterbox'] as $g) {
|
|
| 64 |
+ $obst .= '[ GB #'.$g['id'].' ] '; |
|
| 65 |
+ } */ |
|
| 66 |
+ foreach ($best['anhaenger'] as $anh) {
|
|
| 67 |
+ if (isset($anh['kennz'])) {
|
|
| 68 |
+ $obst .= ' Anhänger <strong>'.$anh['kennz'].'</strong> '; |
|
| 69 |
+ } else {
|
|
| 70 |
+ $obst .= ' Anhänger'; |
|
| 71 |
+ } |
|
| 72 |
+ } |
|
| 73 |
+ $content .= '<p class="lieferart">'.$obst.'</p>'; |
|
| 74 |
+ // Gebrauchte |
|
| 75 |
+ if ($best['gebrauchte']) {
|
|
| 76 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>JA</strong></p>'; |
|
| 77 |
+ } else {
|
|
| 78 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>NEIN</strong></p>'; |
|
| 79 |
+ } |
|
| 80 |
+ // Neue |
|
| 81 |
+ $neue = array(); |
|
| 82 |
+ if (count($best['neue']) == 1) {
|
|
| 83 |
+ $key = array_keys($best['neue']); |
|
| 84 |
+ if ($key[0] != 'sonstiges') {
|
|
| 85 |
+ $neue[] = 'Nur/Zuerst <strong>'.$key[0].'</strong>'; |
|
| 86 |
+ } |
|
| 87 |
+ } else {
|
|
| 88 |
+ foreach ($best['neue'] as $key => $val) {
|
|
| 89 |
+ $neue[] = '<strong>'.$key.'</strong>: '.$val; |
|
| 90 |
+ } |
|
| 91 |
+ } |
|
| 92 |
+ if (isset($best['neue']['sonstiges'])) {
|
|
| 93 |
+ $neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
|
| 94 |
+ } |
|
| 95 |
+ $content .= '<div class="neue"><p>'.implode('</p><p>', $neue).'</p></div>';
|
|
| 96 |
+ if (isset($best['anmerkungen'])) {
|
|
| 97 |
+ $content .= '<div class="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</div>'; |
|
| 98 |
+ } |
|
| 99 |
+ $content .= '</div>'; // Unterauftrag |
|
| 100 |
+ } |
|
| 101 |
+ $content .= '</div>'; // auftrag |
|
| 102 |
+} |
|
| 103 |
+$content .= '</div>'; // auftrag-container |
|
| 104 |
+ |
|
| 105 |
+include "template.php"; |
|
| 106 |
+ |
| ... | ... |
@@ -0,0 +1,105 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once 'lib/api.php'; |
|
| 3 |
+session_start(); |
|
| 4 |
+ |
|
| 5 |
+$data = array("ziel" => "presse");
|
|
| 6 |
+ |
|
| 7 |
+$auftraege = api_call('auftrag/liste', $data);
|
|
| 8 |
+ |
|
| 9 |
+$previous = 'index.php'; |
|
| 10 |
+$headline = 'Aufträge an der Presse'; |
|
| 11 |
+$content = ''; |
|
| 12 |
+ |
|
| 13 |
+$content .= '<div class="navbutton"><a class="btn btn-primary" href="unbearbeitete.php">Neuen Auftrag in die Produktion holen</a></div>'; |
|
| 14 |
+ |
|
| 15 |
+$content .= '<div class="auftrag-container">'; |
|
| 16 |
+ |
|
| 17 |
+foreach ($auftraege["auftraege"] as $a) {
|
|
| 18 |
+ $name = $a['name']; |
|
| 19 |
+ if (!$name) {
|
|
| 20 |
+ $name .= $a['telefon']; |
|
| 21 |
+ } |
|
| 22 |
+ |
|
| 23 |
+ $kdname = ''; |
|
| 24 |
+ if (isset($a['kundennr'])) {
|
|
| 25 |
+ $data = array("kundennr" => $a['kundennr']);
|
|
| 26 |
+ $ret = api_call('kunde/laden', $data);
|
|
| 27 |
+ if (isset($ret['kunde'])) {
|
|
| 28 |
+ $kdname .= '#'.$ret['kunde']['kundennr'].': '; |
|
| 29 |
+ if (isset($ret['kunde']['firma'])) {
|
|
| 30 |
+ $kdname .= $ret['kunde']['firma']; |
|
| 31 |
+ } else {
|
|
| 32 |
+ $kdname .= $ret['kunde']['nachname']; |
|
| 33 |
+ if (isset($ret['kunde']['vorname'])) {
|
|
| 34 |
+ $kdname .= ', '.$ret['kunde']['vorname']; |
|
| 35 |
+ } |
|
| 36 |
+ } |
|
| 37 |
+ if (isset($ret['kunde']['ort'])) {
|
|
| 38 |
+ $kdname .= ' ('.$ret['kunde']['ort'].')';
|
|
| 39 |
+ } |
|
| 40 |
+ } |
|
| 41 |
+ } |
|
| 42 |
+ |
|
| 43 |
+ $incomplete = ''; |
|
| 44 |
+ if (! $a['status']['bestellt']) {
|
|
| 45 |
+ $incomplete = ' incomplete'; |
|
| 46 |
+ } |
|
| 47 |
+ $content .= '<div class="auftrag'.$incomplete.'"> |
|
| 48 |
+ <h4>'.$name.'</h4>'; |
|
| 49 |
+ if ($kdname) {
|
|
| 50 |
+ $content .= '<p class="kundenname">'.$kdname.'</p>'; |
|
| 51 |
+ } |
|
| 52 |
+ foreach ($a['bestellung'] as $best) {
|
|
| 53 |
+ // Evtl. Mehrere Posten in dieser Bestellung |
|
| 54 |
+ $content .= '<div class="unterauftrag">'; |
|
| 55 |
+ $obst = ''; |
|
| 56 |
+ if (count($best['gitterbox']) == 1) {
|
|
| 57 |
+ $obst .= "1 Gitterbox"; |
|
| 58 |
+ } elseif (count($best['gitterbox']) > 1) {
|
|
| 59 |
+ $obst .= count($best['gitterbox'])." Gitterboxen"; |
|
| 60 |
+ } |
|
| 61 |
+ /* Wenn wir die Gitterbox-IDs nutzen, dann sowas: |
|
| 62 |
+ foreach ($best['gitterbox'] as $g) {
|
|
| 63 |
+ $obst .= '[ GB #'.$g['id'].' ] '; |
|
| 64 |
+ } */ |
|
| 65 |
+ foreach ($best['anhaenger'] as $anh) {
|
|
| 66 |
+ if (isset($anh['kennz'])) {
|
|
| 67 |
+ $obst .= ' Anhänger <strong>'.$anh['kennz'].'</strong> '; |
|
| 68 |
+ } else {
|
|
| 69 |
+ $obst .= ' Anhänger'; |
|
| 70 |
+ } |
|
| 71 |
+ } |
|
| 72 |
+ $content .= '<p class="lieferart">'.$obst.'</p>'; |
|
| 73 |
+ // Gebrauchte |
|
| 74 |
+ if ($best['gebrauchte']) {
|
|
| 75 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>JA</strong></p>'; |
|
| 76 |
+ } else {
|
|
| 77 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>NEIN</strong></p>'; |
|
| 78 |
+ } |
|
| 79 |
+ // Neue |
|
| 80 |
+ $neue = array(); |
|
| 81 |
+ if (count($best['neue']) == 1) {
|
|
| 82 |
+ $key = array_keys($best['neue']); |
|
| 83 |
+ if ($key[0] != 'sonstiges') {
|
|
| 84 |
+ $neue[] = 'Nur/Zuerst <strong>'.$key[0].'</strong>'; |
|
| 85 |
+ } |
|
| 86 |
+ } else {
|
|
| 87 |
+ foreach ($best['neue'] as $key => $val) {
|
|
| 88 |
+ $neue[] = '<strong>'.$key.'</strong>: '.$val; |
|
| 89 |
+ } |
|
| 90 |
+ } |
|
| 91 |
+ if (isset($best['neue']['sonstiges'])) {
|
|
| 92 |
+ $neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
|
| 93 |
+ } |
|
| 94 |
+ $content .= '<div class="neue"><p>'.implode('</p><p>', $neue).'</p></div>';
|
|
| 95 |
+ if (isset($best['anmerkungen'])) {
|
|
| 96 |
+ $content .= '<div class="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</div>'; |
|
| 97 |
+ } |
|
| 98 |
+ $content .= '</div>'; // Unterauftrag |
|
| 99 |
+ } |
|
| 100 |
+ $content .= '</div>'; // auftrag |
|
| 101 |
+} |
|
| 102 |
+$content .= '</div>'; // auftrag-container |
|
| 103 |
+ |
|
| 104 |
+include "template.php"; |
|
| 105 |
+ |
| ... | ... |
@@ -0,0 +1,40 @@ |
| 1 |
+<!DOCTYPE html> |
|
| 2 |
+<html lang="de"> |
|
| 3 |
+ <head> |
|
| 4 |
+ <meta charset="utf-8"> |
|
| 5 |
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|
| 6 |
+ <meta name="viewport" content="width=device-width, initial-scale=1"> |
|
| 7 |
+ <title>Mosterei Wurst - Arbeitsplatz</title> |
|
| 8 |
+ |
|
| 9 |
+ <script src="/assets/jquery.js"></script> |
|
| 10 |
+ <script src="/assets/jquery-ui/jquery-ui.min.js"></script> |
|
| 11 |
+ <link href="/assets/jquery-ui/jquery-ui.min.css" rel="stylesheet"> |
|
| 12 |
+ <script src="/assets/fontawesome/svg-with-js/js/fontawesome-all.min.js"></script> |
|
| 13 |
+ <link href="/assets/fontawesome/svg-with-js/css/fa-svg-with-js.css" rel="stylesheet"> |
|
| 14 |
+ <script src="/assets/bootstrap/js/bootstrap.min.js"></script> |
|
| 15 |
+ <link href="/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet"> |
|
| 16 |
+ <link href="assets/style.css" rel="stylesheet"> |
|
| 17 |
+ <script src="assets/script.js"></script> |
|
| 18 |
+ <?php |
|
| 19 |
+ $f = 'assets/'.str_replace('.php','.js', $_SERVER['PHP_SELF']);
|
|
| 20 |
+ if (file_exists($f)) {
|
|
| 21 |
+ echo '<script src="'.$f.'"></script>'; |
|
| 22 |
+ } |
|
| 23 |
+ ?> |
|
| 24 |
+ </head> |
|
| 25 |
+ <body> |
|
| 26 |
+ <div id="banner" class="mb-3"> |
|
| 27 |
+ <div id="banner-back"> |
|
| 28 |
+<?php if (isset($previous)) { ?>
|
|
| 29 |
+ <a href="<?= $previous ?>"><img src="/assets/images/back.svg" width="65" height="65" alt="<"></a> |
|
| 30 |
+<?php } ?> |
|
| 31 |
+ </div> |
|
| 32 |
+ <div id="banner-headline"><h1><?= $headline ?></h1></div> |
|
| 33 |
+ <div id="banner-clear"></div> |
|
| 34 |
+ </div> |
|
| 35 |
+ <div class="container"> |
|
| 36 |
+ <?= $content ?> |
|
| 37 |
+ </div> |
|
| 38 |
+ |
|
| 39 |
+ </body> |
|
| 40 |
+</html> |
| ... | ... |
@@ -0,0 +1,107 @@ |
| 1 |
+<?php |
|
| 2 |
+require_once 'lib/api.php'; |
|
| 3 |
+session_start(); |
|
| 4 |
+ |
|
| 5 |
+$data = array("filter" => array(
|
|
| 6 |
+ "field" => "status", |
|
| 7 |
+ "value" => "%bestaetigt%", |
|
| 8 |
+ "relation" => "notlike")); |
|
| 9 |
+ |
|
| 10 |
+$auftraege = api_call('auftrag/liste', $data);
|
|
| 11 |
+ |
|
| 12 |
+$previous = 'index.php'; |
|
| 13 |
+$headline = 'Neue Aufträge annehmen'; |
|
| 14 |
+$content = ''; |
|
| 15 |
+ |
|
| 16 |
+$content .= '<div class="navbutton"><a class="btn btn-primary" href="auftrag_bestaetigen.php">Auftrag manuell erfassen</a></div>'; |
|
| 17 |
+$content .= '<div class="auftrag-container">'; |
|
| 18 |
+ |
|
| 19 |
+foreach ($auftraege["auftraege"] as $a) {
|
|
| 20 |
+ $name = $a['name']; |
|
| 21 |
+ if (!$name) {
|
|
| 22 |
+ $name .= $a['telefon']; |
|
| 23 |
+ } |
|
| 24 |
+ |
|
| 25 |
+ $kdname = ''; |
|
| 26 |
+ if (isset($a['kundennr'])) {
|
|
| 27 |
+ $data = array("kundennr" => $a['kundennr']);
|
|
| 28 |
+ $ret = api_call('kunde/laden', $data);
|
|
| 29 |
+ if (isset($ret['kunde'])) {
|
|
| 30 |
+ $kdname .= '#'.$ret['kunde']['kundennr'].': '; |
|
| 31 |
+ if (isset($ret['kunde']['firma'])) {
|
|
| 32 |
+ $kdname .= $ret['kunde']['firma']; |
|
| 33 |
+ } else {
|
|
| 34 |
+ $kdname .= $ret['kunde']['nachname']; |
|
| 35 |
+ if (isset($ret['kunde']['vorname'])) {
|
|
| 36 |
+ $kdname .= ', '.$ret['kunde']['vorname']; |
|
| 37 |
+ } |
|
| 38 |
+ } |
|
| 39 |
+ if (isset($ret['kunde']['ort'])) {
|
|
| 40 |
+ $kdname .= ' ('.$ret['kunde']['ort'].')';
|
|
| 41 |
+ } |
|
| 42 |
+ } |
|
| 43 |
+ } |
|
| 44 |
+ |
|
| 45 |
+ $incomplete = ''; |
|
| 46 |
+ if (! $a['status']['bestellt']) {
|
|
| 47 |
+ $incomplete = ' incomplete'; |
|
| 48 |
+ } |
|
| 49 |
+ $content .= '<a class="auftrag'.$incomplete.'" href="auftrag_bestaetigen.php?handle='.$a['handle'].'"> |
|
| 50 |
+ <h4>'.$name.'</h4>'; |
|
| 51 |
+ if ($kdname) {
|
|
| 52 |
+ $content .= '<p class="kundenname">'.$kdname.'</p>'; |
|
| 53 |
+ } |
|
| 54 |
+ foreach ($a['bestellung'] as $best) {
|
|
| 55 |
+ // Evtl. Mehrere Posten in dieser Bestellung |
|
| 56 |
+ $content .= '<div class="unterauftrag">'; |
|
| 57 |
+ $obst = ''; |
|
| 58 |
+ if (count($best['gitterbox']) == 1) {
|
|
| 59 |
+ $obst .= "1 Gitterbox"; |
|
| 60 |
+ } elseif (count($best['gitterbox']) > 1) {
|
|
| 61 |
+ $obst .= count($best['gitterbox'])." Gitterboxen"; |
|
| 62 |
+ } |
|
| 63 |
+ /* Wenn wir die Gitterbox-IDs nutzen, dann sowas: |
|
| 64 |
+ foreach ($best['gitterbox'] as $g) {
|
|
| 65 |
+ $obst .= '[ GB #'.$g['id'].' ] '; |
|
| 66 |
+ } */ |
|
| 67 |
+ foreach ($best['anhaenger'] as $anh) {
|
|
| 68 |
+ if (isset($anh['kennz'])) {
|
|
| 69 |
+ $obst .= ' Anhänger <strong>'.$anh['kennz'].'</strong> '; |
|
| 70 |
+ } else {
|
|
| 71 |
+ $obst .= ' Anhänger'; |
|
| 72 |
+ } |
|
| 73 |
+ } |
|
| 74 |
+ $content .= '<p class="lieferart">'.$obst.'</p>'; |
|
| 75 |
+ // Gebrauchte |
|
| 76 |
+ if ($best['gebrauchte']) {
|
|
| 77 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>JA</strong></p>'; |
|
| 78 |
+ } else {
|
|
| 79 |
+ $content .= '<p class="gebrauchte">Gebrauchte Kartons: <strong>NEIN</strong></p>'; |
|
| 80 |
+ } |
|
| 81 |
+ // Neue |
|
| 82 |
+ $neue = array(); |
|
| 83 |
+ if (count($best['neue']) == 1) {
|
|
| 84 |
+ $key = array_keys($best['neue']); |
|
| 85 |
+ if ($key[0] != 'sonstiges') {
|
|
| 86 |
+ $neue[] = 'Nur/Zuerst <strong>'.$key[0].'</strong>'; |
|
| 87 |
+ } |
|
| 88 |
+ } else {
|
|
| 89 |
+ foreach ($best['neue'] as $key => $val) {
|
|
| 90 |
+ $neue[] = '<strong>'.$key.'</strong>: '.$val; |
|
| 91 |
+ } |
|
| 92 |
+ } |
|
| 93 |
+ if (isset($best['neue']['sonstiges'])) {
|
|
| 94 |
+ $neue[] = '<em>'.$best['neue']['sonstiges'].'</em>'; |
|
| 95 |
+ } |
|
| 96 |
+ $content .= '<div class="neue"><p>'.implode('</p><p>', $neue).'</p></div>';
|
|
| 97 |
+ if (isset($best['anmerkungen'])) {
|
|
| 98 |
+ $content .= '<div class="anmerkungen">'.htmlspecialchars($best['anmerkungen']).'</div>'; |
|
| 99 |
+ } |
|
| 100 |
+ $content .= '</div>'; // Unterauftrag |
|
| 101 |
+ } |
|
| 102 |
+ $content .= '</a>'; // auftrag |
|
| 103 |
+} |
|
| 104 |
+$content .= '</div>'; // auftrag-container |
|
| 105 |
+ |
|
| 106 |
+include "template.php"; |
|
| 107 |
+ |
|
| 0 | 108 |