if ($fa) { foreach ($fa["gruppen"] as $row) { $gruppen .= $row["grpname"] . "<br>"; } } $i = $fa["termbegin"] >= 0 && $fa["termbegin"] <= 23 ? $fa["termbegin"] : 8; $j = $fa["termend"] >= 0 && $fa["termend"] <= 23 && $fa["termend"] > $fa["termbegin"] ? $fa["termend"] : 19; $tbeg = ''; $tend = ''; for ($z = 0; $z < 24; $z++) { $tbeg .= "<option value={$z}" . ($i == $z ? " selected" : "") . ">{$z}"; $tend .= "<option value={$z}" . ($j == $z ? " selected" : "") . ">{$z}"; } $jahr = date("Y"); $re = getReJahr($fa["id"], $jahr, false, true); $an = getAngebJahr($fa["id"], $jahr, false, true); $IMG = getLastYearPlot($re, $an, false); $t->set_var(array('IMG' => $IMG, 'login' => $fa["login"], 'name' => $fa["name"], 'addr1' => $fa["addr1"], 'addr2' => $fa["addr2"], 'addr3' => $fa["addr3"], 'uid' => $fa["id"], 'homephone' => $fa["homephone"], 'workphone' => $fa["workphone"], 'notes' => $fa["notes"], 'mailsign' => $fa["mailsign"], 'email' => $fa["email"], 'msrv' => $fa["msrv"], 'port' => $fa["port"], 'mailuser' => $fa["mailuser"], 'kennw' => $fa["kennw"], 'postf' => $fa["postf"], 'postf2' => $fa["postf2"], 'protopop' => $fa["proto"] == "f" ? "checked" : "", 'protoimap' => $fa["proto"] == "t" ? "checked" : "", 'sql_error' => $fa["sql_error"] == "t" ? ",#sql_error" : "", 'php_error' => $fa["php_error"] == "t" ? ",#php_error" : "", 'ssl' . $fa["ssl"] => "checked", 'mandsig' . $fa['mandsig'] => 'checked', 'interv' => $fa["interv"], 'pre' => $fa["pre"], 'kdviewli' . $fa["kdviewli"] => "selected", 'kdviewre' . $fa["kdviewre"] => "selected", 'searchtab' . $fa["searchtab"] => "selected", 'abteilung' => $fa["abteilung"], 'position' => $fa["position"], 'termbegin' => $tbeg, 'termend' => $tend, 'termseq' => $fa["termseq"] ? $fa["termseq"] : 30, 'GRUPPE' => $gruppen, 'DATUM' => date('d.m.Y'), 'icalext' => $fa["icalext"], 'icaldest' => $fa["icaldest"], 'icalart' . $fa["icalart"] => "selected", 'preon' => $fa["preon"] ? ",#preon" : "", 'streetview' => $fa['streetview'], 'planspace' => $fa['planspace'], 'feature_ac' => $fa['feature_ac'] == 't' ? ',#feature_ac' : '', 'feature_ac_minlength' => $fa['feature_ac_minlength'], 'feature_ac_delay' => $fa['feature_ac_delay'], 'angebot_button' => $fa['angebot_button'] == 't' ? ',#angebot_button' : '', 'auftrag_button' => $fa['auftrag_button'] == 't' ? ',#auftrag_button' : '', 'rechnung_button' => $fa['rechnung_button'] == 't' ? ',#rechnung_button' : '', 'liefer_button' => $fa['liefer_button'] == 't' ? ',#liefer_button' : '', 'zeige_extra' => $fa['zeige_extra'] == 't' ? ',#zeige_extra' : '', 'zeige_dhl' => $fa['zeige_dhl'] == 't' ? ',#zeige_dhl' : '', 'external_mail' => $fa['external_mail'] == 't' ? ',#external_mail' : '', 'zeige_karte' => $fa['zeige_karte'] == 't' ? ',#zeige_karte' : '', 'zeige_etikett' => $fa['zeige_etikett'] == 't' ? ',#zeige_etikett' : '', 'zeige_tools' => $fa['zeige_tools'] == 't' ? ',#zeige_tools' : '', 'zeige_bearbeiter' => $fa['zeige_bearbeiter'] == 't' ? ',#zeige_bearbeiter' : '', 'feature_unique_name_plz' => $fa['feature_unique_name_plz'] == 't' ? ',#feature_unique_name_plz' : '', 'zeige_lxcars' => $fa['zeige_lxcars'] == 't' ? ',#zeige_lxcars' : '', 'tinymce' => $fa['tinymce'] == 't' ? ',#tinymce' : '', 'streetview_default' => $fa['streetview_default'] == 't' ? ',#streetview_default' : '', 'search_history' => $fa['search_history'])); if ($own) { $t->set_block("usr1", "Selectbox", "Block"); $select = !empty($fa["vertreter"]) ? $fa["vertreter"] : $fa["id"]; $user = getAllUser(array(0 => true, 1 => "")); if ($user) { foreach ($user as $zeile) { if ($zeile['id'] != $_SESSION['loginCRM']) { $t->set_var(array('Sel' => $select == $zeile["id"] ? " selected" : "", 'vertreter' => $zeile["id"], 'vname' => $zeile["name"] != '' ? $zeile['name'] : $zeile['login'])); $t->parse("Block", "Selectbox", true); } } } $t->set_block("usr1", "SelectboxB", "BlockB");
$link3 .= '&jahr=' . $jahr; $JahrV = $jahr + 1; } $JahrZ = $jahr - 1; if (isset($_GET['monat'])) { if (substr($_GET['monat'], -4) == 'Jahr') { $reM = getReMonat($_GET['fid'], $jahr, '00', $Q == 'V' ? true : false); } else { $reM = getReMonat($_GET['fid'], substr($_GET['monat'], 3, 4), substr($_GET['monat'], 0, 2), $Q == 'V' ? true : false); } $t->set_file(array('fa1' => 'firma3a.tpl')); $IMG = ''; } else { $top = getTopParts($fid); $re = getReJahr($fid, $jahr, $Q == 'V' ? true : false); $an = getAngebJahr($fid, $jahr, $Q == 'V' ? true : false); $t->set_file(array('fa1' => 'firma3.tpl')); $IMG = getLastYearPlot($re, $an, $ll); $monat = ''; } doHeader($t); $t->set_var(array('Q' => $Q, 'FAART' => $Q == 'C' ? '.:Customer:.' : '.:Vendor:.', 'FID' => $fid, 'kdnr' => $fa['nummer'], 'Link1' => $link1, 'Link2' => $link2, 'Link3' => $link3, 'Link4' => $link4, 'Name' => $name, 'Plz' => $plz, 'Ort' => $ort, 'IMG' => $IMG, 'JAHR' => $jahr, 'JAHRV' => $JahrV, 'JAHRZ' => $JahrZ, 'JAHRVTXT' => $JahrV > 0 ? '.:later:.' : '', 'Monat' => $monat)); if ($re) { $t->set_block('fa1', 'Liste', 'Block'); $i = 0; $monate = array_keys($re); for ($i = 0; $i < 13; $i++) { $colr = array_shift($re); $cola = array_shift($an); $val = array('Month' => substr($monate[$i], 4, 2) . '/' . substr($monate[$i], 0, 4), 'Rcount' => $colr['count'], 'RSumme' => sprintf('%01.2f', $colr['summe']), 'ASumme' => sprintf('%01.2f', $cola['summe']), 'Curr' => $colr['curr']); $t->set_var($val);