ciao ho un problemone che non so come gestire:
ecco il codice:
Codice PHP:
<? while ($iCont < 4) {?>
<tr>
<td></td>
<td align="left">
<? if($edit == 1){?>
<select name="Assegnazione2" class="text" onchange="cambiaData();">
<option value="">
<option value="Help Desk" <?php if ($Assegnata2 == "Help Desk") print("selected"); ?>> Help Desk
<option value="Unix GSS_A" <?php if ($Assegnata2 == "Unix GSS_A") print("selected"); ?>> Unix GSS_A
<option value="Rete GSS_C" <?php if ($Assegnata2 == "Rete GSS_C") print("selected"); ?>> Rete GSS_C
<option value="PC GSS_D" <?php if ($Assegnata2 == "PC GSS_D") print("selected"); ?>> PC GSS_D
<option value="PC GSS_D_Rav" <?php if ($Assegnata2 == "PC GSS_D_Rav") print("selected"); ?>> PC GSS_D_Rav
<option value="PC GSS_D_Tus" <?php if ($Assegnata2 == "PC GSS_D_Tus") print("selected"); ?>> PC GSS_D_Tus
<option value="PC GSS_D_Lie" <?php if ($Assegnata2 == "PC GSS_D_Lie") print("selected"); ?>> PC GSS_D_Lie
<option value="PC GSS_D_Mag" <?php if ($Assegnata2 == "PC GSS_D_Mag") print("selected"); ?>> PC GSS_D_Mag
<option value="Hardware" <?php if ($Assegnata2 == "Hardware") print("selected"); ?>> Hardware
<option value="SAS" <?php if ($Assegnata2 == "SAS") print("selected"); ?>> SAS
<option value="Oracle" <?php if ($Assegnata2 == "Oracle") print("selected"); ?>> Oracle
<option value="Web" <?php if ($Assegnata2 == "Web") print("selected"); ?>> Web
<option value="Os/390" <?php if ($Assegnata2 == "Os/390") print("selected"); ?> > Os/390
<option value="Siged" <?php if ($Assegnata2 == "Siged") print("selected"); ?>> Siged
<option value="-Ass.esterna" <?php if ($Assegnata2 == "Ass.esterna") print("selected"); ?>> -Ass.esterna
</select>
<? }else{ ?>
<input type="text" class="under" name="Assegnazione2" readonly="readonly" value="<?echo $Assegnata2;?>">
<? } ?>
</td>
<td width="5"></td>
<td align="left"><input type="text" class="under" value="" <?if ($edit<>1){?> readonly="readonly"<? }?>></td>
<td width="5"></td>
<td align="left"><input type="text" size="10" class="under" name="DataAss2" <?if ($edit<>1){?>readonly="readonly"<? }?> value="<? if($Assegnata2<>""){$DataAss2 = date('d/m/Y',strtotime($DataAss2)); echo $DataAss2;}else{$DataAss2="";echo $DataAss2;} ?>"></td></td>
<td width="5"></td>
<td></td>
<td align="left"><input type="text" size="10" class="under" name="OraAss2" <?if ($edit<>1){?>readonly="readonly"<? }?>></td>
<td width="5"></td>
<td></td>
<td align="left"><input type="text" class="under" name="MotivoAss2[]"<?if ($edit<>1){?>readonly="readonly"<? }?>></td>
<td width="5"></td>
</tr>
<? $iCont++;
}?>
allora vi metto ancvhe una giffetta che vi sarà più chiaro il tutto:
io vorrei che al click nella lista venisse messa la data e l'ora nelle apposite text come ho fatto anche x sopra!!!!
Voi direte: ma come hai fatto sopra non va???? il problema è che in questo caso le text non sono univoche ma si ripetono nel ciclo...
inoltre vi metto la funzione cambiadata:
codice:
function cambiaData(){
if(this.frmHelpdesk.Stato.value != ''){
var data = new Date();
var gg, i, aaaa,hh, mm;
gg = data.getDate() + "/";
if(gg.length<3) gg="0"+gg;
mm = data.getMonth() + 1 + "/";
if(mm.length<3) mm="0"+mm;
aaaa = data.getYear();
hh = data.getHours() + ":";
if(hh.length<3) hh="0"+hh;
i = data.getMinutes();
parseInt(i) < 10 ? i = "0" + i : null;
this.frmHelpdesk.DataAss.value = gg+mm+aaaa;
this.frmHelpdesk.OraAss.value = hh+i;
}else{
this.frmHelpdesk.DataAss.value = "";
this.frmHelpdesk.OraAss.value = "";
}
}