Exemplo n.º 1
0
        $datos = array();
        $query = $this->mysqli->query("SELECT id_frase, frase_esp, frase_tzo FROM frases WHERE tipo_frase='{$tipo_frase}' AND areas_id_area = '{$id_area}' AND frases_id_frase = '{$id_frase}' ");
        //$query = $this->mysqli->query("SELECT id_frase, frase_esp, frase_tzo FROM frases");
        echo "<option title = 'Elija una opción'>Elija una opción</option>";
        while ($row = $query->fetch_array()) {
            echo "<option value=" . $row['id_frase'] . ">";
            echo utf8_encode($row['frase_esp']);
            echo "</option>";
            //$datos[]=array("id_area"=>$row["id_area"], "area"=>utf8_encode($row["area"]));
        }
    }
}
//Para ver si jala XD
$instance = new model();
if ($_POST['tipo'] == "login") {
    $instance->login();
} else {
    if ($_POST['tipo'] == "preguntas_p") {
        $instance->preguntas_p();
    } else {
        if ($_POST['tipo'] == "listar_areas") {
            $instance->listar_areas();
        } else {
            if ($_POST['tipo'] == "listar_usuarios") {
                $instance->listar_usuarios();
            } else {
                if ($_POST['tipo'] == "listar_frases") {
                    $instance->listar_frases();
                } else {
                    if ($_POST['tipo'] == "listar_frasesM") {
                        $instance->listar_frasesM();
Exemplo n.º 2
0
<?php

include "model.php";
$model = new model();
$username = $model->security($_POST['username']);
$password = $model->security($_POST['password']);
$result = $model->login($username, $password);
if ($result == "success") {
    session_start();
    $_SESSION['username'] = $username;
    $_SESSION['password'] = $password;
}
echo $result;