예제 #1
0
function allMyStudents()
{
    include 'includes/db_connect.php';
    $maestro = $_SESSION['username'];
    $password = $_SESSION['password'];
    $seleccion = "SELECT * FROM teacher T, user U \n\t\t\t\t\t\t\tWHERE T.iduser = U.id_user AND\n\t\t\t\t\t\t\t\t\tU.category = 'maestro' AND\n\t\t\t\t\t\t\t\t\tU.username = '******' AND\n\t\t\t\t\t\t\t\t\tU.password = '******' ;";
    $do = mysqli_query($db_connect, $seleccion) or die(mysqli_error());
    if ($do) {
        while ($pointer = mysqli_fetch_array($do)) {
            $idMaestro = $pointer['id_teacher'];
        }
    }
    $query = "SELECT * FROM student S, academic_info A, classes C, naatik_course N, groups_nc G, teacher T WHERE \n\t\t\t\t\t\t\t\t\tS.status = 'activo' AND\n\t\t\t\t\t\t\t\t\tS.id_student = A.id_student AND\n\t\t\t\t\t\t\t\t\tA.id_classes = C.id_class AND\n\t\t\t\t\t\t\t\t\tC.id_course = N.id_course AND\n\t\t\t\t\t\t\t\t\tC.id_group = G.id_group AND\n\t\t\t\t\t\t\t\t\tC.teacher = T.id_teacher AND\n\t\t\t\t\t\t\t\t\tT.id_teacher = '{$idMaestro}' ORDER BY S.surname1_s ASC;";
    $made = mysqli_query($db_connect, $query) or die(mysqli_error());
    $i = 1;
    if ($made) {
        while ($row = mysqli_fetch_array($made)) {
            $edad = calcular($row['birthday']);
            echo "<tr>";
            echo "<td>" . $i++ . "</td>";
            echo "<th>" . "<img src='img/fotos/student/" . $row['photo_s'] . "' class='img-circle' width=50px height=50px>" . "</th>";
            echo "<td>" . $row['surname1_s'] . "</td>";
            echo "<td>" . $row['surname2_s'] . "</td>";
            echo "<td>" . $row['name_s'] . "</td>";
            echo "<td>" . $edad . "</td>";
            echo "<td>" . $row['course'] . "</td>";
            echo "<td>" . $row['group'] . "</td>";
            echo "<td data-toggle='tooltip' data-placement='bottom' data-trigger='hover' title='Más...'><a href='#' data-toggle='modal' data-target='.bs-example-modal-alumno' class='btn btn-primary btn-fab btn-raised mdi-action-launch'></a></td>";
            echo "</tr>";
        }
    }
}
예제 #2
0
function allMyStudentsEval()
{
    include 'includes/db_connect.php';
    $maestro = $_SESSION['username'];
    $password = $_SESSION['password'];
    $seleccion = "SELECT * FROM teacher T, user U \n\t\t\tWHERE T.iduser = U.id_user AND\n\t\t\t\t\tU.category = 'maestro' AND\n\t\t\t\t\tU.username = '******' AND\n\t\t\t\t\tU.password = '******' ;";
    $do = mysqli_query($db_connect, $seleccion) or die(mysqli_error());
    if ($do) {
        while ($pointer = mysqli_fetch_array($do)) {
            $idMaestro = $pointer['id_teacher'];
        }
    }
    $query = "SELECT * \n\t\t\tFROM student S, academic_info A, classes C, naatik_course N, groups_nc G, teacher T WHERE \n\t\t\t\tS.status = 'activo' AND\n\t\t\t\tS.id_student = A.id_student AND\n\t\t\t\tA.id_classes = C.id_class AND\n\t\t\t\tC.id_course = N.id_course AND\n\t\t\t\tC.id_group = G.id_group AND\n\t\t\t\tC.teacher = T.id_teacher AND\n\t\t\t\tT.id_teacher = '{$idMaestro}' ORDER BY S.surname1_s ASC;";
    $made = mysqli_query($db_connect, $query) or die(mysqli_error());
    $i = 1;
    $link = "";
    if ($made) {
        while ($row = mysqli_fetch_array($made)) {
            if ($row['id_course'] == 1) {
                $link = "?menu_p=EvalClub";
            } else {
                $link = "?menu_p=EvalPAA";
            }
            $edad = calcular($row['birthday']);
            echo "<tr>";
            echo "<td>" . $i++ . "</td>";
            echo "<th>" . "<img src='img/fotos/student/" . $row['photo_s'] . "' class='img-circle' width=50px height=50px>" . "</th>";
            echo "<td>" . $row['surname1_s'] . " " . $row['surname2_s'] . " " . $row['name_s'] . "</td>";
            echo "<td>" . $row['course'] . " " . $row['group'] . "</td>";
            echo "<td><a href='main.php?menu_ad=evalSt&alumno=" . $row['id_student'] . "&curso=" . $row['id_course'] . "' class='label label-success'>Ver evaluaciones</a></td>";
            echo "</tr>";
        }
    }
}
예제 #3
0
function stSep($isSep)
{
    include 'includes/db_connect.php';
    $query = "SELECT * FROM student S, academic_info I WHERE S.id_student=I.id_student AND I.isSep='" . $isSep . "';";
    $result = mysqli_query($db_connect, $query);
    $id = 1;
    while ($row = mysqli_fetch_array($result)) {
        if ($id % 2 == 0) {
            $color = 'panel panel-info';
        } else {
            $color = 'panel panel-success';
        }
        if ($isSep == 'no') {
            $showAdd = "\n               <div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='app/profiles/transactions/addStudentSep.php?idStudent=" . $row['id_student'] . "' class='btn btn-info btn-fab btn-raised mdi-content-create' style='position:absolute; margin-top:10px; float:right;' data-toggle='tooltip' data-placement='bottom' title='Inscribir Alumno'></a>\n                  </div></div>\n            ";
        } else {
            $showAdd = '';
        }
        $fecha = $row['birthday'];
        $edad = calcular($fecha);
        if ($edad >= 15) {
            echo "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>\n                  <div class='panel panel-primary'>\n                  " . $showAdd . "\n                     <div class='panel-heading' role='tab' id='heading" . $row['id_student'] . "'>\n                        <div class='row-picture'>\n                           <img class='circle' src='img/fotos/student/" . $row['photo'] . "' alt='icon'>\n                        </div>\n                           <h4 class='panel-title'>\n                           <a data-toggle='collapse' data-parent='#accordion' href='#" . $row['id_student'] . "' aria-expanded='false' aria-controls='" . $row['id_student'] . "'>\n                           " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . "</a>\n                           </h4>\n                     </div>\n                     <div style='padding-left:55px;padding-top:20px;'> \n                        <div id='" . $row['id_student'] . "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" . $row['id_student'] . "'>\n                           <div class='panel-body'>\n                              <label>Edad: </label> " . $edad . "<br>\n                              <label>Fecha de Nacimiento: </label>" . $row['birthday'] . "<br>\n                              <label>Sexo: </label>" . $row['sexo'] . "<br>\n                              <label>Tel. Celular: </label>" . $row['cellphone'] . "<br>\n                           </div>\n                        </div>\n                     </div>\n                  </div>\n               </div>\n            <div class='list-group-separator'></div>";
            $id++;
        }
    }
}
예제 #4
0
function stScholar($request, $togrant)
{
    include 'includes/db_connect.php';
    if ($togrant == 'si') {
        $query = "SELECT S.id_student,S.photo,S.name_s,S.surname1_s,S.surname2_s,S.birthday,S.sexo,S.cellphone,N.id_course,N.course, A.id_info, \n                        T.id_tutor,T.name_t, T.surname1_t, B.id_student, B.togrant, \n                        B.request, P.id_sponsor, P.id_student \n                     FROM student S, academic_info A, naatik_course N, tutor T, sponsor P, scholar B \n                        WHERE B.request='" . $request . "' AND B.togrant='" . $togrant . "' AND B.id_student=S.id_student AND S.id_student=A.id_student \n                           AND N.id_course = A.id_course AND T.id_tutor = S.id_tutor AND P.id_student=S.id_student;";
    } elseif ($togrant == 'no') {
        $query = "SELECT S.id_student,S.photo,S.name_s,S.surname1_s,S.surname2_s,S.birthday,S.sexo,S.cellphone,N.id_course,N.course, A.id_info, \n                        T.id_tutor,T.name_t, T.surname1_t, B.id_student, B.togrant, \n                        B.request\n                     FROM student S, academic_info A, naatik_course N, tutor T, scholar B \n                        WHERE B.request='" . $request . "' AND B.togrant='" . $togrant . "' AND B.id_student=S.id_student AND S.id_student=A.id_student \n                           AND N.id_course = A.id_course AND T.id_tutor = S.id_tutor;";
    }
    $result = mysqli_query($db_connect, $query);
    $id = 1;
    while ($row = mysqli_fetch_array($result)) {
        if ($id % 2 == 0) {
            $color = 'panel panel-info';
        } else {
            $color = 'panel panel-success';
        }
        if ($togrant == 'no') {
            $showAdd = "\n               <div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='app/profiles/transactions/reassignScholar.php?idStudent=" . $row['id_student'] . "' class='btn btn-info btn-fab btn-raised mdi-action-star-rate' style='position:absolute; margin-top:10px; float:right;' data-toggle='tooltip' data-placement='left' title='Asignar Beca'></a>\n                  </div></div>\n            ";
        } else {
            $showAdd = "<div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='app/profiles/transactions/reassignScholar.php?idStudent=" . $row['id_student'] . "' class='btn btn-warning btn-fab btn-raised mdi-action-cached' style='position:absolute; margin-top:10px; float:right;' data-toggle='tooltip' data-placement='left' title='Reasignar Beca'></a>\n                  </div></div>";
        }
        $fecha = $row['birthday'];
        $edad = calcular($fecha);
        echo "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>\n                  <div class='" . $color . "'>\n                  " . $showAdd . "\n                     <div class='panel-heading' role='tab' id='heading" . $row['id_student'] . "'>\n                        <div class='row-picture'>\n                           <img class='circle' src='img/fotos/student/" . $row['photo'] . "' alt='icon'>\n                        </div>\n                           <h4 class='panel-title'>\n                           <a data-toggle='collapse' data-parent='#accordion' href='#" . $row['id_student'] . "' aria-expanded='false' aria-controls='" . $row['id_student'] . "'>\n                           " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . "</a>\n                           </h4>\n                     </div>\n                     <div style='padding-left:55px;padding-top:20px;'> \n                        <div id='" . $row['id_student'] . "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" . $row['id_student'] . "'>\n                           <div class='panel-body'>\n                            <label>Grupo: </label> " . $row['course'] . "<br>\n                              <label>Edad: </label> " . $edad . "<br>\n                              <label>Fecha de Nacimiento: </label>" . $row['birthday'] . "<br>\n                              <label>Sexo: </label>" . $row['sexo'] . "<br>\n                              <label>Tel. Celular: </label>" . $row['cellphone'] . "<br>\n                              <label>Fecha de inicio de beca: </label>" . $row['birthday'] . "<br>\n                              <label>Tutor: </label>" . $row['name_t'] . " " . $row['surname1_t'] . "<br>\n                           </div>\n                        </div>\n                     </div>\n                  </div>\n               </div>\n            <div class='list-group-separator'></div>";
        $id++;
    }
}
예제 #5
0
function showStudentsAll()
{
    #-- Conexión a la Base de datos.
    include 'includes/db_connect.php';
    //-- <-------------------------- ******************************* ------------------------------->
    //-- Culsulta para mostrar datos de los alumnos.
    $query = "SELECT * \n               FROM student S, classes C, naatik_course N, academic_info A, sep R, groups_nc G, tutor T, scholar B \n                  WHERE S.status = 'activo' AND\n                        S.id_student = A.id_student AND \n                        A.id_classes = C.id_class AND\n                        A.reg_sep    = R.id_sep AND\n                        C.id_course  = N.id_course AND \n                        C.id_group   = G.id_group AND  \n                        S.id_tutor   = T.id_tutor AND \n                        B.id_student = S.id_student ORDER BY S.surname1_s ASC;";
    $resultado = mysqli_query($db_connect, $query) or die(mysqli_error());
    $numero = 1;
    //-- <-------------------------- ******************************* ------------------------------->
    #-- Obtener y mostrar los resultados de las consultas.
    $x = 1;
    while ($fila = mysqli_fetch_array($resultado)) {
        if ($numero % 2 != 0) {
            $str = 'warning';
        } else {
            $str = 'active';
        }
        #-- Fin de if-else ->$numero
        if ($fila['request'] == 'si') {
            $color = 'btn btn-info';
            $msg = 'Retirar Solicitud';
            $flat = 'mdi-action-done-all';
        } else {
            $color = 'btn btn-default';
            $msg = 'Asignar Solicitud';
            $flat = 'mdi-action-done';
        }
        #-- Fin de if-else ->$fila['request']
        if ($fila['name_t'] == 'N/A' && $fila['surname1_t'] == 'N/A') {
            $tutor = 'N/A';
        } else {
            $tutor = $fila['name_t'] . " " . $fila['surname1_t'] . " " . $fila['surname2_t'];
        }
        #-- Fin de if-else 2
        $edad = calcular($fila['birthday']);
        echo "<tr class='" . $str . "'>";
        echo "<td class='hidden checkingSt'>\n            <div class='checkbox'>\n               <label>\n               <input type='checkbox' id='changeCheck" . $x++ . "' name='alumnos[]' value='" . $fila['id_student'] . "'>\n               <span class='checkbox-material check'>\n               </span>\n               </label>\n            </div>\n         </td>";
        echo "<td><p class='text-center'>" . $numero++ . "</p></td>";
        echo "<td>\n                <a href='#' data-toggle='modal' data-target='.bs-example-modal-alumno' onclick='datosStudent(" . $fila['id_student'] . "," . $fila['id_class'] . ")'>" . "<img src='img/fotos/student/" . $fila['photo_s'] . "' class='img-circle' width=50px height=50px>" . "</a>\n            </td>";
        echo "<td><p>" . $fila['surname1_s'] . " " . $fila['surname2_s'] . " " . $fila['name_s'] . "</p></td>";
        echo "<td><p class='text-center'>" . $edad . "</p></td>";
        echo "<td><a href='#' data-toggle='modal' data-target='.bs-example-modal-3' onclick='course(" . $fila['id_student'] . ");'>" . $fila['course'] . "</a></td>";
        echo "<td><p class='text-center'><a href='#' data-toggle='modal' data-target='.bs-example-modal-2' id='" . $fila['id_class'] . "-" . $fila['id_course'] . "-" . $fila['id_student'] . "' onclick='groupss(this.id)'>" . $fila['group'] . "</a></p></td>";
        echo "<td><a href='#' data-toggle='modal' data-target='.bs-example-modal-sm' id='" . $fila['id_tutor'] . "' onclick='datosTutor(this.id)'>" . $tutor . "</a></td>";
        echo "<td data-toggle='tooltip' data-placement='bottom' data-trigger='hover' title='Más...'>\n               <a href='#' data-toggle='modal' data-target='.bs-example-modal-alumno' onclick='datosStudent(" . $fila['id_student'] . "," . $fila['id_class'] . ")' class='btn btn-primary btn-fab btn-raised mdi-action-launch'></a>\n            </td>";
        echo "</tr>";
    }
    #-- Fin de While.
    echo "<input type='text' id='mycounter' class='hidden' value='" . ($x - 1) . "'/>";
    mysqli_close($db_connect);
    #-- Cerar conexión a BD.
}
예제 #6
0
function stSep()
{
    include '../../../../includes/db_connect.php';
    $maestro = $_SESSION['username'];
    $password = $_SESSION['password'];
    $seleccion = "SELECT * FROM teacher T, user U \n                     WHERE T.iduser = U.id_user AND\n                           U.category = 'maestro' AND\n                           U.username = '******' AND\n                           U.password = '******' ;";
    $do = mysqli_query($db_connect, $seleccion) or die(mysqli_error());
    if ($do) {
        while ($pointer = mysqli_fetch_array($do)) {
            $idTeacher = $pointer['id_teacher'];
        }
    }
    //-- <-------------------------- ******************************* ------------------------------->
    #-- Consulta para obtener la lista de alumnos.
    $query = "SELECT * FROM student S, academic_info A, sep R, classes C, naatik_course N, groups_nc G\n                  WHERE S.id_student = A.id_student AND\n                        A.reg_sep    = R.id_sep AND\n                        A.id_classes = C.id_class AND\n                        C.id_course  = N.id_course AND\n                        C.id_group   = G.id_group AND\n                        C.teacher    = '{$idTeacher}' AND \n                        R.issep      = 'si';";
    $result = mysqli_query($db_connect, $query) or die(mysqli_error());
    $id = 1;
    $info_sep = "";
    $showAdd = "";
    //-- <-------------------------- ******************************* ------------------------------->
    #-- Obtener y mostrar los resultados de la consulta.
    while ($row = mysqli_fetch_array($result)) {
        if ($id % 2 == 0) {
            $div = "<div class='clearfix'></div>";
        } else {
            $div = '';
        }
        $showAdd = "\n               <div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='#' onclick='showDataSep(" . $row['id_student'] . ");' data-toggle='modal' data-target='.bs-example-modal-editor' class='btn btn-fab btn-raised mdi-content-create sepIcons'></a>\n                  </div>\n               </div>";
        $info_sep = "<hr clss='hr'>\n                  <label>N&uacute;mero de Registro: </label>" . "  " . $row['regis_num'] . "<br>\n                  <label>Fecha de Registro: </label>" . "  " . $row['date_incorporate'] . "<br>\n                  <label>Calificaci&oacute;n: </label>" . "  " . $row['calification_sep'] . "<br>";
        //-- <-------------------------- ++++++++++ ------------------------------->
        $nacimiento = mes($row['birthday']);
        $edad = calcular($row['birthday']);
        #-- Calcular la edad del alumno con su fecha de nacimiento.
        #-- Filtrar unicamente a los alumnos que tengan 15 o mas años.
        if ($edad >= 15) {
            echo "<div class='col-sm-12 col-sm-12 col-md-6 col-lg-6'>";
            echo "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>\n                  <div class='panel panel-default'>\n                  " . $showAdd . "\n                     <div class='panel-heading' role='tab' id='heading" . $row['id_student'] . "'>\n                        <div class='row-picture'>\n                           <img class='circle' src='img/fotos/student/" . $row['photo_s'] . "' alt='icon'>\n                        </div>\n                           <h4 class='panel-title'>\n                           <a data-toggle='collapse' data-parent='#accordion' href='#" . $row['id_student'] . "' aria-expanded='false' aria-controls='" . $row['id_student'] . "'>\n                           " . $row['name_s'] . " " . $row['surname1_s'] . "</a>\n                           </h4>\n                     </div>\n                     <div style='padding-left:55px;padding-top:20px;'> \n                        <div id='" . $row['id_student'] . "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" . $row['id_student'] . "' aria-expanded='false'> \n                           <div class='panel-body'>\n                              <label>Nombre: </label> " . "  " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . " <br>\n                              <label>Edad: </label> " . "  " . $edad . "<br>\n                              <label>Fecha Nac.: </label>" . "  " . $nacimiento . "<br>\n                              <label>Sexo: </label>" . "  " . $row['sexo'] . "<br>\n                              <label>Tel. Celular: </label>" . "  " . $row['cellphone'] . "\n                              " . $info_sep . "\n                           </div>\n                        </div>\n                     </div>\n                  </div>\n               </div>\n            <div class='list-group-separator'></div></div>" . $div . "";
            $id++;
        }
        #-- Fin del if edad.
    }
    #-- Fin de while.
}
예제 #7
0
function stSep($isSep)
{
    include '../../../includes/db_connect.php';
    //-- <-------------------------- ******************************* ------------------------------->
    #-- Consulta para obtener la lista de alumnos.
    $query = "SELECT * FROM student S, academic_info I, sep R \n                  WHERE S.id_student=I.id_student AND\n                        I.reg_sep=R.id_sep AND \n                        R.issep='" . $isSep . "';";
    $result = mysqli_query($db_connect, $query);
    $id = 1;
    $info_sep = "";
    $showAdd = "";
    //-- <-------------------------- ******************************* ------------------------------->
    #-- Obtener y mostrar los resultados de la consulta.
    while ($row = mysqli_fetch_array($result)) {
        if ($id % 2 == 0) {
            $div = "<div class='clearfix'></div>";
        } else {
            $div = '';
        }
        if ($isSep == 'no') {
            $showAdd = "\n               <div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='#' onclick='setID(" . $row['id_student'] . ");' data-toggle='modal' data-target='.bs-example-modal-register' class='btn btn-fab btn-raised mdi-content-create sepIcons'></a>\n                  </div>\n               </div>";
            $info_sep = "no hay datos de Registro";
        } else {
            $showAdd = "\n               <div class='row'><div class='col-md-10'></div>\n                  <div class='col-md-2'>\n                     <a href='#' onclick='showDataSep(" . $row['id_student'] . ");' data-toggle='modal' data-target='.bs-example-modal-editor' class='btn btn-fab btn-raised mdi-content-create sepIcons'></a>\n                  </div>\n               </div>";
            $info_sep = "<hr clss='hr'>\n                           <label>N&uacute;mero de Registro: </label>" . "  " . $row['regis_num'] . "<br>\n                           <label>Fecha de Registro: </label>" . "  " . $row['date_incorporate'] . "<br>\n                           <label>Calificaci&oacute;n: </label>" . "  " . $row['calification_sep'] . "<br>\n                        ";
        }
        //-- <-------------------------- ++++++++++ ------------------------------->
        $nacimiento = mes($row['birthday']);
        $edad = calcular($row['birthday']);
        #-- Calcular la edad del alumno con su fecha de nacimiento.
        #-- Filtrar unicamente a los alumnos que tengan 15 o mas años.
        if ($edad >= 15) {
            echo "<div class='col-sm-12 col-sm-12 col-md-6 col-lg-6'>";
            echo "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>\n                  <div class='panel panel-default'>\n                  " . $showAdd . "\n                     <div class='panel-heading' role='tab' id='heading" . $row['id_student'] . "'>\n                        <div class='row-picture'>\n                           <img class='circle' src='img/fotos/student/" . $row['photo_s'] . "' alt='icon'>\n                        </div>\n                           <h4 class='panel-title'>\n                           <a data-toggle='collapse' data-parent='#accordion' href='#" . $row['id_student'] . "' aria-expanded='false' aria-controls='" . $row['id_student'] . "'>\n                           " . $row['name_s'] . " " . $row['surname1_s'] . "</a>\n                           </h4>\n                     </div>\n                     <div style='padding-left:55px;padding-top:20px;'> \n                        <div id='" . $row['id_student'] . "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" . $row['id_student'] . "' aria-expanded='false'> \n                           <div class='panel-body'>\n                              <label>Nombre: </label> " . "  " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . " <br>\n                              <label>Edad: </label> " . "  " . $edad . "<br>\n                              <label>Fecha Nac.: </label>" . "  " . $nacimiento . "<br>\n                              <label>Sexo: </label>" . "  " . $row['sexo'] . "<br>\n                              <label>Tel. Celular: </label>" . "  " . $row['cellphone'] . "\n                              " . $info_sep . "\n                           </div>\n                        </div>\n                     </div>\n                  </div>\n               </div>\n            <div class='list-group-separator'></div></div>" . $div . "";
            $id++;
        }
        #-- Fin del if edad.
    }
    #-- Fin de while.
    echo "<div class='row'>\n            <div class='col-xs-0 col-sm-2 col-md-3'></div>\n            <div class='col-xs-12 col-sm-8 col-md-6'>\n                <a id='' href='?menu_ad=registrosep' class='btn btn-sm btn-primary btn-raised'>REGISTRO</a>\n            </div>\n            <div class='col-xs-0 col-sm-2 col-md-3'></div>\n      </div>";
}
예제 #8
0
function stScholar($request, $togrant)
{
    $fecha_beca = "";
    include 'includes/db_connect.php';
    $result = mysqli_query($db_connect, query($request, $togrant)) or die(mysqli_error());
    $i = 1;
    //-- <-------------------------- **************************** ------------------------------->
    #-- Obtener y mostrar resultados de la consulta.
    echo "<div class='panel-group' id='accordion' role='tablist' aria-multiselectable='true'>";
    while ($row = mysqli_fetch_array($result)) {
        #-- Botón flotante para reasignar becas en la pestaña becados. Boton flotante para asignacion de beca a solicitantes
        if ($togrant == 'no') {
            $sponsorInfo = "";
            $btnA = "<a href='app/profiles/transactions/reassignScholar.php?idStudent=" . $row['id_student'] . "'\n                     class='btn btn-default btn-fab btn-raised mdi-action-star-rate' id='becadosIcons' \n                     data-toggle='tooltip' data-placement='left' title='Asignar Beca'></a>";
            $fecha_beca = "No Aplica";
        } else {
            $btnA = "<a href='#' data-toggle='modal' data-target='.bs-example-modal-rs' \n                     class='btn btn-default btn-fab btn-raised' id='becadosIcons' onclick='changeScholar(" . $row['id_student'] . ");'>\n                     <i class='mdi-action-cached' data-toggle='tooltip' data-placement='top' title='Reasignar Beca'></i></a>";
            $fecha_beca = mes($row['date_scholar']);
            $consulta = "SELECT * FROM sponsor S WHERE S.id_scholar = '" . $row['id_grant'] . "';";
            $do = mysqli_query($db_connect, $consulta);
            $count = $do->num_rows;
            while ($i = mysqli_fetch_array($do)) {
                if ($count == 1) {
                    $sponsorInfo = "<label>Padrino(s):</label>" . " " . $i['name_sp'] . " " . $i['surname_sp'] . "<br>";
                } elseif ($count > 1) {
                    $sponsorInfo = "<label>Padrino(s):</label>" . " " . $i['name_sp'] . " " . $i['surname_sp'] . " " . "\n                     <a href='#' id='" . $row['id_scholar'] . "' title='sp' data-toggle='modal' \n                     data-target='.bs-example-modal-sp' onclick='moreSponsor(this.id)' \n                     class='label label-info'>+" . ($count - 1) . " ver todos</a><br>";
                }
            }
        }
        $edad = calcular($row['birthday']);
        $fecha_nac = mes($row['birthday']);
        echo "<div class='col-sm-12 col-sm-12 col-md-6 col-lg-6'>";
        echo "<br>\n               <div class='panel'>\n                  " . $btnA . "\n                     <div class='panel-heading' role='tab' id='heading" . $row['id_student'] . "'>\n                        <div class='row-picture'>\n                           <img class='circle' src='img/fotos/student/" . $row['photo_s'] . "' alt='icon'>\n                        </div>\n                        <h4 class='panel-title'>\n                           <a data-toggle='collapse' data-parent='#accordion' href='#" . $row['id_student'] . "' \n                           aria-expanded='false' aria-controls='" . $row['id_student'] . "'>\n                              " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . "\n                           </a>\n                        </h4>\n                     </div>\n                     <div style='padding-left:45px;padding-top:20px;'> \n                        <div id='" . $row['id_student'] . "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" . $row['id_student'] . "'>\n                           <div class='panel-body'>\n\t\t\t\t\t\t\t\t\t   <label>Alumno:</label>" . " " . $row['name_s'] . " " . $row['surname1_s'] . " " . $row['surname2_s'] . "<br>\n                              <label>Grupo: </label> " . " " . $row['course'] . "<br>\n                              <label>Edad: </label> " . " " . $edad . "<br>\n                              <label>Fecha de Nacimiento: </label>" . " " . $fecha_nac . "<br>\n                              <label>Sexo: </label>" . " " . $row['sexo'] . "<br>\n                              <label>Tel. Celular: </label>" . " " . $row['cellphone'] . "<br>\n                              " . $sponsorInfo . "\n                              <label>Fecha de inicio de beca: </label>" . " " . $fecha_beca . "<br>\n                              <label>Tutor: </label>" . " " . $row['name_t'] . " " . $row['surname1_t'] . "<br>\n                           </div>\n                        </div>\n                     </div>\n                  </div>\n                  <div class='list-group-separator'></div>";
        echo "</div>";
        $i++;
    }
    #-- Fin del while
    echo "</div>";
}
예제 #9
0
function showStudents($nivel)
{
    include 'includes/db_connect.php';
    //-- Culsulta para mostrar datos de los alumnos.
    $query = "SELECT * FROM student S, naatik_course N, academic_info A, tutor T, scholar G WHERE A.id_student = S.id_student AND N.course ='" . $nivel . "' AND A.id_course = N.id_course AND S.id_tutor = T.id_tutor AND G.id_student = S.id_student;";
    $resultado = mysqli_query($db_connect, $query);
    $numero = 1;
    while ($fila = mysqli_fetch_array($resultado)) {
        if ($fila['request'] == 'si') {
            $color = 'btn btn-info';
            $msg = 'Retirar Solicitud';
            $flat = 'mdi-action-done-all';
        } else {
            $color = 'btn btn-default';
            $msg = 'Asignar Solicitud';
            $flat = 'mdi-action-done';
        }
        $fecha = $fila['birthday'];
        $edad = calcular($fecha);
        echo "<tr>";
        echo "<th>" . $numero++ . "</th>";
        echo "<th>" . "<img src='img/fotos/student/" . $fila['photo'] . "' class='img-circle' width=50px height=50px>" . "</th>";
        echo "<th>" . $fila['name_s'] . "</th>";
        echo "<th>" . $fila['surname1_s'] . "</th>";
        echo "<th>" . $fila['surname2_s'] . "</th>";
        echo "<th>" . $edad . "</th>";
        #echo "<th>".$fila['fecha_nacimiento']."</th>";
        echo "<th>" . $fila['sexo'] . "</th>";
        echo "<th>" . $fila['ocupation'] . "</th>";
        echo "<th>" . $fila['course'] . "</th>";
        echo "<th>" . $fila['group_st'] . "</th>";
        echo "<th>" . $fila['name_t'] . " " . $fila['surname1_t'] . " " . $fila['surname2_t'] . "</th>";
        echo "<th>" . "<a href='main.php?menu_ad=view&idStudent=" . $fila['id_student'] . "&idCourse=" . $fila['id_course'] . "&idAcademic=" . $fila['id_info'] . "&idTutor=" . $fila['id_tutor'] . "&scholar=" . $fila['togrant'] . "' class='btn btn-primary btn-fab btn-raised mdi-action-launch' data-toggle='tooltip' data-placement='top' title='Datos de alumno'></a>" . "  ";
        echo "<a href='app/profiles/transactions/requestGrant.php?&idStudent=" . $fila['id_student'] . "&scholar=" . $fila['togrant'] . "' class='" . $color . " btn-fab btn-raised " . $flat . "' data-toggle='tooltip' data-placement='top' title='" . $msg . "'></a>" . "</th>";
        echo "</tr>";
    }
    mysqli_close($db_connect);
}
예제 #10
0
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
</head>
<?php 
include "pagina4.php";
if (isset($_POST["calcular"])) {
    $caja1 = $_POST["num1"];
    $caja2 = $_POST["num2"];
    $opr = $_POST["operacion"];
    calcular($opr);
}
?>
<body>
<h1>CALCULOS SENCILLOS MATEMATICOS</h1>
<!--<form name="form1" method="post" action="calculadora.php">-->
  <form name="form1" method="post" action="">
  <p>
    <label for="num1"></label>
    <input type="text" name="num1" id="num1">
    <label for="num2"></label>
    <input type="text" name="num2" id="num2">
    <label for="operacion"></label>
    <select name="operacion" id="operacion">
      <option>Suma</option>
      <option>Resta</option>
      <option>Multiplicacion</option>
      <option>Division</option>
      <option>Modulo</option>
예제 #11
0
      <option>Suma</option>
      <option>Resta</option>
      <option>Multiplicación</option>
      <option>División</option>
      <option>Módulo</option>
      <option>Incremento</option>
      <option>Decremento</option>

    </select>
  </p>
  <p>
    <input type="submit" name="button" id="button" value="Enviar" onClick="prueba">
  </p>
</form>
<p>&nbsp;</p>

<?php 
include "calculadora.php";
if (isset($_POST["button"])) {
    $numero1 = $_POST["num1"];
    $numero2 = $_POST["num2"];
    $operacion = $_POST["operacion"];
    calcular($operacion);
}
?>




</body>
</html>
예제 #12
0
    }
    echo '<input type="submit" name="enviar" value="enviar">';
    echo '<input type="reset" name="limpar" value="Limpar">';
    echo '</form>';
    echo '</div>';
}
function calcular()
{
    $temp = 0;
    $soma = 0;
    for ($cont = 1; $cont <= 10; $cont++) {
        $temp = $_GET['num_' . $cont];
        $soma = $temp + $soma;
    }
    return $soma;
}
echo '<div class="container" style="margin-top: 60px">';
if (isset($_GET['enviar'])) {
    echo 'A soma dos números é: ' . calcular();
} else {
    gerarInput(10);
}
?>
	
	
		</form>
			</div>
	</body>
</html>

예제 #13
0
function calcular()
{
    $temp = 0;
    global $maior;
    global $menor;
    for ($cont = 1; $cont <= 100; $cont++) {
        $temp = $_GET['num_' . $cont];
        if ($temp < $menor) {
            $menor = $temp;
        } elseif ($temp > $maior) {
            $maior = $temp;
        }
    }
}
echo '<div class="container" style="margin-top: 60px">';
if (isset($_GET['enviar'])) {
    calcular();
    echo '<h1>O menor numero é: ' . $menor . '</h1><br/>';
    echo '<h1>O maior número é: ' . $maior . '</h1><br/>';
} else {
    gerarInput(100);
}
?>
	
	
		</form>
			</div>
	</body>
</html>

예제 #14
0
<?php

//-- Inclusion de funciones necesarias, para la conexion y para el calculo de la edad.
include '../../../includes/db_connect.php';
include '../../php/calcularEdad.php';
//-- <-------------------------- ******************************* ------------------------------->
//-- Culsulta para mostrar datos de los alumnos dados de baja.
$query = "SELECT * FROM student S, academic_info A, classes C, naatik_course N, groups_nc G, tutor T \n\t\t\t\t\tWHERE S.id_student = A.id_student AND\n\t\t\t\t\t\tA.id_classes = C.id_class AND\n\t\t\t\t\t\tC.id_course = N.id_course AND\n\t\t\t\t\t\tC.id_group = G.id_group AND\n\t\t\t\t\t\tS.id_tutor = T.id_tutor AND\n\t\t\t\t\t\tS.status = 'baja';";
$echo = mysqli_query($db_connect, $query) or die(mysqli_error());
$numero = 1;
if ($echo) {
    while ($fila = mysqli_fetch_array($echo)) {
        $edad = calcular($fila['birthday']);
        echo "<tr>";
        echo "<th>" . $numero++ . "</th>";
        echo "<td>" . "<img src='img/fotos/student/" . $fila['photo_s'] . "' class='img-circle' width=50px height=50px>" . "</td>";
        echo "<td>" . $fila['name_s'] . "</td>";
        echo "<td>" . $fila['surname1_s'] . "</td>";
        echo "<td>" . $fila['surname2_s'] . "</td>";
        echo "<td>" . $edad . "</td>";
        echo "<td>" . $fila['course'] . "</td>";
        echo "<td>" . $fila['group'] . "</td>";
        echo "<td>" . $fila['name_t'] . " " . $fila['surname1_t'] . " " . $fila['surname2_t'] . "</td>";
        echo "<td><a href='#' data-toggle='modal' data-target='.bs-example-modal-alumno' onclick='datosStudent(" . $fila['id_student'] . "," . $fila['id_class'] . ")' class='btn btn-primary btn-fab btn-raised mdi-action-launch'></a></td>";
        echo "</tr>";
    }
}
mysqli_close($db_connect);
#-- Cierre de la conexión a la base de datos.
예제 #15
0
<?php

calcular(1, 2, 1, '+');
calcular(1, 2, 1, '-');
function calcular($a, $b, $c, $signo)
{
    if ($signo == '+') {
        $resultado = (-$b + sqrt($b * $b - 4 * $a * $c)) / 2 * $a;
        echo "X1=";
    }
    if ($signo == '-') {
        $resultado = (-$b - sqrt($b * $b - 4 * $a * $c)) / 2 * $a;
        echo "X2= ";
    }
    echo $resultado;
}