<?
	session_start();
	if ($_SESSION['Usuario_inc'] == '' ){header("Location: index.html");}
	if ($_REQUEST['token'] <> $_SESSION['token_inc']){header("Location: index.html");}
	$token=$_REQUEST['token'];
	
	

	if (isset($_GET['identificador'])){$identificador=$_GET['identificador'];}
	if (isset($_GET['nombre'])){$marca=$_GET['nombre'];}
	if (isset($_GET['password'])){$modelo=$_GET['password'];}
	if (isset($_GET['tipo'])){$color=$_GET['tipo'];}

	
	function detect_mobile()
	{
		if(preg_match('/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|ipad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i', $_SERVER['HTTP_USER_AGENT']))
			return true;
	 
		else
			return false;
	}
	$mobile = detect_mobile();
	
?>
	<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Clarosol</title>
	<meta http-equiv="cache-control" content="max-age=0" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
	<script src="./funciones.js" language="javascript" type="text/javascript"></script>
	<script src="jquery-1.11.0.min.js" language="javascript" type="text/javascript"></script>
	<script src="jquery.mobile-1.4.2.min.js"  language="javascript" type="text/javascript"></script>
	<script src="jquery-ui.min.js"  language="javascript" type="text/javascript"></script>
	<link rel="stylesheet" href="jquery-ui.css">	
	<link rel="stylesheet" type="text/css" href="jquery.mobile-1.4.2.min.css" />
	<link rel="apple-touch-icon" href="/icon.png"><link rel="apple-touch-startup-image" href="/Default.png">
	<script type="text/javascript">
		function setCalendar(){
			$("#fecha").datepicker({
				showAnim: "slide",
				dateFormat: "yy-mm-dd",
			});
		};
		
		
	</script>
</head>

<body>
<div data-role="content" data-theme="">
<?
			if($mobile === true){
				echo '<ul data-role="listview" data-divider-theme="b" data-inset="true">';
			}else{
				echo '<ul data-role="listview" data-divider-theme="b" data-inset="true" style="width:50%; margin-left:25%">';
			};
		?>
  <li data-role="list-divider" role="heading"  style="height:50px; font-size: 18px">
		<p><b>FORMULARIO DE ALTA DE USUARIOS</b>
					<a href="menu.php?token=<?echo $token;?>" style="margin-left:7%">
						<img src="icon_home.png" style="left:90%; width: 30px; height:30px"/>
					</a>
					<a href="index.php" style="margin-left:3%">
						<img src="icon_exit.png" style="left:90%; width: 30px; height:30px"/>
					</a>
				</p>
</li>
	<form method="post" action="insertar_usuarios.php">
		<center><table style="text-align: left; width: 100%" cellpadding="3" rules="rows">
 
 
   <tr>
     <td style="border: inset 0pt"><b>DNI:</b></td>
     <td style="border: inset 0pt"> <input type="text" name="identificador" id="identificador" /></td>
   </tr>
   <tr>
     <td style="border: inset 0pt"><b>Nombre:</b></td>
      <td style="border: inset 0pt"><input name="nombre" id="nombre">
	 </td>
   </tr>
   <tr>
     <td style="border: inset 0pt"><b>Contraseņa:</b></td>
     <td style="border: inset 0pt"><input type="text" name="password" id="password" /></td>
   </tr>
     <tr>
     <td style="border: inset 0pt"><b>Tipo :</b></td>
      <td style="border: inset 0pt"><select name="tipo" id="tipo">
      <option selected="selected"></option>
      <option>Operario</option>
      <option>Responsable Clarosol</option>
      <option>Cliente</option>
	  <option>Responsable Cliente</option>
    </select></td>
   </tr>
 
   <tr>
     <td style="border: inset 0pt" class="centrado" colspan="2"><input type="submit" value="Enviar" />
       <input type="reset" value="Restablecer" /></td>
   </tr>

 
 </table></center>
 
</form>
</div>
</body>
</html>