22. januar 2010 - 11:36
#5
Det er reelt 2 siden, hvor den ene indkludere den anden...
Den første er en slags popupsiden, der er rammen om den anden side. Den anden side kan så ændre sig "dynamisk" alt efter hvilket menupunk brugerne vælger på popupsiden... Kort fortalt :-)
Popup:
<?php
# Include the global configuration file
require('system/global_defs.php');
include('system/session_lib.php');
include('static/opsaetning.php');
# Check for page var is set
$page = 'front';
if (isset($_GET['page'])) $page = $_GET['page'];
if (isset($_GET['area'])) $page .= '_'.$_GET['area'];
/* TEMP FIX */
$val = explode('/', $_SERVER['REDIRECT_URL']);
$val = explode('/', $_SERVER['PHP_SELF']);
$_GET['id'] = $val[3];
$page = 'entreprise_'.$val[2];
$area = $val[2];
$_GET['area'] = $area;
/* TEMP FIX */
//$kunde = "";
//$projektleder = "";
if ($_GET['id']) {
$sql = mysql_query("
SELECT tilbud, rev, r9, r18, r1
FROM tilbud
JOIN tilbud0 ON tilbud.id = tilbud0.id && tilbud0.id='".addslashes($_GET['id'])."'
") or die(mysql_error());
$foo = mysql_fetch_array($sql);
$nr = $foo[0];
$rev = $foo[1];
//Vi skal lige have fundet henholdsvis junden og projektlederens initialer til oprettelse af mapper
$kunde = $foo[2];
while (list ($key, $val) = each ($PROJECTMANAGER)) {
if ($key == $foo['r1']) $projektleder = substr(trim($val['navn']), -4, 3);
}
if (isset($_GET['rev']) && $_GET['rev'] == 1) $rev++;
$int['revision'] = $rev;
} else {
$nr = '-';
$rev = '-';
$int['revision'] = '0';
}
$AFSOV = array();
// $AFSOV['tilbud1'] = 'Kunde og Bygherre';
$AFSOV['tilbud1'] = 'Projektoversigt';
$AFSOV['tilbud2'] = 'Bygningsgeometri';
$AFSOV['tilbud3'] = 'Beregningsforudsætninger';
$AFSOV['tilbud5'] = 'Beklædning';
$AFSOV['tilbud6'] = 'Gavlsøjler';
$AFSOV['tilbud7'] = 'Vindafstivning';
$AFSOV['tilbud8'] = 'Gavlsøjler beregnet efter gammel dansk norm';
$AFSOV['tilbud9'] = 'Kalkulation';
$AFSOV['tilbud11'] = 'Udskriv og afslut';
# Identify the user
session_set_cookie();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Tilbud nr. <?php echo $nr; ?>R<?php echo $rev; ?> - <?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=1000,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 setVal(f, v) {
document.forms['ds'].elements[f].value = v;
}
function goPage(no) {
var page = '<?php echo $_GET['area']; ?>';
if (page == 'tilbud9') performBeregn();
if (page == 'tilbud8') performBeregn(false);
document.forms['ds'].elements['nextpage'].value = no;
if (page != 'tilbud1') {
document.forms['ds'].submit();
}
}
function goPageAndReload(no) {
document.forms['ds'].elements['nextpage'].value = no;
document.forms['ds'].elements['reload'].value = '1';
document.forms['ds'].submit();
}
function focusNewKunde(ref) {
opener.location.href = ref;
opener.focus();
}
function goSave() {
var no = <?php echo substr($_GET['area'],6); ?>;
if (no == '9') {
performBeregn();
no = '#9';
}
if (no == '8') performBeregn(false);
document.forms['ds'].elements['nextpage'].value = no;
document.forms['ds'].submit();
}
function beregnSave() {
var no = <?php echo substr($_GET['area'],6); ?>;
if (no == '9') {
no = '#9';
}
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 (page == 'tilbud1'){
var myvar = document.forms['ds'].r1.selectedIndex;
if(myvar == 0) {
alert("Du har ikke valgt en projektleder, for at tilbuddets mapper kan blive oprettet i filsystemet, skal der angives en projektleder");
return false;
} else {
return document.forms['ds'].submit();
}
}
if (fejl != "") {
alert(fejl);
} else{
document.forms['ds'].submit();
}
}
-->
</script>
</head>
<body>
<div id="left" onClick="valider();">
<!--
style="position:relative;top:expression(this.offsetParent.scrollTop);"
-->
<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'] == 'tilbud1') echo '1'; ?>" onClick="goPage(1);">Projektoversigt</td>
</tr>
<!--
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud2') echo '1'; ?>" onClick="goPage(2);">Bygningsgeometri</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud3') echo '1'; ?>" onClick="goPage(3);">Beregnings-forudsætninger</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud5') echo '1'; ?>" onClick="goPage(5);">Beklædning</td>
</tr>
-->
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud9') echo '1'; ?>" onClick="goPage(9);">Kalkulation</td>
</tr>
<!--
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud9') echo '1'; ?>" onClick="goPage('#9');">Forudsætninger og forbehold</td>
</tr>
-->
<tr>
<td colspan="2" id="2" class="menu<?php if($_GET['area'] == 'tilbud10') echo '1'; ?>" onClick="goPage('10', this);">Indgåede aftaler journal / logbog</td>
</tr>
<tr>
<td class="menu<?php if($_GET['area'] == 'tilbud11') echo '1'; ?>" onClick="goPage(11);">Udskriv og afslut</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>
<?php
if ($nr != "-") {
$root = 'Tilbud/'.$nr;
//echo $res['r1'];
/* finder ordresnummeret */
$query = "SELECT ordre, rev FROM tilbud WHERE tilbud=$nr";
$sql = mysql_query($query) or die(mysql_error());
$sql = mysql_fetch_array($sql);
// Finder den overordnet sti til ordremappen
$test;
if($sql[ordre]!="0"){
$test = "1";
$startmappe = substr($sql[ordre], 0, 3);
$slutmappe = $startmappe+1;
$slutmappe = $slutmappe."00"-1;
} else {
$test = "0";
}
if($nr < 40000){
$startmappe = "00000";
$slutmappe = "39999";
}
$folder = $startmappe."00-".$slutmappe;
// Finder den overordnet sti til tilbudsmappen
$tMid = $nr;
$startmappe = substr($tMid, 0, 3);
$slutmappe = $startmappe+1;
$slutmappe = $slutmappe."000"-1;
$tFolder = $startmappe ."000-". $slutmappe;
//Finder sidennr., så vi kan forblive herpå ved klik på tilbudsmappe eller ordremappe
$side = substr($_GET['area'], -2, 2);
if (!is_numeric($side)){//Tjekker om sidetallet er 2-cifret eller ej
$side = substr($_GET['area'], -1);
}
?>
<tr>
<td class="menu" onClick="goPage(<?php echo $side;?>, this);"><a href="\\srv-fil2\DS Entreprise\Tilbud\<?php echo $tFolder."\\".$tMid;?>\" target="new"><b>Tilbuds-mappe</b></a></td>
</tr>
<tr>
<td class="menu"><b>Filliste:</b></td>
</tr>
<tr><td><iframe name="stifinder_entreprise" width="135" height="280" src="/stifinder_entreprise.php?root=<?php echo $root; ?>&projektleder=<? echo $projektleder;?>&kunde=<? echo $kunde;?>"></iframe></td></tr>
<?php
}
?>
</table>
</div>
<div id="right">
<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">Entreprise tilbud 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','510a',
'511','510b','511a','512','513','514','515','516','517','518','518b','520','521','522','523','524',
'525','245','253','258','263','268','273','278','283','288','293','298','303','308','313','10','19',
'20','21','337','338','339','340','341','342','370','372','373','374','375','376','377','392','394',
'403','405','467','468','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','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'
);
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', '467a', '510c');
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','r1','r5','r5a','r4','r6','r7','r18','kns3','r8','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','r49a','r50','r46a','r47b','r47a','r57b','r57c','r57d','r57a','r48a','r56v','r56h','r56d','r56e','r56a','r56b','r58e','r58f','r58c','r59a','r60','r61','r60b','r63f','r63e','r63c','r58a','r58b','r58d','r59','r59b','r60a','r61a','r62','r62a','r63a','r63b','r63d','r64','r65','r66b','r66c','r66a','r68','r69','r70','r72','r73b','r73c','r73a','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','r464','r465a','r419','r422','r423','r425','r426','r419a','r422a','r423a','r425a','r426a','r437','r440','r441','r443','r444','r437a','r440a','r441a','r443a','r444a','r429','r432','r434','r447','r450','r452','r408','r409','r411a','r467', 'r467a','r468','r470','r472','r397','r398','r400','r401','r413','r414','r416','r417','r455','r456','r458','r459','r455a','r456a','r458a','r459a','r474','r475','r476','r478a','r478b','r478c','r478d','r483','r484','r486','r482a','r482b','r478','r479','r481','r498','r488','r489','r491','r493','r494','r496','r499a','r499b','r499','r510c','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>