Example #1
0
<?php

/*
 * <c> 2004 SEL
 * login.php : modulo de administracion
 * Author: Andres Velasco Gordillo <*****@*****.**> 
 */
require_once 'db.php';
require_once 'funciones.php';
$langfile = "../lang/" . $language . ".php";
if (!file_exists($langfile)) {
    rep_error(FILE_NOT_FOUND);
    exit;
}
include $langfile;
require 'template.php';
class moduloadmin
{
    function login_form($message = "")
    {
        $tpl = new template("templates/");
        $tpl->load("login.html");
        $tpl->set_block("form");
        $tpl->set_variable("AppTitle", traducir_cadena("AppTitle"));
        $tpl->set_variable("AdminModule", traducir_cadena("AdminModule"));
        $tpl->set_variable("Institute", traducir_cadena("Institute"));
        $tpl->set_variable("WelcomeAdmin", traducir_cadena("WelcomeAdmin"));
        $tpl->set_variable("message", traducir_cadena($message));
        $tpl->set_variable("user", traducir_cadena("user"));
        $tpl->set_variable("password", traducir_cadena("password"));
        $tpl->parse_block("form");
<?php

include 'db.php';
require 'funciones.php';
$langfile = '../lang/' . $language . '.php';
if (!file_exists($langfile)) {
    rep_error(LangFile);
    exit;
}
include $langfile;
if (isset($_REQUEST['idmateria'])) {
    $idmateria = $_REQUEST['idmateria'];
} else {
    $idmateria = 1;
}
echo "\n\t<html>\n\t<head>\n\t<title>" . AppTitle . " - " . AdminModule . "</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n\t<link rel=\"stylesheet\" href=\"../css/estilo.css\">\n\t</head>\n\t<body>\t\n\t<h3>Preguntas disponibles</h3>\n\t<div style=\"text-align:right; padding-right:60px;\"><input type=\"button\"\tonclick=\"top.frames.location='questionform.php?idmateria={$idmateria}'\" value=\"Agregar pregunta\"/> </div>";
$query = "SELECT * FROM tbancopreguntas WHERE idmateria='" . $idmateria . "' ORDER BY idpregunta ASC";
$req = mysql_query($query);
while ($row = mysql_fetch_object($req)) {
    $questionid = $row->idpregunta;
    $subjectid = $row->idmateria;
    $question = $row->pregunta;
    $choice1 = $row->opcion1;
    $choice2 = $row->opcion2;
    $choice3 = $row->opcion3;
    $choice4 = $row->opcion4;
    $answer = $row->respuesta;
    $unit = $row->unidad;
    echo "<table width=\"90%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n";
    echo "<tr><td class=\"bgwhite10\" align =\"center\" width=\"10%\"><b> " . $questionid . " </b></td>\n\t\t\t  <td class=\"bgwhite10\" colspan=4><span style=\"color:#2053A7;\">" . $question . "</span></td></tr>\n\n\t\t  <tr valign=\"top\"><td class=\"bgwhite10\" width=\"5%\">resp: " . $answer . "</td>\n\t\t\t  <td class=\"bgwhite10\" width=\"20%\"><span style=\"color:#2053A7;\">1)</span> " . $choice1 . "</td>\n\t\t\t  <td class=\"bgwhite10\" width=\"20%\"><span style=\"color:#2053A7;\">2)</span> " . $choice2 . "</td>\n\t\t\t  <td class=\"bgwhite10\" width=\"20%\"><span style=\"color:#2053A7;\">3)</span> " . $choice3 . "</td>\n\t\t\t  <td class=\"bgwhite10\" width=\"20%\"><span style=\"color:#2053A7;\">4)</span> " . $choice4 . "</td></tr>\n\n\t\t\t<tr><td class=\"bgwhite10\" width=\"5%\">unidad:" . $unit . "</td>\n\t\t\t\t\t<td colspan=\"4\" align=\"right\"><input type=\"button\" onclick=\"top.frames.location='questionform.php?id={$questionid}&&idmateria={$subjectid}&action=edit';\" value=\"Editar\">\n\t\t\t\t\t\t<input type=\"button\" onclick=\"if(confirm('¿Desea eliminar la pregunta?')) location='question_delete.php?id={$questionid}&idmateria={$subjectid}&idunidad={$unit}';\" value=\"Eliminar\">\n\t\t\t</td></tr>";
    echo "</table>\n";
Example #3
0
     mysql_free_result($req);
     exit;
 } else {
     if (isset($_REQUEST["qid"])) {
         $qid = $_REQUEST["qid"];
     } else {
         $qid = 0;
     }
     //recuper los datos datos del alumno
     $idalumno = $alumno->idalumno;
     $nombrealumno = $alumno->nombre;
     //verificar que la evaluacion exista
     $sql = "\tSELECT texamenes.*, tmaterias.nombre as materia, tusuarios.nombre as docente FROM texamenes \n\t\t\t\t\t\tLEFT JOIN tmaterias ON texamenes.idmateria = tmaterias.idmateria\n\t\t\t\t\t\tLEFT JOIN tusuarios ON texamenes.idusuario = tusuarios.idusuario \n\t\t\t\t\t\tWHERE texamenes.claveexamen = '" . $_SESSION['idexamen'] . "'";
     $req = mysql_query($sql);
     if (!($evaluacion = mysql_fetch_object($req))) {
         rep_error("<a href=\"index.php\">" . QPNotRegistered . "</a>");
         //echo $sql;
         mysql_free_result($req);
         exit;
     } else {
         $materia = $evaluacion->materia;
         $docente = $evaluacion->docente;
         $fecha = $evaluacion->fecha;
         $idexamen = $evaluacion->idexamen;
         $totalpreg = $evaluacion->totalpreg;
         echo "  <h1>", traducir_cadena("Institute"), "</h1>\n\t\t\t\t\t<h4><b>Alumno:  </b>" . $nombrealumno . "<br>\n\t\t\t\t\t\t<b>Materia:     </b>" . $materia . "<br>\n\t\t\t\t\t\t<b>Fecha:       </b>" . $datetime . "<br>\n\t\t\t\t\t\t<b>Evaluador: </b>" . $docente . "<br> <br> </h4>";
         mysql_free_result($req);
     }
 }
 $questionnumber = "q" . $qid;
 $aid = $qid - 1;
Example #4
0
<?php

/*
 * createexam2.php : modulo de examen 
 * Author: Andres Velasco Gordillo <*****@*****.**>
 * Basado en phpexam de Senthil Nayagam
 * http://sourceforge.net/projects/phpexam/
 * <c> 2004 SEL-0.2beta
 */
include 'db.php';
require 'funciones.php';
$langfile = '../lang/' . $language . '.php';
if (!file_exists($langfile)) {
    rep_error(FileNotFound);
    exit;
}
include $langfile;
echo "\n<html>\n<head>\n<title>" . AppTitle . "</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<link rel=\"stylesheet\" href=\"../css/estilo.css\">\n</head>\n\n<frameset cols=\"50%,50%\" frameborder=\"NO\" border=\"0\" framespacing=\"0\" rows=\"*\">\n\t<frame name=\"leftFrame\" scrolling=\"YES\" noresize src=\"listquestion_by_subject.php?idmateria=" . $_REQUEST['idmateria'] . "\">\n\t<frame name=\"rightFrame\" marginwidth=\"10\" src=\"questionpapers_form.php?idmateria=" . $_REQUEST['idmateria'] . "\">\n</frameset>\n\n<noframes>\n<body >\n</body>\n</noframes>\n</html>";