15. april 2005 - 09:21
#1
<?php
# Code by Lars B. Jensen, lars.jensen@ljweb.com
# All Rights Reserved.
# Include the global configuration file
require('system/global_defs.php');
# Check for page var is set
$page = 'front';
if (isset($_GET['page']))
$page = $_GET['page'];
if (isset($_GET['area']))
$page .= '_'.$_GET['area'];
$page;
/* TEMP FIX */
$val = explode('/', $_SERVER['REDIRECT_URL']);
$val = explode('/', $_SERVER['PHP_SELF']);
$_GET['id'] = $val[3];
$page = 'salg_'.$val[2];
$area = $val[2];
$_GET['area'] = $area;
/* TEMP FIX */
if ($_GET['id']) {
//SELECT tilbud, rev, r9, r18 FROM tilbud JOIN tilbud0 ON tilbud.id = tilbud0.id && tilbud.id='".addslashes($_GET['id'])."'
$sql = mysql_query("
SELECT ordre, rev, r9, r18
FROM ordre
JOIN ordre0 ON ordre.id = ordre0.id && ordre.id ='".addslashes($_GET['id'])."'
") or die(mysql_error());
$foo = mysql_fetch_array($sql);
$nr = $foo[0];
$rev = $foo[1];
if (isset($_GET['rev']) && $_GET['rev'] == 1) $rev++;
$int['revision'] = $rev;
} else {
$nr = '-';
$rev = '-';
$int['revision'] = '0';
}
$AFSOV = array();
$AFSOV['ordre1'] = 'Kunde og Bygherre';
$AFSOV['ordre2'] = 'Bygningsgeometri';
$AFSOV['ordre3'] = 'Beregningsforudsætninger';
$AFSOV['ordre5'] = 'Beklædning';
$AFSOV['ordre6'] = 'Gavlsøjler';
$AFSOV['ordre7'] = 'Vindafstivning';
$AFSOV['ordre8'] = 'Gavlsøjler beregnet efter gammel dansk norm';
$AFSOV['ordre9'] = 'Kalkulation';
$AFSOV['ordre11'] = 'Ordrebekræftelse';
$AFSOV['ordre12'] = 'Statusoversigt';
$AFSOV['ordre13'] = 'Indgåede aftaler journal / logbog';
$AFSOV['ordre14'] = 'Afslut ordre';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Ordre nr. <?php echo $nr; ?>R<?php echo $rev; ?> - <?php echo $foo['r9']?> - <?php echo $foo['r18']?></title>
<style type="text/css">
<!--
body {
margin-bottom : 0px;
margin-left : 0px;
margin-right : 0px;
margin-top : 0px;
font-family : Geneva, Arial, Helvetica, sans-serif;
}
a, a:visited, a:active {
text-decoration: underline;
color : #363636;
}
a:hover {
text-decoration: underline;
color : #363636;
}
a.title, a.title:visited, a.title:active, a.title:hover {
text-decoration: underline;
color : #26354C;
font-size: 16px;
}
div { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; }
td.menu {
font-size: 11px;
line-height: 16px;
color: #363636;
text-align: left;
}
td.title {
font-size: 20px;
color: #26354C;
text-align: left;
padding-bottom : 10px;
}
td.subtitle {
font-size: 16px;
color: #26354C;
text-align: left;
}
td.content {
font-size: 11px;
line-height: 16px;
color: #363636;
text-align: justify;
}
td.legend {
font-size: 13px;
color: #363636;
font-weight: bold;
border-bottom: 1px solid #e9e9e9;
padding-top : 5px;
padding-bottom : 5px;
}
td.shortcut {
font-size: 10px;
color: #363636;
padding-top : -2px;
padding-bottom : 5px;
}
td.listend {
border-top: 1px solid #e9e9e9;
}
td.list0 {
font-size: 11px;
color: #363636;
background-color: #f9f9f9;
padding-top : 5px;
padding-bottom : 5px;
}
td.list1 {
font-size: 11px;
color: #363636;
background-color: #efefef;
padding-top : 5px;
padding-bottom : 5px;
}
ul { margin-top: 0px; margin-bottom: 10px; }
td.menuspace {
height: 5;
background-color: #efefef;
border-bottom: 1px solid #cdcdcd;
font-size : 11px;
font-weight: bold;
color : #363636;
}
td.contenttopleft {
height: 35;
background-color: #efefef;
border-left: 1px solid #cdcdcd;
border-bottom: 1px solid #cdcdcd;
font-size : 20px;
font-weight: bold;
color : #363636;
}
td.contenttopright {
height: 35;
background-color: #efefef;
border-bottom: 1px solid #cdcdcd;
border-right: 1px solid #cdcdcd;
font-size : 20px;
font-weight: bold;
color : #363636;
}
td.contentbottom {
background-color: #ffffff;
border-bottom: 1px solid #cdcdcd;
border-right: 1px solid #cdcdcd;
border-left: 1px solid #cdcdcd;
font-size : 12px;
color : #363636;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 5px;
padding-right: 5px;
}
td.menu {
height: 40;
background-color: #efefef;
border-bottom: 1px solid #cdcdcd;
padding-left: 5px;
font-size : 11px;
font-weight: bold;
color : #363636;
}
td.menu1 {
height: 40;
background-color: #ffffff;
border-bottom: 1px solid #cdcdcd;
padding-left: 5px;
font-size : 11px;
font-weight: bold;
color : #363636;
}
input.submit {
width: 100;
height: 22;
background-color: #efefef;
border: 1px solid #cdcdcd;
font-size : 11px;
font-weight: bold;
color : #363636;
}
input.submit2 {
width: 150;
height: 22;
background-color: #efefef;
border: 1px solid #cdcdcd;
font-size : 11px;
font-weight: bold;
color : #363636;
}
input.minisubmit {
width: 50;
height: 20;
background-color: #efefef;
border: 1px solid #cdcdcd;
font-size : 10px;
font-weight: bold;
color : #363636;
}
input.listform, select.listform {
width: 190;
background-color: #f3f3f3;
border: 1px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
input.listformx, select.listformx {
width: 190;
background-color: #ffffff;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
input.listformy, select.listformy, input.listformxy, select.listformxy {
width: 190;
background-color: #E8EF94;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
input.inputsmall {
width: 145;
background-color: #f3f3f3;
border: 1px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
input.submitsmall {
width: 40;
height: 17;
background-color: #efefef;
border: 1px solid #cdcdcd;
font-size : 9px;
font-weight: bold;
color : #363636;
}
textarea.listform {
width: 335;
height: 40;
background-color: #f3f3f3;
border: 1px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listform2 {
width: 190;
height: 100;
background-color: #f3f3f3;
border: 1px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listformx {
width: 335;
height: 40;
background-color: #ffffff;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listform2x {
width: 190;
height: 100;
background-color: #ffffff;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listformy, textarea.listformxy {
width: 335;
height: 40;
background-color: #E8EF94;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listform2y, textarea.listform2xy {
width: 190;
height: 100;
background-color: #E8EF94;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listformwide {
width: 535;
height: 75;
background-color: #f3f3f3;
border: 1px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listformwidex {
width: 535;
height: 75;
background-color: #ffffff;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
textarea.listformwidey, textarea.listformwidexy {
width: 535;
height: 75;
background-color: #E8EF94;
border: 0px solid #cdcdcd;
font-size : 11px;
color : #363636;
}
#left {
width: 135px;
float : left;
font-size : 13px;
color : #363636;
}
#right {
left: 175px;
width: 790px;
font-size : 11px;
color : #363636;
}
#right td {
font-size : 11px;
color : #363636;
}
-->
</style>
<script language="JavaScript" type="text/javascript">
<!--
function openWin(windowURL, windowName) {
return window.open(windowURL, windowName, 'width=950,height=700,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=0');
}
function openSmall(windowURL, windowName) {
return window.open(windowURL, windowName, 'width=400,height=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1');
}
function openParent(windowURL) {
window.opener.location.href = windowURL;
window.opener.focus();
}
function setVal(f, v) {
document.forms['ds'].elements[f].value = v;
}
function goPage(no) {
var page = '<?php echo $_GET['area']; ?>';
if (page == 'ordre9') performBeregn();
if (page == 'ordre8') performBeregn(false);
document.forms['ds'].elements['nextpage'].value = no;
document.forms['ds'].submit();
}
function goPageAndReload(no) {
document.forms['ds'].elements['nextpage'].value = no;
document.forms['ds'].elements['reload'].value = '1';
document.ds.submit();
}
function focusNewKunde(ref) {
opener.location.href = ref;
opener.focus();
}
function goSave() {
var no = '<?php echo substr($_GET['area'],5); ?>';
if (no == '9') { performBeregn(); no = '#9'; }
if (no == '8') performBeregn(false);
document.forms['ds'].elements['nextpage'].value = no;
document.forms['ds'].submit();
}
function valider() {
var fejl = "";
var page = '<?php echo $_GET['area']; ?>';
if (page == 'tilbud2'){
if (ds.r38.value < 1 || ds.r38.value > 10 || ds.r39.value < 1 || ds.r39.value > 10)
fejl += "Du har valgt en højde, som enten er for stor eller lille\n";
if (ds.r38.value == "")
fejl += "Angiv venligst højde\n";
if (ds.r40.value < 0 || ds.r40.value > 80 || ds.r41.value < 0 || ds.r41.value > 80)
fejl += "Du har valgt en taghældning som enten er for lille eller for stor\n";
if (ds.r40.value == "")
fejl += "Angiv venligst taghældning\n";
if (ds.r53b.value == "" )
fejl += "Vælg venligst overfladebehandling\n";
if (ds.r55.value == "" )
fejl += "Vælg venligst produktionsmetode";
}
if (fejl != "") {
alert(fejl);
} else{
ds.submit();
}
}
-->
</script>
</head>
<body>
<div id="left" onClick="valider();">
<table width="135" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td class="menuspace"><img src="/gfx/transparent.gif" width="1" height="1" alt="" border="0"></td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre1') echo '1'; ?>" onClick="goPage(1);">Kunde og bygherre</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre2') echo '1'; ?>" onClick="goPage(2);">Bygningsgeometri</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre3') echo '1'; ?>" onClick="goPage(3);">Beregnings-forudsætninger</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre5') echo '1'; ?>" onClick="goPage(5);">Beklædning</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre9') echo '1'; ?>" onClick="goPage(9);">Kalkulation</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre9') echo '1'; ?>" onClick="goPage('#9');">Forudsætninger og forbehold</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre11') echo '1'; ?>" onClick="goPage(11);">Ordrebekræftelse</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre12') echo '1'; ?>" onClick="goPage(12);">Statusoversigt</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre13') echo '1'; ?>" onClick="goPage(13);">Indgåede aftaler journal / logbog</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'ordre14') echo '1'; ?>" onClick="goPage(14);">Afslut ordre</td>
</tr>
<tr>
<td class="menuspace"><img src="/gfx/transparent.gif" width="1" height="1" alt="" border="0"></td>
</tr>
<tr>
<td class="menu" onClick="goSave();">Gem</td>
</tr>
<tr>
<td class="menu"><b>Filliste:</b></td>
</tr>
<?php
if ($_nr != "-") {
$root = 'Ordre/'.$nr;
?>
<tr><td><iframe name="stifinder" width="135" height="250" src="/stifinder.php?root=<?php echo $root; ?>"></iframe></td></tr>
<?php
}
?>
</table>
</div>
<div id="right" width="400">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td class="contenttopleft" align="left"> <?php echo $AFSOV[$_GET['area']]; ?></td>
<td class="contenttopright" align="right">Ordre nr. <?php echo $nr; ?> <?php if ($rev > 0) echo "Rev. $rev"; ?> </td>
</tr>
<tr>
<td class="contentbottom" colspan="2"><?php include('content/pop'.$page.'.php'); ?></td>
</tr>
</table>
</div>
<script language="JavaScript" type="text/javascript">
<!--
function setClass() {
var fields = new Array('2','11','12','13','15','99','100','104','105','109','110','114','115','119','120','124','125','129','130','134','135','139','140','144','145','149','150','154','155','159','160','164','165','169','170','174','175','179','180','184','185','189','190','194','195','199','200','204','205','209','210','214','215','219','220','224','225','229','230','234','235','236','238','240','244','246','248','249','250','251','252','256','257','261','262','266','267','271','272','276','277','281','282','286','287','291','292','296','297','301','302','306','307','311','312','316','317','318','320','336','344','347','356','359','368','371','379','382','391','396','399','402','407','410','412','415','418','421','421a','424','424a','428','428a','431','433','435','436','439','439a','442','442a','446','446a','449','451','453','454','457','457a','460','460a','466','469','471','473','477','477a','482','487','500','501','503','504','505a','506','507','508','509','509a','509b','510','511','512','513','514','515','516','517','518b','520','521','522','523','524','525','245','253','258','263','268','273','278','283','288','293','298','303','308','313','10','21','337','338','339','340','341','342','370','372','373','374','375','376','377','392','394','403','405','492','495','490','480','485','497','499c','98','103','108','113','118','123','128','133','138','143','148','153','158','163','168','173','178','183','188','193','198','203','208','213','218','223','228','233','343','378','355','367','390','395','406','462','463','465','411','241','242','243','247','531a','532a','533a','528','96','101','106','111','116','121','126','131','136','141','146','151','156','161','166','171','176','181','186','191','196','201','206','211','216','221','226','231',
'257a','257b','262a','262b','267a','267b','272a','272b','277a','277b','282a','282b','287a','287b','292a','292b','297a','297b','302a','302b','307a','307b','312a','312b','317a','317b','318a','318b','320b','535','535a','535b','536','536a','533b');
for (i=0;i<fields.length;i++) {
if (document.ds.elements['r'+fields[i]]) {
document.ds.elements['r'+fields[i]].className = document.ds.elements['r'+fields[i]].className+'x';
document.ds.elements['r'+fields[i]].readOnly = true;
}
}
}
function setColor() {
var fields = new Array('38','39','40','41','45','46a','47b','49a','239','249a', '321', '322', '323', '324', '325', '326', '327', '328', '329', '330', '331', '332', '333');
for (i=0;i<fields.length;i++) {
if (document.ds.elements['r'+fields[i]]) document.ds.elements['r'+fields[i]].className = document.ds.elements['r'+fields[i]].className+'y';
}
}
function setTabindex() {
var fields = new Array('r9','kns','r14','kns2','r4','r5','r6','r7','r8','r18','kns3','r9a','r24','r25','r26','r27','r28','r29','r30','r31','r32','r32a','r33','r42','r42a','r43','r44','r43a','r44a','r37','r36','r38','r39','r40','r41','r34','r34a','r34b','r34c','r34d','r34e','r35','r35a','r35b','r35c','r35d','r35e','r35f','r35g','r53b','r54','r54a','r55','r45','r49','r50','r46','r47','r47a','r57','r57a','r48','r56','r56a','r56b','r58','r58a','r58b','r58c','r58d','r59','r59a','r59b','r60','r60a','r61','r61a','r60b','r62','r62a','r63','r63a','r63b','r63c','r63d','r64','r65','r66','r66a','r67','r68','r69','r70','r72','r73','r73a','r74','r75','r77','r78','r76','r71','r334','r335','r343a','r369','r83c','r83aselect','r83b','r378a','r345','r346','r348','r349','r350','r351','r352','r353','r354','r355a','r357','r358','r360','r361','r362','r363','r364','r365','r366','r367a','r380','r381','r383','r384','r385','r386','r387','r388','r389','r390a','regn8','r395a','r404','r406a','r461','r462','r463','r464','r465a','r468','r419','r422','r423','r425','r426','r419a','r422a','r423a','r425a','r426a','r437','r440','r441','r443','r444','r437a','r440a','r441a','r443a','r444a','r429','r432','r433','r434','r435','r447','r450','r451','r452','r453','r408','r409','r411a','r470','r397','r398','r400','r401','r413','r414','r416','r417','r455','r456','r458','r459','r455a','r456a','r458a','r459a','r474','r475','r476','r478a','r478b','r478c','r483','r484','r486','r482a','r482b','r478','r479','r481','r498','r478d','r488','r489','r491','r493','r494','r496','r499a','r499b','r499','r502','r505a','r514a','r515a','r507a','r508a','r516a','r517a','r518a','r518','r519a','r519','r526','r243','r249a','r253','r321','r254','r255','r258','r322','r259','r260','r263','r323','r264','r265','r268','r224','r269','r270','r273','r325','r274','r275','r278','r326','r279','r280','r283','r327','r284','r285','r288','r328','r289','r290','r293','r329','r294','r295','r298','r330','r299','r300','r303','r331','r304','r305','r308','r332','r309','r310','r313','r333','r314','r315','r96','r97','r98','r116','r117','r118','r126','r127','r128','r136','r137','r138','r146','r147','r148','r156','r157','r158','r166','r167','r168','r101','r102','r103','r121','r122','r123','r131','r132','r133','r141','r142','r143','r151','r152','r153','r161','r162','r163','r171','r172','r173','r106','r107','r108','r176','r177','r178','r186','r187','r188','r196','r167','r168','r206','r207','r208','r216','r217','r218','r226','r227','r228','r111','r112','r113','r181','r182','r183','r191','r192','r193','r201','r202','r203','r211','r212','r213','r221','r222','r223','r231','r232','r233','r237','submit2');
var tab = 1;
for (i=0;i<fields.length;i++) {
if (document.ds.elements[''+fields[i]]) document.ds.elements[''+fields[i]].tabIndex = tab++;
}
}
setTimeout('setColor();',10);
setTimeout('setClass();',20);
setTimeout('setTabindex();',30);
//-->
</script>
</body>
</html>