<div ng-controller="reporteCostoPerViewController">
	<div class="form-group row">
		<div class="col-sm-12">
			<div class="col-sm-1">
				<label class="control-label" for="estudio">Estudio:</label>
			</div>
			<div class="col-sm-3">
				<select id="estudio" ng-model="estudio" ng-change="eligeEstudio()"
					class="form-control-sm w-100">
				</select>
			</div>
			<div class="oculta1">
				<div class="col-sm-1">
					<label class="control-label w-100" for="peliculasSeries">Serie/
					Pelicula:</label>
				</div>
				<div class="col-sm-3">
					<select id="peliculasSeries" class="form-control-sm w-100"
						ng-model="peliculasSeries"
						ng-change="eligeTemporada()"
						disabled="disabled">
						<option value="Todos">Todos</option>
					</select>
				</div>
			</div>
			<div class="col-sm-1">
				<label class="control-label" for="temporadas">Temporada:</label>
			</div>
			<div class="col-sm-3">
				<select id="temporadas" class="form-control-sm w-100"
					disabled="disabled">
					<option value="Todos">Todos</option>
				</select>
			</div>
		</div>
		<br /> <br /> <br /> <br />
		<div class="col-sm-12">
			<div class="col-sm-1">
				<label class="control-label" for="mes">Mes:</label>
			</div>
			<div class="col-sm-3">
				<input class="form-control required" id="mes" name="mes" type="text"
					ng-model="fechaConsulta">
			</div>
			<div class="col-sm-1">
				<label class="control-label" for="tipoReporte">Tipo de
					Reporte:</label>
			</div>
			<div class="col-sm-3">
				<select class="form-control-sm w-100" id="tipoReporte" ng-model="tipoReporte">
					<option value="">-Seleccione-</option>
					<option value="mensual">Mensual</option>
					<option value="anual">Anual</option>
				</select>
			</div>


			<div class="col-sm-2">
				<button class="btn btn-success" type="button"
					ng-click="muestraReporte(tipoReporte, fechaConsulta, estudio)">Consultar
					Reporte</button>
			</div>
			<div class="col-sm-2">
				<button
					ng-disabled="aheader == null || bheader == null || tabla == null"
					type="button" ng-click="imprime('areaImpresion', fechaConsulta)">
					<img src="${contextPath}/design/img/common/print.png" />
				</button>
				<button ng-if="!reporteZip()"
					ng-disabled="aheader == null || bheader == null || tabla == null"
					id="botonExportar" type="button"
					ng-click="descargaReporte(tipoReporte, fechaConsulta, estudio)">
					<img src="${contextPath}/design/img/common/excel.gif" />
				</button>

				<button ng-if="reporteZip()"
					ng-disabled="aheader == null || bheader == null || tabla == null"
					type="button"
					ng-click="descargaZip(tipoReporte, fechaConsulta, estudio)">
					<img src="${contextPath}/design/img/common/winzip.png" />
				</button>
			</div>
		</div>
	</div>
	<br> <br>
	<div ng-if="aheader != null && bheader != null"
		id="tablaReporteCostoPerView" class="search-table-outter wrapper">
		<div id="areaImpresion">
			<table class="table table-responsive feesT">
				<thead class="">
					<tr>
						<th class="encabezados encabezadoTabla" rowspan="2">Estudio</th>
						<th class="encabezados encabezadoTabla" colspan="3"
							ng-repeat="avalor in aheader track by $index">{{avalor}}</th>
					</tr>
					<tr>
						<th class="encabezados encabezadoTabla"
							ng-repeat="bvalor in bheader track by $index">{{bvalor}}</th>
					</tr>
					<thead><tbody>
					<tr ng-if="tabla != null"
						ng-style="obtenEstilo(row, null, $index, null, tabla.length)"
						ng-repeat="row in tabla| limitTo:totalDisplayed track by $index ">
						<td ng-if="mostrarColumna($index)"
							ng-style="$index == 0 && $parent.$parent.$index < tabla.length - 1 ? {'text-align': 'left'} : {'text-align': 'right'}"
							ng-repeat="column in row track by $index" class="tdEditable">
							{{ ($index > 0 && column != "") ? (column | number:2) : column}}
						</td>
					</tr>
					<tr ng-if="tabla == null">
						<td colspan="{{bheader.length + 1}}" align="center">No se
							encontr&oacute; informaci&oacute;n</td>
					</tr>
				
				</tbody>
			</table>
		</div>
	</div>
	<div class="form-group">
		<div class="col-md-12">
			<div class="col-md-4"></div>
			<div class="col-md-6">
				<btn ng-if="tabla != null && totalDisplayed < tabla.length"
					class="btn" ng-click="loadMore()"
					style="color:red; font-weight: bold;">Click para mostrar mas
				informacion ({{tabla.length - totalDisplayed}} restantes)</btn>
			</div>
			<div class="col-md-2"></div>
		</div>
	</div>
</div>