Foros del Web » Programando para Internet » Javascript » Frameworks JS »

sistema para biblioteca en php

Estas en el tema de sistema para biblioteca en php en el foro de Frameworks JS en Foros del Web. Hola a todos mi problema consiste en q estoy haciendo un sistema para la biblbioteca de mi escuela con php, mysql y ajax, la idea ...
  #1 (permalink)  
Antiguo 15/07/2009, 11:45
 
Fecha de Ingreso: julio-2009
Mensajes: 11
Antigüedad: 14 años, 9 meses
Puntos: 0
sistema para biblioteca en php

Hola a todos mi problema consiste en q estoy haciendo un sistema para la biblbioteca de mi escuela con php, mysql y ajax, la idea es q cuando introduzca en una caja de texto la clave del libro al momento de darle clic en un boton q me mande un mensaje en el cual me avise si ese libro esta prestado o de lo contrario q me mande un formulario donde introduzca los datos del libro y del estudiante o maestro para q se los puedan prestar.

este es mi index.php

Código PHP:
<html>
<head>
<title>PRESTAMOS DE LIBROS</title>
<script language="JavaScript" type="text/javascript" src="ajax.js"></script>
<script language="JavaScript" type="text/javascript">

function cl(clave){
var clave = document.prueba.clave.value;
pedirDatos(clave);
}

function validar(ej){

//////////////////////////// CODIGO O CLAVE DEL ALUMNO    /////////////////////////////////
var checkOK = "0123456789";
var checkStr = ej.codigo.value;
var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
        ch = checkStr.charAt(i);
                for (j = 0; j < checkOK.length; j++)
                  if (ch == checkOK.charAt(j))
                        break;
                            if (j == checkOK.length) {
                              allValid = false;
                              break;
    }
  }
if(document.ej.codigo.value.length==0){ //verifica que el campo no este vacio -->
alert("Escriba la \"CLAVE\" del Alumno .")
document.ej.codigo.focus()
return 0;
}
if (!allValid) {// verifica que en el campo solo tecleen letras -->
    alert("Escriba sólo números en el campo \"CLAVE\".");
    document.ej.codigo.focus();
    return (false);
     }
//////////////////////////////////// FECHA DEL PRESTAMO //////////////////////////////////  
var checkOK = "0123456789/ ";
var checkStr = ej.entrada.value;
var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
        ch = checkStr.charAt(i);
                for (j = 0; j < checkOK.length; j++)
                  if (ch == checkOK.charAt(j))
                        break;
                            if (j == checkOK.length) {
                              allValid = false;
                              break;
    }
  }
if(document.ej.entrada.value.length==0){
alert("Escriba la FECHA DEL PRESTAMO")
document.ej.entrada.focus()
return 0;
}

  if (!allValid) {
    alert("Escriba sólo numeros y / en el campo \"FECHA DE PRESTAMO\".");
    document.ej.entrada.focus();
    return (false);
  }

//////////////////////////////////// FECHA DE DEVOLUCION //////////////////////////////////
var checkOK = "0123456789/ ";
var checkStr = ej.salida.value;
var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
        ch = checkStr.charAt(i);
                for (j = 0; j < checkOK.length; j++)
                  if (ch == checkOK.charAt(j))
                        break;
                            if (j == checkOK.length) {
                              allValid = false;
                              break;
    }
  }
if(document.ej.salida.value.length==0){
alert("Escriba la FECHA DE DEVOLUCION")
document.ej.salida.focus()
return 0;
}
if (!allValid) {
    alert("Escriba sólo numeros y / en el campo \"FECHA DE DEVOLUCION\".");
    document.ej.salida.focus();
    return (false);
  }

enviarDatosPrestamo(); return false  
document.ej.submit();


}

</script>
<style type="text/css">
<!--
#buscar {
    position: absolute;
    left:71px;
    top:323px;
    width:362px;
    height:46px;
    z-index:1;
}

#resultado {
    position:absolute;
    left:10px;
    top:686px;
    width:649px;
    height:3090px;
    z-index:1;
}
#ok {
    position:absolute;
    left:71px;
    top:389px;
    width:360px;
    height:50px;
    z-index:2;
    visibility:hidden;
}

-->
</style>
</head>
<body>
<center>
<p>&nbsp;</p>
<img src="imagenes/libro.gif" width="253" height="129"/>
<p>&nbsp;</p>
<h2>PRESTAMO DE LIBROS</h2>
<p>&nbsp;</p>
<div id="buscar">
<form name="prueba" action="" method="get">
<table width="383" border="1">
    <tr>
      <td width="152" class="texto">Clave del Libro</td>
      <td width="215">      
      <input type="text" name="clave" id="clave" />
      <input name="boton" type="button" onchange"ej()" value="Enviar"/></td>
  </tr>

</table>
</form>
</div>
<div id="ok">El libro esta prestado
</div>
<div id="formulario">
</div>
<div id="resultado"><?php include("consulta.php");?></div>
</center>
</body>
</html>

Este es dato.php en donde manejo el formulario donde se prestan libros

Código PHP:
<?php
include_once("cPrestamo.php");

$cPrestamo=new cPrestamo// objeto de la clase cPrestamo; herencia
$idlib=$_POST["idlib"];
$consultaClave=$cPrestamo->consultarClave($idlib);

$rowmysql_fetch_array($consultaClave);// arreglo que almacenara los datos encontrados en la consulta

// valores retornados de la consulta
$atit=$row['titulo'];
$aaut=$row['autor'];

?>
<style type="text/css">
<!--
.texto {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
}
.texto2 {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    color: #FF0000;
}
-->
</style>
<form name="ej" method="get" action="" >


<p>&nbsp;</p>

<p>&nbsp;</p>
<input name="numero" type="hidden" size="6" maxlength="6" value="<?php echo $idlib?>"  />
<table width="526" border="1">
  <tr>
    <td width="167" class="texto">Titulo del Libro</td>
    <td width="343"><input name="titulo" type="text"  disabled="disabled" class="texto2" value="<?php echo $atit?>" size="30" maxlength="30" /></td>
  </tr>
   <tr>
    <td class="texto">Autor</td>
    <td><input name="autor" type="text" disabled="disabled" class="texto2" value="<?php echo $aaut?>"  size="20" maxlength="20"  />    </td>
  </tr>
  <tr>
    <td class="texto">Clave del Alumno</td>
    <td> <input name="codigo" type="text" class="texto" size="9" maxlength="9"/>    </td>
  <tr>
    <td class="texto">Grupo</td>
    <td><input name="grupo" type="text" class="texto" size="6" maxlength="6" /></td>
  </tr>
    <tr>
    <td height="38" class="texto">Fecha del Prestamo</td>
    <td class="texto"><input name="entrada" type="text" class="texto" >
        <button type="button" onClick="window.open('cal.php?destino=ej.entrada', '_blank', 'width=300,height=300')" > Fecha Prestamo </button></td>
  </tr>
  <tr>
    <td height="39" class="texto">Fecha de Devolucion</td>
    <td class="texto"><input name="salida" type="text" class="texto" >
        <button type="button" onClick="window.open('cal.php?destino=ej.salida', '_blank', 'width=300,height=300')" > Fecha Devolución </button></td>
   </tr>
</table>
<p>
  <label>
  <input name="Submit" type="button" class="texto" onclick="validar(ej)" value="Insertar" />
  </label>
</p>
</form>

Pero de aqui ya no c q hacer si alguien me ayudara seria fabuloso, si necesitan otro codigo se los enviare
  #2 (permalink)  
Antiguo 15/07/2009, 14:32
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: sistema para biblioteca en php

Tema trasladado desde PHP
  #3 (permalink)  
Antiguo 07/02/2013, 13:42
 
Fecha de Ingreso: febrero-2013
Mensajes: 4
Antigüedad: 11 años, 2 meses
Puntos: 0
Respuesta: sistema para biblioteca en php

Alguien tiene el codigo de una biblioteca en PHP??? Algo simple no muy complicado en el qual se puedan hacer prestamos y reservas minimamente ... =)

Se agradeceriaaa!!
  #4 (permalink)  
Antiguo 07/02/2013, 21:37
Avatar de sonickseven  
Fecha de Ingreso: diciembre-2012
Ubicación: bogota
Mensajes: 404
Antigüedad: 11 años, 4 meses
Puntos: 2
Respuesta: sistema para biblioteca en php

amigo con un $.ajax({}); lo puedes hacer por ahi hay muchos tutos la verdad tambien tienes que tener una bd donde se inserte el dato de si se presto o no? para poder consultar con ajax y php amigo la verdad tienes que dar mas detalles.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:44.