Código PHP:
?php require_once('F_design.php');
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
$isValid = False;
set equal to their username.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "noautorizado.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO diario (FECHA, TURNO, LINEA12, LINEA34, CFSS, CFFV, CFHPPHPCFAH, USRDUSCCEALAM, CFPL2, `3FPL3FFV`, CCIDIFT, EDAR, SERVMANNTO, SOSA, ALGIBE, D7001, GRUPOSDEFRIO, CLORO, ENTRANTE, SALIENTE, VBJEFEMANNTO) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['FECHA'], "text"),
GetSQLValueString($_POST['TURNO'], "text"),
GetSQLValueString($_POST['LINEA12'], "text"),
GetSQLValueString($_POST['LINEA34'], "text"),
GetSQLValueString($_POST['CFSS'], "text"),
GetSQLValueString($_POST['CFFV'], "text"),
GetSQLValueString($_POST['CFHPPHPCFAH'], "text"),
GetSQLValueString($_POST['USRDUSCCEALAM'], "text"),
GetSQLValueString($_POST['CFPL2'], "text"),
GetSQLValueString($_POST['3FPL3FFV'], "text"),
GetSQLValueString($_POST['CCIDIFT'], "text"),
GetSQLValueString($_POST['EDAR'], "text"),
GetSQLValueString($_POST['SERVMANNTO'], "text"),
GetSQLValueString($_POST['SOSA'], "text"),
GetSQLValueString($_POST['ALGIBE'], "text"),
GetSQLValueString($_POST['D7001'], "text"),
GetSQLValueString($_POST['D417'], "text"),
GetSQLValueString($_POST['GRUPOSDEFRIO'], "text"),
GetSQLValueString($_POST['CLORO'], "text"),
GetSQLValueString($_POST['ENTRANTE'], "text"),
GetSQLValueString($_POST['SALIENTE'], "text"),
GetSQLValueString(isset($_POST['VBJEFEMANNTO']) ? "true" : "", "defined","1","0"));
mysql_select_db($database_turno, $turno);
$Result1 = mysql_query($insertSQL, $turno) or die(mysql_error());
$insertGoTo = "cambiook.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
izq();
?>
<h1 align="center">Cambio de turno:</h1>
<p align="center"><img src="logo_bioiberica.gif" width="210" height="122" /></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">FECHA:</td>
<td align="left"><input type="text" id="FECHA" name="FECHA" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">TURNO:</td>
<td align="left">
<select name="TURNO" size="1" id="TURNO">
<option>Mañana</option>
<option>Tarde</option>
<option>Noche</option>
</select>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">LINEA 1-2:</td>
<td align="left"><textarea name="LINEA12" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">LINEA 3-4:</td>
<td align="left"><textarea name="LINEA34" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">CF-SS</td>
<td align="left"><textarea name="CFSS" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">CF-FV:</td>
<td align="left"><textarea name="CFFV" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">CF-HP/PHP/CF-AH:</td>
<td align="left"><textarea name="CFHPPHPCFAH" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">USRD/USCC/E.A.LAM:</td>
<td align="left"><textarea name="USRDUSCCEALAM" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">CF-PL2:</td>
<td align="left"><textarea name="CFPL2" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">3FPL/3FFV:</td>
<td align="left"><textarea name="3FPL3FFV" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">C+C/I+D+I/FT:</td>
<td align="left"><textarea name="CCIDIFT" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">EDAR:</td>
<td align="left"><textarea name="EDAR" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" valign="top">SERV/MANNTO:</td>
<td align="left"><textarea name="SERVMANNTO" cols="60" rows="8"></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">SOSA:</td>
<td align="left"><input type="text" name="SOSA" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">ALGIBE</td>
<td align="left"><input type="text" name="ALGIBE" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">D-7001:</td>
<td align="left"><input type="text" name="D7001" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">D-417:</td>
<td align="left"><input type="text" name="D417" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">GRUPOS DE FRIO :</td>
<td align="left"><input type="text" name="GRUPOSDEFRIO" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">CLORO :</td>
<td align="left"><input type="text" name="CLORO" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">ENTRANTE:</td>
<td align="left"><input type="text" name="ENTRANTE" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">SALIENTE:</td>
<td align="left"><input type="text" name="SALIENTE" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">VºBº JEFE MANTTO.:</td>
<td align="left"><input type="checkbox" name="VBJEFEMANNTO" value="" ></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td align="left"><input type="submit" value="Guardar registro" name="guardar_final">
<label>
<input type="submit" name="Submit" value="Guardado parcial" />
<input name="recuperar informe" type="button" id="recuperar informe" value="Recuperar informe" />
<input type="button" name="Submit2" value="Enviar informe diario" />
<input name="Inicio" type="button" id="Inicio" value="Inicio" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<script>
$(function(){
$('#FECHA').datepicker({dateFormat:'dd-mm-yy'});
});
</script>
<?php
der();