Aquí les dejo el codigo de ambos archivos
header.php
Código PHP:
<?php
$servidor = "http://" . $_SERVER['SERVER_NAME'];
$path = dirname(dirname($servidor . $_SERVER['PHP_SELF']));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AWIC Servicios</title>
<link type="text/css" rel="stylesheet" href="<?php echo $path ?>../../css/main.css" />
<link type="text/css" rel="stylesheet" href="<?php echo $path ?>../../css/tablas.css" />
<link type="text/css" rel="stylesheet" href="<?php echo $path ?>../../css/form.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $path ?>../../css/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="<?php echo $path ?>../../js/jsDatePick.min.1.3.js"></script>
<script type="text/javascript" src="<?php echo $path ?>../../js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="<?php echo $path ?>../../js/jquery.func.js"></script>
<script language="JavaScript" src="<?php echo $path ?>../../js/fechas.js"></script>
<script type="text/javascript" src="<?php echo $path ?>../../tiny_mce/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
convert_urls : false,
mode : "textareas",
plugins : "phpimage",
theme : "advanced",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
theme_advanced_buttons1 : "bold,italic,strikethrough,separator,styleselect,formatselect,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,phpimage,separator,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
content_css : "../../tiny_mce/estilo_editor.css"
});
</script>
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/demo/screen.css" type="text/css" />
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/jquery.treeview.css" type="text/css" />
<script type="text/javascript" src="http://jquery.bassistance.de/treeview/jquery.treeview.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#example").treeview();
});
</script>
</head>
<body style="background:#BFDFFF;">
<div id="cabecera">
<h1>AWIC - Gestor de Información Servicios</h1>
</div>
</body>
</html>
sumainc.php
Código PHP:
<?php
include ('header.php');
$servidor="http://".$_SERVER['SERVER_NAME'];
$path=dirname($servidor.$_SERVER['PHP_SELF']);
?>
<script LANGUAGE="JavaScript">
function sumar(boton)
{
select_a = Number(document.formulario.a.options[formulario.a.selectedIndex].value);
select_b = Number(document.formulario.b.options[formulario.b.selectedIndex].value);
select_c = Number(document.formulario.c.options[formulario.c.selectedIndex].value);
valor = select_a + select_b + select_c;
document.forms[0].elements["total"].value=valor;
}
</script>
<BODY>
<form action="" name="formulario" id="formulario" method="GET">
Edad:<br/>
<select onchange="javascript:sumar()" name="a" >
<option value="10"> 10 | Sostén de vida</option>
<option value="9"> 9 | Cuidados Intensivos y Quirófano</option>
<option value="8"> 8 | Radioterapia</option>
<option value="7"> 7 | Monitoreo</option>
<option value="6"> 6 | Imagenología</option>
<option value="5"> 5 | Laboratorio Clínico</option>
<option value="4"> 4 | Accesorios de Laboratorio</option>
<option value="3"> 3 | Computadoras</option>
<option value="2"> 2 | Accesorios de PC</option>
</select>
<select name="b" onChange="javascript:sumar()">
<option value="5"> 5 | Muerte</option>
<option value="4"> 4 | Daño al paciente y/o operador</option>
<option value="3"> 3 | Terapia inapropiada</option>
<option value="2"> 2 | ........</option>
<option value="1"> 1 | Sin riesgo significativo</option>
</select>
<select name="c" onChange="javascript:sumar()">
<option value="5"> 5 | Intensivo</option>
<option value="3"> 3 | Medio</option>
<option value="1"> 1 | Mínimo</option>
</select>
<input type="text" readonly name="total">
</form>
</BODY>