<?php 
$currentSet = $_GET['id'];
$datiSet = $connection->query("SELECT * FROM redirect_sets WHERE id = '$currentSet'");
$infoSet = $datiSet->fetchAll();
$setName = $infoSet[0]['set_name'];
$dati = $connection->query("SELECT * FROM redirects WHERE set_in = '$currentSet'");
?>
<div class="kt-portlet kt-portlet--mobile">
	<div class="kt-portlet__body">
<form id="kt_form" action="be_services/redirect/edit_redirect_set.php" method="POST">
<div class="form-group">
	<input type="hidden" name="redirectSetId" value="<?php echo $infoSet[0]['id']; ?>">
	
																	<label>Nome del set di redirect</label>
													<input type="text" class="form-control" name="redirectSetName" placeholder="Inserisci il nome del nuovo set" value="<?php echo $setName; ?>">
																</div>
																




<div id="kt_repeater_3"> <!-- contenitore repeater -->
																				
																		<div class="form-group row">
																			<div data-repeater-list="redirect" class="col-lg-12"> <!-- repeater esterno (domanda) -->
																				
																				<?php 
																				while($datiDom = $dati->fetch(PDO::FETCH_ASSOC))
																				{																					
?>
																				<div data-repeater-item>

<div class="kt-portlet kt-portlet--bordered">
					<div class="kt-portlet__head">
						<div class="kt-portlet__head-label">
							<h3 class="kt-portlet__head-title">
								REDIRECT - <a href="javascript:;" data-repeater-delete="" class="btn btn-danger">
																			<i class="la la-remove"></i>
																			<span> Elimina redirect </span>
																		</a>
							</h3>
						</div>
					</div>
					<div class="kt-portlet__body">
																					
																			<label>Domanda</label>
																			<input type="text" class="form-control" name="url" placeholder="URL.." value="<?php echo $datiDom['url']; ?>">
																		
															  
															
																	</div>
															</div>			
															</div> <!-- fine domanda -->

<?php
}
?>

															</div>
														</div>
<!-- fine div form domande -->

														<div class="row"> 
															<div class="col-lg-3"></div>
															<div class="col">
																<div data-repeater-create="" class="btn btn btn-primary">
																	<span>
																		<i class="la la-plus"></i>
																		<span>Aggiungi redirect</span>
																	</span>
																</div>
															</div>
														</div>

															</div>
															<button class="btn btn-success btn-md btn-tall btn-wide kt-font-bold kt-font-transform-u" data-ktwizard-type="action-submit">
															Modifica set di redirect
														</button>
</form>
														</div></div>
													


<script type="text/javascript" charset="UTF-8" src="assets/js/pages/redirectset/redirectsets.js"></script> 