Skip to main content

Adding Dynamic Fields

Author

Robert Loncaric

Timestamps

Created: 18 December 2023
Modified: 15 January 2024

Steps

Prvo, u unosu dodas ovaj kod, stavis polja koja trebas itd.

<div class="box-100 light">
<h3 class="h3-no-border">Veličine  <a href="javascript:;" class="gumb gumb-nova-cijena" onclick="sjx('addCjenikUsluga',$('#cu_num').val());">Novi red</a></h3>
<div id="cu_polja">
	<input type="hidden" id="cu_num" value="0" />
	<?php
	$opcije = Db::query('SELECT * FROM proizvodi_cijene WHERE proizvod_id = '.$_GET['id'].' ORDER BY id');
	?>
	<div class="box-100 opcije_items" id="cu1-">
		<table class="cijene-table">
			<thead>
				<tr>
					<th>Veličina</th>
					<th>Cijena</th>
					<th>Briši</th>
				</tr>
			</thead>
			<tbody id="append">
				<?php foreach ($opcije as $opcija) {
						$num=$opcija['id'];
					echo opcije_rows($opcija, $num);
				} ?>
			</tbody>
		</table>
	</div>
</div>
</div>