<?php
?>
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="acc_calendar/acc_calendar.js"></script>
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript" >
function addRow(seccion) {
var table = document.getElementById(seccion);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
cant = rowCount ;
for(var i=0; i<colCount; i++) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
//alert(newcell.childNodes);
cant = cant + 1;
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;
}
}
}
</script>
<?php
include "config.php";
if(!$link){
}
if(!$_POST ){
?>
<?php
$codigo_plan=$_REQUEST['id'];
$codigo_plan = $_SESSION['codigo_plan'] ;
$cantidad = $_SESSION['cantidad'] ;
$query = ("SELECT a.nombre_carrera FROM carrera a, plan_estudio b
WHERE a.codigo_carrera = b.codigo_carrera and b.codigo_plan = $codigo_plan ") or
die(mysql_error()); $nombre_carrera=$row['nombre_carrera'];}
}
?>
<form action="seccion2.php" method="post" name="aula">
<br>
<div align="center"><h2><strong><font size="+3" color="#0009A8"> Carga Academica</font></strong></h2></div>
<table align="center">
<tr>
<td align="center"> <strong> Curso </strong> </td>
<td align="center" width="7"> <strong> L </strong> </td>
<td align="center" width="7"> <strong> M </strong> </td>
<td align="center" width="7"> <strong> Mi </strong> </td>
<td align="center" width="7"> <strong> J </strong> </td>
<td align="center" width="7"> <strong> V </strong> </td>
<td align="center" width="7"> <strong> S </strong> </td>
<td align="center" width="7"> <strong> D </strong> </td>
<td align="center" > <strong> Hora Inicio </strong> </td>
<td align="center"> <strong> Hora Final </strong> </td>
</tr>
</table>
<?php
for ($i = 1; $i <= $cantidad; $i++) {
?>
<table align="center" id="seccion">
<tr>
<td> <?php
$con="SELECT nombre_curso FROM curso WHERE codigo_plan = $codigo_plan";
if(!$res){
echo "fallo la conexion";
}
else{
echo "<select name= 'curso1[]' style='width:200px'>";
echo "<option>", $fila['nombre_curso'], "</option>";
}}
echo "</select>";
echo "
</td>
<td align='center'><input name= 'l[]' type='checkbox' value='x'></td>
<td align='center'><input name= 'm[]' type='checkbox' value='x'></td>
<td align='center'><input name= 'mi[]' type='checkbox' value='x'></td>
<td align='center'><input name= 'j[]' type='checkbox' value='x'></td>
<td align='center'><input name= 'v[]' type='checkbox' value='x'></td>
<td align='center'><input name= 's[]' type='checkbox' value='x'></td>
<td align='center'><input name= 'd[]' type='checkbox' value='x'></td>
<td>
<select name= 'hi[]'>
<option > -----</option>
<option > 07</option>
<option > 08</option>
<option > 09</option>
<option > 10</option>
<option > 11</option>
<option > 12</option>
<option > 13</option>
<option > 14</option>
<option > 15</option>
<option > 16</option>
<option > 17</option>
<option > 18</option>
<option > 19</option>
<option > 20</option>
</select>
<select name= 'mi1[]'>
<option > -----</option>
<option > :00 </option>
<option > :30 </option>
</select></td>
<td>
<select name= 'hf[]'>
<option > -----</option>
<option > 07</option>
<option > 08</option>
<option > 09</option>
<option > 10</option>
<option > 11</option>
<option > 12</option>
<option > 13</option>
<option > 14</option>
<option > 15</option>
<option > 16</option>
<option > 17</option>
<option > 18</option>
<option > 19</option>
<option > 20</option>
</select>
<select name= 'mf[]'>
<option > -----</option>
<option > :00 </option>
<option > :30 </option>
</select>
</td>
</tr>
";
}
?>
</table>
<br>
<div align="center"><input type="submit" name="Aceptar" value="Guardar" /></div>
<INPUT type="button" value="Add Row" onclick="addRow('seccion')" />
<div align="center"><input type="hidden" name="cantidad" value="<?php echo $cantidad; ?>" /></div>
<div align="center"><input type="hidden" name="codigo_plan" value="<?php echo $codigo_plan; ?>" /></div>
<div align="center"><input type="hidden" name="trimestre" value="<?php echo $tri; ?>" /></div>
</form>
<?php
}else{
$cantidad=$_POST ['cantidad'];
$codigo_plan=$_POST ['codigo_plan'];
$trimestre=$_POST ['trimestre'];
$curso=$_POST["curso1"];
$inicioh=$_POST ["hi"];
$iniciom= $_POST ["mi1"] ;
$finalh=$_POST ["hf"];
$finalm= $_POST ["mf"];
$martes=$_POST["m"];
$miercoles=$_POST["mi"];
$viernes=$_POST["v"];
$sabado=$_POST["s"];
$domingo=$_POST["d"];
$jueves=$_POST["j"];
$c=1;
foreach($curso as $a => $b)
{
echo $curso[$a];
if(isset($_POST['l'][$a])) {
echo "x";
} else { echo " ";}
}}
?>
</body>
</html>