function upload() { global $charset; $x = 0; $q = db_select("select kodenr,beskrivelse from grupper where art='DG' order by kodenr", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $gruppe[$x] = $r['kodenr']; $gruppebeskr[$x] = $r['beskrivelse']; $x++; } print "<tr><td width=100% align=center><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody>"; print "<tr><td colspan=\"2\">Denne funktion importerer ordrer fra en tabulatorsapareret fil til ordrer</td></tr>"; print "<tr><td colspan=\"2\">Filen skal have følgende format:</td></tr>"; $txt = HtmlEntities("Kundenr<tab>Ordrenr<tab>Dato<tab>Projekt<tab>Telefon<tab>Navn<tab>Adresse1<tab>Adresse2<tab>Postnr<tab>Bynavn<tab>Email<tab>Varenummer<tab>Varenavn<tab>Antal<tab>Pris", ENT_COMPAT, $charset); $txt .= "<br>" . HtmlEntities("Hvis kundenummer ikke eksisterer i forvejen, oprettes en ny kunde i den valgte debitorgruppe.", ENT_COMPAT, $charset); $txt .= "<br>" . HtmlEntities("Hvis der ikke er angivet varenummer søges efter vare med samme navn. Hvis denne ikke findes, indsættes linjen som kommentar.", ENT_COMPAT, $charset); print "<tr><td colspan=\"2\">{$txt}<br></td></tr>"; print "<tr><td colspan=\"2\"><hr></td></tr>"; print "<form enctype=\"multipart/form-data\" action=\"csv2ordre.php\" method=\"POST\">"; print "<tr><td width=\"150px\">Debitorgruppe</td><td align=\"right\"><select name=\"gruppe\" style=\"width:150px\">\n"; for ($x = 0; $x < count($gruppe); $x++) { print "<option value=\"{$gruppe[$x]}\">{$gruppe[$x]} {$gruppebeskr[$x]}</option>\n"; } print "</select></span></td></tr>"; print "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"900000\">"; print "<tr><td colspan=\"2\"><hr></td></tr>"; print "<tr><td> Vælg datafil:</td><td><input name=\"uploadedfile\" type=\"file\"></td></tr>"; print "<tr><td colspan=\"2\"><hr></td></tr>"; print "<tr><td colspan=\"2\" align=center><input type=\"submit\" value=\"Hent\"value=\"Godkend\" onclick=\"javascript:return confirm('Importer ordrer?')\"></td></tr>"; print "</form>"; print "</tbody></table>"; print "</td></tr>"; }
Function OutputDebug($message) { $message.="\n"; if ($this->html_debug) $message = str_replace("\n", "<br />\n", HtmlEntities($message)); echo $message; flush(); }
</head> <body onload="<?php echo $onload; ?> " bgcolor="#cccccc"> <center><h1>Test for Manuel Lemos' PHP form class using the linked select plug-in input</h1></center> <hr /> <?php if ($doit) { $continent = $form->GetInputValue("continent"); $country = $form->GetInputValue("country"); $location = $form->GetInputValue("location"); ?> <center><h2>The chosen location is <?php echo HtmlEntities($locations[$country][$location]), " (", HtmlEntities($countries[$continent][$country]), ", ", HtmlEntities($continents[$continent]), ")"; ?> </h2></center> <?php } else { $form->StartLayoutCapture(); $title = "Linked select plug-in test"; $body_template = "form_linked_select_body.html.php"; include "templates/form_frame.html.php"; $form->EndLayoutCapture(); $form->DisplayOutput(); } ?> <hr /> </body> </html>
?> <h2><center>The file was uploaded.</center></h2> <center><table> <tr> <th align="right">Uploaded file path:</th> <td><tt><?php echo $userfile_values["tmp_name"]; ?> </tt></td> </tr> <tr> <th align="right">Client file name:</th> <td><tt><?php echo HtmlEntities($userfile_values["name"]); ?> </tt></td> </tr> <tr> <th align="right">File type:</th> <td><tt><?php echo $userfile_values["type"]; ?> </tt></td> </tr> <tr> <th align="right">File size:</th> <td><tt><?php
$email_message->SetEncodedHeader("Subject",$multibyte_subject); $email_message->AddPlainTextPart($multibyte_body); $error=$email_message->Send(); if(strlen($error)==0) { echo "<center><h2>Message sent.</h2></center>\n"; echo "<center><table border=\"1\">\n"; echo "<tr>\n<th>From:</th>\n<td>$from_name <$from_address></td>\n</tr>\n"; echo "<tr>\n<th>To:</th>\n<td>$to_name <$to_address></td>\n</tr>\n"; echo "<tr>\n<th>Subject:</th>\n<td>$multibyte_subject</td>\n</tr>\n"; echo "<tr>\n<th valign=\"top\">Body:</th>\n<td>".nl2br($multibyte_body)."</td>\n</tr>\n"; echo "</table></center>\n"; } else echo "<center><h2>Error: ".HtmlEntities($error)."</h2></center>\n"; } else { echo "<form method=\"POST\" action=\"$PHP_SELF\">\n"; echo "<center><table>\n"; echo "<tr>\n<th>From:</th>\n<td><input type=\"text\" name=\"from_name\" value=\"$from_name\"> <<input type=\"text\" name=\"from_address\" value=\"$from_address\">></td>\n</tr>\n"; echo "<tr>\n<th>To:</th>\n<td><input type=\"text\" name=\"to_name\" value=\"$to_name\"> <<input type=\"text\" name=\"to_address\" value=\"$to_address\">></td>\n</tr>\n"; echo "<tr>\n<th>Subject:</th>\n<td><input type=\"text\" name=\"multibyte_subject\" value=\"$multibyte_subject\"></td>\n</tr>\n"; echo "<tr>\n<th valign=\"top\">Body:</th>\n<td><textarea cols=\"75\" rows=\"10\" name=\"multibyte_body\">$multibyte_body</textarea></td>\n</tr>\n"; echo "<tr><td colspan=\"2\"><center><input type=\"submit\" name=\"send\" value=\"Send message\"></center></td>\n</tr>\n"; echo "</table></center>\n"; echo "</form>\n"; } echo "<hr />\n</body>\n</html>\n"; ?>
function SetKey(&$form, $encrypted, $format) { if (strlen($error = $form->GetInputEventURL($this->input, "getimage", array($this->image_parameter => $encrypted), $image_url))) { return $error; } $this->valid_marks["data"]["image"] = "<img alt=\"CAPTCHA image\" width=\"" . $this->image_width . "\" height=\"" . $this->image_height . "\"" . (strlen($this->image_align) ? " align=\"" . $this->image_align . "\"" : "") . (strlen($this->verification_style) ? " style=\"" . $this->verification_style . "\"" : "") . (strlen($this->verification_class) ? " class=\"" . $this->verification_class . "\"" : "") . " src=\"" . HtmlEntities($image_url) . "\" />"; if (strlen($error = $form->SetInputValue($this->validation, $encrypted))) { return $error; } return $this->DefaultSetInputProperty($form, "Format", $format); }
function httpClientPost($url, $paramters) { //$url='https://login.yahoo.com/config/login?'; //$url="https://accounts.google.com/ServiceLogin"; //log echo '<br/> httpClient $url: '. $url ; //log echo '<br/> httpClient $paramters: ' ; //log var_dump($paramters); $resultbody; set_time_limit(0); $http = new http_class(); $http->timeout = 0; $http->data_timeout = 0; $http->debug = 0; $http->html_debug = 1; //$url="https://login.yahoo.com/config/login"; if ($this->isDebug) { echo "<br/>url:" . $url; echo "<br/>arguments:<br/>"; var_dump($paramters); } $error = $http->GetRequestArguments($url, $arguments); $arguments["RequestMethod"] = "POST"; //$arguments['Protocol']='https'; //$arguments['HostName']='login.yahoo.com'; //$arguments['HostPort']='443'; //$arguments['RequestMethod']='POST'; $arguments['PostValues'] = $paramters; /* $arguments["PostValues"]=array( "somefield"=>"Upload forms", "MAX_FILE_SIZE"=>"1000000" ); $arguments["PostFiles"]=array( "userfile"=>array( "Data"=>"This is just a plain text attachment file named attachment.txt .", "Name"=>"attachment.txt", "Content-Type"=>"automatic/name", ), "anotherfile"=>array( "FileName"=>"test_http_post.php", "Content-Type"=>"automatic/name", ) ); $arguments["Referer"]="http://www.alltheweb.com/"; */ if ($this->isDebug) { echo "<H2><LI>Opening connection to:</H2>\n<PRE>", HtmlEntities($arguments["HostName"]), "</PRE>\n"; echo '<br/> <b>$arguments: </b><br/> '; var_dump($arguments); } flush(); $error = $http->Open($arguments); if ($this->isDebug) { echo "<br/><br/>http->open:" . $error . "<br/>"; } if ($error == "") { $error = $http->SendRequest($arguments); if ($this->isDebug) { echo "<br/>[http->SendRequest:" . $error . "]<br/><br/>"; } if ($error == "") { //log echo "<H2><LI>Request:</LI</H2>\n<PRE>\n".HtmlEntities($http->request)."</PRE>\n"; //log echo "<H2><LI>Request headers:</LI</H2>\n<PRE>\n"; for (Reset($http->request_headers), $header = 0; $header < count($http->request_headers); Next($http->request_headers), $header++) { $header_name = Key($http->request_headers); if (GetType($http->request_headers[$header_name]) == "array") { for ($header_value = 0; $header_value < count($http->request_headers[$header_name]); $header_value++) { //log echo $header_name.": ".$http->request_headers[$header_name][$header_value],"\r\n"; } } else { //log echo $header_name.": ".$http->request_headers[$header_name],"\r\n"; } } //log echo "</PRE>\n"; if ($this->isDebug) { echo "<H4><LI>HTTP Request body:</LI></H4>error_code:\n" . $http->error_code . "<br/><PRE>request_body:\n" . HtmlEntities($http->request_body) . "</PRE>\n"; } flush(); $headers = array(); $error = $http->ReadReplyHeaders($headers); if ($error == "") { //log echo "<H2><LI>Response headers:</LI</H2>\n<PRE>\n"; for (Reset($headers), $header = 0; $header < count($headers); Next($headers), $header++) { $header_name = Key($headers); if (GetType($headers[$header_name]) == "array") { for ($header_value = 0; $header_value < count($headers[$header_name]); $header_value++) { if ($this->isDebug) { echo "http header:" . $header_name . ": " . $headers[$header_name][$header_value], "\r\n"; } } } else { if ($this->isDebug) { echo $header_name . ": " . $headers[$header_name], "\r\n"; } } } //log echo "</PRE>\n"; flush(); //log echo "<H2><LI>Response body:</LI</H2>\n<PRE>\n"; for (;;) { $error = $http->ReadReplyBody($body, 1000); if ($error != "" || strlen($body) == 0) { break; } //log echo HtmlSpecialChars($body); $this->httpResponseStatus = $http->response_status; $resultbody = $body; if ($this->isDebug) { echo "<br/>http-> get response_status: " . $http->response_status . "<br/> "; echo "<br/>http-> get body: " . $resultbody . "<br/> "; } } //log echo "</PRE>\n"; flush(); } } $http->Close(); } if (strlen($error)) { if ($this->isDebug) { echo " <H4>POST Error: ", $error, "</H4> "; } } return $resultbody; }
$form->METHOD = 'POST'; $form->ACTION = ''; $form->InvalidCLASS = 'invalid'; $form->ShowAllErrors = 0; $form->debug = 'trigger_error'; $form->AddInput(array('TYPE' => 'checkbox', 'ID' => 'condition', 'NAME' => 'condition', 'CHECKED' => 1, 'LABEL' => '<u>V</u>alidate', 'ACCESSKEY' => 'V')); $form->AddInput(array('TYPE' => 'text', 'ID' => 'dependent', 'NAME' => 'dependent', 'LABEL' => '<u>D</u>ependent', 'ACCESSKEY' => 'D', 'ValidateAsNotEmpty' => 1, 'ValidationErrorMessage' => 'It was not entered a value in the dependent field.', 'DependentValidation' => 'condition')); $form->AddInput(array('TYPE' => 'submit', 'VALUE' => 'Submit', 'NAME' => 'doit')); $form->LoadInputValues($form->WasSubmitted('doit')); $verify = array(); if ($form->WasSubmitted('doit')) { if (($error_message = $form->Validate($verify)) == '') { $doit = 1; } else { $doit = 0; $error_message = HtmlEntities($error_message); } } else { $error_message = ''; $doit = 0; } if (!$doit) { $form->ConnectFormToInput('dependent', 'ONLOAD', 'Focus', array()); } $onload = HtmlSpecialChars($form->PageLoad()); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test for Manuel Lemos' PHP form class for dependent validation</title> <style type="text/css"><!--
?> <h2><center>The file was uploaded.</center></h2> <center><table> <tr> <th align="right">Uploaded file path:</th> <td><tt><?php echo $userfile_values['tmp_name']; ?> </tt></td> </tr> <tr> <th align="right">Client file name:</th> <td><tt><?php echo HtmlEntities($userfile_values['name']); ?> </tt></td> </tr> <tr> <th align="right">File type:</th> <td><tt><?php echo $userfile_values['type']; ?> </tt></td> </tr> <tr> <th align="right">File size:</th> <td><tt><?php
/** * This function is used to send and receive data via GET/POST methods. * @param string $strRequestData * @return string * @access protected */ function SendDataAndGetResponse($strRequestData) { $http = new HTTP(); if ($this->useOpenSSL) { $http->use_openssl = 1; } $strResponseData = ""; $strTempURL = $this->url; //POST Method if ($this->request_method == "POST") { $postValues = array("xmldata" => $strRequestData); } else { $strTempURL .= "?xmldata=" . urlencode($strRequestData); } //Connect $error = $this->ConnectToPosnetSystem($strTempURL, $postValues, $http, $arguments); if ($error == "") { if ($this->debug) { echo "<H2><LI>Sending request for page:</H2>\n<PRE>"; echo HtmlEntities($arguments["RequestURI"]), "\n"; } if ($this->debug) { echo "</PRE>\n"; } flush(); //Send $error = $http->SendRequest($arguments); if ($error == "") { if ($this->debug) { echo "<H2><LI>Request:</LI</H2>\n<PRE>\n" . HtmlEntities($http->request) . "</PRE>\n"; } flush(); $headers = array(); //Read Response Headers $error = $http->ReadReplyHeaders($headers); if ($error == "") { if ($this->debug) { echo "<H2><LI>Response status code:</LI</H2>\n<P>" . $http->response_status; } switch ($http->response_status) { case "301": case "302": case "303": case "307": echo " (redirect to <TT>" . $headers["location"] . "</TT>)<BR>\nSet the <TT>follow_redirect</TT> variable to handle redirect responses automatically."; break; } if ($this->debug) { echo "</P>\n"; } flush(); //Read Response Body for (;;) { $error = $http->ReadReplyBody($body, 2000); if (strlen($body) == 0) { break; } $strResponseData .= $body; } flush(); } } $http->Close(); } if (strlen($error)) { $this->error = $error; if ($this->debug) { echo "<CENTER><H2>Error: ", $error, "</H2></CENTER>\n"; } return ""; } return $strResponseData; }
function EscapeSpecialCharacters($string) { if (GetType($string) != "string") { $string = strval($string); } for ($escaped = "", $character = 0; $character < strlen($string); $character++) { switch ($string[$character]) { case "\"": case ">": case "<": case "&": $escaped .= HtmlEntities($string[$character]); break; default: $code = Ord($string[$character]); if ($code < 32 || $code > 127) { $escaped .= "&#{$code};"; break; } $escaped .= $string[$character]; break; } } return $escaped; }
function test($email) { echo "<tr><td>" . HtmlEntities($email) . "</td>"; echo "<td>" . (is_valid_email_address($email) ? 'Yes' : 'No') . "</td></tr>"; }
function ordreside($id, $regnskab) { # print "<!--Function ordreside start-->"; global $art; global $bgcolor; global $bgcolor5; global $bogfor; global $bruger_id; global $brugsamletpris; global $brugsamletpris; global $brugernavn; global $bruttosum; global $bruttosaetsum; global $charset; global $db_encode; global $db_id; global $difkto; global $fokus; global $fakturadate; global $fakturadato; global $genfakt; global $hurtigfakt; global $incl_moms; global $oio; global $omkunde; global $ordresum; global $procentfakt; global $procenttillag; global $procentvare; global $returside; global $rvid; global $rvnr; global $samlet_pris; global $samlet_rabat; global $samlet_rabatpct; global $sprog_id; global $sprog; global $submit; global $svnr; global $varenr; global $vis_projekt; global $vis_saet; #20150306 varenr $id *= 1; $r = db_fetch_array(db_select("select * from ordrer where id='{$id}'", __FILE__ . " linje " . __LINE__)); $sag_id = $r['sag_id'] * 1; if ($sag_id) { $returside = urlencode("../sager/sager.php?funktion=vis_sag&sag_id={$sag_id}&konto_id={$konto_id}"); } if (!$returside) { if ($popup) { $returside = "../includes/luk.php"; } else { $returside = "ordreliste.php"; } } $addr1 = NULL; $addr2 = NULL; $batchvare = NULL; $betalingsbet = NULL; $betalingsdage = NULL; $bynavn = NULL; $debitorkort = NULL; $dbsum = NULL; $dkantal = NULL; $cvrnr = NULL; $ean = NULL; $email = NULL; $felt_1 = NULL; $felt_2 = NULL; $felt_3 = NULL; $felt_4 = NULL; $felt_5 = NULL; $firmanavn = NULL; $institution = NULL; $ko_ant = array(); $kontakt = NULL; $kontakt_tlf = NULL; $konto_id = NULL; $kontonr = NULL; $kostsum = NULL; $kred_ord_id = NULL; $krediteret = NULL; $kundeordnr = NULL; $land = NULL; $levdato = NULL; $levdiff = NULL; $lev_addr1 = NULL; $lev_addr2 = NULL; $lev_bynavn = NULL; $lev_kontakt = NULL; $lev_max = NULL; $lev_navn = NULL; $lev_postnr = NULL; $lev_pbs = NULL; $lev_pbs_nr = NULL; $linjebg = NULL; $mail_fakt = NULL; $momsfri = NULL; $momssats = NULL; $momssum = NULL; $oio_fakt = NULL; $ordredato = NULL; $ordrenr = NULL; $pbs_nr = NULL; $postnr = NULL; $prev_id = NULL; $reserveret = NULL; $status = NULL; $tidl_lev = NULL; $udskriv_til = NULL; $valutakurs = NULL; $vis_lev_addr = NULL; $y = NULL; if (!$id) { $fokus = 'kontonr'; } if ($id) { $query = db_select("select * from ordrer where id = '{$id}'", __FILE__ . " linje " . __LINE__); $row = db_fetch_array($query); $konto_id = $row['konto_id'] * 1; $kontonr = HtmlEntities($row['kontonr'], ENT_COMPAT, $charset); $firmanavn = HtmlEntities($row['firmanavn'], ENT_COMPAT, $charset); $addr1 = HtmlEntities($row['addr1'], ENT_COMPAT, $charset); $addr2 = HtmlEntities($row['addr2'], ENT_COMPAT, $charset); $postnr = HtmlEntities($row['postnr'], ENT_COMPAT, $charset); $bynavn = HtmlEntities($row['bynavn'], ENT_COMPAT, $charset); $land = HtmlEntities($row['land'], ENT_COMPAT, $charset); $kontakt = HtmlEntities($row['kontakt'], ENT_COMPAT, $charset); $kontakt_tlf = HtmlEntities($row['kontakt_tlf'], ENT_COMPAT, $charset); $kundeordnr = HtmlEntities($row['kundeordnr'], ENT_COMPAT, $charset); $lev_navn = HtmlEntities($row['lev_navn'], ENT_COMPAT, $charset); $lev_addr1 = HtmlEntities($row['lev_addr1'], ENT_COMPAT, $charset); $lev_addr2 = HtmlEntities($row['lev_addr2'], ENT_COMPAT, $charset); $lev_postnr = HtmlEntities($row['lev_postnr'], ENT_COMPAT, $charset); $lev_bynavn = HtmlEntities($row['lev_bynavn'], ENT_COMPAT, $charset); $lev_kontakt = HtmlEntities($row['lev_kontakt'], ENT_COMPAT, $charset); $vis_lev_addr = $row['vis_lev_addr']; $felt_1 = HtmlEntities($row['felt_1'], ENT_COMPAT, $charset); $felt_2 = HtmlEntities($row['felt_2'], ENT_COMPAT, $charset); $felt_3 = HtmlEntities($row['felt_3'], ENT_COMPAT, $charset); $felt_4 = HtmlEntities($row['felt_4'], ENT_COMPAT, $charset); $felt_5 = HtmlEntities($row['felt_5'], ENT_COMPAT, $charset); $cvrnr = $row['cvrnr']; $ean = HtmlEntities($row['ean'], ENT_COMPAT, $charset); $institution = HtmlEntities($row['institution'], ENT_COMPAT, $charset); $email = HtmlEntities($row['email'], ENT_COMPAT, $charset); $mail_fakt = $row['mail_fakt']; $udskriv_til = $row['udskriv_til']; $mail_bilag = $row['mail_bilag']; #20131122 tilføj $mail_bilag til visning $betalingsbet = trim($row['betalingsbet']); $betalingsdage = $row['betalingsdage']; $valuta = $row['valuta']; $valutakurs = $row['valutakurs'] * 1; if (!$valutakurs) { $valutakurs = 100; } $projekt[0] = $row['projekt']; $formularsprog = $row['sprog']; $pbs = $row['pbs']; $afd = $row['afd']; $sum = $row['sum']; $moms = $row['moms']; $ref = trim(HtmlEntities($row['ref'], ENT_COMPAT, $charset)); $fakturanr = HtmlEntities($row['fakturanr'], ENT_COMPAT, $charset); $lev_adr = HtmlEntities($row['lev_adr'], ENT_COMPAT, $charset); $ordrenr = $row['ordrenr']; $kred_ord_id = $row['kred_ord_id'] * 1; $restordre = $row['restordre']; if ($row['ordredate']) { $ordredate = $row['ordredate']; } else { $ordredate = date("y-m-d"); } $ordredato = dkdato($ordredate); if ($row['levdate']) { $levdato = dkdato($row['levdate']); } if ($row['fakturadate']) { $fakturadate = $row['fakturadate']; $fakturadato = dkdato($row['fakturadate']); } if ($row['nextfakt']) { $genfakt = dkdato($row['nextfakt']); } $momssats = $row['momssats']; $procenttillag = $row['procenttillag'] * 1; $status = $row['status']; if (!$status) { $status = 0; } $kontonr = $row['kontonr']; $art = $row['art']; $mail_subj = HtmlEntities($row['mail_subj'], ENT_COMPAT, $charset); $mail_text = HtmlEntities(str_replace("<br>", "\n", $row['mail_text']), ENT_COMPAT, $charset); $dokument = $row['dokument']; $sag_id = $row['sag_id'] * 1; $sagsnr = $row['sagsnr'] * 1; $tilbudnr = $row['tilbudnr']; $datotid = $row['datotid']; $nr = $row['nr'] * 1; if (!$returside && $row['returside']) { $returside = $row['returside']; } $row['omvbet'] ? $omkunde = 'on' : ($omkunde = ''); # if ($brugernavn && !$ref) $ref=$brugernavn; #flyttet til efter 'ikke faktureret' # if ($returside=='../includes/luk.php' && !$popup) $returside=''; $x = 0; $krediteret = ''; $q = db_select("select art,pbs_nr,pbs from adresser where art = 'S' or id = '{$konto_id}'", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if ($r['art'] == 'S') { $lev_pbs_nr = $r['pbs_nr']; $lev_pbs = $r['pbs']; } else { $pbs_nr = $r['pbs_nr']; } } $query = db_select("select id,ordrenr from ordrer where kred_ord_id = '{$id}'", __FILE__ . " linje " . __LINE__); while ($row2 = db_fetch_array($query)) { $x++; if ($x > 1) { $krediteret = $krediteret . ","; } $krediteret = $krediteret . "<a href=\"ordre.php?id={$row2['id']}\">{$row2['ordrenr']}</a>"; } if ($status < 3) { if (substr($fokus, 0, 4) != 'dkan' && substr($fokus, 0, 4) != 'pris') { $fokus = 'vare0'; } #20151019 } else { $fokus = ''; } } else { $r = db_fetch_array(db_select("select ansatte.navn as ref,ansatte.afd as afd from ansatte,brugere where ansatte.id = " . nr_cast("brugere.ansat_id") . " and brugere.brugernavn='{$brugernavn}'", __FILE__ . " linje " . __LINE__)); $ref = $r['ref']; $afd = $r['afd']; } $afd *= 1; $afd_navn = NULL; if ($r = db_fetch_array(db_select("select beskrivelse from grupper where art = 'AFD' and kodenr = '{$afd}'", __FILE__ . " linje " . __LINE__))) { $afd_navn = $r['beskrivelse']; } ($r = db_fetch_array(db_select("select * from grupper where ART = 'bilag' and (box6 ='on' or (box1 !='' and box2 !='' and box3 !=''))", __FILE__ . " linje " . __LINE__))) ? $bilag = 1 : ($bilag = 0); if (db_fetch_array(db_select("select * from grupper where art = 'DIV' and kodenr = '2' and box7='on'", __FILE__ . " linje " . __LINE__))) { $url = "jobkort.php?returside=ordre.php&konto_id={$konto_id}&ordre_id={$id}"; $jobkort = "<a href={$url} style=\"text-decoration:none\"><input type=\"button\" style=\"width:75px\" value=\"jobkort\" onClick=\"window.navigate('{$url}')\"></a>"; $url = "debitorkort.php?returside=ordre.php&konto_id={$konto_id}&ordre_id={$id}"; $debitorkort = "<a href={$url} style=\"text-decoration:none\"><input type=\"button\" style=\"width:75px\" value=\"debitorkort\" onClick=\"window.navigate('{$url}')\"></a>"; } else { $jobkort = NULL; } #cho "procentfakt $procentfakt $default_procenttillag<br>"; ######### pile ########## tilfoejet 20080210 if ($status == 0) { $tmp = "tilbud"; } elseif ($status >= 3) { $tmp = "faktura"; } else { $tmp = "ordrer"; } #cho "$status select box1 from grupper where art = 'OLV' and kodenr = '$bruger_id' and kode='$tmp'<br>\n"; $r = db_fetch_array(db_select("select box1 from grupper where art = 'OLV' and kodenr = '{$bruger_id}' and kode='{$tmp}'", __FILE__ . " linje " . __LINE__)); $ordreliste = explode(",", $r['box1']); $x = 0; $next_id = 0; while ($ordreliste[$x]) { if ($ordreliste[$x] == $id) { if (isset($ordreliste[$x - 1])) { $prev_id = $ordreliste[$x - 1]; } else { $prev_id = NULL; } if (isset($ordreliste[$x + 1])) { $next_id = $ordreliste[$x + 1]; } else { $next_id = NULL; } } $x++; } ######### elip ########## if ($art == 'DK') { $query = db_select("select ordrenr from ordrer where id = '{$kred_ord_id}'", __FILE__ . " linje " . __LINE__); $row2 = db_fetch_array($query); if ($kred_ord_id) { sidehoved($id, "{$returside}", "", "", "Kunde kreditnota {$ordrenr} (kreditering af ordre nr: <a href=\"ordre.php?id={$kred_ord_id}\">{$row2['ordrenr']}</a>)"); } else { sidehoved($id, "{$returside}", "", "", "Kunde kreditnota {$ordrenr}"); } } elseif ($krediteret) { sidehoved($id, "{$returside}", "", "", "Kundeordre {$ordrenr} ( krediteret på KN nr: {$krediteret} )"); } else { if ($returside == "ordreliste.php") { sidehoved($id, "{$returside}", "", "", "Kundeordre {$ordrenr} - {$temp}"); } else { sidehoved($id, "{$returside}", "", "", "Kundeordre {$ordrenr} - {$temp}"); } } if (!$status) { $status = 0; } if ($status >= 3) { print "<form name=\"ordre\" id=\"1\" action=\"ordre.php?id={$id}&sag_id={$sag_id}&returside={$returside}\" method=\"post\">\n"; print "<input type=\"hidden\" name=\"ordrenr\" value=\"{$ordrenr}\">"; print "<input type=\"hidden\" name=\"status\" value=\"{$status}\">"; print "<input type=\"hidden\" name=\"id\" value=\"{$id}\">"; print "<input type=\"hidden\" name=\"art\" value=\"{$art}\">"; print "<input type=\"hidden\" name=\"kred_ord_id\" value=\"{$kred_ord_id}\">\n"; print "<input type=\"hidden\" name=\"konto_id\" value=\"{$konto_id}\">"; print "<input type=\"hidden\" name=\"kontonr\" value=\"{$kontonr}\">"; print "<input type=\"hidden\" name=\"firmanavn\" value=\"{$firmanavn}\">"; print "<input type=\"hidden\" name=\"addr1\" value=\"{$addr1}\">"; print "<input type=\"hidden\" name=\"addr2\" value=\"{$addr2}\">"; print "<input type=\"hidden\" name=\"postnr\" value=\"{$postnr}\">"; print "<input type=\"hidden\" name=\"bynavn\" value=\"{$bynavn}\">"; print "<input type=\"hidden\" name=\"land\" value=\"{$land}\">"; print "<input type=\"hidden\" name=\"kontakt\" value=\"{$kontakt}\">"; print "<input type=\"hidden\" name=\"kontakt_tlf\" value=\"{$kontakt_tlf}\">"; print "<input type=\"hidden\" name=\"kundeordnr\" value=\"{$kundeordnr}\">\n"; print "<input type=\"hidden\" name=\"lev_navn\" value=\"{$lev_navn}\">"; print "<input type=\"hidden\" name=\"lev_addr1\" value=\"{$lev_addr1}\">"; print "<input type=\"hidden\" name=\"lev_addr2\" value=\"{$lev_addr2}\">"; print "<input type=\"hidden\" name=\"lev_postnr\" value=\"{$lev_postnr}\">"; print "<input type=\"hidden\" name=\"lev_bynavn\" value=\"{$lev_bynavn}\">"; print "<input type=\"hidden\" name=\"lev_kontakt\" value=\"{$lev_kontakt}\">"; print "<input type=\"hidden\" name=\"levdato\" value=\"{$levdato}\">\n"; print "<input type=\"hidden\" name=\"genfakt\" value=\"{$genfakt}\">"; print "<input type=\"hidden\" name=\"cvrnr\" value=\"{$cvrnr}\">"; print "<input type=\"hidden\" name=\"ean\" value=\"{$ean}\">"; print "<input type=\"hidden\" name=\"institution\" value=\"{$institution}\">"; print "<input type=\"hidden\" name=\"email\" value=\"{$email}\">"; # print "<input type=\"hidden\" name=\"mail_fakt\" value=\"$mail_fakt\">"; print "<input type=\"hidden\" name=\"betalingsbet\" value=\"{$betalingsbet}\">"; print "<input type=\"hidden\" name=\"betalingsdage\" value=\"{$betalingsdage}\">"; print "<input type=\"hidden\" name=\"momssats\" value=\"" . dkdecimal($momssats) . "\">"; print "<input type=\"hidden\" name=\"procenttillag\" value=\"" . dkdecimal($procenttillag) . "\">"; print "<input type=\"hidden\" name=\"ref\" value=\"{$ref}\">"; print "<input type=\"hidden\" name=\"fakturanr\" value=\"{$fakturanr}\">"; print "<input type=\"hidden\" name=\"lev_adr\" value=\"{$lev_adr}\">"; print "<input type=\"hidden\" name=\"valuta\" value=\"{$valuta}\">"; print "<input type=\"hidden\" name=\"valutakurs\" value=\"{$valutakurs}\">"; print "<input type=\"hidden\" name=\"projekt[0]\" value=\"{$projekt['0']}\">"; #20130816 print "<input type=\"hidden\" name=\"sprog\" value=\"{$formularsprog}\">"; print "<input type=\"hidden\" name=\"pbs\" value=\"{$pbs}\">"; print "<input type=\"hidden\" name=\"afd\" value=\"{$afd}\">"; print "<input type=\"hidden\" name=\"sum\" value=\"{$sum}\">"; print "<input type=\"hidden\" name=\"sag_id\" value=\"{$sag_id}\">"; print "<input type=\"hidden\" name=\"sagsnr\" value=\"{$sagsnr}\">"; print "<input type=\"hidden\" name=\"tilbudnr\" value=\"{$tilbudnr}\">"; print "<input type=\"hidden\" name=\"datotid\" value=\"{$datotid}\">"; print "<input type=\"hidden\" name=\"nr\" value=\"{$nr}\">"; print "<input type=\"hidden\" name=\"returside\" value=\"{$returside}\">"; print "<input type=\"hidden\" name=\"omkunde\" value=\"{$omkunde}\">"; if ($mail_fakt) { $mail_fakt = "checked"; } ##### pile ######## tilfoejet 20080210 $alerttekst = findtekst(154, $sprog_id); $spantekst = findtekst(198, $sprog_id); print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"0\" width=\"100%\" valign = \"top\"><tbody>\n"; #Tabel 1 -> if ($prev_id) { print "<tr><td width=\"50%\" title=\"{$spantekst}\"><a href=\"javascript:confirmClose('ordre.php?id={$prev_id}&returside={$returside}','{$alerttekst}')\"><img src=\"../ikoner/left.png\" style=\"border: 0px solid; width: 15px; height: 15px;\"></a></span></td>\n"; } else { print "<tr><td width=\"50%\"></td>\n"; } $spantekst = findtekst(199, $sprog_id); if ($next_id) { print "<td width=\"50%\" align=\"right\" title=\"{$spantekst}\"><a href=\"javascript:confirmClose('ordre.php?id={$next_id}&returside={$returside}','{$alerttekst}')\"><img src=\"../ikoner/right.png\" style=\"border: 0px solid; width: 15px; height: 15px;\"></a></span></td></tr>\n"; } else { print "<tr><td width=\"50%\"></td>\n"; } print "</tbody></table>\n"; # <- Tabel 1 ##### pile ######## print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"1\" valign = \"top\"><tbody>\n"; #Tabel 2 -> $ordre_id = $id; print "<tr><td width=\"31%\" valign=\"top\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"; #Tabel 2.1 -> print "<tr><td width=\"100\"><b>Kontonr</b></td><td width=\"100\">{$kontonr}</td></tr>\n"; print "<tr><td><b>Firmanavn</b></td><td>{$firmanavn}</td></tr>\n"; print "<tr><td><b>Adresse</b></td><td>{$addr1}</td></tr>\n"; print "<tr><td></td><td>{$addr2}</td></tr>\n"; print "<tr><td><b>Postnr & by</b></td><td>{$postnr} {$bynavn}</td></tr>\n"; print "<tr><td><b>Land</b></td><td>{$land}</td></tr>\n"; print "<tr><td><b>Att.</b></td><td>{$kontakt}</td></tr>\n"; print "<tr><td><b>Ordrenr.</b></td><td>{$kundeordnr}</td></tr>\n"; print "<tr><td><b>CVR-nr.</b></td><td>{$cvrnr}</td></tr>\n"; print "<tr><td><b>EAN-nr.</b></td><td>{$ean}</td></tr>\n"; print "<tr><td><b>Institution</b></td><td>{$institution}</td></tr>\n"; print "</tbody></table></td>\n"; # <- Tabel 2.1 print "<td width=\"38%\" valign=\"top\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"; #Tabel 2.2 -> $alerttekst = 'Husk at opdatere ved at klikke på [OK] til højre for feltet du har ændret!'; print "<tr><td><b>E-mail</b></td><td width=\"105\"><input class=\"inputbox\" type=\"text\" name=\"email\" style=\"width:130px\" value=\"{$email}\" onchange=\"javascript:this.form.submit()\"></td></tr>\n"; # print "<tr><td><b>Edskriv til</b></td>" # if ($email) print "<tr><td title=\"Vælg på hvilken måde dokumentet skal udskrives, gemmes eller sendes.\"><b>Udskriv til</b></td>\n"; if ($mail_fakt) { $udskriv_til = "email"; } # if ($oioxml) $udskriv_til="oioxml"; if ($oioubl) { $udskriv_til = "oioubl"; } if ($lev_pbs_nr) { if ($pbs) { $udskriv_til = "PBS"; } } if (!$udskriv_til) { $udskriv_til = "PDF"; } print "<td><select class=\"inputbox\" name=\"udskriv_til\" onchange=\"this.form.submit()\">\n"; /* print "<option>$udskriv_til</option>\n"; if ($udskriv_til!="PDF") print "<option>PDF</option>\n"; if ($udskriv_til!="email" && $email) print "<option>email</option>\n"; if ($udskriv_til!="oioxml" && strlen($ean)==13) print "<option title=\"Kun ved fakturering/kreditering.\">oioxml</option>\n"; print "</SELECT></td></tr>\n"; */ print "<option>{$udskriv_til}</option>\n"; if ($udskriv_til != "PDF") { print "<option>PDF</option>\n"; } if ($udskriv_til != "PDF-tekst") { print "<option title=\"Udskrives som PDF uden baggrund\">PDF-tekst</option>\n"; } if ($udskriv_til != "email") { print "<option title=\"Sendes som PDF via e-mail\">email</option>\n"; } # if ($udskriv_til!="oioxml") print "<option title=\"Kun ved fakturering/kreditering.\">oioxml</option>\n"; #PHR 20090803 if (($pbs || $lev_pbs_nr) && $udskriv_til != "PBS") { print "<option value=\"PBS\">PBS</option>\n"; } if ($udskriv_til != "oioubl") { print "<option title=\"Kun ved fakturering/kreditering.\">oioubl</option>\n"; } #PHR 20090803 # if ($udskriv_til!="edifakt") print "<option title=\"Kun ved fakturering/kreditering.\">edifakt</option>\n"; #20140201 $tmp = $pbs_nr * 1; # 20120822 if ($lev_pbs_nr) { if ($tmp == 'L') { if ($pbs) { print "<option value=\"PBS\">PBS</option>\n"; } elseif ($tmp && $udskriv_til != "PBS" && $lev_pbs == 'B') { print "<option title=\"Opkræves via PBS betalingsservice\">PBS</option>\n"; } } } if ($udskriv_til != "historik" && db_fetch_array(db_select("select * from grupper where ART = 'bilag' and (box6 ='on' or (box1 !='' and box2 !='' and box3 !=''))", __FILE__ . " linje " . __LINE__))) { print "<option title=\"Gem en kopi og vedhæft kundens historik\">historik</option>\n"; } print "</SELECT>"; /* print "<tr><td><b>Fakt som mail</td><td><input class=\"inputbox\" type=\"checkbox\" name=\"mail_fakt\" $mail_fakt></td></tr>\n"; if ($lev_pbs_nr) { if ($pbs == "FI") $pbs_fi='checked'; elseif ($pbs == "BS") $pbs_bs='checked'; $title="PBS udsender FI-indbetalingskort"; if (!$pbs_bs) { print "<td colspan=\"2\" title=\"$title\">Faktura via PBS (FI)</td><td title=\"$title\"><input class=\"inputbox\" type=\"checkbox\" name=\"pbs_fi\" $pbs_fi onchange=\"javascript:docChange = true;\"></td></tr>\n"; if ($pbs_nr && !$pbs_fi) print "<tr>\n"; } $title="Opkræves via PBS's betalingsservice"; if ($pbs_nr && !$pbs_fi) print "<td colspan=\"2\" title=\"$title\">Opkræv via PBS (BS)</td><td title=\"$title\"><input class=\"inputbox\" type=\"checkbox\" name=\"pbs_bs\" \"$pbs_bs\" onchange=\"javascript:docChange = true;\"></td></tr>\n"; } else print "</tr>\n"; */ print "<tr><td width=\"100\"><b>Ordredato</b></td><td width=\"100\">{$ordredato}</td></tr>\n"; print "<tr><td><b>Leveringsdato</b></td><td>{$levdato}</td></tr>\n"; print "<tr><td><b>Fakturadato</b></td><td>{$fakturadato}</td></tr>\n"; print "<tr><td><b>Genfaktureres</b></td><td><input class=\"inputbox\" type=\"text\" name=\"genfakt\" size=\"7\" value=\"{$genfakt}\"><input type=\"submit\" value=\"OK\" name=\"submit\"></td></tr>\n"; print "<tr><td><b>Betaling</b></td><td>{$betalingsbet} + {$betalingsdage}</td>\n"; print "<tr><td><b>Vor ref.</b></td><td>{$ref} {$afd_navn}</td></tr>\n"; print "<tr><td><b>Fakturanr</b></td><td>{$fakturanr}</td></tr>\n"; $tmp = dkdecimal($valutakurs); if ($valuta) { print "<tr><td><b>Valuta / Kurs</b></td><td>{$valuta} / {$tmp}</td></tr>\n"; } if ($projekt[0]) { print "<tr><td><b>Projekt</b></td><td>{$projekt['0']}</td></tr>\n"; } print "</tbody></table></td>\n"; # <- Tabel 2.2 print "<td width=\"31%\" valign=\"top\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" valign=\"top\">\n"; #Tabel 2.3 -> if ($vis_lev_addr) { print "<tr><td><b>Leveringsadresse</b><br /> </td><td align=\"center\">{$jobkort} {$debitorkort}</td></tr>\n"; print "<tr><td colspan=\"2\"><b><hr></b></tr>\n"; print "<tr><td><b>Firmanavn</b></td><td colspan=\"2\">{$lev_navn}</td></tr>\n"; print "<tr><td valign=\"top\"><b>Adresse</b></td><td colspan=\"2\">{$lev_addr1}</td></tr>\n"; print "<tr><td></td><td colspan=\"2\">{$lev_addr2}</td></tr>\n"; print "<tr><td><b>Postnr. & by</b></td><td>{$lev_postnr} {$lev_bynavn}</td></tr>\n"; print "<tr><td><b>Att.</b></td><td colspan=\"2\">{$lev_kontakt}</td></tr>\n"; print "<tr><td colspan=\"2\"><b><hr></b></tr>\n"; print "<tr><td colspan=\"2\"><a href=\"ordre.php?id={$id}&returside={$returside}&vis_lev_addr=0\">Vis ekstrafelter</tr>\n"; } else { print "<tr><td><b>" . findtekst(243, $sprog_id) . "</b></td><td align=\"center\">{$jobkort} {$debitorkort}</td></tr>\n"; print "<tr><td colspan=\"2\"><b><hr></b></tr>\n"; if ($vis_saet) { print "<tr><td><b>{$felt_1}</b></td><td align=\"right\">" . dkdecimal($felt_2) . "</td></tr>"; print "<tr><td><b>{$felt_3}</b></td><td align=\"right\">" . dkdecimal($felt_4) . "</td></tr>"; } else { if (findtekst(244, $sprog_id)) { print "<tr><td><b>" . findtekst(244, $sprog_id) . "</b></td><td>{$felt_1}</td></tr>\n"; } if (findtekst(245, $sprog_id)) { print "<tr><td><b>" . findtekst(245, $sprog_id) . "</b></td><td>{$felt_2}</td></tr>\n"; } if (findtekst(246, $sprog_id)) { print "<tr><td><b>" . findtekst(246, $sprog_id) . "</b></td><td>{$felt_3}</td></tr>\n"; } if (findtekst(247, $sprog_id)) { print "<tr><td><b>" . findtekst(247, $sprog_id) . "</b></td><td>{$felt_4}</td></tr>\n"; } if (findtekst(248, $sprog_id)) { print "<tr><td><b>" . findtekst(248, $sprog_id) . "</b></td><td>{$felt_5}</td></tr>\n"; } } print "<tr><td colspan=\"2\"><b><hr></b></tr>\n"; print "<tr><td colspan=\"2\"><a href=\"ordre.php?id={$id}&returside={$returside}&vis_lev_addr=1\">Vis leveringsadresse</td></tr>\n"; } $lev_max = 0; $q = db_select("select lev_nr from batch_salg where ordre_id = {$id}", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if ($r['lev_nr'] > $lev_max) { $lev_max = $r['lev_nr']; } } if ($lev_max > 0) { print "<tr><td colspan=\"2\"> </td></tr>\n"; for ($levnr = 1; $levnr <= $lev_max; $levnr++) { print "<tr><td colspan=\"2\"> <a href='udskriftsvalg.php?id={$id}&valg={$levnr}&formular=3'>Følgeseddel {$levnr}</a></td></tr>\n"; } } if (!$formularsprog) { $formularsprog = 'Dansk'; } $art == 'DO' ? $form_nr = 4 : ($form_nr = 5); $q = db_select("select * from formularer where formular='{$form_nr}' and art='5' and lower(sprog)='" . strtolower($formularsprog) . "'", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if ($r['xa'] == '1') { $std_subj = $r['beskrivelse']; } elseif ($r['xa'] == '2') { $std_txt_title = $r['beskrivelse']; } list($std_txt, $tmp) = explode("<br>", $std_txt_title); $mail_text ? $std_txt_title = $mail_text : ($std_txt_title = str_replace("<br>", "", $std_txt_title)); } print "</tbody></table></td></tr>\n"; # -< Tabel 2.3 if ($udskriv_til == 'email') { print "<tr><td align=\"center\" colspan=\"3\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tbody>\n"; #Tabel 2.4 -> print "<tr><td width=\"120px\">Mail emne</td><td><input class=\"inputbox\" type=\"text\" style=\"width:1000px;\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_subj\" placeholder=\"{$std_subj}\" value=\"{$mail_subj}\" onchange=\"javascript:docChange = true;\"></td>"; if ($bilag) { if ($dokument) { print "<td title=\"klik her for at åbne bilaget: {$dokument}\"><a href=\"../includes/bilag.php?kilde=ordrer&filnavn={$dokument}&bilag_id={$id}&bilag={$dokument}&kilde_id={$id}\"><img style=\"border: 0px solid\" alt=\"clip_m_papir\" src=\"../ikoner/paper.png\"></a></td>"; } else { print "<td title=\"klik her for at vedhæfte et bilag\"><a href=\"../includes/bilag.php?kilde=ordrer&bilag_id={$id}&bilag={$dokument}&ny=ja&kilde_id={$id}\"><img style=\"border: 0px solid\" alt=\"clip\" src=\"../ikoner/clip.png\"></a></td>"; } } print "</tr><tr><td valign=\"top\">Mail tekst</td><td title=\"{$std_txt_title}\">"; if ($mail_text) { print "<textarea style=\"width:1000px;\" rows=\"2\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_text\" onchange=\"javascript:docChange = true;\">{$mail_text}</textarea>\n"; } else { print "<input class=\"inputbox\" type=\"text\" style=\"width:1000px;\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_text\" placeholder=\"{$std_txt}\" value=\"{$mail_text}\" onchange=\"javascript:docChange = true;\">"; } print "</td><td><input type=\"submit\" value=\"OK\" name=\"opdat_mailtext\"></td></tr></tbody></table></td></tr>\n"; # <- Tabel 2.4 } print "<tr><td align=\"center\" colspan=\"3\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" width=\"100%\"><tbody>\n"; #Tabel 2.5 -> //print "<tr><td colspan=\"7\"></td></tr>\n<tr>\n"; # udkommenteret 20140502 print "<td align=\"center\"><b>Pos.</b></td><td align=\"center\"><b>Varenr.</b></td><td align=\"center\"><b>Antal</b></td><td align=\"center\"><b>Enhed</b></td><td align=\"center\"><b>Beskrivelse</b></td><td align=\"center\"><b>Pris</b></td><td align=\"center\"><b>Rabat</b></td>\n"; # print "<td align=\"center\"><b>Pos.</b></td><td align=\"center\"><b>Varenr.</b></td><td align=\"center\"><b>Antal</b></td><td align=\"center\"><b>Enhed</b></td><td align=\"center\"><b>Beskrivelse</b></td><td align=\"center\"><b>Pris</b></td><td align=\"center\"><b>Rabat</b></td>"; if ($procentfakt) { print "<td align=\"center\"><b>Procent</b></td>\n"; } print "<td align=\"center\"><b>I alt</b></td>\n"; if (db_fetch_array(db_select("select * from grupper where art = 'PRJ' order by kodenr", __FILE__ . " linje " . __LINE__))) { $vis_projekt = 'on'; } if ($vis_projekt && !$projekt[0]) { print "<td align=\"center\" title=\"Projektnummer. Vises for ordrelinjer tilknyttet et projekt.\"><b>Proj.</b></td>\n"; } # else //print "<td></td>\n"; # udkommenteret 20140502 if ($genfakt) { print "<td align=\"center\" title=\"Når dette felt er afmærket udelades ordrelinjen ved genfakturering.\"><b>kdo</b></td>\n"; } if ($omkunde) { print "<td align=\"center\" title =\"Hvis feltet vises er kunden underlagt reglerne for omvendt betalingspligt. Er varen afmærkeret er der ikke opkrævet moms for den pågældende vare.\"><b>O/B</b></td>"; } print "</tr>\n"; $x = 0; $k_sum = 0; if (!$ordre_id) { $ordre_id = 0; } $query = db_select("select * from ordrelinjer where ordre_id = '{$ordre_id}' order by posnr", __FILE__ . " linje " . __LINE__); while ($row = db_fetch_array($query)) { if ($row['posnr'] > 0) { $x++; $linje_id[$x] = $row['id']; $vare_id[$x] = $row['vare_id']; $posnr[$x] = $x; $varenr[$x] = HtmlEntities($row['varenr'], ENT_COMPAT, $charset); $lev_varenr[$x] = HtmlEntities($row['lev_varenr'], ENT_COMPAT, $charset); $beskrivelse[$x] = HtmlEntities($row['beskrivelse'], ENT_COMPAT, $charset); $enhed[$x] = HtmlEntities($row['enhed'], ENT_COMPAT, $charset); $pris[$x] = $row['pris'] * 1; $rabat[$x] = $row['rabat'] * 1; $rabatart[$x] = $row['rabatart']; $procent[$x] = $row['procent']; $antal[$x] = $row['antal']; $momsfri[$x] = $row['momsfri']; $varemomssats[$x] = $row['momssats']; $folgevare[$x] = $row['folgevare']; $saet[$x] = $row['saet']; $samlevare[$x] = $row['samlevare']; $fast_db[$x] = $row['fast_db']; $row['omvbet'] ? $omvbet[$x] = 'checked' : ($omvbet[$x] = ''); #omvendt betalingspligt if (!$varemomssats[$x] || $varemomssats[$x] > $momssats) { $varemomssats[$x] = $momssats; } if ($momsfri[$x] || $omvbet[$x]) { $varemomssats[$x] = 0; } $serienr[$x] = HtmlEntities($row['serienr'], ENT_COMPAT, $charset); $kostpris[$x] = $row['kostpris']; $k_sum += $kostpris[$x] * $antal[$x]; $projekt[$x] = $row['projekt']; $omvbet[$x] = $row['omvbet']; $lev_varenr[$x] = $row['lev_varenr']; $row['kdo'] ? $kdo[$x] = 'checked' : ($kdo[$x] = ''); #/* if (!$brugsamletpris) { if ($vare_id[$x]) { list($koordpr, $koordnr, $koordant, $koordid, $koordart) = explode(chr(9), find_kostpris($vare_id[$x], $linje_id[$x])); $kobs_ordre_pris = explode(",", $koordpr); $ko_ant[$x] = count($kobs_ordre_pris); $kobs_ordre_id = explode(",", $koordid); $kobs_ordre_antal = explode(",", $koordant); $kobs_ordre_art = explode(",", $koordart); $kostpris[$x] = 0; for ($y = 0; $y < $ko_ant[$x]; $y++) { $kostpris[$x] += $kobs_ordre_pris[$y]; if ($valutakurs && $valutakurs != 100) { $kostpris[$x] *= 100 / $valutakurs; } } $kostpris[$x] /= $ko_ant[$x]; #20141023 #cho "Kost3 $kostpris[$x]<br>"; $kostsum[$x] = $kostpris[$x] * $antal[$x]; #cho "Kost4 $kostsum[$x]<br>"; # db_modify("update ordrelinjer set kostpris='$kostpris[$x]' where id='$linje_id[$x]'",__FILE__ . " linje " . __LINE__); $db[$x] = ($pris[$x] - $kostpris[$x]) * $antal[$x]; #cho "DB $db[$x]=($pris[$x]-$kostpris[$x])*$antal[$x]<br>"; if ($pris[$x] != 0) { $dg[$x] = $db[$x] * 100 / $pris[$x]; } else { $dg[$x] = 0; } $dk_db[$x] = dkdecimal($db[$x]); $dk_dg[$x] = dkdecimal($dg[$x]); #cho "$dk_db[$x] $dk_dg[$x]<br>"; } } if ($art == 'DK' && $antal[$x] < 0) { $bogfor == 0; } if ($serienr[$x]) { $serienumre[$x] = NULL; $q2 = db_select("select serienr from serienr where salgslinje_id='{$linje_id[$x]}' order by serienr", __FILE__ . " linje " . __LINE__); while ($r2 = db_fetch_array($q2)) { $serienumre[$x] ? $serienumre[$x] .= ',' . $r['serienr'] : ($serienumre[$x] = $r['serienr']); } } #*/ if ($brugsamletpris && $linje_id[$x]) { db_modify("update ordrelinjer set posnr='{$x}' where id = '{$linje_id[$x]}'", __FILE__ . " linje " . __LINE__); } } } $linjeantal = $x; print "<input type=\"hidden\" name=\"linjeantal\" value=\"{$x}\">\n"; $totalrest = 0; for ($x = 1; $x <= $linjeantal; $x++) { if (!$vare_id[$x]) { $query = db_select("select id from varer where varenr = '{$varenr[$x]}'", __FILE__ . " linje " . __LINE__); if ($row = db_fetch_array($query)) { $vare_id[$x] = $row['id']; } } if ($varenr[$x] && $vare_id[$x]) { $row = db_fetch_array(db_select("select gruppe,provisionsfri from varer where id = '{$vare_id[$x]}'", __FILE__ . " linje " . __LINE__)); $provisionsfri[$x] = $row['provisionsfri']; $row = db_fetch_array(db_select("select box8,box9 from grupper where art='VG' and kodenr='{$row['gruppe']}'", __FILE__ . " linje " . __LINE__)); $row['box8'] == 'on' ? $lagervare = 1 : ($lagervare = 0); $row['box9'] == 'on' ? $batchvare = 1 : ($batchvare = 0); if ($rabatart[$x] == 'amount') { $ialt = ($pris[$x] - $rabat[$x]) * $antal[$x]; } else { $ialt = ($pris[$x] - $pris[$x] / 100 * $rabat[$x]) * $antal[$x]; } if ($provisionsfri[$x]) { if ($art == 'DO') { $kostsum[$x] = $ialt; } } # if ($valutakurs)$kostsum[$x]*=$valutakurs/100; #20140116 $db[$x] = $ialt - $kostsum[$x]; $ialt = afrund($ialt, 3); if ($ialt != 0) { $dg[$x] = $db[$x] * 100 / $ialt; $dk_dg[$x] = dkdecimal($dg[$x]); } $dk_kostpris[$x] = dkdecimal($kostpris[$x]); if ($art == 'DO') { $dk_db[$x] = dkdecimal($db[$x]); $dk_kostsum[$x] = dkdecimal($kostsum[$x]); } else { $dk_db[$x] = dkdecimal($db[$x] * -1); $dk_kostsum[$x] = dkdecimal($kostsum[$x] * -1); } $dkpris = dkdecimal($pris[$x]); $rabat[$x] ? $dkrabat = dkdecimal($rabat[$x], 3) : ($dkrabat = NULL); $dkprocent = dkdecimal($procent[$x]); if ($momsfri[$x] != 'on' && !$omvbet[$x]) { if ($incl_moms) { $dkpris = dkdecimal($pris[$x] + $pris[$x] * $varemomssats[$x] / 100); } } if ($antal[$x]) { if ($art == 'DK') { $dkantal[$x] = dkdecimal($antal[$x] * -1); } else { $dkantal[$x] = dkdecimal($antal[$x]); } if (substr($dkantal[$x], -1) == '0') { $dkantal[$x] = substr($dkantal[$x], 0, -1); } if (substr($dkantal[$x], -1) == '0') { $dkantal[$x] = substr($dkantal[$x], 0, -2); } } if ($saet[$x] || $rvnr || $lev_varenr[$x]) { $dkrabat = NULL; if ($lev_varenr[$x]) { $dkpris = NULL; } } } else { $antal[$x] = ''; $dkpris = ''; $dkrabat = ''; $dkprocent = ''; $ialt = ''; } $title = var2str($beskrivelse[$x], $id, $posnr[$x], $varenr[$x], $dkantal[$x], $enhed[$x], $dkpris, $dkprocent, $serienr[$x], $varemomssats[$x], $rabat[$x]); print "<tr bgcolor=\"{$linjebg}\">\n"; print "<input type=\"hidden\" name=\"linje_id[{$x}]\" value=\"{$linje_id[$x]}\">\n"; print "<input type=\"hidden\" name=\"posn{$x}\" value=\"{$posnr[$x]}\"><td align=\"right\">{$posnr[$x]}</td>\n"; print "<input type=\"hidden\" name=\"vare{$x}\" value=\"{$varenr[$x]}\"><td>{$varenr[$x]}<br></td>\n"; print "<input type=\"hidden\" name=\"dkan{$x}\" value=\"{$dkantal[$x]}\"><td align=\"right\">{$dkantal[$x]}<br></td>\n"; print "<input type=\"hidden\" name=\"enhed[{$x}]\" value=\"{$enhed[$x]}\"><td align=\"right\">{$enhed[$x]}<br></td>\n"; print "<input type=\"hidden\" name=\"beskrivelse{$x}\" value=\"{$beskrivelse[$x]}\"><td title=\"{$title}\">" . str_replace("\n", "<br>", $beskrivelse[$x]) . " </td>\n"; print "<input type=\"hidden\" name=\"pris{$x}\" value=\"" . dkdecimal($pris[$x], 3) . "\"><td align=\"right\" title=\"Kostpris {$dk_kostpris[$x]}\">{$dkpris}<br></td>\n"; # print "<input type=\"hidden\" name=\"pris$x\" value=\"$dkpris\"><td align=\"right\">$dkpris<br></td>\n"; print "<input type=\"hidden\" name=\"raba{$x}\" value=\"" . dkdecimal($rabat[$x], 3) . "\"><td align=\"right\">{$dkrabat}<br></td>\n"; print "<input type=\"hidden\" name=\"proc{$x}\" value=\"{$dkprocent}\">"; if ($procentfakt) { print "<td align=\"right\">{$dkprocent}<br></td>\n"; } print "<input type=\"hidden\" name=\"serienr[{$x}]\" value=\"{$serienr[$x]}\">\n"; print "<input type=\"hidden\" name=\"vare_id[{$x}]\" value=\"{$vare_id[$x]}\">\n"; print "<input type=\"hidden\" name=\"lev_varenr[{$x}]\" value=\"{$lev_varenr[$x]}\">\n"; print "<input type=\"hidden\" name=\"kdo[{$x}]\" value=\"{$kdo[$x]}\">\n"; print "<input type=\"hidden\" name=\"rabatart[{$x}]\" value=\"{$rabatart[$x]}\">\n"; print "<input type=\"hidden\" name=\"momsfri[{$x}]\" value=\"{$momsfri[$x]}\">\n"; print "<input type=\"hidden\" name=\"varemomssats[{$x}]\" value=\"{$varemomssats[$x]}\">\n"; print "<input type=\"hidden\" name=\"samlevare[{$x}]\" value=\"{$samlevare[$x]}\">\n"; print "<input type=\"hidden\" name=\"folgevare[{$x}]\" value=\"{$folgevare[$x]}\">\n"; print "<input type=\"hidden\" name=\"omvbet[{$x}]\" value=\"{$omvbet[$x]}\">\n"; print "<input type=\"hidden\" name=\"saet[{$x}]\" value=\"{$saet[$x]}\">\n"; print "<input type=\"hidden\" name=\"fast_db[{$x}]\" value=\"{$fast_db[$x]}\">\n"; if ($brugsamletpris) { $dbsum = $sum - $k_sum; #else $dbsum=-$sum-$k_sum; } else { $dbsum = $dbsum + $db[$x]; } if ($ialt) { if ($procentfakt) { $ialt *= $procent[$x] / 100; } if ($varenr[$x]) { if ($incl_moms && !$momsfri[$x] && !$omvbet[$x]) { $tmp = $ialt + $ialt * $momssats / 100; } else { $tmp = $ialt; } if ($brugsamletpris) { if ($saet[$x] || $varenr[$x] == $rvnr) { if ($lev_varenr[$x]) { list($tmp) = explode("|", $lev_varenr[$x], 2); } else { $tmp = ''; } } elseif ($rvnr && $incl_moms) { #20150917 $tmp = $antal[$x] * ($pris[$x] + $pris[$x] * $momssats / 100); } } if ($art == 'DK') { $tmp *= -1; } $tmp = dkdecimal($tmp); } print "<td align=\"right\" title=\"Kostpris {$dk_kostsum[$x]} * db: {$dk_db[$x]} * dg: {$dk_dg[$x]}%\">" . $tmp . "</td>\n"; } else { print "<td> </td>\n"; } print "<input type=\"hidden\" name=\"projekt[{$x}]\" value=\"{$projekt[$x]}\">\n"; if ($vis_projekt && !$projekt[0]) { $r = db_fetch_array(db_select("select beskrivelse from grupper where art = 'PROJ' and kodenr='{$projekt[$x]}'", __FILE__ . " linje " . __LINE__)); print "<td align=\"right\" title=\"'{$r['projekt']}'\">{$projekt[$x]}</td>\n"; } // else print "<td></td>"; # udkommenteret 20140502 print $kdo[$x]; if ($genfakt) { print "<td align=\"center\">"; if ($kdo[$x]) { print "<b>√</b>"; } print "</td>"; } if ($omvbet[$x]) { $omvbet[$x] = "√"; } if ($omkunde) { print "<td align=\"center\">{$omvbet[$x]}</td>\n"; } #cho "$kobs_ordre_id[0] && $art!='DK' && $ko_ant[$x]>=1<br>"; if ($kobs_ordre_id[0] && $art != 'DK' && $ko_ant[$x] >= 1) { for ($y = 0; $y < $ko_ant[$x]; $y++) { $spantekst = "Købsordre {$kobs_ordre_nr[$y]} \n antal: {$kobs_ordre_antal[$y]} á " . dkdecimal($kobs_ordre_pris[$y]); if ($kobs_ordre_art[$y] == 'KO') { $link = "../kreditor/ordre.php?id={$kobs_ordre_id[$y]}"; } else { $link = "../debitor/ordre.php?id={$kobs_ordre_id[$y]}"; } print "<td align=\"right\" onClick=\"javascript:k_ordre=window.open('{$link}','ordre' ,'left=10,top=10,width=800,height=400,scrollbars=yes,resizable=yes,menubar=no,location=no');k_ordre.focus();\"onMouseOver=\"this.style.cursor = 'pointer'\" title=\"'{$spantekst}'\"><img src=\"../ikoner/opslag.png\"></td>\n"; } } else { //print "<td><br></td>\n"; # udkommenteret 20140502 if ($serienr[$x]) { print "<td onClick=\"serienummer({$linje_id[$x]})\" onMouseOver=\"this.style.cursor = 'pointer'\" align=\"right\" title=\"Serienumre \"><img alt=\"Serienummer\" src=\"../ikoner/serienr.png\"></td>\n"; } } } # 20150412 if ($brugsamletpris) { print "<tr><td></td><td></td><td></td><td></td><td><textarea class=\"autosize inputbox ordreText comment\" id=\"comment\" rows=\"1\" cols=\"58\" name=\"ekstratekst\" onfocus=\"document.forms[0].fokus.value=this.name; var val=this.value; this.value=''; this.value= val;\"></textarea></td><td colspan=\"3\"><input style=\"width:100%\" type=\"submit\" name=\"tilfoj\" value=\"Tilføj\"></td></tr>"; } # $tmp=$momssum/100*$momssats; #ellers runder den ned ved v. 0,5 re ?? # $moms=afrund($tmp,3); $kostpris[0] = $kostpris[0] * 1; if ($submit == 'del_ordre' || $submit == 'Fakturer') { db_modify("update ordrer set sum='{$sum}',kostpris='{$kostpris['0']}',moms='{$moms}' where id='{$id}'", __FILE__ . " linje " . __LINE__); } if ($art == 'DK') { $sum = $sum * -1; $momssum = $momssum * -1; $moms = $moms * -1; } # $tmp=$momssum/100*$momssats; #ellers runder den ned ved v. 0,5 ?? # $moms=afrund($tmp,3); $ialt = $sum + $moms; print "<tr><td colspan=\"11\"><br></td></tr>\n"; print "<tr><td colspan=\"11\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\"><tbody>\n"; #Tabel 2.5.1 -> print "<tr bgcolor=\"{$bgcolor5}\">\n"; # print "<td align=\"center\">".dkdecimal($procenttillag)."% tillæg ".dkdecimal($tillag)." </td>\n"; print "<td width=\"20%\" align=\"center\">Nettosum " . dkdecimal($sum) . "</td>\n"; print "<td width=\"20%\" align=\"center\" title=\"Dækningsbidrag: " . dkdecimal($dbsum) . "\">"; if (!$vis_saet) { print "Dækningsbidrag: " . dkdecimal($dbsum); } print "</td>\n"; if ($sum) { $dg_sum = $dbsum * 100 / $sum; } else { $dg_sum = dkdecimal(0); } print "<td width=\"20%\" align=\"center\" title=\"Dækningsgrad: " . dkdecimal($dg_sum) . "%\">"; if (!$vis_saet) { print "Dækningsgrad: " . dkdecimal($dg_sum); } print "</td>\n"; print "<td align=\"center\">Moms " . dkdecimal($moms) . "</td>\n"; print "<td align=\"center\" title=\"Dækningsgrad: " . dkdecimal($dg_sum) . "%\">I alt " . dkdecimal($ialt) . "</td>\n"; print "</tbody></table></td></tr>\n"; #<- Tabel 2.5.1 print "<tr><td align=\"center\" colspan=\"11\">\n"; print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr>\n"; #Tabel 2.5.2 -> if ($art != 'DK') { print "<td align=\"center\"><input type=\"submit\" class=\"button gray medium\" value=\" Kopiér \" name=\"submit\" title=\"Kopiér til ny ordre med samme indhold.\"></td>\n"; } if ($mail_fakt) { $tmp = "value=\" Send \" onclick=\"return confirm('Dokumentet sendes pr. mail til {$email}')\" title=\"Send via e-mail med vedhæftet PDF-fil. Anden form for behandling vælges fra listen Udskriv til.\""; } else { $tmp = "value=\" Udskriv \" title=\"Åbn et PDF-dokument, som kan gemmes eller viderebehandles på anden vis.\""; } print "<td align=\"center\"><input type=\"submit\" class=\"button gray medium\" name=\"submit\" {$tmp}></td>\n"; if ($art != 'DK' && !$krediteret) { $title = "Klik her for at oprette en kreditnota, som hel eller delvist krediterer denne faktura. Kreditnotaen oprettes som en kreditnotaordre, som kan redigeres inden bogføring. Eksempelvis hvis kun en enkelt faktureret vare skal krediteres."; print "<td align=\"center\" title=\"{$title}\"><input type=\"submit\" class=\"button gray medium\" value=\"Kreditér\" name=\"submit\"></td>\n"; } print "</tbody></table></td></tr>\n"; #<- Tabel 2.5.2 print "</tbody></table></td></tr>\n"; #<- Tabel 2.5 print "</tbody></table></td></tr>\n"; #<- Tabel 2 print "</form>\n"; } else { ############################# ordren er ikke faktureret ################################# if ($brugernavn && !$ref) { $ref = $brugernavn; } if (!$konto_id) { #20150302 if ($incl_moms) { $momssats = 25; } $status = 0; } if ($rvnr || $brugsamletpris) { $x = 1; $linje_id = array(); $q = db_select("select id from ordrelinjer where ordre_id = '{$id}' and saet > 0 and varenr!='{$rvnr}' order by saet,samlevare,posnr,id", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $linje_id[$x] = $r['id']; $x++; } $q = db_select("select id,saet from ordrelinjer where ordre_id = '{$id}' and rabat > 0 and varenr!='{$rvnr}' order by saet,samlevare,posnr,id", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if (!$r['saet']) { $linje_id[$x] = $r['id']; $x++; } } $qtxt = "select id from ordrelinjer where ordre_id = '{$id}' and vare_id > '0' and (varenr='{$svnr}' or varenr='{$rvnr}')"; if (db_fetch_array(db_select($qtxt, __FILE__ . " linje " . __LINE__))) { #20150914 Skal kun afvikles hvis der er rabat eller sæt vnr på ordren. $qtxt = "select id from ordrelinjer where ordre_id = '{$id}' and vare_id > '0' and varenr='{$rvnr}'"; $r = db_fetch_array(db_select($qtxt, __FILE__ . " linje " . __LINE__)); if ($linje_id[$x] = $r['id']) { $x++; } $q = db_select("select * from ordrelinjer where ordre_id = '{$id}' order by posnr", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if (!$r['saet'] && $r['rabat'] * 1 == 0 && $r['varenr'] != $rvnr || !$r['varenr']) { $linje_id[$x] = $r['id']; $x++; } } for ($x = 1; $x <= count($linje_id); $x++) { if ($linje_id[$x]) { db_modify("update ordrelinjer set posnr='{$x}' where id='{$linje_id[$x]}'", __FILE__ . " linje " . __LINE__); } } } } $qtxt = "select max(antal) as antal from ordrelinjer where ordre_id = '{$id}' and vare_id > '0'"; $r = db_fetch_array(db_select($qtxt, __FILE__ . " linje " . __LINE__)); $r['antal'] < 0 ? $dan_kn = 1 : ($dan_kn = NULL); print "<form name=\"ordre\" action=\"ordre.php?id={$id}&sag_id={$sag_id}&returside={$returside}\" method=\"post\">\n"; print "<input type=\"hidden\" name=\"ordrenr\" value=\"{$ordrenr}\">\n"; print "<input type=\"hidden\" name=\"status\" value=\"{$status}\">\n"; print "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n"; print "<input type=\"hidden\" name=\"art\" value=\"{$art}\">\n"; print "<input type=\"hidden\" name=\"kred_ord_id\" value=\"{$kred_ord_id}\">\n"; print "<input type=\"hidden\" name=\"sag_id\" value=\"{$sag_id}\">\n"; #20140507-1 if ($art == 'OT') { // Når input fields er 'disabled' bliver de ikke opdateret, derfor tilføjes hidden fields #20140716 print "<input type=\"hidden\" name=\"kontonr\" value=\"{$kontonr}\">\n"; print "<input type=\"hidden\" name=\"ref\" value=\"{$ref}\">\n"; print "<input type=\"hidden\" name=\"procenttillag\" value=\"" . dkdecimal($procenttillag) . "\">"; print "<input type=\"hidden\" name=\"felt_1\" style=\"width:200px\" value=\"{$felt_1}\">\n"; print "<input type=\"hidden\" name=\"felt_2\" style=\"width:200px\" value=\"{$felt_2}\">\n"; print "<input type=\"hidden\" name=\"felt_3\" style=\"width:200px\" value=\"{$felt_3}\">\n"; print "<input type=\"hidden\" name=\"felt_4\" style=\"width:200px\" value=\"{$felt_4}\">\n"; print "<input type=\"hidden\" name=\"felt_5\" style=\"width:200px\" value=\"{$felt_5}\">\n"; print "<input type=\"hidden\" name=\"lev_navn\" value=\"{$lev_navn}\">\n"; print "<input type=\"hidden\" name=\"lev_addr1\" value=\"{$lev_addr1}\"><input type=\"hidden\" name=\"lev_addr2\" value=\"{$lev_addr2}\">\n"; print "<input type=\"hidden\" name=\"lev_postnr\" value=\"{$lev_postnr}\"><input type=\"hidden\" name=\"lev_bynavn\" value=\"{$lev_bynavn}\">\n"; print "<input type=\"hidden\" name=\"lev_kontakt\" value=\"{$lev_kontakt}\">\n"; } #cho "status $status<br>"; #intiering af variabler $antal_ialt = 0; #10.10.2007 $leveres_ialt = 0; #10.10.2007 $tidl_lev_ialt = 0; #10.10.2007 $konto_id *= 1; #cho "art: $art<br>"; #cho "vis_lev_addr: $vis_lev_addr<br>"; #cho "ref: $ref"; $r = db_fetch_array(db_select("select * from adresser where id={$konto_id}", __FILE__ . " linje " . __LINE__)); $k_firmanavn = HtmlEntities($r['firmanavn'], ENT_COMPAT, $charset); $k_addr1 = HtmlEntities($r['addr1'], ENT_COMPAT, $charset); $k_addr2 = HtmlEntities($r['addr2'], ENT_COMPAT, $charset); $k_postnr = HtmlEntities($r['postnr'], ENT_COMPAT, $charset); $k_bynavn = HtmlEntities($r['bynavn'], ENT_COMPAT, $charset); $k_land = HtmlEntities($r['land'], ENT_COMPAT, $charset); $k_cvrnr = HtmlEntities($r['cvrnr'], ENT_COMPAT, $charset); $k_betalingsbet = HtmlEntities($r['betalingsbet'], ENT_COMPAT, $charset); $k_betalingsdage = HtmlEntities($r['betalingsdage'], ENT_COMPAT, $charset); $k_email = HtmlEntities($r['email'], ENT_COMPAT, $charset); $k_ean = HtmlEntities($r['ean'], ENT_COMPAT, $charset); $k_institution = HtmlEntities($r['institution'], ENT_COMPAT, $charset); // Query til kunde kontakt $x = 0; #20140826 $q = db_select("select * from ansatte where konto_id='{$konto_id}' order by posnr", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $a_kontakt[$x] = htmlspecialchars($r['navn']); $a_mobil[$x] = $r['mobil']; $a_email[$x] = HtmlEntities($r['email']); $x++; } //echo "kontakt: $kontakt<br>"; //echo "konto id: $konto_id<br>"; //echo "kontakt_tlf: $kontakt_tlf<br>"; ##### pile ######## tilfoejet 20080210 $alerttekst = findtekst(154, $sprog_id); $spantekst = findtekst(198, $sprog_id); print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"0\" width=\"100%\" valign = \"top\"><tbody>\n"; #Tabel 3 -> if ($prev_id) { print "<tr><td width=\"50%\" title=\"{$spantekst}\"><a href=\"javascript:confirmClose('ordre.php?id={$prev_id}&returside={$returside}','{$alerttekst}')\"><img src=\"../ikoner/left.png\" style=\"border: 0px solid; width: 15px; height: 15px;\"></a></span></td>\n"; } else { print "<tr><td width=\"50%\"></td>\n"; } $spantekst = findtekst(199, $sprog_id); if ($next_id) { print "<td width=\"50%\" align=\"right\" title=\"{$spantekst}\"><a href=\"javascript:confirmClose('ordre.php?id={$next_id}&returside={$returside}','{$alerttekst}')\"><img src=\"../ikoner/right.png\" style=\"border: 0px solid; width: 15px; height: 15px;\"></a></span></td></tr>\n"; } else { print "<tr><td width=\"50%\"></td>\n"; } print "</tbody></table>\n"; # <- Tabel 3 ##### pile ######## print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"1\"\tvalign = \"top\"><tbody>\n"; #Tabel 4 -> $ordre_id = $id; $ret = 0; $art == 'OT' ? $disabled = "disabled='disabled'" : ($disabled = NULL); #20140716 print "<tr><td width=\"31%\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n"; #Tabel 4.1 -> print "<tr><td witdh=\"100\">Kontonr.</td><td colspan=\"2\">\n"; if (trim($kontonr)) { if ($status < 1) { print "<input class=\"inputbox\" type=\"text\" style=\"width:200px;background-color:#ddd;\" name=\"kontonr\" readonly=\"readonly\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontonr}\" {$disabled}></td></tr>\n"; } else { print "<input class=\"inputbox\" type=\"text\" readonly=\"readonly\" style=\"width:200px;background-color:#ddd;\" name=\"kontonr\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontonr}\"></td></tr>\n"; } } else { print "<input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"kontonr\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontonr}\" onchange=\"javascript:docChange = true;\"></td></tr>\n"; } if ($firmanavn == $k_firmanavn) { $tekstcolor = "#444444"; } else { $tekstcolor = "#ff0000"; $ret = 1; } print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_firmanavn}\">Firmanavn</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"firmanavn\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$firmanavn}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; if ($addr1 == $k_addr1 && $addr2 == $k_addr2) { $tekstcolor = "#444444"; } else { $tekstcolor = "#ff0000"; $ret = 1; } print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_addr1},{$k_addr2}\">Adresse</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"addr1\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$addr1}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td></td><td colspan=\"2\" style=\"color:{$tekstcolor};\" ><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"addr2\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$addr2}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; if ($postnr == $k_postnr) { $tekstcolor = "#444444"; } else { $tekstcolor = "#ff0000"; $ret = 1; } print "<tr><td><span style=\"color:{$tekstcolor};\" title=\"{$k_postnr}\">Postnr.</span> & "; if ($bynavn == $k_bynavn) { $tekstcolor = "#444444"; } else { $tekstcolor = "#ff0000"; $ret = 1; } print "<span style=\"color:{$tekstcolor};\" title=\"{$k_bynavn}\">by</span></td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:45px;\" name=\"postnr\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$postnr}\" onchange=\"javascript:docChange = true;\" {$disabled}><input class=\"inputbox\" type=\"text\" style=\"width:150px;margin-left:3px;\" name=\"bynavn\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$bynavn}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; if ($land == $k_land) { $tekstcolor = "#444444"; } else { $tekstcolor = "#ff0000"; $ret = 1; } print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_land}\">Land</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"land\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$land}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; if (!$sag_id) { #20140826 print "<tr><td>Att.</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"kontakt\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontakt}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; } else { print "<tr><td>Att.</td><td colspan=\"2\"><div class=\"ddbox\"><input class=\"inputbox ddtext\" type=\"text\" name=\"kontakt\" id=\"Textbox\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontakt}\" onchange=\"javascript:docChange = true;\" {$disabled}>\n"; // DropDownIndexClear('DropDownExTextbox'); print "<select name=\"DropDownExTextbox\" id=\"DropDownExTextbox\" tabindex=\"1000\" class=\"inputbox ddselect\" {$disabled}>\n"; // onchange=\"DropDownTextToBox(this,'Textbox');\" for ($y = 0; $y <= count($a_kontakt); $y++) { print "<option value=\"{$a_kontakt[$y]}\" data-kontakt_tlf=\"{$a_mobil[$y]}\">{$a_kontakt[$y]}</option>\n"; } print "</select></div></td></tr>\n"; print "<tr><td>Att. tlf</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"kontakt_tlf\" id=\"kontakt_tlf\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kontakt_tlf}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; #20160129 print "<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\n\t\t\t\t\t\t\tDropDownIndexClear(\"DropDownExTextbox\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#DropDownExTextbox').on('change', function () {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar select = \$(this).find('option:selected').val()\n\t\t\t\t\t\t\t\t\tvar selectTlf = \$(this).find('option:selected').attr('data-kontakt_tlf')\n\t\t\t\t\t\t\t\t\t\$('#Textbox').val(select)\n\t\t\t\t\t\t\t\t\t\$('#kontakt_tlf').val(selectTlf)\n\t\t\t\t\t\t\tDropDownIndexClear(\"DropDownExTextbox\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n"; } print "<tr><td title=\"Kundens ordrenummer som refererence\">Kundeordre</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" name=\"kundeordnr\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$kundeordnr}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; #cho "$cvrnr!=$k_cvrnr<br>"; if ($cvrnr != $k_cvrnr || $ean != $k_ean || $email != $k_email || $institution != $k_institution) { $ret = 1; } if ($ret) { print "<tr><td></td><td align=\"center\"><a href=\"sync_stamkort.php?konto_id={$konto_id}&ordre_id={$id}&retning=op\"><img src=\"../ikoner/up.png\" title=\"Klik her for at synkronisere stamkort med informationer fra ordre\" style=\"border: 0px solid; width: 25px; height: 25px;\"></a></td>"; print "<td align=\"center\"><a href=\"sync_stamkort.php?konto_id={$konto_id}&ordre_id={$id}&retning=ned\"><img src=\"../ikoner/down.png\" title=\"Klik her for at synkronisere ordre med informationer fra stamkort\" style=\"border: 0px solid; width: 25px; height: 25px;\"></a></td></tr>\n"; } print "</tbody></table></td>\n\n"; # <- Tabel 4.1 print "<td width=\"38%\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"250\">\n"; #Tabel 4.2 -> $cvrnr == $k_cvrnr ? $tekstcolor = "#444444" : ($tekstcolor = "#ff0000"); print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_cvrnr}\">CVR-nr.</td><td><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"cvrnr\" value=\"{$cvrnr}\" onchange=\"javascript:docChange = true;\" {$disabled}></td>\n"; $ean == $k_ean ? $tekstcolor = "#444444" : ($tekstcolor = "#ff0000"); print "<td> </td><td style=\"color:{$tekstcolor};\">EAN-nr.</td><td><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"ean\" value=\"{$ean}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; $email == $k_email ? $tekstcolor = "#444444" : ($tekstcolor = "#ff0000"); if (!$sag_id) { #20160303 print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_email}\">E-mail</td><td><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"email\" value=\"{$email}\" onchange=\"javascript:docChange = true;\"></td>\n"; } else { print "<tr><td style=\"color:{$tekstcolor};\" title=\"{$k_email}\">E-mail</td><td><div class=\"ddbox2\"><input class=\"inputbox ddtext2\" type=\"text\" name=\"email\" id=\"Textbox2\" value=\"{$email}\" onchange=\"javascript:docChange = true;\">\n"; print "<select name=\"DropDownExTextbox2\" id=\"DropDownExTextbox2\" tabindex=\"1000\" class=\"inputbox ddselect2\">\n"; if ($k_email) { print "<option value=\"{$k_email}\">Kunde: {$k_email}</option>\n"; print "<option style=\"font-size: 1px; background-color: #cccccc;\" disabled></option>"; } for ($y = 0; $y < count($a_email); $y++) { print "<option value=\"{$a_email[$y]}\">{$a_kontakt[$y]}: {$a_email[$y]}</option>\n"; } print "<option> </option>\n"; print "</select></div></td>\n"; print "<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\n\t\t\t\t\t\t\tDropDownIndexClear(\"DropDownExTextbox2\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#DropDownExTextbox2').on('change', function () {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar select = \$(this).find('option:selected').val()\n\t\t\t\t\t\t\t\t\t\$('#Textbox2').val(select)\n\t\t\t\t\t\t\t\t\tDropDownIndexClear(\"DropDownExTextbox2\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n"; } $institution == $k_institution ? $tekstcolor = "#444444" : ($tekstcolor = "#ff0000"); print "<td></td><td style=\"color:{$tekstcolor};\" title=\"{$k_institution}\">Institution</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"institution\" value=\"{$institution}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td>Udskriv til</td>\n"; if (!$udskriv_til) { if ($mail_fakt) { $udskriv_til = "email"; } # if ($oio_fakt) $udskriv_til="oioxml"; if ($lev_pbs_nr) { if ($pbs) { $udskriv_til = "PBS"; } } } if (!$udskriv_til) { $udskriv_til = "PDF"; } print "<td><select class=\"inputbox\" style=\"width:130px\" name=\"udskriv_til\">\n"; if ($udskriv_til == "PBS" && $lev_pbs != 'B') { print "<option value=\"PBS\">PBS</option>\n"; } else { print "<option>{$udskriv_til}</option>\n"; } if ($udskriv_til != "PDF") { print "<option>PDF</option>\n"; } if ($udskriv_til != "PDF-tekst") { print "<option title=\"Udskrives som PDF uden baggrund\">PDF-tekst</option>\n"; } if ($udskriv_til != "email") { print "<option title=\"Sendes som PDF via e-mail\">email</option>\n"; } # if ($udskriv_til!="oioxml") print "<option title=\"Kun ved fakturering/kreditering.\">oioxml</option>\n"; #PHR 20090803 if ($udskriv_til != "oioubl") { print "<option title=\"Kun ved fakturering/kreditering.\">oioubl</option>\n"; } #PHR 20090803 # if ($udskriv_til!="edifakt") print "<option title=\"Kun ved fakturering/kreditering.\">edifakt</option>\n"; #PHR 20140201 if ($udskriv_til != "historik" && db_fetch_array(db_select("select * from grupper where ART = 'bilag' and (box6='on' or (box1 !='' and box2 !='' and box3 !=''))", __FILE__ . " linje " . __LINE__))) { print "<option title=\"Gem en kopi og vedhæft kundens historik\">historik</option>\n"; } $tmp = $pbs_nr * 1; # 20120822 if ($lev_pbs_nr) { if ($lev_pbs == 'L') { if ($tmp) { print "<option value=\"PBS\">PBS</option>\n"; } } else { if ($udskriv_til != "PBS" && $lev_pbs != 'B') { print "<option value=\"PBS_FI\">PBS</option>\n"; } elseif ($tmp && $udskriv_til != "PBS" && $lev_pbs == 'B') { print "<option title=\"Opkræves via PBS betalingsservice\">PBS</option>\n"; } } } print "</SELECT></td>\n"; print "<td> </td><td>Momssats</td><td><input class=\"inputbox\" style=\"text-align:right;width:40px\" type=\"text\" name=\"momssats\" value=\"" . dkdecimal($momssats) . "\" onchange=\"javascript:docChange = true;\" {$disabled}>%</td></tr>\n"; /* print "<tr><td colspan=2>Send pr. mail </td><td><input class=\"inputbox\" type=\"checkbox\" name=\"mail_fakt\" onchange=\"javascript:docChange = true;\" $mail_fakt></td>\n"; if ($lev_pbs_nr) { if ($pbs == "FI") $pbs_fi='checked'; elseif ($pbs == "BS") $pbs_bs='checked'; $title="PBS udsender FI indbetalingskort"; if (!$pbs_bs) { #naeste linje ingen apostrof omkring $pbs_fi print "<td colspan=\"2\" title=\"$title\">Faktura via PBS (FI)</td><td title=\"$title\"><input class=\"inputbox\" type=\"checkbox\" name=\"pbs_fi\" $pbs_fi onchange=\"javascript:docChange = true;\"></td></tr>\n"; if ($pbs_nr && !$pbs_fi) print "<tr><td colspan=\"2\"><td>\n"; } $title="Opkræves via PBS betalingsservice"; if ($pbs_nr && !$pbs_fi) print "<td colspan=\"2\" title=\"$title\">Opkræv via PBS (BS)</td><td title=\"$title\"><input class=\"inputbox\" type=\"checkbox\" name=\"pbs_bs\" \"$pbs_bs\" onchange=\"javascript:docChange = true;\"></td></tr>\n"; } else print "</tr>\n"; */ $mail_bilag == 'on' ? $checked = "checked='checked'" : ($checked = NULL); if ($udskriv_til == "email" && (strpos($_SERVER['SERVER_NAME'], 'ackup') || strpos($_SERVER['SERVER_NAME'], 'sl3'))) { print "<tr><td>Mail bilag</td><td><input type=\"checkbox\" name=\"mail_bilag\" {$checked}></td>"; } else { print "<tr><td colspan=\"2\"><input type=\"hidden\" name=\"mail_bilag\" value=\"{$mail_bilag}\"></td>"; } if ($procentvare) { print "<td> </td><td>Procenttillæg</td><td><input class=\"inputbox\" style=\"text-align:right;width:40px\" type=\"text\" name=\"procenttillag\" value=\"" . dkdecimal($procenttillag) . "\" onchange=\"javascript:docChange = true;\" {$disabled}>%</td></tr>\n"; } else { print "</tr>\n"; } if (db_fetch_array(db_select("select distinct sprog from formularer where sprog != 'Dansk'", __FILE__ . " linje " . __LINE__))) { print "<tr><td title=\"Sprog som skal anvendes på dokumenter som tilbud, ordrer, fakturaer med videre.\">Sprog</span></td>\n"; print "<td><select class=\"inputbox\" style=\"width:130px\" name=\"sprog\">\n"; print "<option>{$formularsprog}</option>\n"; $q = db_select("select distinct sprog from formularer order by sprog", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { print "<option>{$r['sprog']}</option>\n"; } print "</SELECT></td>"; } else { print "<tr><td colspan=\"2\"></td>"; } print "<tr><td colspan=\"5\"><hr></td></tr>\n"; print "<tr><td width=\"20%\">Ordredato</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"ordredato\" value=\"{$ordredato}\" onchange=\"javascript:docChange = true;\" {$disabled}></td>\n"; if ($hurtigfakt == 'on') { print "<td></td></tr>\n"; } else { if ($art == 'DK') { print "<td title=\"Dato for returnering\">Modt. dato</td>"; } else { print "<td title=\"Leveringsdato\">Lev. dato</td>"; } print "<td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"levdato\" value=\"{$levdato}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; } if ($fakturadato || $status > 0) { $dd = date("d-m-Y"); print "<tr><td "; if ($art != 'DK') { print "title=\"Fakturadato\">Fakt. dato"; } else { print "title=\"Dato for kreditnota\">KN. dato"; } print "</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:130px\" placeholder=\"{$dd}\" name=\"fakturadato\" value=\"{$fakturadato}\" onchange=\"javascript:docChange = true;\"></td>\n"; $tmp = "Genfaktureringsdato. Dette felt skal kun udfyldes, hvis der er tale om et abonnement eller \nlignende, som skal faktureres igen på et senere tidspunkt. \nSkriv datoen for næste fakturering"; if ($art == 'DO') { print "<td width=\"20%\" title=\"{$tmp}\">Genfakt.</span></td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:130px\" name=\"genfakt\" value=\"{$genfakt}\" onchange=\"javascript:docChange = true;\"></td>\n"; } } print "<tr><td>Betaling</td>\n"; if (!$betalingsbet) { $betalingsbet = "Netto"; } if ($art == 'DK') { print "<td colspan=\"2\"><select class=\"inputbox\" style=\"width:130px\" name=\"betalingsbet\">\n"; if ($betalingsbet == 'Kontant') { print "<option>Kontant</option>\n"; } if ($betalingsbet == 'Netto') { print "<option value='Netto'>Konto</option>\n"; } if ($betalingsbet != 'Kontant') { print "<option>Kontant</option>\n"; } if ($betalingsbet != 'Netto') { print "<option>Netto</option>\n"; } if ($betalingsbet == 'Kontant' || $betalingsbet == 'Efterkrav' || $betalingsbet == 'Forud' || $betalingsbet == 'Kreditkort') { $betalingsdage = ''; } else { $betalingsdage = 0; } print "</SELECT></td>\n"; } else { if (!$betalingsbet) { $betalingsbet = "Netto"; } print "<td colspan=\"2\"><select class=\"inputbox\" style=\"width:96px\" name=\"betalingsbet\" {$disabled}>\n"; print "<option style=\"color: red !important;\">{$betalingsbet}</option>\n"; if ($betalingsbet != 'Forud') { print "<option>Forud</option>\n"; } if ($betalingsbet != 'Kontant') { print "<option>Kontant</option>\n"; } if ($betalingsbet != 'Kreditkort') { print "<option>Kreditkort</option>\n"; } if ($betalingsbet != 'Efterkrav') { print "<option>Efterkrav</option>\n"; } if ($betalingsbet != 'Netto') { print "<option>Netto</option>\n"; } if ($betalingsbet != 'Lb. md.') { print "<option>Lb. md.</option>\n"; } if ($betalingsbet == 'Kontant' || $betalingsbet == 'Efterkrav' || $betalingsbet == 'Forud' || $betalingsbet == 'Kreditkort') { $betalingsdage = ''; } elseif (!$betalingsdage) { $betalingsdage = 'Nul'; } if ($betalingsdage) { if ($betalingsdage == 'Nul') { $betalingsdage = 0; } print "</SELECT>+<input class=\"inputbox\" type=\"text\" style=\"text-align:right;width:25px\" name=\"betalingsdage\" value=\"{$betalingsdage}\" onchange=\"javascript:docChange = true;\" {$disabled}></td>\n"; } } $list = array(); $beskriv = array(); $list[0] = 'DKK'; $x = 0; $q = db_select("select * from grupper where art = 'VK'order by box1 ", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $x++; $list[$x] = $r['box1']; $beskriv[$x] = $r['beskrivelse']; } $tmp = $x; if ($x > 0) { $list[0] = 'DKK'; $beskriv[0] = 'Danske kroner'; print "<td>Valuta</td>\n"; print "<td><select class=\"inputbox\" NAME=\"ny_valuta\">\n"; for ($x = 0; $x <= $tmp; $x++) { if ($valuta != $list[$x]) { print "<option title=\"{$beskriv[$x]}\">{$list[$x]}</option>\n"; } else { print "<option title=\"{$beskriv[$x]}\" selected=\"selected\">{$list[$x]}</option>\n"; } } print "</SELECT></td><td></td>\n"; } else { //print "<tr><td colspan=\"2\" width=\"200\">\n"; # udkommenteret 15052014 print "</tr>\n"; } $r = db_fetch_array(db_select("select id from adresser where art = 'S'", __FILE__ . " linje " . __LINE__)); $adr_id = $r['id'] * 1; $x = 0; $ansat = array(); $a_afd = array(); $q = db_select("select navn,afd from ansatte where konto_id = '{$adr_id}' and lukket != 'on' order by navn", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $ansat[$x] = $r['navn']; $a_afd[$x] = $r['afd']; $x++; } if (!in_array($ref, $ansat)) { $r = db_fetch_array(db_select("select navn from ansatte,brugere where brugernavn='{$ref}' and ansatte.id=" . nr_cast('brugere.ansat_id') . "", __FILE__ . " linje " . __LINE__)); if ($r['navn']) { $ref = $r['navn']; } } for ($x = 0; $x < count($ansat); $x++) { if (!$x) { print "<tr><td>Vor ref.</td>\n"; print "<td><select class=\"inputbox\" name=\"ref\" {$disabled}>\n"; print "<option>{$ref}</option>\n"; } if ($ref != $ansat[$x]) { print "<option> {$ansat[$x]}</option>\n"; } } print "</select>\n"; $x = 0; $afd_navn = array(); $afd_nr[$x] = array(); $q = db_select("select * from grupper where art = 'AFD'", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $afd_nr[$x] = $r['kodenr']; $afd_navn[$x] = $r['beskrivelse']; $x++; } if (count($afd_nr) > 1) { print "</td><td></td>\n"; print "<td>Afd</td><td><select name=\"afd\">"; for ($x = 0; $x < count($afd_nr); $x++) { if ($afd_nr[$x] == $afd) { print "<option value=\"{$afd_nr[$x]}\">{$afd_nr[$x]} {$afd_navn[$x]}</option>"; } } for ($x = 0; $x < count($afd_nr); $x++) { if ($afd_nr[$x] != $afd) { print "<option value=\"{$afd_nr[$x]}\">{$afd_nr[$x]} {$afd_navn[$x]}</option>"; } } print "</select>"; } print "</td></tr>\n"; $list = array(); $beskriv = array(); $x = 0; $q = db_select("select * from grupper where art = 'PRJ' and kodenr != '0' order by kodenr", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $x++; $list[$x] = $r['kodenr']; $beskriv[$x] = $r['beskrivelse']; } $projektantal = $x; if ($x > 0) { $vis_projekt = 'on'; print "<td title=\"Hvis hele ordren skal registreres på et projekt, vælges projektet her. Ellers anvendes projektfeltet på ordrelinjen.\">Projekt</td>\n"; print "<td><select class=\"inputbox\" name=\"projekt[0]\">\n"; for ($x = 0; $x <= $projektantal; $x++) { if ($projekt[0] != $list[$x]) { print "<option title=\"{$beskriv[$x]}\">{$list[$x]}</option>\n"; } else { print "<option title=\"{$beskriv[$x]}\" selected=\"selected\">{$list[$x]}</option>\n"; } } print "</select></td></tr>\n"; } else { print "<tr><td colspan=\"2\" width=\"200\"></tr>\n"; } if ($status == 0 && $hurtigfakt != "on") { print "<tr><td>Godkend</td><td><input class=\"inputbox\" type=\"checkbox\" name=\"godkend\" {$disabled}></td></tr>\n"; } elseif ($status < 3 && $hurtigfakt != "on") { if ($restordre) { $restordre = "checked"; } else { $restordre = ""; } print "<tr><td>Restordre</td><td><input class=\"inputbox\" type=\"checkbox\" name=\"restordre\" {$restordre}></td>\n"; } print "</tbody></table></td>\n"; # <- Tabel 4.2 print "<td width=\"31%\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" valign=\"top\">\n"; # Tabel 4.3 -> if ($vis_lev_addr || !$kontonr) { print "<tr><td align=\"center\">{$jobkort} {$debitorkort}</td><td align=\"right\">Vis leveringsadresse <input type=\"checkbox\" name=\"vis_lev_addr\" checked=\"checked\"><td></tr>\n"; print "<tr><td colspan=\"2\"><hr><td></tr>\n"; print "<tr><td colspan=\"2\" align=\"center\"><b>Leveringsadresse</b></td></tr>\n"; print "<tr><td colspan=\"2\"><hr></b></tr>\n"; print "<tr><td>Firmanavn</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" onfocus=\"document.forms[0].fokus.value=this.name;\" name=\"lev_navn\" value=\"{$lev_navn}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td>Adresse</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" onfocus=\"document.forms[0].fokus.value=this.name;\" name=\"lev_addr1\" value=\"{$lev_addr1}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td></td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"lev_addr2\" value=\"{$lev_addr2}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td>Postnr. & by</td><td><input class=\"inputbox\" type=\"text\" style=\"width:45px\" onfocus=\"document.forms[0].fokus.value=this.name;\" name=\"lev_postnr\" value=\"{$lev_postnr}\" {$disabled}><input class=\"inputbox\" type=\"text\" style=\"width:150px;margin-left:3px;\" name=\"lev_bynavn\" value=\"{$lev_bynavn}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<tr><td>Att.</td><td colspan=\"2\"><input class=\"inputbox\" type=\"text\" style=\"width:200px\" onfocus=\"document.forms[0].fokus.value=this.name;\" name=\"lev_kontakt\" value=\"{$lev_kontakt}\" onchange=\"javascript:docChange = true;\" {$disabled}></td></tr>\n"; print "<input type=\"hidden\" name=\"felt_1\" style=\"width:200px\" value=\"{$felt_1}\">\n"; print "<input type=\"hidden\" name=\"felt_2\" style=\"width:200px\" value=\"{$felt_2}\">\n"; print "<input type=\"hidden\" name=\"felt_3\" style=\"width:200px\" value=\"{$felt_3}\">\n"; print "<input type=\"hidden\" name=\"felt_4\" style=\"width:200px\" value=\"{$felt_4}\">\n"; print "<input type=\"hidden\" name=\"felt_5\" style=\"width:200px\" value=\"{$felt_5}\">\n"; } else { print "<tr><td align=\"center\">{$jobkort} {$debitorkort}</td><td align=\"right\">Vis leveringsadresse <input type=\"checkbox\" name=\"vis_lev_addr\"><td></tr>\n"; print "<tr><td colspan=\"2\"><hr><td></tr>\n"; print "<tr><td colspan=\"2\" align=\"center\"><b>" . findtekst(243, $sprog_id) . "</b></tr>\n"; print "<tr><td colspan=\"2\"><hr></b></tr>\n"; if ($vis_saet) { $felt_2 *= 1; $felt_4 *= 1; if ($fakturadate) { if (!$felt_2) { $felt_2 = $sum + $moms; } $felt_2 < $sum + $moms ? $felt_4 = $sum + $moms - $felt_2 : ($felt_4 = 0); } $dkfelt_2 = dkdecimal($felt_2, 2); $dkfelt_4 = dkdecimal($felt_4, 2); $r = db_fetch_array(db_select("select * from grupper where art = 'POS' and kodenr = '1'", __FILE__ . " linje " . __LINE__)); $kortantal = $r['box4'] * 1; $korttyper = explode(chr(9), $r['box5']); print "<tr><td><select name=\"felt_1\">"; if (!$felt_1) { $felt_1 = $korttyper[0]; } if ($felt_1) { print "<option value=\"{$felt_1}\">{$felt_1}</value>"; } if ($felt_1 != 'Kontant') { print "<option value=\"Kontant\">Kontant</value>"; } for ($x = 0; $x < $kortantal; $x++) { if ($felt_1 != $korttyper[$x]) { print "<option value=\"{$korttyper[$x]}\">{$korttyper[$x]}</value>"; } } print "</select></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_2\" style=\"text-align:right;width:200px\" value=\"{$dkfelt_2}\" {$disabled}></td></tr>"; print "<tr><td><select name=\"felt_3\">"; if ($felt_3) { print "<option value=\"{$felt_3}\">{$felt_3}</value>"; } if ($felt_3 != 'Kontant') { print "<option value=\"Kontant\">Kontant</value>"; } for ($x = 0; $x < $kortantal; $x++) { if ($felt_3 != $korttyper[$x]) { print "<option value=\"{$korttyper[$x]}\">{$korttyper[$x]}</value>"; } } print "</select></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_4\" style=\"text-align:right;width:200px\" value=\"{$dkfelt_4}\" {$disabled}></td></tr>"; } else { if (substr(findtekst(244, $sprog_id), 0, 1) != "#") { print "<tr><td><span onmouseover=\"return overlib('" . findtekst(249, $sprog_id) . "',WIDTH=600);\" onmouseout=\"return nd();\">" . findtekst(244, $sprog_id) . "</span></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_1\" style=\"width:200px\" value=\"{$felt_1}\" {$disabled}></td></tr>\n"; } if (substr(findtekst(245, $sprog_id), 0, 1) != "#") { print "<tr><td><span onmouseover=\"return overlib('" . findtekst(250, $sprog_id) . "',WIDTH=600);\" onmouseout=\"return nd();\">" . findtekst(245, $sprog_id) . "</span></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_2\" style=\"width:200px\" value=\"{$felt_2}\" {$disabled}></td></tr>\n"; } if (substr(findtekst(246, $sprog_id), 0, 1) != "#") { print "<tr><td><span onmouseover=\"return overlib('" . findtekst(251, $sprog_id) . "',WIDTH=600);\" onmouseout=\"return nd();\">" . findtekst(246, $sprog_id) . "</span></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_3\" style=\"width:200px\" value=\"{$felt_3}\" {$disabled}></td></tr>\n"; } if (substr(findtekst(247, $sprog_id), 0, 1) != "#") { print "<tr><td><span onmouseover=\"return overlib('" . findtekst(252, $sprog_id) . "',WIDTH=600);\" onmouseout=\"return nd();\">" . findtekst(247, $sprog_id) . "</span></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_4\" style=\"width:200px\" value=\"{$felt_4}\" {$disabled}></td></tr>\n"; } if (substr(findtekst(248, $sprog_id), 0, 1) != "#") { print "<tr><td><span onmouseover=\"return overlib('" . findtekst(253, $sprog_id) . "',WIDTH=600);\" onmouseout=\"return nd();\">" . findtekst(248, $sprog_id) . "</span></td><td><input class=\"inputbox\" type=\"text\" name=\"felt_5\" style=\"width:200px\" value=\"{$felt_5}\" {$disabled}></td></tr>\n"; } } print "<input type=\"hidden\" name=\"lev_navn\" value=\"{$lev_navn}\">\n"; print "<input type=\"hidden\" name=\"lev_addr1\" value=\"{$lev_addr1}\"><input type=\"hidden\" name=\"lev_addr2\" value=\"{$lev_addr2}\">\n"; print "<input type=\"hidden\" name=\"lev_postnr\" value=\"{$lev_postnr}\"><input type=\"hidden\" name=\"lev_bynavn\" value=\"{$lev_bynavn}\">\n"; print "<input type=\"hidden\" name=\"lev_kontakt\" value=\"{$lev_kontakt}\">\n"; } print "</td></tr></tbody></table></td></tr>\n"; #<- Tabel 4.3 $row2 = db_fetch_array(db_select("select notes from adresser where kontonr = '{$kontonr}' and art = 'D'", __FILE__ . " linje " . __LINE__)); #20142403-1 $notes = str_replace("\n", "<br>", $row2['notes']); if ($notes) { print "<tr><td colspan=\"3\" witdh=\"100%\" style=\"color: rgb(255,0,0)\">{$notes}</td></tr>\n"; } /* $query = db_select("select notes from adresser where kontonr = '$kontonr' and art = 'D'",__FILE__ . " linje " . __LINE__); if ($row2 = db_fetch_array($query) ) { $notes=str_replace("\n","<br>",$row2['notes']); print "<tr><td colspan=\"3\" witdh=\"100%\" style=\"color: rgb(255,0,0)\">$notes</td></tr>\n"; } */ if ($udskriv_til == 'email') { if (!$formularsprog) { $formularsprog = 'Dansk'; } $status < 1 ? $form_nr = 1 : ($form_nr = 2); if ($art == 'DK') { $form_nr = 5; } $q = db_select("select * from formularer where formular='{$form_nr}' and art='5' and lower(sprog)='" . strtolower($formularsprog) . "'", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { if ($r['xa'] == '1') { $std_subj = $r['beskrivelse']; } elseif ($r['xa'] == '2') { $std_txt_title = $r['beskrivelse']; } } if ($art != 'DK') { $q = db_select("select * from formularer where formular='4' and art='5' and lower(sprog)='" . strtolower($formularsprog) . "'", __FILE__ . " linje " . __LINE__); } while ($r = db_fetch_array($q)) { if ($r['xa'] == '1') { $fak_subj = $r['beskrivelse']; } elseif ($r['xa'] == '2') { $fak_text = str_replace("<br>", "", $r['beskrivelse']); } } $subj_title = ''; if (!$mail_subj && $art != 'DK') { $subj_title = HtmlEntities("Ved fakturering ændres emneteksten til:\n\n{$fak_subj}", ENT_COMPAT, $charset); } $text_title = ''; if (!$mail_text && $art != 'DK') { $text_title = HtmlEntities("Ved fakturering ændres mailteksten til:\n\n{$fak_text}", ENT_COMPAT, $charset); } list($std_txt, $tmp) = explode("<br>", $std_txt_title); $mail_text ? $std_txt_title = $mail_text : ($std_txt_title = str_replace("<br>", "", $std_txt_title)); print "<tr><td align=\"center\" colspan=\"3\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tbody>\n"; #Tabel 4.4 -> if (!$mail_subj && !$mail_text && $art != 'DK') { print "<tr><td></td><td colspan=\"1\" align=\"left\"><small>Nedenstående tekster ændres ved fakturering, hold musen over beskrivelsen til venstre for at se ændringen</small></td>"; } print "<tr><td width=\"120px\" title=\"{$subj_title}\">Mail emne</td><td title=\"{$std_subj}\"><input class=\"inputbox\" type=\"text\" style=\"width:1000px;\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_subj\" placeholder=\"{$std_subj}\" value=\"{$mail_subj}\" onchange=\"javascript:docChange = true;\"></td>"; if ($bilag) { if ($dokument) { print "<td title=\"klik her for at åbne bilaget: {$dokument}\"><a href=\"../includes/bilag.php?kilde=ordrer&filnavn={$dokument}&bilag_id={$id}&bilag={$dokument}&kilde_id={$id}\"><img style=\"border: 0px solid\" alt=\"clip_m_papir\" src=\"../ikoner/paper.png\"></a></td>"; } else { print "<td title=\"klik her for at vedhæfte et bilag\"><a href=\"../includes/bilag.php?kilde=ordrer&bilag_id={$id}&bilag={$dokument}&ny=ja&kilde_id={$id}\"><img style=\"border: 0px solid\" alt=\"clip\" src=\"../ikoner/clip.png\"></a></td>"; } } print "</tr><tr><td valign=\"top\" title=\"{$text_title}\">Mail tekst</td><td title=\"{$std_txt_title}\">"; if ($mail_text) { print "<textarea style=\"width:1000px;\" rows=\"2\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_text\" onchange=\"javascript:docChange = true;\">{$mail_text}</textarea>\n"; } else { print "<input class=\"inputbox\" type=\"text\" style=\"width:1000px;\" onfocus=\"document.forms[0].fokus.value=this.name;\"name=\"mail_text\" placeholder=\"{$std_txt}\" value=\"{$mail_text}\" onchange=\"javascript:docChange = true;\">"; } print "</td></tr></tbody></table></td></tr>\n"; # <- Tabel 4.4 } print "<tr><td align=\"center\" colspan=\"3\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tbody>\n"; # Tabel 4.5 -> if ($kontonr) { print "<tr><td align=\"center\" title=\"Positionsnummer. Rækkefølgen ændres ved at overskrive positionsnumrene (1,5 hvis mellem 1 og 2). En enkelt linje slettes ved at skrive minustegn som positionsnummer.\">Pos.</td><td align=\"center\" title=\"Varenummer. Skriv hele varenumret eller klik på Opslag for at vælge. Hvis du vil vælge mellem varenumre startende med t, så skriv t* i feltet og klik på Opslag.\">Varenr.</td><td align=\"center\" title=\"Antal enheder. Timer og minutter kan angives med : som skilletegn. Eksempelvis 5:45 som bliver til 5,75.\">Antal</td><td align=\"center\">Enhed</td><td align=\"center\" title=\"Brug [Shift]+[Enter] for et indsætte et linjeskift i en beskrivelseslinje\">Beskrivelse</td><td align=\"center\">Pris</td><td align=\"center\">Rabat</td>"; if ($procentfakt) { print "<td align=\"center\">Procent</td>"; } print "<td align=\"center\">I alt</td>"; if ($vis_projekt && !$projekt[0]) { print "<td align=\"center\">Proj.</td>"; } if ($genfakt) { print "<td align=\"center\" title=\"'Kun denne ordre'. Afmærk dette felt hvis ordrelinjen ikke skal med ved genfakturering eller kopiering af ordren.\">kdo</td>\n"; } if ($status >= 1 && $hurtigfakt != 'on') { if ($art != 'DK') { $tmp = "Levér"; $tmp2 = "Indtastningsfeltet herunder er det antal, som leveres ved klik på Levér. Antallet i parantes er det, som allerede er leveret."; } else { $tmp = "Modtag"; $tmp2 = "Indtastningsfeltet herunder er det antal, som modtages ved klik på Modtag. Antallet i parantes er det, som allerede er modtaget."; } print "<td colspan=\"2\" align=\"center\" title=\"{$tmp2}\">{$tmp}</td>"; } } if ($omkunde) { print "<td title =\"Hvis feltet vises er kunden underlagt reglerne for omvendt betalingspligt. Er varen ligeledes omfattet vil feltet herunder være afmærket pr default og momsen vil være undertrykt for den pågældende vare.\">O/B</td>"; } print "</tr>\n"; if (!$status) { $status = 0; } print "<input type=\"hidden\" name=\"status\" value=\"{$status}\">"; print "<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n"; $x = 0; if (!$ordre_id) { $ordre_id = 0; } $kostpris[0] = 0; $kostsum = 0; $blandet_moms = 0; #tilfojet 20100923 grundet afrundingsfejl på ordre med rabat $lagervarer = 0; # db_modify("update ordrelinjer set posnr=posnr+10 where varenr = '$svnr'"); # global $db; $query = db_select("select * from ordrelinjer where ordre_id = '{$ordre_id}' order by posnr", __FILE__ . " linje " . __LINE__); # $query = db_select("select * from ordrelinjer where ordre_id = '$ordre_id' order by saet desc,samlevare,posnr,id",__FILE__ . " linje " . __LINE__); while ($row = db_fetch_array($query)) { if ($row['posnr'] > 0 && !is_numeric($row['samlevare']) && $row['samlevare'] < 1) { #Hvis "samlevare" er numerisk,indgaar varen i den ordrelinje,der refereres til - hvis "on" er varen en samlevare. $x++; $linje_id[$x] = $row['id']; $kred_linje_id[$x] = $row['kred_linje_id']; $posnr[$x] = $row['posnr']; $varenr[$x] = HtmlEntities(trim($row['varenr']), ENT_COMPAT, $charset); $beskrivelse[$x] = HtmlEntities(trim($row['beskrivelse']), ENT_COMPAT, $charset); if ($beskrivelse[$x] == ".") { $beskrivelse[$x] = ""; } $enhed[$x] = HtmlEntities(trim($row['enhed']), ENT_COMPAT, $charset); $pris[$x] = $row['pris']; $rabat[$x] = $row['rabat'] * 1; $rabatart[$x] = $row['rabatart']; $procent[$x] = $row['procent'] * 1; $antal[$x] = $row['antal'] * 1; $leveres[$x] = $row['leveres']; $vare_id[$x] = $row['vare_id']; $momsfri[$x] = $row['momsfri']; $rabatgruppe[$x] = $row['rabatgruppe']; $m_rabat[$x] = $row['m_rabat'] * -1; $folgevare[$x] = $row['folgevare'] * 1; $varemomssats[$x] = $row['momssats'] * 1; $fast_db[$x] = $row['fast_db'] * 1; $saet[$x] = $row['saet']; $lev_varenr[$x] = $row['lev_varenr']; $kostpris[$x] = $row['kostpris']; $row['omvbet'] ? $omvbet[$x] = 'checked' : ($omvbet[$x] = NULL); if (!$momsfri[$x] && !$varemomssats[$x]) { $varemomssats[$x] = $momssats; } elseif ($varemomssats[$x] > $momssats) { $varemomssats[$x] = $momssats; } elseif ($momsfri[$x] || $omvbet[$x]) { $varemomssats[$x] = 0; } $serienr[$x] = HtmlEntities(trim($row['serienr']), ENT_COMPAT, $charset); $samlevare[$x] = $row['samlevare']; $projekt[$x] = $row['projekt']; $row['kdo'] ? $kdo[$x] = 'checked' : ($kdo[$x] = NULL); if ($vare_id[$x]) { if ($fast_db[$x]) { $kostpris[$x] = $pris[$x] * $fast_db[$x]; /* } else { list($koordpr,$koordnr,$koordant,$koordid,$koordart)=explode(chr(9),find_kostpris($vare_id[$x],$linje_id[$x])); $kobs_ordre_pris=explode(",",$koordpr); $kobs_ordre_antal=explode(",",$koordant); $ko_ant[$x]=count($kobs_ordre_pris); $kostpris[$x]=0; #rettet 20120418 grundet fejl i kostpris v leverring af flere omgange på samme ordrelinje på købsordre #rettet yderligere 20121213 grundet ny fejl hvis køb er fordelt over flere købsordrer for($y=0;$y<$ko_ant[$x];$y++) $kostsum[$x]+=$kobs_ordre_pris[$y]*$kobs_ordre_antal[$y]; ($antal[$x])?$kostpris[$x]=$kostsum[$x]/$antal[$x]:$kostpris[$x]=0; if ($valutakurs) $kostpris[$x]*=100/$valutakurs; #20140116 */ } $kostsum += $kostpris[$x] * $antal[$x]; /* #cho "update ordrelinjer set kostpris='$kostpris[$x]' where id='$linje_id[$x]'<br>"; db_modify("update ordrelinjer set kostpris='$kostpris[$x]' where id='$linje_id[$x]'",__FILE__ . " linje " . __LINE__); */ if ($rabatart[$x] == 'amount') { $db[$x] = $pris[$x] - $rabat[$x]; } else { $db[$x] = $pris[$x] - $pris[$x] * $rabat[$x] / 100; } #20140424 -= $db[$x] -= $kostpris[$x]; #20140424 -= #cho "$db[$x]=$pris[$x]-$kostpris[$x]<br>"; if ($pris[$x] != 0) { $dg[$x] = $db[$x] * 100 / $pris[$x]; } else { $dg[$x] = 0; } $dk_db[$x] = dkdecimal($db[$x]); $dk_dg[$x] = dkdecimal($dg[$x]); } if ($art == 'DK' && $antal[$x] < 0) { $bogfor == 0; } if ($serienr[$x]) { $serienumre[$x] = NULL; $q2 = db_select("select serienr from serienr where salgslinje_id='{$linje_id[$x]}' order by serienr", __FILE__ . " linje " . __LINE__); while ($r2 = db_fetch_array($q2)) { $serienumre[$x] ? $serienumre[$x] .= ',' . $r2['serienr'] : ($serienumre[$x] = $r2['serienr']); } } if (!$lagervarer && $vare_id[$x]) { $r2 = db_fetch_array(db_select("select grupper.box8 from varer,grupper where varer.id = '{$vare_id[$x]}' and grupper.art='VG' and grupper.kodenr=varer.gruppe", __FILE__ . " linje " . __LINE__)); if ($r2['box8']) { $lagervarer = 1; } } } } $linjeantal = $x; #cho "Lagervarer $lagervarer<br>"; $moms = 0; $sum = 0; $ny_pos = 0; $saetnr = 0; $saetpris = 0; for ($x = 1; $x <= $linjeantal; $x++) { if ($saet[$x]) { if ($saetnr && $saetnr != $saet[$x]) { # tilføjer linjen for sætpris $qtxt = "select beskrivelse from ordrelinjer where saet = '{$saetnr}' and ordre_id='{$id}' and samlevare='on'"; $r = db_fetch_array(db_select($qtxt, __FILE__ . " linje " . __LINE__)); list($sum, $dbsum, $blandet_moms, $moms) = explode(chr(9), ordrelinjer($x, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, '0', '0', '0', '0', $linje_id[$x], '0', '', '', $r['beskrivelse'], '', $saetpris, $rabat[$x], 'percent', '100', '1', '0', $vare_id[$x], '', '0', '0', $momssats, '', 'on', '', '', '', '', '', '', '', '', '', '', '0', '', '0', $saetnr)); $saetpris = 0; } if (!$saetpris) { print "<tr><td><br></td></tr>"; } $linjesum = $pris[$x] * $antal[$x]; $linjesum -= $linjesum * $rabat[$x] / 100; $linjesum += $linjesum * $varemomssats[$x] / 100; $saetpris += afrund($linjesum, 3); $saetnr = $saet[$x]; } elseif ($saetnr) { $r = db_fetch_array(db_select("select beskrivelse from ordrelinjer where saet = '{$saetnr}' and ordre_id='{$id}' and samlevare='on'", __FILE__ . " linje " . __LINE__)); list($sum, $dbsum, $blandet_moms, $moms) = explode(chr(9), ordrelinjer($x, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, '0', '0', '0', '0', '0', '0', '', '', $r['beskrivelse'], '', $saetpris, '0', 'percent', '100', '1', '0', '0', '', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '0', '', '0', $saetnr)); $saetpris = 0; $saetnr = 0; print "<tr><td><br></td></tr>"; } if (!$folgevare[$x] || $folgevare[$x] >= 0) { list($sum, $dbsum, $blandet_moms, $moms, $antal_ialt, $leveres_ialt, $tidl_lev_ialt, $tidl_lev[$x], $levdiff) = explode(chr(9), ordrelinjer($x, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, $leveres_ialt, $tidl_lev_ialt, $levdiff, $projekt[0], $linje_id[$x], $kred_linje_id[$x], $posnr[$x], $varenr[$x], $beskrivelse[$x], $enhed[$x], $pris[$x], $rabat[$x], $rabatart[$x], $procent[$x], $antal[$x], $leveres[$x], $vare_id[$x], $momsfri[$x], $rabatgruppe[$x], $m_rabat[$x], $varemomssats[$x], $serienr[$x], $samlevare[$x], $folgevare[$x], $projekt[$x], $kdo[$x], $kobs_ordre_pris, $ko_ant[$x], $kostpris[$x], $db[$x], $dg[$x], $dk_db[$x], $dk_dg[$x], '0', $omvbet[$x], $saet[$x], $saetnr)); } if ($samlevare[$x] == 'on') { $q = db_select("select * from ordrelinjer where ordre_id = '{$ordre_id}' and samlevare = '{$linje_id[$x]}' order by id", __FILE__ . " linje " . __LINE__); while ($r = db_fetch_array($q)) { $antal_ialt += $r['antal']; if ($r['antal'] > 0) { $tmp = 0; $q2 = db_select("select antal from batch_salg where linje_id = '{$r['id']}' and ordre_id='{$id}' and vare_id = '{$r['vare_id']}'", __FILE__ . " linje " . __LINE__); while ($r2 = db_fetch_array($q2)) { $tmp = $tmp + $r2['antal']; } if ($art == 'DK') { $dkantal = dkdecimal($r['antal'] * -1); } else { $dkantal = dkdecimal($r['antal']); } if (substr($dkantal, -1) == '0') { $dkantal = substr($dkantal, 0, -1); } if (substr($dkantal, -1) == '0') { $dkantal = substr($dkantal, 0, -2); } } $tidl_lev_ialt += $tmp; print "<tr><td></td><td>{$r['varenr']}</td><td align=\"right\">{$dkantal}</td><td>{$r['enhed']}</td><td>{$r['beskrivelse']}</td></tr>"; } } print "<input type=\"hidden\" name=\"samlevare[{$x}]\" value=\"{$samlevare[$x]}\">\n"; if ($folgevare[$x] > 0) { $x_nr = 0; $fv_linje_id = 0; for ($i = 1; $i <= $linjeantal; $i++) { $tmp = $linje_id[$x] * -1; if ($tmp == $folgevare[$i]) { $x_nr = $i; $fv_linje_id = $linje_id[$i] * 1; $fv_varenr = $varenr[$i]; $fv_salgspris = $pris[$i]; $fv_kostpris = $kostpris[$i]; $fv_enhed = $enhed[$i]; $fv_beskrivelse = $beskrivelse[$i]; $fv_varemomssats = $varemomssats[$i]; $fv_db = $fv_salgspris - $fv_kostpris; $fv_salgspris != 0 ? $fv_dg = $fv_db * 100 / $fv_salgspris : ($fv_dg = 0); } } if (!$fv_linje_id) { global $regnaar; $r = db_fetch_array(db_select("select varer.varenr,varer.beskrivelse,varer.enhed,varer.salgspris,varer.kostpris,grupper.box4,grupper.box7 from varer,grupper where varer.id = '{$folgevare[$x]}' and grupper.art='VG' and grupper.kodenr=varer.gruppe", __FILE__ . " linje " . __LINE__)); $fv_linje_id = 0; $fv_varenr = $r['varenr']; $fv_salgspris = $r['salgspris']; $fv_kostpris = $r['kostpris']; $fv_enhed = $r['enhed']; $fv_beskrivelse = $r['beskrivelse']; $fv_db = $fv_salgspris - $fv_kostpris; $fv_salgspris != 0 ? $fv_dg = $fv_db * 100 / $fv_salgspris : ($fv_dg = 0); $r2 = db_fetch_array(db_select("select moms from kontoplan where kontonr = '{$r['box4']}' and regnskabsaar = '{$regnaar}'", __FILE__ . " linje " . __LINE__)); if ($tmp = trim($r2['moms'])) { # f.eks S3 $tmp = substr($tmp, 1); #f.eks 3 $r2 = db_fetch_array(db_select("select box2 from grupper where art = 'SM' and kodenr = '{$tmp}'", __FILE__ . " linje " . __LINE__)); if ($r2['box2']) { $fv_varemomssats = $r2['box2'] * 1; } } else { $fv_varemomssats = $momssats; } } $fv_dk_db = dkdecimal($fv_db); $fv_dk_dg = dkdecimal($fv_dg); list($sum, $dbsum, $blandet_moms, $moms) = explode(chr(9), ordrelinjer($x_nr, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, $leveres_ialt, $tidl_lev_ialt, $levdiff, $projekt[0], $fv_linje_id, 0, $x, $fv_varenr, $fv_beskrivelse, $fv_enhed, $fv_salgspris, 0, 'percent', $procent[$x], $antal[$x], $leveres[$x], $folgevare[$x], $fv_momsfri, 0, 0, $fv_varemomssats, 0, 0, 0, $projekt[$x], $kdo[$x], 0, 0, $fv_kostpris, $fv_db, $fv_dg, $fv_dk_db, $fv_dk_dg, '1', $saet[$x], $saetnr)); } print "<input type=\"hidden\" name=\"folgevare[{$x}]\" value=\"{$folgevare[$x]}\">\n"; if ($saet[$x] && $x == $linjeantal && $saetpris) { # $r=db_fetch_array(db_select("select beskrivelse from varer where id = '$svid'",__FILE__ . " linje " . __LINE__)); $r = db_fetch_array(db_select("select beskrivelse from ordrelinjer where saet = '{$saetnr}' and ordre_id='{$id}' and samlevare='on'", __FILE__ . " linje " . __LINE__)); #cho __LINE__."<br>"; list($sum, $dbsum, $blandet_moms, $moms) = explode(chr(9), ordrelinjer($x, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, '0', '0', '0', '0', '0', '0', '', '', $r['beskrivelse'], '', $saetpris, '0', 'percent', '100', '1', '0', '0', '', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '0', '', '0', $saetnr)); $saetnr = 0; } } if ($brugsamletpris && $samlet_rabat && $samlet_pris && $samlet_pris != $ordresum) { $x++; $diff = afrund($samlet_pris - ($sum + $moms), 3); $tmp = $sum + $moms; if ($samlet_rabat) { $ms = afrund($moms * 100 / ($sum + $moms), 2); #20150318 $r = db_fetch_array(db_select("select id,beskrivelse from varer where varenr = '{$rvnr}'", __FILE__ . " linje " . __LINE__)); opret_ordrelinje($id, $r['id'], $rvnr, 1, $r['beskrivelse'], $diff, $ms, 100, 'DO', '', '', '0', '', '', '', '99', '0'); $r = db_fetch_array(db_select("select * from ordrelinjer where ordre_id = '{$id}' and varenr = '{$rvnr}'", __FILE__ . " linje " . __LINE__)); $vist_rabat = $samlet_pris - $bruttosaetsum . "|" . $samlet_pris; db_modify("update ordrelinjer set lev_varenr='{$vist_rabat}' where id='{$r['id']}'", __FILE__ . " linje " . __LINE__); list($sum, $dbsum, $blandet_moms, $moms) = explode(chr(9), ordrelinjer($x, $sum, $dbsum, $blandet_moms, $moms, $antal_ialt, '0', '0', '0', '0', $r['id'], '0', '99', $rvnr, $r['beskrivelse'], '', $r['pris'], $r['rabat'], 'percent', '100', '1', '0', $r['vare_id'], '', '0', '0', $momssats, '', '', '', '', '', '', '', '', '', '', '', '', '0', '', '0', '0')); } } $sum = afrund($sum, 2); $moms = afrund($moms, 2); print "<input type=\"hidden\" name=\"linjeantal\" value=\"{$linjeantal}\">\n"; print "<input type=\"hidden\" name=\"lagervarer\" value=\"{$lagervarer}\">\n"; if ($status >= 1 && $bogfor != 0 && !$leveres_ialt && $tidl_lev_ialt && $antal_ialt != $tidl_lev_ialt) { $del_ordre = 'on'; } else { $del_ordre = ''; } if ($kontonr) { $x++; $antal[0] = 1; $posnr[0] = $linjeantal + 1; if ($varenr[0] && isset($_GET['vare_id'])) { #20150407 $fokus = "dkan0"; #20150306 + value i dkan0 $r = db_fetch_array(db_select("select * from varer where varenr='{$varenr['0']}'", __FILE__ . " linje " . __LINE__)); $beskrivelse[0] = $r['beskrivelse']; $pris[0] = $r['salgspris']; print "<input type=\"hidden\" name=\"indsat\" value=\"" . $_GET['vare_id'] . "\">"; if ($incl_moms) { if ($r = db_fetch_array(db_select("select box7 from grupper where art='VG' and kodenr='{$gruppe}' and box7!='on'", __FILE__ . " linje " . __LINE__))) { $momsfri[0] = $r2['box7']; } else { $pris[0] += $pris[0] * $momssats / 100; } } } else { $varenr[0] = NULL; $antal[0] = NULL; } if ($art != 'OT') { // ordrelinje til indtastning behøves ikke at vises ved 'Original tilbud' #20140716 print "<tr>\n"; print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"text-align:right\" size=\"3\" name=\"posn0\" value=\"{$posnr['0']}\"></td>\n"; if ($art == 'DK') { print "<td valign=\"top\"><input class=\"inputbox\" readonly=\"readonly\" size=\"12\" name=\"vare0\" onfocus=\"document.forms[0].fokus.value=this.name;\"></td>\n"; } else { print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" size=\"12\" name=\"vare0\" onfocus=\"document.forms[0].fokus.value=this.name;\" value=\"{$varenr['0']}\"></td>\n"; } print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"text-align:right\" size=\"4\" name=\"dkan0\" placeholder=\"{$antal['0']}\"></td>\n"; print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"background: none repeat scroll 0 0 #e4e4ee\" readonly=\"readonly\" size=\"3\"></td>\n"; //print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" size=\"58\" name=\"beskrivelse0\" onfocus=\"document.forms[0].fokus.value=this.name;\"></td>\n"; print "<td valign=\"top\"><textarea class=\"autosize inputbox ordreText comment\" id=\"comment\" rows=\"1\" cols=\"58\" name=\"beskrivelse0\" placeholder=\"{$beskrivelse['0']}\" onfocus=\"document.forms[0].fokus.value=this.name; var val=this.value; this.value=''; this.value= val;\"></textarea></td>\n"; #2013.11.27 Ændret til textarea, så hele texten vises #2013.11.29 indsat ny onfocus da chrome ikke satte curser efter tekst print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"text-align:right\" size=\"10\" name=\"pris0\" placeholder=\"" . dkdecimal($pris[0]) . "\"></td>\n"; print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"text-align:right\" size=\"4\" name=\"raba0\">\n"; if ($procentfakt) { print "</td><td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"text-align:right\" size=\"4\" name=\"proc0\" value=\"100,00\"></td>\n"; } else { print "<input type=\"hidden\" name=\"proc0\" value=\"100,00\"></td>\n"; } print "<td valign=\"top\"><input class=\"inputbox\" type=\"text\" style=\"background: none repeat scroll 0 0 #e4e4ee\" readonly=\"readonly\" size=\"10\"></td>\n"; if ($vis_projekt && !$masterprojekt) { print "<td></td>"; } if ($genfakt) { print "<td title=\"Afmærk dette felt hvis ordrelinjen ikke skal med ved genfakturering / kopiering.\"><input class=\"inputbox\" name=\"kdo[0]\" type=\"checkbox\"></td>\n"; } print "<td valign=\"top\" colspan=\"2\"><input type=\"button\" name=\"insert\" class=\"button white small bold\" value=\"B\" onClick=\"this.form.beskrivelse0.value=this.form.beskrivelse0.value.concat('<b></b>'); this.form.beskrivelse0.focus();\" title=\"Indsættes ved fed tekst. Sæt cursoren imellem <b> og </b>\n(F.eks. <b>Lorem ipsum</b>).\">\n"; #2013.11.29 Sætter fokus på felt ved clik print "<input type=\"button\" name=\"insert\" class=\"button white small italic\" value=\"I\" onClick=\"this.form.beskrivelse0.value=this.form.beskrivelse0.value.concat('<i></i>'); this.form.beskrivelse0.focus();\" title=\"Indsættes ved kursiv tekst. Sæt cursoren imellem <i> og </i>\n(F.eks. <i>Lorem ipsum</i>).\nKan også bruges til tom linje. Her insættes <i></i> uden tekst. \"></td>\n"; print "</tr>\n"; } if ($procenttillag) { $r = db_fetch_array(db_select("select beskrivelse from varer where varenr = '{$procentvare}'", __FILE__ . " linje " . __LINE__)); $tillag = $sum * $procenttillag / 100; $beskr = var2str($r['beskrivelse'], $id, $posnr[$x], $varenr[$x], $dkantal[$x], $enhed[$x], $dkpris, $dkprocent, $serienr[$x], $varemomssats[$x], $dkrabat[$x]); $beskr = str_replace('$procenttillæg;', dkdecimal($procenttillag), $beskr); print "<tr>\n"; print "<td></td>\n"; print "<td>{$procentvare}</td>\n"; print "<td></td>\n"; print "<td></td>\n"; print "<td>{$beskr}</td>\n"; print "<td></td>\n"; print "<td></td>\n"; print "<td></td>\n"; print "<td align=right>" . dkdecimal($tillag) . "</td>\n"; if ($art != 'OT') { print "<td></td>\n"; } #20140716 print "</tr>\n"; $sum += $tillag; $dbsum += $tillag; $moms += $tillag / 100 * $momssats; } print "<input type=\"hidden\" name=\"sum\" value=\"{$sum}\">\n"; if (!$blandet_moms && !$incl_moms) { $moms = $sum * $momssats / 100; } #tilfojet 20100923 grundet afrundingsfejl på ordre med rabat $moms = afrund($moms * 1, 3); $kostpris[0] = $kostpris[0] * 1; db_modify("update ordrer set sum={$sum},kostpris={$kostsum},moms={$moms} where id={$id}", __FILE__ . " linje " . __LINE__); if ($art == 'DK') { $sum = $sum * -1; $moms = $moms * -1; } $ialt = $sum + $moms; print "<tr><td colspan=\"12\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tbody>\n"; # Tabel 4.5.1 -> print "<tr>\n"; # print "<td align=\"center\">".dkdecimal($procenttillag)."% tillæg: ".dkdecimal($tillag)."</td>\n"; print "<td align=\"center\">Nettosum: " . dkdecimal($sum) . "</td>\n"; if ($vis_saet) { $db = $sum - $kostsum; } else { $db = $dbsum; } print "<td width=\"20%\" align=\"center\" title=\"DB: DKK " . dkdecimal($db * $valutakurs / 100) . "\">"; if (!$vis_saet) { print "Dækningsbidrag: " . dkdecimal($db); } print "</td>\n"; if ($sum) { $dg_sum = $db * 100 / $sum; } else { $dg_sum = dkdecimal(0); } print "<td width=\"20%\" align=\"center\" title=\"DG;" . dkdecimal($dg_sum) . "%\">"; if (!$vis_saet) { print "Dækningsgrad: " . dkdecimal($dg_sum) . "%"; } print "</td>\n"; print "<td width=\"20%\" align=\"center\" align=\"center\">Moms: " . dkdecimal($moms) . "</td>\n"; print "<td width=\"20%\" align=\"center\" align=\"center\" title=\"DG;" . dkdecimal($dg_sum) . "%\">I alt:"; if ($brugsamletpris && $art == 'DO') { print "<input type=\"hidden\" name=\"ordresum\" value=\"" . afrund($ialt, 2) . "\">"; print "<input style=\"width:100px;text-align:right\" type=\"text\" name=\"samlet_pris\" value=\"" . dkdecimal($ialt) . "\">"; } else { print dkdecimal($ialt); } print "</td>\n"; } print "</tbody></table></td></tr>\n"; # <- Tabel 4.5.1 if ($fokus != 'dkan' . count($vare_id)) { print "<input type=\"hidden\" name=\"fokus\">\n"; } #20151019 print "<tr><td align=\"center\" colspan=\"12\">\n"; print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\"><tbody><tr>\n"; # Tabel 4.5.2 -> if ($status < 3) { if ($levdiff) { $status = 1; } elseif ($status == 1) { $status++; } //if ($status<1) $width="33%"; //elseif ($sum!=0) $width="25%"; if ($hurtigfakt == 'on' && $fakturadato) { print "<input type=\"hidden\" name=\"levdato\" value=\"{$fakturadato}\">\n"; } print "<input type=\"hidden\" name=\"valutakurs\" value=\"{$valutakurs}\">\n"; print "<input type=\"hidden\" name=\"status\" value=\"{$status}\">\n"; print "<td align=\"center\" width={$width}><input type=\"submit\" class=\"button gray medium\" id=\"submit\" style=\"width:75px;\" accesskey=\"g\" value=\"Gem\" name=\"submit\" onclick=\"javascript:docChange = false;\"></td>\n"; if ($art != 'OT') { # Fjerner knappen opslag hvis art er = OT (original tilbud) #20140716 print "<td align=\"center\" width={$width}><input type=\"submit\" class=\"button blue medium\" style=\"width:75px;\" accesskey=\"o\" value=\"Opslag\" name=\"submit\" "; if ($art == "DK") { print "disabled=\"disabled\" "; } print "onclick=\"javascript:docChange = false;\"></td>\n"; } if ($status == 1 && $bogfor != 0 && $hurtigfakt != 'on' && $leveres_ialt) { if ($art == 'DO') { print "<td align=\"center\" width={$width}><input type=\"submit\" class=\"button gray medium\" style=\"width:75px;\" accesskey=\"l\" value=\"Levér\" name=\"submit\" onclick=\"javascript:docChange = false;\"></td>\n"; } else { print "<td align=\"center\" width={$width} title=\"Klik her for at tage varer retur\"><input type=\"submit\" class=\"button gray medium\" style=\"width:75px;\" accesskey=\"l\" value=\"Modtag\" name=\"submit\" onclick=\"javascript:docChange = false;\"></td>\n"; } } if ($status == 2 && $bogfor != 0 || $status > 0 && $hurtigfakt == 'on') { $disabled = NULL; $titletext = ''; $tmp = ""; $dd = date("d-m-Y"); if ($art != 'DK' && !$dan_kn) { if ($udskriv_til == 'email') { $tmp = "onclick=\"return confirm('Faktura sendes pr. mail til {$email}')\""; } elseif ($udskriv_til == 'PBS') { $tmp = "onclick=\"return confirm('Faktura tilføjes PBS/Nets liste!')\""; } elseif ($udskriv_til == 'oioubl') { $tmp = "onclick=\"return confirm('Faktura genereres som OIOUBL fil!')\""; } elseif (!$fakturadato) { $tmp = "onclick=\"return confirm('Fakturadato sættes til {$dd}!')\""; } else { $tmp = ""; } if ($vis_saet) { if (($betalingsbet == 'Netto' || $betalingsbet == 'Lb.md') && is_numeric($felt_2) && $felt_2 != 0) { #20150313 $tmp = "onclick=\"return confirm('Betalingsbetingelser er sat til {$betalingsbet} {$betalingsdage} dage og betaling til {$felt_1}!\\\n Vil du det?')\""; } else { if ($fakturadate && $fakturadate != date('Y-m-d')) { $tmp = "onclick=\"return confirm('Fakturadato er ikke idag!\\\n Vil du det?')\""; } if ($felt_2 + $felt_4 < $sum + $moms) { $disabled = 'disabled'; $titletext = 'Vælg betalingsmåde'; } } } #echo "$art=='DO' && $dan_kn<br>"; print "<td align=\"center\" width=\"{$width}\" title=\"{$titletext}\"><input {$disabled} type=\"submit\" class=\"button gray medium\" style=\"width:75px;\" accesskey=\"f\" value=\"Fakturér\" name=\"submit\" {$tmp}></td>\n"; } else { if ($vis_saet) { $disabled = NULL; $titletext = ''; $diff = afrund($felt_2 + $felt_4 + ($sum + $moms), 2); if ($diff) { $disabled = 'disabled'; $titletext = 'Vælg betalingsmåde'; } } if ($art == 'DO' && $dan_kn) { $tmp = "onclick=\"return confirm('Ordre omdannes til kreditnota ved fakturering!')\""; } if ($mail_fakt) { $tmp = "onclick=\"return confirm('Kreditnota sendes pr. mail til {$email}')\""; } print "<td align=\"center\" width=\"{$width}\" title=\"{$titletext}\"><input {$disabled} type=\"submit\" class=\"button gray medium\" style=\"width:75px;\" accesskey=\"f\" value=\"Kreditér\" name=\"submit\" {$tmp}></td>\n"; } } elseif ($del_ordre == 'on') { $txt = "Klik her for at opdele ordren i 2.<br>Den ene vil indeholde ikke leverede varer<br>Den anden vil indeholde leverede varer"; print "<td align=\"center\" width=\"{$width}\" >\n\t\t\t\t\t<span onmouseover=\"return overlib('{$txt}',WIDTH=800);\" onmouseout=\"return nd();\">\n\t\t\t\t\t<input type=\"submit\" class=\"button gray medium\" accesskey=\"f\" value=\"Del ordre\" name=\"submit\" style=\"width:75px;\" onclick=\"javascript:docChange = false;\"></span></td>\n"; } if ($linjeantal > 0 && $konto_id && ($art == 'DO' || $art == 'OT')) { # skal også med ved 'original tilbud' (OT) #20140716 if ($mail_fakt && $status < 1) { $tmp = "onclick=\"return confirm('Tilbud sendes pr mail til {$email}')\""; } elseif ($mail_fakt && $hurtigfakt && $status < 3) { $tmp = "onclick=\"return confirm('Ordrebekræftelse sendes pr mail til {$email}')\""; } elseif ($mail_fakt && $status < 2) { $tmp = "onclick=\"return confirm('Ordrebekræftelse sendes pr. mail til {$email}')\""; } else { $tmp = ""; } $udskriv_til == 'email' ? $value = 'Send' : ($value = 'Udskriv'); print "<td align=\"center\" width={$width}><input type=\"submit\" class=\"button gray medium\" style=\"width:75px;\" value=\"{$value}\" name=\"submit\" {$tmp} title=\"{$tekst2}\" onclick=\"javascript:docChange = false;\"></td>\n"; } if ($status < 3 && $brugsamletpris && $svnr && $konto_id) { print "<td align=\"center\" width={$width}><input type=\"button\" class=\"button gray medium\" style=\"width:75px;\" value=\"Sæt\" name=\"ret_saet\" title=\"Klik her for at oprette eller rette i varesæt\" onclick=\"jacascript:window.location.href='saetpris.php?id={$id}'\"></td>\n"; } $tekst = findtekst(155, $sprog_id); $tekst2 = findtekst(156, $sprog_id); if (count($leveret) == 0 && $art != 'OT' && $id) { print "<td align=\"center\"><input type=\"submit\" class=\"button rosy medium\" style=\"width:75px;\" value=\"Slet\" name=\"submit\" onclick=\"return confirm('{$tekst}')\" title=\"{$tekst2}\"></td>\n"; } if ($art == 'OT' && $sag_id) { print "<td align=\"center\"><a class=\"button gray medium mozMedium\" style=\"\" title=\"klik her for at kopiér tilbud til ny sag\" href=\"../sager/sager.php?funktion=kopi_ordre&sag_id={$sag_id}&konto_id={$konto_id}&ordre_id={$id}&returside=ordre\">Kopiér</a></td>\n"; } print "</tbody></table></td></tr>\n"; # <- Tabel 4.5.2 print "</form>\n"; print "</tbody></table></td></tr>\n"; # <- Tabel 4.5 //print "<tr><td></td></tr>\n"; } # end if ($status < 3) if ($konto_id) { $r = db_fetch_array(db_select("select kreditmax from adresser where id = '{$konto_id}'", __FILE__ . " linje " . __LINE__)); } if ($kreditmax = $r['kreditmax'] * 1) { if ($valutakurs) { $kreditmax = $kreditmax * 100 / $valutakurs; } $q = db_select("select * from openpost where konto_id = '{$konto_id}' and udlignet='0'", __FILE__ . " linje " . __LINE__); $tilgode = 0; while ($r = db_fetch_array($q)) { if (!$r['valuta']) { $r['valuta'] = 'DKK'; } if (!$r['valutakurs']) { $r['valutakurs'] = 100; } if ($valuta == 'DKK' && $r['valuta'] != 'DKK') { $opp_amount = $r['amount'] * $r['valutakurs'] / 100; } elseif ($valuta != 'DKK' && $r['valuta'] == 'DKK') { if ($r3 = db_fetch_array(db_select("select kurs from grupper,valuta where grupper.art='VK' and grupper.box1='{$valuta}' and valuta.gruppe = " . nr_cast('grupper.kodenr') . " and valuta.valdate <= '{$r['transdate']}' order by valuta.valdate desc"))) { $opp_amount = $r['amount'] * 100 / $r3['kurs']; } elseif ($valuta) { print "<BODY onLoad=\"javascript:alert('Ingen valutakurs for faktura {$r['faktnr']}')\">\n"; } } elseif ($valuta != 'DKK' && $r['valuta'] != 'DKK' && $r['valuta'] != $valuta) { $tmp == $r['amount'] * $r['valuta'] / 100; $opp_amount = $tmp * 100 / $r['valutakurs']; } else { $opp_amount = $r['amount']; } $tilgode = $tilgode + $opp_amount; } if ($kreditmax < $ialt + $tilgode) { $tmp = dkdecimal($ialt + $tilgode - $kreditmax, 2); print "<BODY onLoad=\"javascript:alert('Kreditloft overskrides med {$valuta} {$tmp}')\">\n"; } } # end if ($kreditmax.... print "</tbody></table></td></tr>\n"; # <- Tabel 4 print "</form>\n"; # } # end else for (if ($status>=3)) # ADD LINK TO GLS!! if ($db_id == '390') { # || $db_id=='2' print "<tr><td align=\"center\"><br>"; print "<form name=\"glslabel_form\" action=\"../includes/gls.php\" target=\"_blank\" method=\"POST\">" . "\n<input type=\"hidden\" name=\"txtAction\" value=\"70120\">" . "\n<input type=\"hidden\" name=\"txtConsigneeNo\" value=\"" . $kontonr . "\">" . "\n<input type=\"hidden\" name=\"txtWeight\" value=\"1\">" . "\n<input type=\"hidden\" name=\"txtCountryNum\" value=\"208\">" . "\n<input type=\"hidden\" name=\"txtReferenceNo\" value=\"" . $ordrenr . " \">" . "\n<input type=\"hidden\" name=\"txtConsigneeEmail\" value=\"" . $email . " \">"; if (!empty($lev_navn)) { print "\n<input type=\"hidden\" name=\"txtName1\" value=\"" . $lev_navn . "\">"; print "\n<input type=\"hidden\" name=\"txtZipCodeDisplay\" value=\"" . $lev_postnr . "\">"; print "\n<input type=\"hidden\" name=\"txtCity\" value=\"" . $lev_bynavn . "\">"; print "\n<input type=\"hidden\" name=\"txtStreet\" value=\"" . $lev_addr1 . "\">"; print "\n<input type=\"hidden\" name=\"txtName2\" value=\"" . $lev_addr2 . "\">"; print "\n<input type=\"hidden\" name=\"txtContact\" value=\"" . $lev_kontakt . "\">"; } else { print "\n<input type=\"hidden\" name=\"txtName1\" value=\"" . $firmanavn . "\">"; print "\n<input type=\"hidden\" name=\"txtZipCodeDisplay\" value=\"" . $postnr . "\">"; print "\n<input type=\"hidden\" name=\"txtCity\" value=\"" . $bynavn . "\">"; print "\n<input type=\"hidden\" name=\"txtStreet\" value=\"" . $addr1 . "\">"; print "\n<input type=\"hidden\" name=\"txtName2\" value=\"" . $addr2 . "\">"; print "\n<input type=\"hidden\" name=\"txtContact\" value=\"" . $kontakt . "\">"; } print "\n<input type=\"submit\" value=\"Send til GLS\"></form>"; if ($cvrnr && !is_numeric(substr($cvrnr, 0, 2))) { $landekode = substr($cvrnr, 0, 2); } elseif (strtolower($land) == 'sverige' || strtolower($land) == 'sweden') { $landekode = 'se'; } elseif (strtolower($land) == 'norge' || strtolower($land) == 'norway') { $landekode = 'no'; } else { $landekode = 'se'; } print "<form name=\"fedexlabel_form\" action=\"https://www.fedex.com/shipping/shipEntryAction.do\" target=\"_blank\" method=\"POST\">" . "\n<input type=\"hidden\" name=\"txtAction\" value=\"70120\">" . "\n<input type=\"hidden\" name=\"txtConsigneeNo\" value=\"" . $kontonr . "\">" . "\n<input type=\"hidden\" name=\"txtWeight\" value=\"1\">" . "\n<input type=\"hidden\" name=\"txtCountryNum\" value=\"208\">" . "\n<input type=\"hidden\" name=\"billingData.referenceData.yourReference\" value=\"" . $ordrenr . "\">" . "\n<input type=\"hidden\" name=\"notificationData.recipientNotifications.email\" value=\"" . $email . "\">" . "\n<input type=\"hidden\" name=\"notificationData.recipientNotifications..pickupNotificationFlag\" value=\"true\">" . "\n<input type=\"hidden\" name=\".companyName\" value=\"" . $firmanavn . "\">" . "\n<input type=\"hidden\" name=\"toData.addressLine1\" value=\"" . $addr1 . "\">" . "\n<input type=\"hidden\" name=\"toData.addressLine2\" value=\"" . $addr2 . "\">" . "\n<input type=\"hidden\" name=\"toData.city\" value=\"" . $bynavn . "\">" . "\n<input type=\"hidden\" name=\"toData.zipPostalCode\" value=\"" . $postnr . "\">" . "\n<input type=\"hidden\" name=\"toData.contactName\" value=\"" . $kontakt . "\">" . "\n<input type=\"hidden\" name=\"toData.countryCode\" value=\"{$landekode}\">" . "\n<input type=\"hidden\" name=\"toData.taxID\" value=\"" . $cvrnr . "\">" . "\n<input type=\"hidden\" name=\"toData.phoneNumber\" value=\"" . $tlf . "\">" . "\n<input type=\"hidden\" name=\"psdData.numberOfPackages\" value=\"1\">" . "\n<input type=\"hidden\" name=\"psdData.mpsRowDataList[0].weight\" value=\"1\">" . "\n<input type=\"hidden\" name=\"psdData.serviceType\" value=\"International Economy\">" . "\n<input type=\"hidden\" name=\"psdData.packageType\" value=\"Your Packaging\">" . "\n<input type=\"hidden\" name=\"psdData.serviceType\" value=\"International Economy\">" . "\n<input type=\"hidden\" name=\"billingData.selectedBillDutiesAndTaxIndex\" value=\"R\">" . "\n<input type=\"hidden\" name=\"billingData.referenceData.invoiceNumber\" value=\"{$fakturanr}\">"; //fedex fragttype "\n<input type=\"hidden\" name=\"commodityData.totalCustomsValue\" value=\"{$sum}\">" . "\n<input type=\"hidden\" name=\"commodityData.documentShipping\" value=\"false\">"; // if (!empty($lev_navn)) { print "\n<input type=\"hidden\" name=\"toData.addressData.countryCode\" value=\"{$landekode}\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.companyName\" value=\"" . $lev_navn . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.zipPostalCode\" value=\"" . $lev_postnr . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.city\" value=\"" . $lev_bynavn . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.addressLine1\" value=\"" . $lev_addr1 . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.addressLine2\" value=\"" . $lev_addr2 . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.contactName\" value=\"" . $lev_kontakt . "\">"; } else { print "\n<input type=\"hidden\" name=\"toData.addressData.countryCode\" value=\"{$landekode}\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.companyName\" value=\"" . $firmanavn . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.zipPostalCode\" value=\"" . $postnr . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.city\" value=\"" . $bynavn . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.addressLine1\" value=\"" . $addr1 . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.addressLine2\" value=\"" . $addr2 . "\">"; print "\n<input type=\"hidden\" name=\"toData.addressData.contactName\" value=\"" . $kontakt . "\">"; } print "\n<input type=\"submit\" value=\"Send til Fedex\"></form>"; print "</td></tr>"; } print "<!--Function ordreside s**t-->"; }
<TITLE>Test for Manuel Lemos' PHP HTTP class to save and restore cookies</TITLE> </HEAD> <BODY> <H1><CENTER>Test for Manuel Lemos' PHP HTTP class to save and restore cookies</CENTER></H1> <HR> <UL> <?php require "http.php"; set_time_limit(0); $http = new http_class(); $http->debug = 0; $http->html_debug = 1; $http->follow_redirect = 1; $url = "http://my.yahoo.com/"; $error = $http->GetRequestArguments($url, $arguments); echo "<H2><LI>Opening connection to:</H2>\n<PRE>", HtmlEntities($arguments["HostName"]), "</PRE>\n"; flush(); $error = $http->Open($arguments); if ($error == "") { echo "<H2><LI>Sending request for page:</H2>\n"; echo "<PRE>", HtmlSpecialChars($arguments["RequestURI"]), "</PRE>\n"; flush(); $error = $http->SendRequest($arguments); if ($error == "") { echo "<H2><LI>Getting response headers ...</H2>\n"; flush(); $headers = array(); $error = $http->ReadReplyHeaders($headers); if ($error == "") { echo "<H2><LI>Response status code:</LI</H2>\n<PRE>" . $http->response_status . "</PRE>\n"; flush();
function EncodeHTMLString($string) { switch (strtolower($this->encoding)) { case "iso-8859-1": return HtmlEntities($string); default: return HtmlSpecialChars($string); } }
$error = $http->SendRequest($arguments); if ($error == "") { echo "<H2><LI>Request:</LI</H2>\n<PRE>\n" . HtmlEntities($http->request) . "</PRE>\n"; echo "<H2><LI>Request headers:</LI</H2>\n<PRE>\n"; for (Reset($http->request_headers), $header = 0; $header < count($http->request_headers); Next($http->request_headers), $header++) { $header_name = Key($http->request_headers); if (GetType($http->request_headers[$header_name]) == "array") { for ($header_value = 0; $header_value < count($http->request_headers[$header_name]); $header_value++) { echo $header_name . ": " . $http->request_headers[$header_name][$header_value], "\r\n"; } } else { echo $header_name . ": " . $http->request_headers[$header_name], "\r\n"; } } echo "</PRE>\n"; echo "<H2><LI>Request body:</LI</H2>\n<PRE>\n" . HtmlEntities($http->request_body) . "</PRE>\n"; flush(); $headers = array(); $error = $http->ReadReplyHeaders($headers); if ($error == "") { echo "<H2><LI>Response headers:</LI</H2>\n<PRE>\n"; for (Reset($headers), $header = 0; $header < count($headers); Next($headers), $header++) { $header_name = Key($headers); if (GetType($headers[$header_name]) == "array") { for ($header_value = 0; $header_value < count($headers[$header_name]); $header_value++) { echo $header_name . ": " . $headers[$header_name][$header_value], "\r\n"; } } else { echo $header_name . ": " . $headers[$header_name], "\r\n"; } }
$to_address = $to[$recipient]["address"]; $to_name = $to[$recipient]["name"]; $email_message->SetEncodedEmailHeader("To", $to_address, $to_name); /* Do we really need to personalize the message body? * If not, let the class reuse the message body defined for the first recipient above. */ if (!$email_message->cache_body) { /* * Create a personalized body parts, either HTML and text * alternative parts. */ $first_name = strtok($to_name, " "); $balance = number_format($to[$recipient]["balance"], 2); $html_smarty->assign("firstname", HtmlEntities($first_name)); $html_smarty->assign("balance", HtmlEntities($balance)); $html_smarty->assign("email", HtmlEntities($to_address)); $email_message->CreateQuotedPrintableHtmlPart($html_smarty->fetch("mailing.html.tpl"), "", $recipient_html_part); /* Make the personalized replace the initially empty HTML part */ $email_message->ReplacePart($html_part, $recipient_html_part); $text_smarty->assign("firstname", $first_name); $text_smarty->assign("balance", $balance); $text_smarty->assign("email", $to_address); $email_message->CreateQuotedPrintableTextPart($email_message->WrapText($text_smarty->fetch("mailing.txt.tpl")), "", $recipient_text_part); /* Make the personalized replace the initially empty text part */ $email_message->ReplacePart($text_part, $recipient_text_part); } /* Send the message checking for eventually acumulated errors */ $error = $email_message->Send(); if (strlen($error)) { break; }
public function CreateTableRow($row, $links = null, $styles = null, $events = null, $id = null) { // Replace Standart Styles $class_normal = $this->baseclass . '_normal'; $class_over = $this->baseclass . '_over'; $class_td = $this->baseclass . '_td'; if (count($styles) > 0) { if (array_key_exists('normal', $styles)) { if (is_array($styles['normal'])) { $class_normal = implode(' ', $styles['normal']); } else { $class_normal = $styles['normal']; } } if (array_key_exists('over', $styles)) { $class_over = $styles['over']; } if (array_key_exists('td', $styles)) { $class_td = $styles['td']; } } // Get Additional Events $AddEvents = ''; if ($events !== null && count($events) > 0) { while (list($event, $action) = each($events)) { if (strtolower($event) != 'onmouseover' && strtolower($event) != 'onmouseout') { $AddEvents = " {$event}=\"{$action};\" "; } } } if ($id !== null) { $id = "id=\"{$id}\" "; } $res = "<tr {$id}class=\"{$class_normal}\" onmouseover=\"this.className='{$class_over}';\" onmouseout=\"this.className='{$class_normal}';\" {$AddEvents}>\n"; $cont = 0; foreach ($this->fields as $field) { $hint = ''; if ($field['visible']) { $type = strtoupper($field['type']); if ($type == 'LINK') { $value = $this->CreateLinksCell($links); $res .= " <td class=\"{$class_td}\" align=\"center\">{$value}</td>\n"; } else { if ($field['align'] == '') { $align = $this->GetDefaultAlign($field['type']); } else { $align = strtolower($field['align']); } if ($field['type'] != 'CALCULATED') { // if (is_array($row)) $value = $row[$field['field']]; // else if (is_object($row)) $value = $row->getField($field['field']); if (is_array($row)) { $value = $row[$field['field']]; } else { $value = $row->getField($field['field']); } // PH: do not escape anything different from a string // TODO: check if a not empty string is returned as empty string. Give a warning mentioning the charset in that case if ($this->SetHtmlEntities && is_string($value)) { $value = HtmlEntities($value, ENT_QUOTES, $this->charset); } $format = $field['format']; $number_format = $field['number_format']; // Corregge il campo data if ($field['type'] == 'DATE') { if ($value == '0000-00-00') { $value = ''; } else { $value = SQLDateToStr($value, $format === false ? 'd/m/Y' : $format); } } else { if ($field['type'] == 'TIME') { if ($value == '00:00:00') { $value = ''; } else { $value = SQLDateToStr($value, $format === false ? 'H:i:s' : $format); } } else { if ($field['type'] == 'DATETIME') { if ($value == '0000-00-00 00:00:00') { $value = ''; } else { $value = SQLDateToStr($value, $format === false ? 'd/m/Y H:i:s' : $format); } } else { if (strpos($field['type'], 'URL') !== false) { if (strpos($field['type'], 'MAILTO') !== false) { $value = sprintf("<a href=\"mailto:%s\">%s</a>", $value, $value); } else { $value = sprintf("<a href=\"%s\" target=\"_BLANK\">%s</a>", $value, $value); } } else { if ($field['type'] == 'EURO') { // DEPRECATED! $value = valueToEuro($value); } else { if ($field['type'] == 'CHECKBOX') { if (!isset($_SESSION[$this->name][$field['field']])) { $_SESSION[$this->name][$field['field']] = array(); } if (!isset($_SESSION[$this->name][$field['field'] . '_off'])) { $_SESSION[$this->name][$field['field'] . '_off'] = array(); } if (in_array($value, $_SESSION[$this->name][$field['field']]) || $_SESSION[$this->name][$field['field'] . '_header'] == 'T' && !in_array($value, $_SESSION[$this->name][$field['field'] . '_off'])) { $checked = 'checked'; } else { $checked = ''; } // if (1==1) $checked = 'checked'; // else $checked = ''; // $value = "<input type=\"checkbox\" name=\"" . $field['field'] . "[]\" id=\"" . $field['field'] . "_$value\" value=\"$value\" $checked onclick=\"simpletable_onCheckboxClick(this, '" . $field['field'] . "', '" . $value . "')\">"; $tmp_value = ''; // - checkbox $tmp_value .= "<input type=\"checkbox\" name=\"" . $field['field'] . "[]\" id=\"" . $field['field'] . "_{$value}\" value=\"{$value}\" onClick=\"simpletable_setHeaderCheckboxStatus(this);\" {$checked}>"; // - hidden var (to store/remove old status) $tmp_value .= "<input type=\"hidden\" name=\"" . $field['field'] . "_hd[]\" id=\"" . $field['field'] . "_hd_{$value}\" value=\"{$value}\">"; $value = $tmp_value; //if (isset($field['header_checkbox']) && $field['header_checkbox'] == true) { //$label = "<input type=\"checkbox\" name=\"" . $field['field'] . "_header\" value=\"T\" onclick='simpletable_onHeaderCheckboxClick()'>" . $label; //unset($field['sortable']); //} } else { // Format or number_format if ($value != '') { if ($format !== false) { $value = sprintf($format, $value); } else { if ($number_format !== false) { if (!defined("__R3_LOCALE__")) { require_once 'r3locale.php'; } $localeInfo = getLocaleInfo(); if (!is_array($number_format)) { $number_format = array('decimals' => $number_format, 'dec_point' => $localeInfo['decimal_point'], 'thousands_sep' => $localeInfo['thousands_sep']); } else { $number_format = array_merge(array('decimals' => 0, 'dec_point' => $localeInfo['decimal_point'], 'thousands_sep' => $localeInfo['thousands_sep']), $number_format); } if ($number_format['decimals'] === null && is_numeric($value)) { $diff = round($value - (int) $value, 10); if ($diff == 0) { $number_format['decimals'] = 0; } else { $number_format['decimals'] = strlen($diff) - 2; // -2 is 0. of the number } } $value = number_format($value, $number_format['decimals'], $number_format['dec_point'], $number_format['thousands_sep']); } } } } } } } } } } else { // Calculated fields if (isset($this->calcvalues[$cont]['value'])) { $value = $this->calcvalues[$cont]['value']; } else { $value = ''; } if (isset($this->calcvalues[$cont]['hint'])) { $hint = 'title="' . htmlspecialchars($this->calcvalues[$cont]['hint']) . '"'; } } // Replace spaces from value with if ($field['type'] != 'CALCULATED' && $field['type'] != 'CHECKBOX' && strpos($field['type'], 'URL') === false && $field['wrap'] != true) { $value = str_replace(" ", " ", $value); } // add new line if ($field['wrap']) { $value = nl2br($value); } $res .= " <td class=\"{$class_td}\" align=\"{$align}\" {$hint}>{$value}</td>\n"; } } $cont++; } $res .= "</tr>\n"; // Clear calculated array unset($this->calcvalues); return $res; }
<title>Test for Manuel Lemos' PHP form class using the linked select plug-in input</title> </head> <body onload="<?php echo $onload; ?> " bgcolor="#cccccc"> <center><h1>Test for Manuel Lemos' PHP form class using the linked select plug-in input</h1></center> <hr /> <?php if ($doit) { $form->GetInputProperty("continent", "SelectedOption", $continent); $form->GetInputProperty("country", "SelectedOption", $country); $form->GetInputProperty("location", "SelectedOption", $location); ?> <center><h2>The chosen location is <?php echo HtmlEntities($location), " (", HtmlEntities($country), ", ", HtmlEntities($continent), ")"; ?> </h2></center> <?php } else { $form->StartLayoutCapture(); $title = "Linked select plug-in test"; $body_template = "form_linked_select_body.html.php"; include "templates/form_frame.html.php"; $form->EndLayoutCapture(); $form->DisplayOutput(); } ?> <hr /> </body> </html>
function OutputDebug($message) { if ($this->log_debug) { error_log($message); } else { $message .= "\n"; if ($this->html_debug) { $message = str_replace("\n", "<br />\n", HtmlEntities($message)); } echo $message; flush(); } }
foreach ($Derp as $Error) { $Line = $Error[0]; $Type = $Error[1]; $Name = $Error[3]; $Error = $Error[2]; echo "<li class=\"msg_{$Type}\">"; echo "<span class=\"err_type\"><img src=\"icon_{$Type}.png\" alt=\"\" width=\"16\" height=\"16\"></span>"; if ($Line > 0) { echo "Line <b>{$Line}</b>: "; } echo $Error; if ($Line > 0) { $Line = HtmlEntities(UTF8_Encode($Data[--$Line])); echo "<p><pre>{$Line}</pre></p>"; if (!empty($Name)) { $Line = HtmlEntities(UTF8_Encode($Data[$OriginalLines[$Name] - 1])); echo "<p>English line:<pre>{$Line}</pre></p>"; } } echo "</li>"; } echo "</ol></li>"; } echo "</ol>"; /*echo "<textarea class=\"form-control\">[SPOILER=.txt]"; foreach( $Errors as $Section => $Derp ) { echo "Section [B][".HtmlEntities( $Section )."][/B]:\n[LIST]"; foreach( $Derp as $Error )