Hola!

Registrándote como bakuno podrás publicar, compartir y comunicarte en privado con otros bakuos :D

Regístrame ya!

Ayuda con codigo PHP y postgresql

macsix

Becerro
Desde
17 Dic 2008
Mensajes
47
Hola buen dia solo para solicitar su apoyo para poder incrustar una funcion en este codigo ya que no he podido realizarlo me muestra array cuando lo he intentado o no me muestra nada, el codigo es le siquiente:

<html>
<head>
</head>
<body bgcolor='#EAEAC7'>

<?php

include('config.php');
include('funciones.php');

$db_iems=connect_db($server['ip'][0],$server['db_name'][0],$server['user'][0],$server['pass'][0]);
$db_semi=connect_db($server['ip'][1],$server['db_name'][1],$server['user'][1],$server['pass'][1]);
$db_LabComp=connect_db($server['ip'][2],$server['db_name'][2],$server['user'][2],$server['pass'][2]);
$colorC=$conf['color']['C'];
$colorO=$conf['color']['O'];


print("<Table align=\"center\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" bgcolor=\"$colorC\" width=\"100%\">");
impCabeceraT("REGISTRO DE ALUMNO",$conf['semestre']);
$alumno=get_alumno($matricula,$db_iems);
if (count($alumno)==0){
$alumno=get_alumno($matricula,$db_semi);
}
else{
$clase='ALUMNO';
}
print ("<FORM ACTION=\"registro.php\" method=post>");
if (count($alumno)>0){
$nombre=$alumno['nombre'];
$hora=get_hora();
$fecha=date("Y-m-d");

print("<Table align=\"center\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" bgcolor=\"$colorC\" width=\"100%\">");
print("<TR bgcolor=$colorO><TD WIDTH=5%><b>Foto</b></TD><TD WIDTH=5%><b>Matricula</b></TD><TD W<TD WIDTH=90%><b>Alumno</b></TD></TR>");
$foto=$conf['fotos'].$matricula.".jpg";
print("<TR><TD><img src =$foto aling = center border = 0 width = 150 height = 100 >");
print("<TD>");
print("<Table align=\"center\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\" bgcolor=\"$colorC\" width=\"100%\">");
print("<TR><TD>$matricula </TD></TR>");
print("<TR><TD bgcolor=$colorO ><b>Hora</b></TD></TR>");
print("<TR><TD><INPUT TYPE=\"text\" NAME= \"hora\" VALUE=\"$hora\"></TD>");
print("</Table></TD>");
print("<TD>");
print("<Table align=\"center\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\" bgcolor=\"$colorC\" width=\"100%\">");
print("<TR><TD>$nombre </TD></TR>");
print("<TR><TD bgcolor=$colorO ><b>Tutor</b></TD></TR>");//AQUI DEBE DE IR EL DATO DE LA FUNCION//
print("<TR><TD>$tutor </TD></TR>");
print("<TR><TD bgcolor=$colorO ><b>Datos de Registro</b></TD></TR>");

print("</Table></TD>");
print("</TR>");
print("</SELECT><INPUT TYPE=\"hidden\" NAME= \"nombre\" VALUE=\"$nombre\"><INPUT TYPE=\"hidden\" NAME= \"matricula\" VALUE=\"$matricula\"><INPUT TYPE=\"hidden\" NAME= \"clase\" VALUE=\"$clase\"><INPUT TYPE=\"hidden\" NAME= \"fecha\" VALUE=\"$fecha\"><INPUT TYPE=\"hidden\" NAME= \"id_admon\"<INPUT TYPE=\"Submit\" VALUE=\"REGISTRAR\" NAME=\"Search\"></TD></TR>");
print("</TABLE>");
print("</FORM>");
}
else
{
print("<H2 align='center'>MATRICULA INCORRECTA!!</H2>");
}
pg_close($db_iems);
pg_close($db_LabComp);
print("</TABLE>");

?>
</body>
</html>


La funcion esta en otro php donde estan todas declaradas fUnciones.php y la qUE quiero insertar es la siguiente:

function get_tutor($matricula,$conexion){
$SQLdatos="SELECT b.nombres, b.apellidos, matricula FROM alumnos a left join profesores b on a.id_profesor=b.id_profesor WHERE a.matricula='$matricula'";
$result_datos=query($conexion,$SQLdatos);
if (pg_numrows($result_datos)>0){
$record_datos=pg_fetch_row($result_datos,0);
$datos['nombre']=$record_datos[1] . " " . $record_datos[0];
$datos['id']=$record_datos[2];
return $datos;
}
}


muchas gracias!!!!
 
Volver
Arriba