Viewing file: demo.php (3.94 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$er = isset($con);
echo $er;
if ($er == false)
{
///// Definción de arreglos iniciales
//// arreglo de control
$drr[0] = "1";
$drr[1] = "0";
$drr[2] = "0";
$drr[3] = "0";
$drr[4] = "0";
$drr[5] = "1";
$drr[6] = "0";
$drr[7] = "1";
$drr[8] = "1";
$drr[9] = "0";
//// arreglo de items
$arr[0] = "Ecosistemas";
$arr[1] = "Humedales";
$arr[2] = "Areas protegidas";
$arr[3] = "Entre Nubes";
$arr[4] = "Cerros";
$arr[5] = "Ecourbanismo";
$arr[6] = "Ecobarrios";
$arr[7] = "Rural";
$arr[8] = "Saneamiento Basico";
$arr[9] = "Ciclo del Agua";
//// arreglo de codigos
$crr[0] = "1";
$crr[1] = "1.1";
$crr[2] = "1.2";
$crr[3] = "1.21";
$crr[4] = "1.3";
$crr[5] = "2";
$crr[6] = "2.1";
$crr[7] = "3";
$crr[8] = "4";
$crr[9] = "4.1";
////////////////////////
$primer = 1;
}
if ($er == true) {
$items = explode ("_", $asi);
$citems = explode ("_", $csi);
$ditems = explode ("_", $dsi);
echo "quepas";
$how = 0;
foreach($citems as $v) {
$how++;
}
$protes = isset($titi);
if ($protes == true) {
//$titi = "1.";
$lentiti = strlen($titi);
if ($lentiti == 1) {
$titi = $titi . ".";
}
$lentiti = $lentiti + 1;
$conta = 0;
foreach($citems as $v) {
$result = strstr($v, $titi);
$lenow = strlen($result);
if ($result != "" and $lenow == $lentiti) {
$ditems[$conta] = 1;
}
echo $conta . $result . "<br>";
$conta++;
}
$primer = 0;
}else{
$primer = 1;
}
//while ($key = array_search("1", $citems))
//{
//echo $key;
//}
$count = 0;
foreach($citems as $v) {
if ($ditems[$count] == 1) {
$len = strlen($v);
$nex = $count + 1;
/// Reemplazar
if ($len == 1) {
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
}
if ($len == 3) {
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
}
if ($len == 4) {
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
echo "<img src=\"blanco.gif\" width=\"12\" height=\"12\">";
}
//////
if ($nex < $how) {
$len1 = strlen($citems[$nex]);
if ($len < $len1) {
echo "<a href=\"demo.php?titi=$v&con=1\"><img src=\"mas.gif\" width=\"12\" height=\"12\" border=\"0\"></a> ";
}else{
echo "<img src=\"menos.gif\" width=\"12\" height=\"12\"> ";
}
}else{
echo "<img src=\"menos.gif\" width=\"12\" height=\"12\"> ";
}
echo $items[$count] . " - " . $v . "<br>";
}
$count++;
}
}
//// Si se carga por primera vez, entonces coja los valores iniciales
if ($primer == 1) {
$ann = "";
foreach($arr as $v) {
$ann = $ann . "_" . $v;
}
$cnn = "";
foreach($crr as $v) {
$cnn = $cnn . "_" . $v;
}
$dnn = "";
foreach($drr as $v) {
$dnn = $dnn . "_" . $v;
}
}
////////////////////////////////////////
//// Si se carga por primera vez, entonces coja los valores iniciales
if ($primer != 1) {
$ann = "";
foreach($items as $v) {
$ann = $ann . "_" . $v;
}
$cnn = "";
foreach($citems as $v) {
$cnn = $cnn . "_" . $v;
}
$dnn = "";
foreach($ditems as $v) {
$dnn = $dnn . "_" . $v;
}
}
////////////////////////////////////////
?>
<form name="form1" method="post" action="demo.php">
<input name="asi" type="hidden" id="as" value="<?php echo $ann; ?>">
<input name="csi" type="hidden" id="as" value="<?php echo $cnn; ?>">
<input name="dsi" type="hidden" id="as" value="<?php echo $dnn; ?>">
<input name="con" type="hidden" id="con" value="1">
<input type="submit" name="Submit" value="Enviar">
</form>
<p><a href="demo.php"><img src="mas.gif" width="12" height="12" border="0"></a></p>
<p><a href="demo.php"><img src="menos.gif" width="12" height="12" border="0"></a></p>
</body>
</html>
|