include "inc/crmLib.php"; include "inc/FirmenLib.php"; $nr = $_GET["nr"]; $id = $_GET["id"]; $Q = $_GET['Q']; $Doc = substr($id, 0, 1); $id = substr($id, 1); $menu = $_SESSION['menu']; $tmp = getRechParts($id, $Doc); if ($Doc == 'R') { $curr = getCurrCompany($id, 'I'); } else { if ($Doc == 'V') { $curr = getCurrCompany($id, 'E'); } else { $curr = getCurrCompany($id, ''); } } $curr = $curr['name']; $adr = getRechAdr($id, $Doc); if ($adr["shiptoname"]) { $NAME = $adr["shiptoname"]; } else { $NAME = $adr["name"]; } if ($adr["shiptostreet"]) { $STRASSE = $adr["shiptostreet"]; } else { $STRASSE = $adr["street"]; } if ($adr["shiptocity"]) {
function getOneTT($id, $event = true) { $sql = "select t.*,v.name as vname,c.name as cname from timetrack t "; $sql .= "left join customer c on c.id=t.fid "; $sql .= "left join vendor v on v.id=t.fid "; $sql .= "where t.id = {$id}"; $rs = $_SESSION['db']->getOne($sql); $rs["name"] = $rs["tab"] == "C" ? $rs["cname"] : $rs["vname"]; $rs["startdate"] = db2date($rs["startdate"]); $rs["stopdate"] = db2date($rs["stopdate"]); $curr = getCurrCompany($rs['fid'], $rs['tab']); $rs['cur'] = $curr['name']; if ($event) { $rs["events"] = getTTEvents($id, "o", false); } return $rs; }
$evids = "and t.id in (" . implode(",", $_POST["clear"]) . ") "; } $msg = mkTTorder($_POST["tid"], $evids, $_POST['order']); $data = getOneTT($_POST["tid"]); $data["msg"] = $msg; } else { $data["msg"] = ".:missing:. .:customer:."; } } else { $data = getOneTT($_POST["tid"]); $data["msg"] = ".:clrok:."; } } else { unset($data); if ($data['fid']) { $curr = getCurrCompany($data['fid'], $data['tab']); $data["cur"] = $curr['name']; } else { $data["cur"] = getCurr(); } $data["active"] = "t"; } } } } } } } } if ($data["events"]) { $delete = False;