Ayuda con el location.herf php
Publicado por Haydee (11 intervenciones) el 10/06/2014 20:59:43
no logro que conecte las paginas necesito ayuda, por favor.
--------------------------------------------Pagina a la que quiero que vaya------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
mysql_connect("localhost","root","root");
mysql_select_db("chavaotros");
$fecha_ini=$_POST[fechaini];
$fecha_fin=$_POST[fechafin];
echo "esto es fecha inicio ".$_POST[fechaini];
echo "<br>";
echo "esto es fecha fin ".$_POST[fechafin];
echo "<br>";
echo "esto es num pau ".$_POST[numpau];
echo "<br>";
//numero de materiales
$num=$_POST[numpau];
//$i=1;
//$j=1;
while($fecha_ini<=$fecha_fin){
$i=1;
while($i<=$num){
$j=1;
$s=0;
$z=0;
for($a=1;$a<=3;$a++)
{
if($_POST[hor_.$i._.$a]==1)
{
$s++;
}
}
echo "esto es s".$s;
echo "<br>";
switch ($s){
case 1:
$num_imp2=1; // 0
break;
case 2:
$num_imp2=2; // 1
break;
case 3:
$num_imp2=3; // 2
break;
}
echo "esto es num_imp2 ".$num_imp2;
echo "<br>";
$num_imp=explode(",",$_POST[num_imp_.$i]);
print_r($num_imp);
echo "<br>";
$num_imp3=count($num_imp);
echo "esto es num_imp3 ".$num_imp3;
echo "<br>";
if($num_imp2==$num_imp3){
while($j<=3)
{
if($_POST[hor_.$i._.$j]==1)
{
switch ($j){
case 1:
$horai="06:00:00";
$horaf="11:59:59";
break;
case 2:
$horai="12:00:00";
$horaf="17:59:59";
break;
case 3:
$horai="18:00:00";
$horaf="23:59:59";
break;
}
for($r=1;$r<=$num_imp[$z];$r++)
{
$id_mat=$_POST[mat_.$i];
$inicio=$fecha_ini." ".$horai;
$fin=$fecha_ini." ".$horaf;
$qry="insert into to_impactos values ('','','$_POST[canal]','$id_mat','$inicio','$fin','$_POST[tipot]','','','','','')";
echo $qry;
echo "<br>";
mysql_query($qry) or die(mysql_error());
}
$z++;
}
$j++;
}
}
$i++;
}
$q3="SELECT ADDDATE('$fecha_ini', 1) as dia";
$rs3 = mysql_query($q3) or die(mysql_error());
$r3 = mysql_fetch_array($rs3);
$fecha_ini=$r3[dia];
echo "esto es fecha ini ".$fecha_ini;
echo "<br>";
}
for($i=1;$i<=$_POST[numpau];$i++){
$url=$url."&mat_$i=".$_POST[mat_.$i];
}
$url=$url."&fechaini=".$_POST[fechaini]."&fechafin=".$_POST[fechafin]."&canal=".$_POST[canal];
//header('Location: revision_impactos.php?numpau='echo .$_POST[numpau].$url);
?>
<script type="text/javascript">
location.href="revision_impactos.php?numpau=<? echo $_POST[numpau].$url?>";
//location.href="crea_impactos_tv_2.php?numpau=<? //echo $_POST[numpau].$url?>";
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?
mysql_connect("localhost","root","root");
mysql_select_db("chavaotros");
?>
<!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>Documento sin título</title>
</head>
<?
$i = $_GET['fechaini'];
$c = $_GET['canal'];
$query = "select * from to_impactos as a, to_canales as b, to_materiales as c WHERE a.id_canal = b.id_canal and a.id_mat = c.id_mat and a.id_canal =".$c." and a.bexpected like '".$i."%' order by bexpected asc";
echo $query;
$tr = mysql_query($query) or die (mysql_error());
$numero = mysql_num_rows($tr);
?>
<body>
<form name="form" method="get" action="crea_impactos_tv_2.php">
<table width="834">
<tr>
<td> Fecha</td>
<td>Canal</td>
<td>Material</td>
</tr>
<? while ($r = mysql_fetch_array($tr)){ ?>
<tr>
<td><? echo $r['bexpected'];?></td>
<td><? echo $r['nombre_canal'];?></td>
<td><? echo $r['nombre_mat'];?></td>
</tr>
<? }?>
<tr>
<td><? echo "El numero de registros en la tabla es:" .$numero; ?></td>
</tr>
</table>
</body>
</html>
Valora esta pregunta
0