<?php
/*
  ===============================================================

  inGenio X
  http://ingenio.area421.com

  Created by 
  Julian Moreno Hidalgo (Software developer)
  Jesus Moreno Hidalgo (Communication's tree)

  inGenio X is a free software licensed under CC-GNU GPL

  ===============================================================
*/

	// valor "1" en desarrollo y "0" en internet
	ini_set("display_errors", "0");

	// Attempt...
	define("IGNX", 1);

	// conex, config, login  global
	require("inc.global.php");

/******* CONFIGURACION  ***********/

$titulo = INGENIO_NOMBRE." ".INGENIO_VERSION;
$archivo="usuarios.php";

/******* CONFIGURACION FIN ********/

	$ig = $_GET;
	$in = $_POST;

if (isset($in["guardar"]))
{


		// los ids y datos se ponen alineados
		$ids_conf = array('43','44','7','60');
		$datos_conf = array($in["instal_users"],$in["list_users"],$in["instal_visits"],$in["list_visits"]);	
		for ($i=0; $i<count($ids_conf); $i++)
		{
			myquery("UPDATE ".INGENIO." SET topic='".$datos_conf[$i]."' WHERE igID='".$ids_conf[$i]."'","[conf1]");
		}

		Redir ($archivo."?msj=1");

}
?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<?php echo '<meta http-equiv="content-type" content="text/html; charset='.CONFIG_2.'" />'; ?>
<title><?php echo $titulo; ?></title>
<?php include("inc.head.php"); ?>

<?php include("inc.formjs.php"); ?>

</head>

<body>

<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td valign="top">

<?php include("inc.menu.php"); ?>

</td><td valign="top" width="100%">

<?php include("inc.copy.php"); ?>

<div class="contenido">

<div class="div_rotulo_top_sec">
<img class="img_icon_pag" src="../skins_admin/<?php echo substr($row_comp['skin_admin'],0,-4); ?>/imgs/icon_usuarios.png" />
&nbsp;&nbsp;&nbsp;
<span class="rotulo_top_sec"><?php  echo LEN_ADMIN_284; ?></span>
</div>

<form enctype="multipart/form-data" action="<?php echo $archivo; ?>" onsubmit="return validar_ingreso(this);" method="post" name="principal">

<div class="rotulo"><?php  echo LEN_ADMIN_330; ?></div>

<?php
	
	if (isset($ig["msj"]))
	{
		echo '<span class="mensaje">'.LEN_ADMIN_58.'</span><br /><br />';
	
	}
?>

<div class="div_destacar_grupos">
<?php
		// instalar usuarios
		$qid = myquery("SELECT * FROM ".INGENIO." WHERE igID='43'","[id3]");
		$row4 = myfetch($qid);
		
		$sel_users_0 = $row4["topic"] == 0 ? ' selected' : '';
		$sel_users_1 = $row4["topic"] == 1 ? ' selected' : '';
		
		echo '<strong>'.salida_sin_tags_html_br($row4["ayuda"]).'</strong><br /><br />';
		echo '<select name="instal_users">';
		echo '<option value="0"'.$sel_users_0.'>'.LEN_ADMIN_60.'</option<>';
		echo '<option value="1"'.$sel_users_1.'>'.LEN_ADMIN_59.'</option<>';
		echo '</select>';
		
?>
</div>

<br /><br />
<div class="div_destacar_grupos">
<?php 

		// instalar usuarios
		$qid = myquery("SELECT * FROM ".INGENIO." WHERE igID='44'","[id4]");
		$row5 = myfetch($qid);

		echo '<strong>'.salida_sin_tags_html_br($row5["ayuda"]).'</strong><br /><br />';
		echo '<textarea name="list_users" rows="12" class="input_editor">';
		echo  $row5['topic'];
		echo '</textarea>';

?>
</div>

<br /><br /><br />
<div class="div_destacar_grupos">
<?php
		// instalar visitantes
		$qid = myquery("SELECT * FROM ".INGENIO." WHERE igID='7'","[id5]");
		$row4 = myfetch($qid);
		
		$sel_users_0 = $row4["topic"] == 0 ? ' selected' : '';
		$sel_users_1 = $row4["topic"] == 1 ? ' selected' : '';
		
		echo '<strong>'.salida_sin_tags_html_br($row4["ayuda"]).'</strong><br /><br />';
		echo '<select name="instal_visits">';
		echo '<option value="0"'.$sel_users_0.'>'.LEN_ADMIN_60.'</option<>';
		echo '<option value="1"'.$sel_users_1.'>'.LEN_ADMIN_59.'</option<>';
		echo '</select>';
		
?>
</div>

<br /><br />
<div class="div_destacar_grupos">
<?php 

		// instalar visitantes
		$qid = myquery("SELECT * FROM ".INGENIO." WHERE igID='60'","[id6]");
		$row5 = myfetch($qid);

		echo '<strong>'.salida_sin_tags_html_br($row5["ayuda"]).'</strong><br /><br />';
		echo '<textarea name="list_visits" rows="12" class="input_editor">';
		echo  $row5['topic'];
		echo '</textarea>';

?>
</div>

<div style="text-align:center;margin:20px 0px 20px 0px;">
<input type="submit" value="<?php echo LEN_ADMIN_16;?>" class="boton">
<input type="hidden" name="guardar" value="1">
&nbsp;&nbsp;&nbsp;<input type="reset" value="<?php echo LEN_ADMIN_18;?>" class="boton">
</div>

</form>
</div>

</td></tr></table>

</body>
</html>
<?php
	include("inc.fin.php");
?>