Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/04/2009, 14:39
Ney07
 
Fecha de Ingreso: marzo-2008
Ubicación: Cuba
Mensajes: 110
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: enviar una variable con un link

este es el link que quiero que vean:
<a href="imprimir.php?print_exp=<? print $fila['id_expediente'];?>" class="Estilo1" target="_blank">Imprimir</a>

que esta en el barnes(esta antes de mi consulta) y esta es la consulta que aparece despues no se si se podran dar cuenta que esta consulta no puedo ponerlo antes del barner ,logico, pero necesito de alugun modo enviar con el link el valor $fila['id_expediente'].

<?

define("__offset", 10);

if (isset($_POST['_Via']) or ($_POST['Tipo']) or ($_POST['Situacion']) or ($_POST['Resultado']) or ($_POST['Tema']) or ($_POST['Planteamiento']) or ($_POST['Destino']) or ($_POST['Fecha_ent']) or ($_POST['Fecha_env']) or ($_POST['Fecha_ent2']) or ($_POST['Fecha_env2'])){

$_SESSION['_Via'] = $_POST['_Via'];
$_SESSION['Tipo'] = $_POST['Tipo'];
$_SESSION['Situacion'] = $_POST['Situacion'];
$_SESSION['Resultado'] = $_POST['Resultado'];
$_SESSION['Tema'] = $_POST['Tema'];
$_SESSION['Planteamiento'] = $_POST['Planteamiento'];
$_SESSION['Destino'] = $_POST['Destino'];
$_SESSION['Fecha_ent'] = $_POST['Fecha_ent'];
$_SESSION['Fecha_env'] = $_POST['Fecha_env'];
$_SESSION['Fecha_ent2'] = $_POST['Fecha_ent2'];
$_SESSION['Fecha_env2'] = $_POST['Fecha_env2'];

$_SESSION['from'] = 0;
}

$sql="select * from table_carta where ";
if ($_SESSION['_Via'] != "0") $sql .= "(via regexp '".$_SESSION['_Via']."')and ";
if ($_SESSION['Tipo'] != "0") $sql .= "(tipo regexp '".$_SESSION['Tipo']."')and ";
if ($_SESSION['Situacion'] != "0") $sql .= "(situacion regexp '".$_SESSION['Situacion']."')and ";
if ($_SESSION['Resultado'] != "0") $sql .= "(resultado regexp '".$_SESSION['Resultado']."')and ";

if (($_SESSION['Tema'] != "0") && ($_SESSION['Planteamiento'] != "0")) $sql .= "(tema regexp '".$_SESSION['Tema']."')and (planteamiento regexp '".$_SESSION['Planteamiento']."') and ";

if ($_SESSION['Destino'] != "0") $sql .= "(destino regexp '".$_SESSION['Destino']."')and ";

if (($_SESSION['Fecha_ent'] != "") && ($_SESSION['Fecha_ent2'] != "")) $sql .= "(fecha_ent >= '".$_SESSION['Fecha_ent']."') and (fecha_ent <= '".$_SESSION['Fecha_ent2']."') and ";



if (($_SESSION['Fecha_env'] != "") && ($_SESSION['Fecha_env2'] != "")) $sql .= "(fecha_env >= '".$_SESSION['Fecha_env']."') and (fecha_env <= '".$_SESSION['Fecha_env2']."') and ";



$sql .= "(Id <> '') order by id_expediente ASC";// limit ".$_SESSION['from'].", ".__offset;

if ($_POST['btn_go']) $_SESSION['from'] = $_SESSION['from'] + __offset;
elseif ($_POST['btn_back']) $_SESSION['from'] = $_SESSION['from'] - __offset;

$tabla1=mysql_query($sql);
$cantidad=mysql_num_rows($tabla1);

if ($_SESSION['from'] > $cantidad) $_SESSION['from'] = $cantidad - __offset;
else if ($_SESSION['from'] < 0) $_SESSION['from'] = 0;


?>
</p>
<table width="83%" border="0" align="center">
<tr>
<td height="195"><table width="100%" border="0" align="center">
<tr>
<td width="13%" class="content">Resultado:</td>
<td width="27%" class="content"><select name="Resultado" class="content" id="Resultado">
<option value="0"></option>
<?php
//codigo para cargar el select de la BD
$r= mysql_query('SELECT * FROM resultado_carta ORDER BY idresult ASC');
while ($via = mysql_fetch_array($r)) {
?>
<option value="<?php echo $via['result']; ?>"><?php echo $via['result']; ?></option>
<?php
}
mysql_free_result($r);
?>
</select></td>
<td width="7%" class="content">&nbsp;</td>
<td width="15%" class="content">&nbsp;</td>
<td width="38%" class="content">&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" align="center">
<tr>
<td width="14%" class="content">&nbsp;</td>
<td width="30%" class="content">&nbsp;</td>
<td width="8%" class="content">&nbsp;</td>
<td width="10%" class="content">&nbsp;</td>
<td width="38%" class="content">&nbsp;</td>
</tr>
<tr>
<? $f=date('d/m/Y') ?>
<td class="content"> Entrada de: </td>
<td class="content"><input name="Fecha_ent" type="text" class="content" id="Fecha_ent" value="<? echo "$f";?>" /></td>
<td class="content">&nbsp;</td>
<td class="content">a:</td>
<td class="content"><input name="Fecha_ent2" type="text" class="content" id="Fecha_ent2" value="<? echo "$f";?>" /></td>
</tr>
<tr>
<td class="content"> Env&iacute;o de: </td>
<td class="content"><input name="Fecha_carta" type="text" class="content" id="Fecha_carta" value="<? echo "$f";?>"/></td>
<td class="content">&nbsp;</td>
<td class="content">a:</td>
<td class="content"><input name="Fecha_carta2" type="text" class="content" id="Fecha_carta2" value="<? echo "$f";?>"/>
<label> &nbsp;&nbsp;&nbsp;&nbsp;
<input name="Submit" type="submit" class="content" value="Buscar" />
</label></td>
</tr>
</table></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="635" border="0" align="center">
<tr>
<td width="629" height="1" bgcolor="#325372"></td>
</tr>
</table>
<table width="340" border="0" align="center">
<tr>
<td class="content">&nbsp;</td>
<td class="content">&nbsp;</td>
<td class="content">&nbsp;</td>
</tr>
<tr>
<td width="120" class="content"><strong># de Expediente</strong></td>
<td width="133" class="content"><strong>Nombre</strong></td>
<td width="65" class="content"><strong>Cartas</strong></td>
</tr>
</table>
<span class="content">
<?
if ($cantidad > 0){
for($i=0;$i<$_SESSION['from'];$i++) $fila=mysql_fetch_array($tabla1);
$to = $_SESSION['from'] + __offset;

print"</span>
<table width='379' border='0' align='center'>";

for ($e=$_SESSION['from'];$e<=$to;$e++){
if ($e<$cantidad){

$fila=mysql_fetch_array($tabla1);
$rs_process=mysql_query("select * from tb_servicios where idaplicacion='1'");
$rs_process=mysql_fetch_assoc($rs_process);
if($rs_process['monitor_rs']=="0"){
$tok_query=mysql_query("update tb_servicios set monitor_rs='".$fila['id_expediente']."' where idaplicacion='1'");
}
if($rs_process['monitor_rs']==$fila['id_expediente']){
}else{

?>
</span></td>
</tr>
<tr>
<td width="145"><div align="center"><span class="content"><? echo"<a href='registro_tramites.php?visor_tramites_exp=".$ fila['id_expediente']."' class='content Estilo6'>".$fila['id_expediente']."</a>";?> </span></div></td>
<td width="135"><span class="content">
<?
$n=mysql_query("select na from table_perfil where id_expediente='".$fila['id_expediente']."'") or die (mysql_error());
$na=mysql_fetch_assoc($n);
if ($na['na']==!""){
echo $na['na'];
}else{ echo"Anónimo";
}
?>
</span></td>
<td width="85"><span class="content">
<?
$s=mysql_query("select * from table_carta where id_expediente='".$fila['id_expediente']."'") or die(mysql_error());
$Count=mysql_num_rows($s);

for($i=1;$i<=$Count;$i++){
$ff=mysql_fetch_array($s);
$resto="".$ff['numero_carta'].",";

if($i==$Count){
$resto = substr($resto, 0, strlen($resto)-1);
}

echo"<a href='registro_tramites.php?visor_tramites_exp=".$ ff['id_expediente']."&visor_tramites_carta=".$ff['numero_carta']."'
class='content Estilo6'>$resto</a>";}


$tok_query=mysql_query("update tb_servicios set monitor_rs='".$fila['id_expediente']."' where idaplicacion='1'");
?>
</span></td>
</tr>
<?
}
}
}
$tok_query=mysql_query("update tb_servicios set monitor_rs='0' where idaplicacion='1'");
print"</table>
<p class='textorojo'><span class='textorojo'>";
}
mysql_close($cxn);
?>