Hej alle. Jeg har denne kode:
<?
$idso = $_GET['a'];
$dage = new Querys;
$man = $dage::GetOne("SELECT mandag FROM $klient");
$mana = explode(',',$man);
$man = $mana[0];
$tirs = $dage::GetOne("SELECT tirsdag FROM $klient");
$tirsa = explode(',',$tirs);
$tirs = $tirsa[0];
$ons = $dage::GetOne("SELECT onsdag FROM $klient");
$onsa = explode(',',$ons);
$ons = $onsa[0];
$tors = $dage::GetOne("SELECT torsdag FROM $klient");
$torsa = explode(',',$tors);
$tors = $torsa[0];
$fre = $dage::GetOne("SELECT fredag FROM $klient");
$frea = explode(',',$fre);
$fre = $frea[0];
$loer = $dage::GetOne("SELECT loerdag FROM $klient");
$loera = explode(',',$loer);
$loer = $loera[0];
$soen = $dage::GetOne("SELECT soendag FROM $klient");
$soena = explode(',',$soen);
$soen = $soena[0];
?>
<form id="form1" name="form1" method="post" action="javascript:;" onsubmit="afslut('?month=<?=''.$_GET['month'] . '&day=' . $_GET['day'] . '&year=' . $_GET['year']; ?>&v=1&navn=' + document.getElementById('calName').value + '&service=' + printValue('service') + '&desc=' + document.getElementById('calDesc').value + '&dato=' + document.getElementById('calDate').value + '&tillservice=' + printValue('service2') +'&Submit=' + document.getElementById('Submit').value +
&email=+document.getElementById('email').value+'&telf='+document.getElementById('fon').value+'');">
<table cellpadding="0" cellspacing="0" class="tableClass">
<tr>
<td width="142">Fulde navn:</td>
<td width="146"><div align="left">
<input type="text" name="calName" id="calName" onKeyup="checkFilled();">
</div></td>
</tr>
<tr>
<td width="142">Service:</td>
<td width="146"><div align="left">
<select name="tillaeg" id="service" onchange="getValueSelected(this, 'cid=<?=$idso;?>');">
<?
print ('<option value="">Vælg service</option>');
$result = @mysql_query("SELECT * FROM varer WHERE klientid = ".$idso." AND tillaeg = 0 ORDER BY id");
while($row = @mysql_fetch_array($result))
{
print ('<option value="'.$row[id].'">'.$row[varenavn].'</option>');
}
?>
</select>
</div></td>
</tr>
<tr>
<td width="142">Tillæg service:</td>
<td width="146"><div align="left">
<div id="tillaeg">
</div>
</div></td>
</tr>
<tr>
<td rowspan="2">Evt. bemærkning:</td>
<td><div align="left">
<textarea name="calDesc" id="calDesc" cols="15" rows="5" onKeyDown="remChars(this, document.form1.txtCount, 200);"
onKeyUp="remChars(this, document.form1.txtCount, 200);"></textarea>
<br/>
</div></td>
</tr>
<tr>
<td>Du har
<input readonly name="txtCount" type="text" id="txtCount" value="200" size="2" maxlength="3">
tegn tilbage!</td>
</tr>
<tr>
<td>Bestillings dato:</td>
<td><div align="left">
<input type="text" name="calDate" id="calDate" value="<?=$_GET['day'] . '/' . $_GET['month'] . '/' . $_GET['year'];?>" readonly>
</div></td>
</tr>
<tr>
<td>aa:</td>
<td><div align="left">
<select id="2" name="select">
<?
$sqlQ = new Querys;
$client_navn = $sqlQ::GetOne("SELECT navn FROM klienter WHERE id = ".$idso."");
$aebner = $sqlQ::GetOne("SELECT aebner FROM ".$client_navn."");
$lukker = $sqlQ::GetOne("SELECT lukker FROM ".$client_navn."");
$kunderitimen = $sqlQ::GetOne("SELECT kunderitimen FROM ".$client_navn."");
$abenti = abs($aebner - $lukker);
$kundetider = 60 / $kunderitimen ;
$minabent = $abenti * 60;
$kunderpaaetdoegn = $minabent / $kundetider;
$i = 0;
$i2 = 0;
$hour = $aebner;
$fulddato = "".$day."/".$month."/".$year."";
while ($i <= $minabent) {
$count = $i2 / 60;
$count = round($count,2);
$countstrip = strstr($count, '.', true);
$hcs15 = $hour + $countstrip ."15";
$hcs30 = $hour + $countstrip ."30";
$hcs45 = $hour + $countstrip ."45";
$hpc = $hour + $count ."00";
if(strstr($count, '.') == "0.25" || strstr($count, '.') == "0.33")
{
$optaget = @mysql_query("SELECT * FROM caltbl WHERE klokken='$hcs15' AND clientid='$idso' AND calDate='$fulddato'") or die(mysql_error());
$antal = @mysql_num_rows($optaget);
if($antal != 0) {} else { $output = "".$hour + strstr($count, '.', true)."15"; }
}
elseif(strstr($count, '.') == "0.50")
{
$optaget = @mysql_query("SELECT * FROM caltbl WHERE klokken='$hcs30' AND clientid='$idso' AND calDate='$fulddato'") or die(mysql_error());
$antal = @mysql_num_rows($optaget);
if($antal != 0) {} else { $output = "".$hour + strstr($count, '.', true)."30";}
}
elseif(strstr($count, '.') == "0.75" || strstr($count, '.') == "0.67")
{
$optaget = @mysql_query("SELECT * FROM caltbl WHERE klokken='$hcs45' AND clientid='$idso' AND calDate='$fulddato'") or die(mysql_error());
$antal = @mysql_num_rows($optaget);
if($antal != 0) {} else { $output = "".$hour + strstr($count, '.', true).":45";}
}
else {
$optaget = @mysql_query("SELECT * FROM caltbl WHERE klokken='$hpc' AND clientid='$idso' AND calDate='$fulddato'") or die(mysql_error());
$antal = @mysql_num_rows($optaget);
if($antal != 0) {} else { $output = "".$hour + $count . ":00";}
}
print '<option value="'.$output.'">'.$output.'</option>>';
$i = $i + $kundetider;
$i2 = $i2 + $kundetider;
}
?>
</select>
</div>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" id="Submit" value="Submit"></td>
</tr>
</table>
</form>
og et stykke javascript til Onsubmit delen der ser sådan her ud
function afslut(parm){
httpObject = getHTTPObject();
if (httpObject != null) {
httpObject.open("GET", 'modules/afslut.php' + parm +'&a=<?=$ids;?>', true);
httpObject.send(null);
httpObject.onreadystatechange = setOutput;
}
}
Mit problem er, at den poster når jeg beder den om det. Den bliver bare stående, og skifter ikke siden som den burde gøre.
Det virker med alle mine andre forms. Nogle ideer til en Evt. fejl?
på forhånd tak.
Jonas