<script type="text/javascript">
	
	function bejelol(){
		
		var rows = document.getElementsByTagName('tr');
		for ( var i = 0; i < rows.length; i++ ) {
		
			checkbox = rows[i].getElementsByTagName( 'input' )[0];
			if ( checkbox && checkbox.type == 'checkbox' ) {
				checkbox.checked = "true";
			} else {
			//	return;
			}
		}
	}
	
jQuery(document).ready(function($){
idozito = setTimeout(function(){menjel();},2000);
function menjel(){
//	alert("menjel");
	var url = "/temp/";
	jQuery('#semmidiv').load(url, function(response, status, xhr){
			//alert("ok");
		});
	
	idozito = setTimeout(function(){menjel();},180000);
}
});

</script>


<style>
	div.renderek{
		background: #bbb;
	/*	width: 870px;*/
		padding: 5px;
		margin-bottom: 10px;
	}
	
	div.hibasak{
		background: #d00;
	}
	
	div.renderek td{
		padding-right: 10px;
	}
</style>

<div id="semmidiv"></div>
<h1>Renderek</h1>

<div>

<form action="/admin/rendertorol" method="post">
<h2>Összes render</h2>

<div onclick="bejelolzzzzz()" style="cursor: pointer; border: 1px solid #111; margin: 0px 0px 5px 10px; padding: 3px; width: 50px; text-align: center;">Mind</div>

<div class="renderek">
<?if($uresek):?>
	<?$allapotok = lang('render_allapotok')?>
	<?
		if(isset($irany) && $irany == "asc")
			$ujirany = "desc";
		else
			$ujirany = "asc";
	?>
	<table border="0" style="width: 100%;">
		<tr>
			<th width="70">Törlés</th>
			<th>Guid</th>
			<th width="90"><a href="/admin/render/teszt/<?=$ujirany?>">Teszt</a></th>
			<th><a href="/admin/render/user_id/<?=$ujirany?>">Fehasználó</a></th></th>
			<th><a href="/admin/render/allapot/<?=$ujirany?>">Állapot, Alternatívák</a></th>
			<th width="100"><a href="/admin/render/datum/<?=$ujirany?>">Dátum</a></th>
			<th width="200">Állapot módosítás</th>
		</tr>
	<?foreach($uresek as $render):?>
		<tr>
			<td style="padding-right: 15px;">
				<input type="checkbox" name="torol[]" value="<?=$render->render_id?>" /> Törlés
			</td>
			<td>
				<?if($render->allapot == "1"):?>
				<a href="/<?=$render->keszkep?>" class="fancy" rel="group"><?=$render->guid?></a>
				<?else:?>
				<a href="/<?=$render->kiskep?>" class="fancy"><?=$render->guid?></a>
				<?endif;?>
			</td>
			<td><?if($render->teszt == "2"):?>Teljes render<?else:?>Próba render<?endif;?></td>
			<td><?=$render->tulaj?></td>
			<td>
				<?=$allapotok[$render->allapot]?>
				<?if($render->allapot == 1):?>
				<?
					//$ertek = '_500.bmp';
					$db = 0;
					$kepekxx = '/home/vendeg/render/eredmeny/';
					$handle = opendir($kepekxx);
					while($file = readdir($handle)){
						if( substr($file,0,36) == $render->guid ){
							$db++;
						}
					}
					if( $db >= 5 )
						print ", Van";
					elseif( $render->infok != "" )
						print ", Volt";
					else
						print ", Nincs";
				?>
				<?endif;?>
			</td>
			<td><?=date('Y-m-d H:i',$render->datum)?></td>
			<td>
				<form action="/admin/editrender/<?=$render->render_id?>" method="post">
				<select name="allapot">
					<?foreach( $allapotok as $k=>$all ):?>
					<option value="<?=$k?>"<?if($k == $render->allapot):?> selected=selected<?endif;?>><?=$all?></option>
					<?endforeach;?>
				</select>
				<input type="submit" value="OK" />
				</form>
			</td>
		</tr>
	<?endforeach;?>
	</table>
<?else:?>
nincs hibás render
<?endif;?>
</div>


<input type="submit" value="Kijelöltek törlése" style="margin: 0px 0px 10px 10px; font-weight: bold;" class="ngomb" />

</form>

</div>