<!-- RIGHE -->
<?php

	if( $records[0]['id_contratto'] != "0" && $records[0]['id_contratto'] != "" ){
		$rs_contratto = $dbo->fetchArray("SELECT * FROM co_contratti WHERE id=\"".$records[0]['id_contratto']."\"");		
		$rs_tipo= 		$dbo->fetchArray("SELECT id , descrizione FROM co_contratti_tipi where id ='".$rs_contratto[0]['id_tipocanone']."'");
		$rs_righe= $dbo->fetchArray("SELECT idarticolo , descrizione , qta FROM co_contratti_tipi_righe_qta where idtipocontratto ='".$rs_contratto[0]['id_tipocanone']."'");
		$tot_righe=sizeof($rs_righe);
	}
	$richiesto=0;
	if( $records[0]['id_contratto'] != "0" && $records[0]['id_contratto'] != "" ){
		$richiesto=1;
	}
?>


<div class="panel panel-<?php echo $_SESSION['profilo_pannello'] ?>">
	
	<div class="panel-body">

		<div class="clearfix"></div>
		<br>
		<?php
			if( $tot_righe != "0"  ){
		?>
		<div class="row">
			<div class="col-md-12">
				<table class="table table-striped table-hover table-condensed table-bordered">
				<tr>
					<th>Posizioni a scalare</th>
					<th width="120">Qta Canone</th>	
					<th width="120">Qta Consumata</th>					
					<th width="120">Qta Residua</th>					
				</tr>
				<?php include($docroot."/modules/contratti/row-list-contratti.php"); ?>
				</table>
			</div>
		</div>
		
		<div class="row">
			<div class="col-md-12">
				<table class="table table-striped table-hover table-condensed table-bordered">
				<tr>
					<th width="30%">Documento</th>
					<th width="30%">Articolo</th>
					<th width="20%">Data</th>	
					<th width="20%">Qta Consumata</th>								
				</tr>
				<?php include($docroot."/modules/contratti/row-list-dettaglio.php"); ?>
				</table>
			</div>
		</div>
		
		
		<?php																		
					}
					?>	
		
	</div>
</div>