<?php



//	$query = "SELECT * FROM `zz_campi_add` WHERE id_module='".$id_record."' and deleted='0' order by id";
	$query = "SELECT * FROM `zz_campi_add` WHERE id_module='".$id_record."' order by id";
	$rs_tipi = $dbo->fetchArray( $query );
	$tot_art = sizeof($rs_tipi);
	

	if( $tot_art>0 ){
		
		
		for( $i=0; $i<$tot_art; $i++ ){
			echo "<tr><td align='left'>\n";
				echo $rs_tipi[$i]['id_label']." \n";
			echo "</td>\n";
			// stato documento ricerca
			echo "<td class='text-left'>\n";
			echo $rs_tipi[$i]['id_campo']." \n";
			echo "</td>\n";
			
			// dimensione
			echo "<td class='text-left'>\n";
			echo $rs_tipi[$i]['dimensione']." \n";
			echo "</td>\n";


			if( $rs_tipi[$i]['deleted'] == '1' ) {
				$testo_abilitato="DISABILITATO";
				echo "<td class='text-left'>\n";
				
				echo "<small class='pull-center label label-danger''> ".$testo_abilitato."</small>\n";
				echo "</td>\n";
			
			}
			if( $rs_tipi[$i]['deleted'] == '0' ) {
				$testo_abilitato="ABILIATO";
				echo "<td class='text-left'>\n";
				echo "<small class='pull-center label label-info''> ".$testo_abilitato."</small>\n";
				echo "</td>\n";
			
			}
			

			//Possibilità di rimuovere una riga 
			echo "<td class='text-center'>\n";
				echo "	<form action='".$rootdir."/editor.php?id_module=".$modules_info['Utenti e Profili']['id']."&id_record=".$id_record."' method='post' id='delete-form-".$rs_tipi[$i]['id']."' role='form'>\n";
				echo "		<input type='hidden' name='backto' value='record-edit'>\n";
				echo "		<input type='hidden' name='id_record' value='".$id_record."'>\n";
				echo "		<input type='hidden' name='idriga_tipologia' value='".$rs_tipi[$i]['id']."'>\n";				
				echo "			<a class='btn btn-xs btn-warning' title='Modifica questa riga...' onclick=\"launch_modal( 'Modifica campo', '".$rootdir."/modules/campi_personalizzati/edit_riga.php?idrecord=".$id_record."&idriga=".$rs_tipi[$i]['id']."', 1 );\"><i class='fa fa-edit'></i></a>\n";								
				echo "	</form>\n";
			echo "</td></tr>\n";
			
			
			
			
			
		}	
	}

	
?>
