<?php
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
//sigurnost:
if (!defined('SIGURICA')) die('Nedozvoljen pristup!');
if ($prava_pristup_admin!=1) die('Nedozvoljen pristup!');
?>
<script type="text/javascript">
$(document).ready(function(){
//JQuery ready is quicker than onload
$(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
$(".stripeMe tr:even").addClass("alt");
});
</script>
<div id="main_content">
<h1>Pregled, editiranje i dodavanje stylesheetova</h1>
<?php
//lista administratora
$sql99 = "select * from b7_stylesheet order by id asc";
$rez99=mysql_query($sql99,$conn);
if ($rez99) $num99=mysql_num_rows($rez99);
if ($num99>0) {
	$cur99=1;
	?>
	<table class="stripeMe" cellpadding="5" cellspacing="1" border="0">
    <tr>
    <th>ID</th>
    <th>Ime stylesheeta</th>
    <th>Ime u izborniku</th>
    <th>Opis</th>
    <th>Dostupnost</th>
    <th>Datum</th>
    <th>Editirao</th>
    <th colspan="2">Akcija</th>
    </tr>
    <?php
	while ($num99>=$cur99) {
		$row99=mysql_fetch_array($rez99);	
		$id=$row99[0];
		$ime=$row99[1];
		$ime_dropdown=$row99[2];
		$opis=$row99[3];
		//$stil=$row99[4];
		$selectable=$row99[5];
		$date_edit=$row99[6];
		$user=$row99[7];		
		
		$dostupnost[0]='NEdostupan u izborniku';
		$dostupnost[1]='dostupan u izborniku';
		?>
        <tr>
        <td><?php echo $id; ?></td>
        <td><?php echo $ime; ?></td>
        <td><?php echo $ime_dropdown; ?></td>
        <td><?php echo substr($opis, 0, 20); ?>...</td>
        <td><?php echo $dostupnost[$selectable]; ?></td>
        <td><?php echo date_format(date_create($date_edit), 'd.m.Y - H:i:s'); ?></td>
        <td><?php echo $user; ?></td>
        <td><a href="glavna.php?modul=site_admin&amp;akcija=form_edit_stylesheet&amp;sheet_id=<?php echo $id; ?>">Uredi</a></td>
        <td><a href="glavna.php?modul=site_admin&amp;akcija=del_sheet&amp;sheet_id=<?php echo $id; ?>" onclick="return verify()">Obriši</a></td>
       	</tr>
        <?php
		$cur99++;
	}
	?>
    </table>
    <?php	
}
?>
</div>