<?
//session_start();
//require('../valtiempoinact.php');
require("../conectar.php");
$tc=str_replace(",",".",$_GET['tc']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>	   <title>Tarifas</title>
        <style>	 
            .tabla{width:100%;background:#ffffff;border-collapse: collapse;font-family:arial;}
			.titulo{height:35px;max-height:35px !important;background:#ffffff url(images/tlcancion.jpg) repeat-x;color:#0d0d0d;font-size:15px;}
			.titulos{height:30px;background:url(images/tcancion.jpg) repeat-x;max-height:30px !important;color:#ffffff;font-size:12px;}
			.nombre{height:28px;background:#0a0a0a;color:#ffffff;text-align:center;font-size:12px;}
			.concepto{height:28px;background:url(images/tcancion.jpg) repeat-x;color:#ffffff;text-align:center;font-size:11px;}
			.inp{width:38px;text-align:right;font-size:10px; }
			.inpd{width:15px;text-align:right;font-size:10px;}
			.tdcal{background:#ffffff;}
			.tdcal:hover .inpd{border:1px;Moz-box-shadow: 0 0 5px 2px #000;-webkit-box-shadow: 0 0 5px 2px #000; box-shadow: 0 0 5px 2px #000;}			.act{display:block;overflow:hidden;width:100%;height:50px;background:#BEF781;font-family:arial;font-size:17px;font-weight:bold;color:#4B610B;text-align:center;border:solid 2px #4B610B;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px; -Moz-box-shadow: 0px 5px 10px # 556B2F;-webkit-box-shadow: 0px 5px 10px #556B2F; box-shadow: 0px 5px 10px #556B2F;}
			.act p{position:relative;top:0px;}
			.act img{position:relative;width:40px;height:40px;top:-50px;left:250px;}
			h2{font-family:arial;font-size:16px;}
			.inpof{width:15px;text-align:right;font-size:10px;border:none;}
			.nd{cursor:hand;cursor:pointer;}
			.nd1{font-size:12px;}
			.nd2{font-size:10px;text-align:center;font-weight:bold;}
			.nd3{font-size:11px;text-align:left;font-weight:bold;}
			.nd4{font-size:13px;text-align:center;font-weight:bold;}
			.nd5{font-size:10px;text-align:center;font-weight:bold;background-color:#0d0d0d;font-family:arial;color:#ffffff;}
			.nd6{font-size:10px;text-align:left;font-weight:bold;}
			.fila{position:relative;width:30%;}			.subt{z-index:1000;position:fixed;width:100%;height:0px;background:#084B8A;margin-left:0px;margin-rigth:0px;top:0px;background:#045FB4;color:#FFFFFF;text-align:center;}
			.tr1{background:#D8D8D8;}
            .tr2{background:#F2F2F2;}
	         .tr3:hover{background:#01A9DB;color:#ffffff;}	
	         .tr3:hover a{color:#ffffff;}
			 .activo{background:#AD9E87;color:#000;font-weight:bold;}
			.trs:hover{background:#E0D1D1;color:#000;font-weight:bold;}	
			.trs:hover a{color:#ffffff;}	
			.trs:hover .trssb{color:#ffffff;}
			.activofila{background:;color:;font-weight:bold;}				    .cont{position:absolute;min-width:800px;min-height:100%;top:0px;left:0;}			.calendario{width:100%;height:60px;}			.subt{z-index:1000;position:fixed;width:100%;height:30px;background:#084B8A;margin-left:0px;}			.dias{z-index:1000;position:absolute;width:787px;height:30px;background:#084B8A;margin-top:0px;-moz-box-shadow: 0 0 15px #000;-webkit-box-shadow: 0 0 15px #000;box-shadow: 0 0 15px #000;margin-left:179px;}			            .n{float:left;width:236px;height:30px; font-size:12px;text-align:;font-weight:bold;background-color:#319300}			.n2{float:left;width:236px;height:30px;margin-left:39px;background:#E6E6E6;font-size:12px;text-align:;font-weight:bold;background-color:#F781BE}			.n3{float:left;width:236px;height:30px;margin-left:40px;background:#E6E6E6;font-size:12px;text-align:;font-weight:bold;background-color:#F89E18;}			.sinfor{text-decoration:none}			
    
  .tooltip
        {
            display: inline;
            position: relative;
            text-decoration: none;
            top: 0px;
            left: 4px;
        }
        .tooltip:hover:after
        {
            background: #333;
            background: rgba(0,0,0,.8);
            border-radius: 5px;
            top: -5px;
            color: #fff;
            content: attr(alt);
            left: 160px;
            padding: 5px 15px;
            position: absolute;
            z-index: 98;
            width: 150px;
        }
        .tooltip:hover:before
        {
            border: solid;
            border-color: transparent black;
            border-width: 6px 6px 6px 0;
            bottom: 20px;
            content: "";
            left: 155px;
            position: absolute;
            z-index: 99;
            top: 3px;
        }
			</style>
        <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
        <script>
           function marcar(tr){
			     clase=tr.className;
				 if(/activo/.test(clase)){
				  clase=clase.replace(/activo/,"");
				  tr.className=clase;
				 }else{
				  tr.className=clase+" activo";
				 }
			 }
			  function marcarfila(tr){
			     clase=tr.className;
				 if(/activofila/.test(clase)){
				  clase=clase.replace(/activofila/,"");
				  tr.className=clase;
				 }else{
				  tr.className=clase+" activofila";
				 }
			 }
		</script>		
	</head>
	<body>
	<?
	  require('../conectar.php');
	  $sql="SELECT p.nombre AS propiedad,d.no_depto AS no,d.clave  AS clave,d.id_departamento,d.capacidad,d.limite,d.area,d.mascota,d.camaextra,d.estacionamiento
			FROM departamentos AS d 
	        INNER JOIN complejo as p ON d.id_complejo=p.id_complejo 
			order by p.id_complejo=21,
			p.id_complejo='14',
			p.id_complejo='6',
			p.id_complejo='5',
			p.id_complejo='1',
			p.id_complejo='3',
			p.id_complejo='2',
			p.id_complejo='4',
			d.no_depto, d.tipo ASC";
    ?>
<div class="cont">  <div class="calendario">    <div class="subt">	  <div class="dias">	      <div class="n">TARIFA RACK 76% al 100% Ocupacion</div>		  <div class="n2">TARIFA STANDAR 41% al 75% Ocupacion </div>		  <div class="n3">TARIFA PROMOCION 0% al 40% Ocupacion</div> <!--<table border="0" class="subt">
    <tr>
	  <td width="11%"></td>
	  <td width="15%" style="background-color:#319300" class="nd4">TARIFA RACK 76% al 100% Ocupacion</td>
	  <td width="5%"></td>
	  <td width="15%" style="background-color:#F781BE" class="nd4">TARIFA STANDAR 41% al 75% Ocupacion</td>
	  <td width="5%"></td>
	  <td width="21%" style="background-color:#F89E18" class="nd4">TARIFA PROMOCION 0% al 40% Ocupacion</td>
	  <td width="5%"></td>
	</tr>
</table>-->	 </div>	</div>   </div>
<table width="100%" border="0">
    <?
$r=mysql_query($sql);
$nprop="";
$n=1;
$f=1;
$c="";
while($ls=mysql_fetch_array($r)){                        
                        $iddepto=$ls['id_departamento'];
                        if($ls['mascota']==0){$mascota="N";}else{$mascota="S";}
						if($ls['camaextra']==0){$cextra="N";}else{$cextra="S";}
						if($ls['estacionamiento']==0){$estacionamiento="N";}else{$estacionamiento="S";}
                        if($f==1){$f=2;}else{$f=1;}
					     if($nprop!=$ls["propiedad"]){
				        ?>
						  <tr>
						    <td></td>
                            <?
							 for($i=1;$i<4;$i++){
							 ?>
							    <td colspan="6" class="nd5"><?echo $ls["propiedad"]?></td>
								<?
								if($i<3){?>
								<td width="5%"></td>
							<?
							 }} ?>
							 <td width="5%"></td>
							 <td colspan="6" class="nd5">ATRIBUTOS</td>
						  </tr>
				                <?$nprop=$ls["propiedad"];?>
						 <tr>
						    <td class="nd3">DEPTO</td>
							<td class="nd2">ANUAL</td>
							<td class="nd2">5 a 8</td>
							<td class="nd2">2 a 4</td>
							<td class="nd2">MES</td>
							<td class="nd2">SEMANA</td>
							<td class="nd2">NOCHE</td>
							<td width="5%"></td>
							
							<td class="nd2">ANUAL</td>
							<td class="nd2">5 a 8</td>
							<td class="nd2">2 a 4</td>
							<td class="nd2">MES</td>
							<td class="nd2">SEMANA</td>
							<td class="nd2">NOCHE</td>
							<td width="5%"></td>
							
							<td class="nd2">ANUAL</td>
							<td class="nd2">5 a 8</td>
							<td class="nd2">2 a 4</td>
							<td class="nd2">MES</td>
							<td class="nd2">SEMANA</td>
							<td class="nd2">NOCHE</td>
							<td width="5%"></td>
							
							<td class="nd2">M<sup>2</sup></td>
							<td class="nd2">CAPACIDAD</td>
							<td class="nd2">LIMITE</td>
							<td class="nd2">MASCOTA</td>
							<td class="nd2">CAMA EXTRA</td>
							<td class="nd2">ESTACIONAMIENTO</td>
						 </tr>	
								<?}?>
		
						  <tr class="tr<?echo $f;?> trs" onclick="javascript:marcarfila(this);"> <!--tr3<?echo $c?>">-->
						    <td class="nd6">							<a href="detalle.php?iddepto=<?echo$iddepto;?>&depto=<?echo $ls['no']." (".$ls['clave'].")";?>&prop=<?echo$nprop;?>" target="_blank" onClick="window.open(this.href, this.target, 'width=300,height=400'); return false;" class="sinfor" style="color:#000">
                         <?
						     $arr=explode(" ",$nprop);
							 for($i=0;$i<count($arr);$i++){
							     echo substr($arr[$i], 0, 1);
							 }
						     echo $ls['no']." (".$ls['clave'].")";?></a>
							</td>
						<?	 
							 $sqlta="SELECT * from tarifa_alta where id_departamento='$ls[id_departamento]'";
							 $ejeta=mysql_query($sqlta);
							 $ta=mysql_fetch_array($ejeta);
						?>   
						     <input type="hidden" name="id<?echo $n;?>" value="<?echo$ta['id_tarifaalta'];?>" class="inp">
						     <td class="inp" id="<?echo "ta".$n;?>" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.$ta['anual']*$tc;?>" class="tooltip"><?echo$ta['anual'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($ta['5a8']*$tc);?>"><?echo$ta['5a8'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($ta['2a4']*$tc);?>"><?echo$ta['2a4'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($ta['mes']*$tc);?>"><?echo$ta['mes'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($ta['semana']*$tc);?>"><?echo$ta['semana'];?></td>
                             <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($ta['noche'])*$tc;?>"><?echo$ta['noche'];?></td> 
						<?	 
							 $sqltm="SELECT * from tarifa_media where id_departamento='$ls[id_departamento]'";
							 $ejetm=mysql_query($sqltm);
							 $tm=mysql_fetch_array($ejetm);
						?>
						     <td width="5%"></td>
							 <input type="hidden" name="idtm<?echo $n;?>" value="<?echo$tm['id_tarifamedia'];?>" class="inp" readonly>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['anual']*$tc);?>"><?echo$tm['anual'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['5a8']*$tc);?>"><?echo$tm['5a8'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['2a4']*$tc);?>"><?echo$tm['2a4'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['mes']*$tc);?>"><?echo$tm['mes'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['semana']*$tc);?>"><?echo$tm['semana'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tm['noche']*$tc);?>"><?echo$tm['noche'];?></td>
								 
						<?	 
							 $sqltb="SELECT * from tarifa_baja where id_departamento='$ls[id_departamento]'";
							 $ejetb=mysql_query($sqltb);
							 $tb=mysql_fetch_array($ejetb);
						?>
						     <td width="5%"></td>
							 <input type="hidden" name="idtb<?echo $n;?>" value="<?echo$tb['id_tarifa'];?>" class="inp" readonly>
                             <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['anual']*$tc);?>"><?echo$tb['anual'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['5a8']*$tc);?>"><?echo$tb['5a8'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['2a4']*$tc);?>"><?echo$tb['2a4'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['mes']*$tc);?>"><?echo$tb['mes'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['semana']*$tc);?>"><?echo$tb['semana'];?></td>
							 <td class="inp" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.($tb['noche']*$tc);?>"><?echo$tb['noche'];?></td>
							 
							 <td width="5%"></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $ls['area'];?></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $ls['capacidad'];?></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $ls['limite'];?></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $mascota;?></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $cextra;?></td>
							 <td width="5%" class="inp" onclick="javascript:marcar(this);"><?echo $estacionamiento;?></td>
						   </tr>						   
				         <?
						 $n++;
						 if($c==""){$c="1";}else{$c="";}
				     }
		?>
		<tr class="tr1">
		  <td></td>
		  <td colspan="6" class="nd5">EXTRAS</td>
		</tr>
		<tr>
						    <td class="nd3"></td>
							<td class="nd2"></td>
							<td class="nd2"></td>
							<td class="nd2"></td>
							<td class="nd2">MES</td>
							<td class="nd2">SEMANA</td>
							<td class="nd2">NOCHE</td>
 
		</tr>
		<tr><td></td></tr>
		<tr class="tr1" onclick="javascript:marcarfila(this);">
		  <td class="nd6">PERSONA EXTRA</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(120*$tc);?>">120</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(35*$tc);?>">35</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(5*$tc);?>">5</td>		
		</tr>
		<tr class="tr2" onclick="javascript:marcarfila(this);">
		  <td class="nd6">ESTACIONAMIENTO</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(240*$tc);?>">240</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(60*$tc);?>">60</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(10*$tc);?>">10</td>		
		</tr>
		<tr class="tr1" onclick="javascript:marcarfila(this);">
		  <td class="nd6">CAMA EXTRA</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(130*$tc);?>">130</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(75*$tc);?>">75</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(15*$tc);?>">15</td>		
		</tr>
		<tr class="tr2" onclick="javascript:marcarfila(this);">
		  <td class="nd6">MASCOTA</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(100*$tc);?>">100</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(35*$tc);?>">35</td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(10*$tc);?>">10</td>		
		</tr>
		<tr class="tr1" onclick="javascript:marcarfila(this);">
		  <td class="nd6">CUNA</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2"></td>
		  <td class="nd2"></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(5*$tc);?>">5</td>		
		</tr>
		<tr class="tr2" onclick="javascript:marcarfila(this);">
		  <td class="nd6">LIMPIEZA</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2"></td>
		  <td class="nd2"></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(15*$tc);?>">15</td>		
		</tr>
		<tr class="tr1" onclick="javascript:marcarfila(this);">
		  <td class="nd6">BLANCOS</td>
		  <td></td>
		  <td></td>
		  <td></td>
		  <td class="nd2" onclick="javascript:marcar(this);" title="<?echo 'MXN $'.(50*$tc);?>">50</td>
		  <td class="nd2"></td>
		  <td class="nd2"></td>		
		</tr>
		<input type="hidden" name="tot" value="<?echo $n;?>">
	</table>	</div>
	</body>
</html>
