/** * Obtiene arreglo que indica el nivel general del usuario, su ranking a nivel de facultad, su ranking a nivel general (UAI) * y el id de la facultad a la que pertenece e.g.array('nivel' => 'textonivel (valornivel)', 'facultad' => 'rankfacultad', 'uai' => 'rankuai', 'idfacultad' => 'idfacultad1'). * @return array. */ function get_summary() { global $DB, $USER, $SESSION; if (isset($SESSION->summary)) { return $SESSION->summary; exit; } //Consulta anterior, eliminada por el bajo alcance, dado que solo sirve para los profesores, pero no //para los alumnos y/o ayudantes. if (get_rol() == 'Profesor' || get_rol() == 'Decano' || get_rol() == 'Rector') { $nivel = $DB->get_field_sql("SELECT nivel FROM (SELECT round(AVG(puntaje),3) as nivel, id_profesor\t\t\n\t FROM {local_toolbox_score}\t\t\t\n\t GROUP BY id_profesor) as Profesor\n\t\t\t\t\t\t\t\t WHERE id_profesor =" . $USER->id); if (empty($nivel)) { return null; } $idfacultad = $DB->get_field_sql("SELECT MIN(id_facultad) as facultad\n\t\t\t\t\t\t\t\t\tFROM {local_toolbox_score}\n\t\t\t\t\t\t\t\t\tGROUP BY id_profesor HAVING id_profesor =" . $USER->id); $test = $DB->execute("SET @rownum := 0"); $rankuai = "0"; $rankuai = $DB->get_field_sql("SELECT cuenta\n\t\t\t\t\t\t\t\t\t FROM (Select count(*) + 1 as cuenta\n\t\t\t\t\t\t\t\t\t FROM (SELECT id_profesor, round(AVG(puntaje),3) as score\n\t\t\t\t\t\t\t\t\t FROM {local_toolbox_score}\n\t\t\t\t\t\t\t\t\t GROUP BY id_profesor\n\t\t\t\t\t\t\t\t\t HAVING score > {$nivel}) as a) as b"); $test = $DB->execute("SET @rownum := 0"); $rankfacultad = "0"; if ($test) { $nivelfacultad = $DB->get_field_sql("SELECT nivel FROM (SELECT round(AVG(puntaje),3) as nivel, id_profesor\t\t\n\t\t\t FROM {local_toolbox_score} WHERE id_facultad = " . $idfacultad . " \t\t\t\n\t\t\t GROUP BY id_profesor) as Profesor\n\t\t\t\t\t\t\t\t\t\t WHERE id_profesor =" . $USER->id); $rankfacultad = $DB->get_field_sql("SELECT cuenta\n\t\t\t\t\t\t\t\t\t FROM (Select count(*) + 1 as cuenta\n\t\t\t\t\t\t\t\t\t FROM (SELECT id_profesor, round(AVG(puntaje),3) as score\n\t\t\t\t\t\t\t\t\t FROM {local_toolbox_score} WHERE id_facultad = " . $idfacultad . " \n\t\t\t\t\t\t\t\t\t GROUP BY id_profesor\n\t\t\t\t\t\t\t\t\t HAVING score > {$nivelfacultad}) as a) as b"); } $summary = array('nivel' => $nivel, 'facultad' => $rankfacultad, 'uai' => $rankuai, 'idfacultad' => $idfacultad); $SESSION->summary = $summary; if ($summary['nivel'] == 'NULL') { return NULL; } $valor = $summary['nivel']; } else { $nivel = get_nivel(); $summary = array('nivel' => $nivel); } return $summary; }
<input type="password" name="pwd_check"> <br> <label for="email">E-mail:</label> <input type="text" name="email"> <br> <label for="status_u">Estado del usuario:</label> <select name="status_u"> <option value="enabled">Habilitar</option> <option value="disabled">Deshabilitar</option> </select> <br> <label for="rol">Rol</label> <br> <?php $rol = get_rol(); echo "<select name='rol'>"; for ($x = 0; $x < count($rol); $x++) { echo "<option value=" . $rol[$x]->id . ">" . $rol[$x]->name . "</option>"; } echo "</select>"; ?> <br> <input type="submit"> </form> </body> </html> <?php } else { echo get_message("no_session");
<input type="tel" name="phone_number" value="<?php echo $user_info->phone_number; ?> "> <br> <label for="status_u">Estado del usuario:</label> <select name="status_u"> <option value="enabled">Habilitar</option> <option value="disabled">Deshabilitar</option> </select> <br> <label for="rol">Rol</label> <br> <?php $user_rol = get_rol(); echo "<select>"; for ($x = 0; $x < count($user_rol); $x++) { echo "<tr>"; echo "<option value=" . $user_rol[$x]->id . ">" . $user_rol[$x]->name . "</option>"; } echo "</select>"; ?> <br> <input type="submit"> </form> </body> </html> <?php } else {
* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ require_once __DIR__ . "/../../session.php"; require_once __DIR__ . "/../../moneyio.php"; open_session(); if (isset($_SESSION["mio-username"]) && !empty($_SESSION["mio-username"]) && isset($_SESSION["mio-username_id"]) && !empty($_SESSION["mio-username_id"]) && isset($_SESSION["mio-pic"]) && !empty($_SESSION["mio-pic"])) { $rol_name = $_POST["name"]; $rol_descr = $_POST["descr"]; if (isset($rol_name) && !empty($rol_name) && isset($rol_descr) && !empty($rol_descr)) { require_once __DIR__ . "/rol_func.php"; if (get_rol($rol_name)) { echo get_message("rol_exists"); } else { create_rol($rol_name, $rol_descr); echo get_message("rol_created"); } } } else { echo get_message("no_session"); }
function get_all($sql_db, $sql_df) { $mysqli = new mysqli(DBSERVER, DBUSER, DBPWD, DB); $query = "SELECT DISTINCT * " . "FROM `paiements` " . "WHERE `paiements`.`date_paiement` " . "BETWEEN '{$sql_db}' AND '{$sql_df}'"; $output = ''; $result = $mysqli->query($query); while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $result_array[] = $row; } $mysqli->close(); $total = 0; foreach ($result_array as $value) { switch ($value["type"]) { case "CANTINE": $numrol = get_rol($value["idfacture"], 'factures_cantine'); $redevable = get_enfants($value["idfacture"]); break; case "AMARRAGE": $numrol = get_rol($value["idfacture"], 'factures_amarrage'); $redevable = get_client($value["idfacture"], 'factures_amarrage'); break; case "PLACE ET ETAL": $numrol = get_rol($value["idfacture"], 'factures_etal'); $redevable = get_mandataire($value["idfacture"], 'factures_etal'); break; } $year = substr($value["date_paiement"], 0, 4); if ($value["mode"] == 'anl') { $value["montantcfp"] = 0; } $output .= '<Row ss:Height="12.8952">'; $output .= '<Cell><Data ss:Type="String">' . $value["idpaiement"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . reversedate($value["date_paiement"]) . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . htmlentities($redevable, ENT_QUOTES, "UTF-8") . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">-</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $year . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $value["type"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $value["payeur"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $value["montantcfp"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $value["mode"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $value["numero_cheque"] . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . htmlentities($value["obs"], ENT_QUOTES, "UTF-8") . '</Data></Cell>'; $output .= '<Cell><Data ss:Type="String">' . $numrol . '</Data></Cell>'; $output .= '</Row>'; $total += $value["montantcfp"]; } //print_r($result_array); return array($output, $total); }
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ require_once __DIR__ . "/../../../../session.php"; require_once __DIR__ . "/../../../../moneyio.php"; require_once __DIR__ . "/../../../../mio-rol/update/rol_func.php"; open_session(); if (isset($_SESSION) && !empty($_SESSION)) { $rol_update_id = $_GET["rol_id"]; $rol_info = get_rol($rol_update_id); ?> <!DOCTYPE html> <html> <head> <meta charset="utf8"> <meta keywords="user"> <meta author="netSys"> <meta description="This example test"> <title>Update rol </title> </head> <body> <form action="../../../../mio-rol/update/rol.php?rol_id=<?php echo $rol_info->rol_id;