<?php
include("postget.php");
include_once("common.php");
$pagetitle = _FIRST_SETUP;

checklevel(4);


if ($_REQUEST['option']) {
	mysql_query("UPDATE hd_firstsetup SET status='1' WHERE task='".$_REQUEST['option']."'",$db_link);
	$url = query("SELECT url FROM hd_firstsetup WHERE task='".$_REQUEST['option']."'",1);
	go2($url[0]);
}

if (!$ismain) {
	include("head_template.php");
	$where = '';
}else{
	$where = 'WHERE status=0';
}

/////////////////// contar tareas sin configurar
$queryFS="SELECT count(task) FROM hd_firstsetup WHERE status=0";
$resultFS=mysql_query($queryFS,$db_link);
$rowFS = mysql_fetch_array($resultFS);
if ($rowFS[0]>0 OR !$ismain) {


	$query="SELECT * FROM hd_firstsetup $where ORDER BY hd_firstsetup.order";
	$q=mysql_query($query,$db_link);

	$text="";
	while($row=mysql_fetch_array($q)) {

		$help = '';

                echo '<tr>';

		if ($row[status]==0) {
			$text.= "<td width='50%'><b><font size='2'><b>".ucfirst(constant($row[task]))."</b></font></b></td>";
			$text.= "<td align='center'><b><font color='#CC0033' size='3'>".ucfirst(_INCOMPLETE)."</font></b></td>";
			$text.= "<td align='center'>
			<a href='firstsetup.php?option=".$row[task]."' class='btn btn-warning'>
			".strtoupper(_CONFIGURE)."</a></td>";
			$text.= "<td align='center'><b>".$help."</b></td>";
		}else{
			$text.= "<td width='50%'><b><font size='2'><b>".ucfirst(constant($row[task]))."</b></font></b></td>";
			$text.= "<td align='center'><font size='3'>".ucfirst(_COMPLETED)."</font></td>";
			$text.= "<td align='center'><a href='".$row[url]."' class='btn btn-success'>".strtoupper(_CONFIGURE)."</a></td>";
			$text.= "<td align='center'><b>".$help."</b></td>";
		}

		$text.= "</tr>";
	};




	echo '
<div class="container">
	<div class="row">
';

	echo "<table class='table table-striped'>";

	echo "<tr><th colspan='4'><font size='5'>".strtoupper(_FIRST_SETUP)."</font></th></tr>";

	echo $text;

	echo "</table>";

echo '
</div>
</div>
';

}

if (!$ismain) {
	include("foot_template.php");
}

?>