Пример #1
0
        require_once "../views/renderTable.php";
        require_once "../views/renderCombobox.php";
        $table_maker = new RenderTable();
        $combo_maker = new renderCombobox();
        echo '<h1>' . $Idioma['Modificar usuario'];
        makeTooltip($Idioma['tmu'], $Idioma['dmu']);
        echo '</h1>';
        echo '<br/>' . $Idioma['Seleccione usuario'] . ':';
        $combo_maker->comboboxBlankUsuario();
        //ComboBox de Selección
        $datos = $man->getDatosUsuario($_GET["id"]);
        echo '<br/>' . $Idioma['Nombre usuario'] . ':<input class="form-control" type=text value="' . $datos["user_name"] . '"name="nombre" readonly><br>';
        echo $Idioma['Descripcion'] . '<br/><textarea  rows="5" cols="30" name="desc">' . $datos["user_desc"] . '' . '</textarea><br>';
        echo $Idioma['Email'] . ':<input class="form-control" type=text value="' . $datos["user_email"] . '"name="email"<br>';
        echo '<br/>' . $Idioma['Contraseña'] . ': <a class="btn btn-default" href=\'ModificarPass.php?id=' . $_GET["id"] . '\'">Cambiar</a>';
        $table_maker->tableRolByUser($datos["user_name"]);
        $table_maker->tablePagByUser($datos["user_name"]);
        $table_maker->tableFunByUser($datos["user_name"]);
        echo '<hr/>';
        echo '<a class="btn btn-default" onclick="location.href=\'GestionUsuarios.php\'">' . $Idioma['Atras'] . ' </a>';
        echo ' <input type="button" class="btn btn-default btn-primary" data-toggle="modal" data-target="#myModal"  value="' . $Idioma['Guardar'] . '" class="continuar"/>';
        echo '</form>';
        echo '</div>';
    }
}
?>
</div>

<?php 
include "../views/popup.php";
?>
Пример #2
0
$man2 = DBManager::getInstance();
$man3 = DBManager::getInstance();
$man2->connect();
$man3->connect();
$man1->connect();
function say_error($correct)
{
    if ($correct) {
        echo "creacion realizada correctamente<br/>";
    } else {
        echo "Ya existia un dato asi en la base de datos<br/>";
    }
}
if ($man->connect()) {
    say_error($man->insertarRol("rolDummy1", "rol de test unit"));
    say_error($man1->insertarFun("funDummy1", "funcion de test unit"));
    say_error($man2->insertarPag("pagDummy1", "pagina de test unit"));
    say_error($man3->insertarUser("userDummy1", "12345", "usuario de test unit", "dummy@dummy"));
    say_error($man3->insertarRol("rolDummy2", "rol de test unit"));
    say_error($man->insertarFun("funDummy2", "funcion de test unit"));
    say_error($man2->insertarPag("pagDummy2", "pagina de test unit"));
    say_error($man->insertarUser("userDummy2", "12345", "usuario de test unit", "dummy@dummy"));
    $result = $man->listRolesByUser("userDummy1");
    $result = $man->listRolesByFun("userDummy1");
    $result = $man->listUsersByRol("rolDummy1");
    foreach ($result as $item) {
        echo reset($item);
    }
}
$table->tableRolByUser("benis");
echo "test pased";