Jump to content

Help working with a .jsp file in php


LucianU

Recommended Posts

Hello, phpfreaks community!

As the subject of the topis says I have some difficulties with a .jsp script - its use in php.

 

The situation is the following:

I have an erp script and I need to add it some features. On the inventory section there are products which come in batches. The default features of a batch is name and quantity. I want to add expiration date. I added the necessary html and for the date form I thought I would use Jason's Date Input Calendar. And here come the issues:

 

1. The form for the batch has 10 rows so, of course the calendar appears 10 times.

The problem is that no matter from which the 10 calendars I choose the date it only changes in the first. Is there any way to go around that?

2. The code that prints the calendar is the following:

echo "<TR><TD><script>DateInput('expirationdate', true, 'DD/MON/YYYY')</script></TD>";

where expirationdate takes the date chosen by the user.

The features of the batch are organisez into an array - $Bundle - with the subsequent keys BundleRef (batch name) and BundleQty (batch quantity). So what I think I need to do is add the key BundleExpDate.

The problem is I don't know how to take the value of 'expirationdate' and assign it as a value of the key BundleExpDate.

 

This is how the page looks like (you'll have to zoom in because I decreased the resolution):

http://img221.imageshack.us/my.php?image=formxc0.jpg

 

This is part of the code that prints the form:

if ($EditControlled){
foreach ($LineItem->SerialItems as $Bundle){

        echo "<TR><TD><script>DateInput('expirationdate', true, 'DD/MON/YYYY')</script></TD>";   	

	echo '<TD valign=top><input type=text name="SerialNo'. $StartAddingAt .'"
		value="'.$Bundle->BundleRef.'" size=21  maxlength=20></TD>';

	/*if the item is controlled not serialised - batch quantity required so just enter bundle refs
	into the form for entry of quantites manually */

	if ($LineItem->Serialised==1){
		echo '<input type=hidden name="Qty' . $StartAddingAt .'" Value=1></TR>';
	} else {
		echo '<TD><input type=text name="Qty' . $StartAddingAt .'" size=11
			value="'. number_format($Bundle->BundleQty, $LineItem->DecimalPlaces). '" maxlength=10></TR>';
	}

	$StartAddingAt++;
}
}

for ($i=0;$i < 10;$i++){

echo "<TR><TD><script>DateInput('expirationdate', true, 'DD/MON/YYYY')</script></TD>";

echo '<TD valign=top><input type=text name="SerialNo'. ($StartAddingAt+$i) .'" size=21  maxlength=20></TD>';

/*if the item is controlled not serialised - batch quantity required so just enter bundle refs
into the form for entry of quantites manually */

if ($LineItem->Serialised==1){
	echo '<input type=hidden name="Qty' . ($StartAddingAt+$i) .'" Value=1></TR>';
} else {
	echo '<TD valign=top><input type=text name="Qty' . ($StartAddingAt+$i) .'" size=11  maxlength=10></TR>';
}
}

echo '</table>';

 

Thank you in advance for your help!

Have a good day.

Link to comment
https://forums.phpfreaks.com/topic/86443-help-working-with-a-jsp-file-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.