I need help on template with

webnexus2003

I need help on template with

Beitragvon webnexus2003 » Di 14. Feb 2006, 11:22

Hi,

I wrote a template for make an user input inside a tbl_object but it works with a multinsert from one insert form.

I have a range of date and some information, for every day inside that range, I must insert an object with that information.
I make a manipulation of sent var and after I use we:tag we:write but it inserts empty objects.
I have seen that the object field that we:write uses isn't store in $we_ui_we_global_form array but I can't recognized what is the array.

Can you help me?

this is the template:
<?
if ($step==1){
//costruzione variabile frequenza
$k=0;
for ($j=0; $j<7; $j++){
if ($week[$j]==1){
$freq[$k]=$j;
$k++;
}
}
$n_freq=count($week);
//costruzione variabile frequenza

//variabili per la scrittura dell'object fisse nel ciclo
$edit_object=1;
$we_editObject_ID=0;
$we_ui_we_global_form[ID]=$viaggio;
$we_ui_we_global_form[Prezzo]=sprintf("%01.2f", $prezzo);
$we_ui_we_global_form[Note]=$we_ui_we_global_form[Note];
//variabili per la scrittura dell'object fisse nel ciclo

//ciclo costruzione date e scrittura object
$Ts_dp=mktime ( 10, 00, 00, $mm_pp, $gg_pp, $aaaa_pp );
$Ts_up=mktime ( 10, 00, 00, $mm_up, $gg_up, $aaaa_up );
$gg_p=($Ts_up-$Ts_dp)/(24*60*60);
for ($i=0; $i<$gg_p; $i++){
$Ts_p=$Ts_dp+($i*24*60*60);
$giorno_della_settimana=date('w', $Ts_p);
for ($j=0; $j<$n_freq; $j++){
if ($giorno_della_settimana==$freq[$j]){
//settaggio variabili data
$we_ui_we_global_form[we_date_DataPartenza_day]=date('d', $Ts_p);
$we_ui_we_global_form[we_date_DataPartenza_month]=date('m', $Ts_p);
$we_ui_we_global_form[we_date_DataPartenza_year]=date('Y', $Ts_p);
$we_ui_we_global_form[we_date_DataPartenza_hour]="10";
$we_ui_we_global_form[we_date_DataPartenza_minute]="00";
//settaggio variabili data

//we_tag scrrittura record

?>
<we:write type="object" publish="true" userid="6" classid="20"/>
<?
//we_tag scrrittura record
}
}
}
//ciclo costruzione date e scrittura object
}
?>

Ralf Pospiech

Beitragvon Ralf Pospiech » Mi 15. Feb 2006, 11:17

Hello,

can you please post the code of the form which you will send to this we:write document.

webnexus2003

form and first solution

Beitragvon webnexus2003 » Fr 17. Feb 2006, 13:12

this is yhe form:
<table width="600" border="0" cellspacing="0" cellpadding="0">
<we:form type="object" method="post" classid="20">
<input type="hidden" name="step" value="1">

<tr>
<td>Categoria   
<select name="Categoria"/>
<option value="T">Turistic</option>
<option value="C">Confort</option>
<option value="CS">Confort Superior</option>
<option value="S">Superior</option>
<option value="SP">Superior Plus</option>
</select></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Viaggio   
<we:listview type="object" name="viaggi" classid="18">
<select name="viaggio">
<we:repeat>
<option value="<we:field name="WE_ID" />"><we:field name="Identificativo" type="text" /></option>
</we:repeat>
</select>
</we:listview>
</td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Data prima partenza   
<select name="gg_pp">
<? for ($i=1; $i<32; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
 / 
<select name="mm_pp">
<? for ($i=1; $i<13; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
 / 
<? $aaaa_o=date('Y'); ?>
<select name="aaaa_pp">
<? for ($i=$aaaa_o; $i<$aaaa_o+4; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Data ultima partenza   
<select name="gg_up">
<? for ($i=1; $i<32; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
 / 
<select name="mm_up">
<? for ($i=1; $i<13; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
 / 
<? $aaaa_o=date('Y'); ?>
<select name="aaaa_up">
<? for ($i=$aaaa_o; $i<$aaaa_o+4; $i++) { ?>
<option value="<? echo $i; ?>"><? echo $i; ?></option>
<? } ?>
</select>
</td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td nowrap>Frequenza settimanale    
<input name="week[0]" type="checkbox" id="week[0]" value="1">Dom 
<input name="week[1]" type="checkbox" id="week[1]" value="1">Lun 
<input name="week[2]" type="checkbox" id="week[2]" value="1">Mar 
<input name="week[3]" type="checkbox" id="week[3]" value="1">Mer 
<input name="week[4]" type="checkbox" id="week[4]" value="1">Gio 
<input name="week[5]" type="checkbox" id="week[5]" value="1">Ven 
<input name="week[6]" type="checkbox" id="week[6]" value="1">Sab
</td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Luogo di partenza   
<we:userInput type="textinput" name="PartenzaDa" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Prezzo   
<we:userInput type="textinput" name="PrezzoBase" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Quota d'iscrizione   
<we:userInput type="textinput" name="Iscrizione" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Costi accessori   
<we:userInput type="textinput" name="Accessori" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Altri costi   
<we:userInput type="textinput" name="Altro" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td>Disponibilità   
<we:userInput type="textinput" name="Disponibilita" size="70"/></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" valign="top">Note</td>
<td width="90%"><we:userInput name="Note" type="textarea" removefirstparagraph="true" autobr="true" hideautobr="true" wysiwyg="true" commands="bold,insertunorderedlist,insertorderedlist,createlink,unlink,fullscreen,cut,copy,paste,undo,redo,editsource"/></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5"><spacer type="block"></spacer></td>
</tr>
<tr>
<td><table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right"><input type="submit" name="Invia" value="Invia"></td>
</tr>
</table></td>
</tr>

</we:form>
</table>

and I make a solution with an upgrade of record:
<we:write type="object" publish="true" userid="6" classid="20" categories="$cat"/>
<?
$sql= "UPDATE tblObject_20 set date_DataPartenza=".$date_update[$i].", int_ID=".$viaggio." WHERE int_ID='' AND date_DataPartenza=0 AND OF_ID!=0";
$per = f($sql,"",$DB_WE);
?>
This solution have two problem:
1 - In webEdition admin area in the list of object I see correct date but if I go in edit pannel of record the field that I make an upgrade I can't see variation

2 - When I do a listview I don't see the data that I upgrade.


Zurück zu „DB / Object Module“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast