<?
	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['tipo_servicio'])){$tipo_servicio=$_GET['tipo_servicio'];}
	if (isset($_GET['operario'])){$operario=$_GET['operario'];}
	if (isset($_GET['vehiculo'])){$vehiculo=$_GET['vehiculo'];}
	if (isset($_GET['hora_inicio'])){$hora_inicio=$_GET['hora_inicio'];}
	if (isset($_GET['hora_fin'])){$hora_fin=$_GET['hora_fin'];}
	if (isset($_GET['ok_inicio'])){$ok_inicio=$_GET['ok_inicio'];}
	if (isset($_GET['ok_fin'])){$ok_fin=$_GET['ok_fin'];}
	if (isset($_GET['observaciones'])){$ok_fin=$_GET['observaciones'];}

	
	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 SERVICIO</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_servicios.php">
		<center><table style="text-align: left; width: 100%" cellpadding="3" rules="rows">
 
 
   <tr>
     <td style="border: inset 0pt"><b>Identificador:</b></td>
     <td style="border: inset 0pt"> <input type="text" name="identificador" id="identificador" /></td>
   </tr>
   <tr>
     <td style="border: inset 0pt"><b>Tipo de servicio:</b></td>
      <td style="border: inset 0pt"><select name="tipo_servicio" id="tipo_servicio">
      <option selected="selected"></option>
      <option>servicio1</option>
      <option>servicio2</option>
      <option>servicio3</option>
    </select></td>
   </tr>
   <tr>
     <td style="border: inset 0pt"><b>Operario:</b></td>
     <td style="border: inset 0pt"><input type="text" name="operario" id="operario" /></td>
   </tr>
   <tr>
   <td style="border: inset 0pt"><b>Vehiculo:</b></td>
   <td style="border: inset 0pt"><input type="text" name="vehiculo" id="vehiculo" /></td>
   </tr>
  <tr>
   <td style="border: inset 0pt"><b>Hora inicio:</b></td>
   <td style="border: inset 0pt"><input type="time" name="hora_inicio" id="hora_inicio" /></td>
   </tr>
  <tr>
   <td style="border: inset 0pt"><b>Hora fin:</b></td>
   <td style="border: inset 0pt"><input type="time" name="hora_fin" id="hora_fin" /></td>
   </tr>
   <tr>
   <td style="border: inset 0pt"><b>OK inicio:</b></td>
   <td style="border: inset 0pt"><input type="text" name="ok_inicio" id="ok_inicio" /></td>
   </tr>
  <tr>
   <td style="border: inset 0pt"><b>OK fin:</b></td>
   <td style="border: inset 0pt"><input type="text" name="ok_fin" id="ok_fin" /></td>
   </tr>
   <tr>
   <td style="border: inset 0pt"><b>Observaciones:</b></td>
   <td style="border: inset 0pt"><input type="text" name="observaciones" id="observaciones" /></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>