witam,
nie wiem za bardzo jak to ladnie napisac ale w skrocie,
mam taki kod (oczywiscie wyciete fragmenty najbardziej moim zdaniem istotne):
<?php
$i_f=0;
echo '<select name="id_towary[1]">'; while ($i_f < $num_f) {
$i_f++;
};
?>
i teraz chcialbym na tej podstawie dynamicznie wypelnic 2 imputy obok, to znaczy:
<?php
<input name="cena[1]" type="textbox" VALUE= "cena where id_towary = id_towary z selekta">
<input name="vat[1]" type="textbox" VALUE="vat where id_towary = id_towary z selekta">
?>
uwagi: wszystko jest w petli, to sa tak jakby pozycje w fvat, na podstawie wypelenienia innych imputow (ilosc) bedzie liczona cena brutto, netto łącznie, łącznie cała fvat (js) tabele: towary, pozycje, fvat
ps. juz poprawilem zeby to logicznej brzmialo.
ps2:
CREATE TABLE `firmy` (
`id_firmy` int(11) NOT NULL AUTO_INCREMENT,
`nip` bigint(12) NOT NULL,
`nazwa` varchar(50) collate utf8_polish_ci NOT NULL,
`ulica` varchar(30) collate utf8_polish_ci NOT NULL,
`kod` varchar(6) collate utf8_polish_ci NOT NULL,
`miasto` varchar(20) collate utf8_polish_ci NOT NULL,
`regon` int(11) NOT NULL,
`uwagi` text collate utf8_polish_ci NOT NULL,
PRIMARY KEY (`id_firmy`)
)
CREATE TABLE `fvat` (
`id_fvat` int(11) NOT NULL AUTO_INCREMENT,
`id_firmy` int(11) NOT NULL,
`numer` int(11) NOT NULL,
`data` date NOT NULL,
`uwagi` text collate utf8_polish_ci NOT NULL,
PRIMARY KEY (`id_fvat`)
)
CREATE TABLE `platnosci` (
`id_platnosci` int(11) NOT NULL AUTO_INCREMENT,
`id_fvat` int(11) NOT NULL,
`data` date NOT NULL,
`netto` int(11) NOT NULL,
`brutto` int(11) NOT NULL,
`rozliczono` int(1) NOT NULL,
PRIMARY KEY (`id_platnosci`)
)
CREATE TABLE `pozycje` (
`id_pozycje` int(11) NOT NULL AUTO_INCREMENT,
`id_fvat` int(11) NOT NULL,
`id_towary` int(11) NOT NULL,
`ilosc` int(11) NOT NULL,
`rabat` int(11) NOT NULL,
PRIMARY KEY (`id_pozycje`)
)
CREATE TABLE `towary` (
`id_towary` int(11) NOT NULL AUTO_INCREMENT,
`nazwa` char(50) collate utf8_polish_ci NOT NULL,
`cena` int(11) NOT NULL,
`vat` int(11) NOT NULL,
PRIMARY KEY (`id_towary`)
)
Ten post edytował Ciubas 1.03.2009, 20:56:06