} $rows[$key] = $value; } return $rows; } // create a new EditableGrid object $grid = new EditableGrid(); /* * Add columns. The first argument of addColumn is the name of the field in the databse. * The second argument is the label that will be displayed in the header */ $grid->addColumn('ALUNO_CDG', 'Cdg', 'integer', NULL, false); $grid->addColumn('ALUNO_NOME', 'Nome', 'string'); $grid->addColumn('ALUNO_PONTOS', 'Pontos', 'integer'); $grid->addColumn('ALUNO_DTNASC', 'Nascimento', 'date', NULL, true, 'nasc'); //$grid->addColumn('firstname', 'Firstname', 'string'); //$grid->addColumn('age', 'Age', 'integer'); //$grid->addColumn('height', 'Height', 'float'); /* The column id_country and id_continent will show a list of all available countries and continents. So, we select all rows from the tables */ //$grid->addColumn('ALUNO_NOME', 'ALUNO', 'string' , fetch_pairs($mysqli,'SELECT ALUNO_CDG, ALUNO_NOME FROM ALUNO'),true); //$grid->addColumn('TURMA', 'Turma', 'STRING',NULL,false); //$grid->addColumn('id_continent', 'Continent', 'string' , fetch_pairs($mysqli,'SELECT id, name FROM continent'),true); //$grid->addColumn('id_country', 'Country', 'string', fetch_pairs($mysqli,'SELECT id, name FROM country'),true ); //$grid->addColumn('email', 'Email', 'email'); $grid->addColumn('ALUNO_LOGADO', 'Freelance', 'boolean'); //$grid->addColumn('lastvisit', 'Lastvisit', 'date'); //$grid->addColumn('website', 'Website', 'string'); $grid->addColumn('action', 'Ações', 'html', NULL, false, 'id'); $Aluno = new Admin_Aluno(); $result = $Aluno->resultset_alunos($_SESSION['ESCOLA'], -1, ''); $grid->renderJSON($result);
<?php include_once '../../../config.php'; include ROOT . "model/admin/admin_aluno.php"; include ROOT . "model/admin/materia.php"; include ROOT . "model/admin/admin_usuario.php"; include ROOT . "view/admin/vheader_admin.php"; $palavra_chave = isset($_POST['pesquisa']) ? $_POST['pesquisa'] : ""; $t = isset($_GET['t']) ? $_GET['t'] : -1; $texto_pesquisado = $palavra_chave; $aluno = new Admin_Aluno(); $alunos = $aluno->lista_alunos($_SESSION['ESCOLA'], $t, $palavra_chave); $action_pesquisa = ROOT_URL . 'control/cadastros/alunos/lista_alunos.php'; require ROOT . 'view/cadastros/alunos/vlista_alunos.php';
/* * Add columns. The first argument of addColumn is the name of the field in the databse. * The second argument is the label that will be displayed in the header */ $grid->addColumn('ALUNO_CDG', 'Cdg', 'integer', NULL, false); $grid->addColumn('ALUNO_NOME', 'Nome', 'string'); $grid->addColumn('ALUNO_LOGIN', 'Login', 'string'); $grid->addColumn('ALUNO_PONTOS', 'Pontos', 'integer', null, false); $grid->addColumn('ALUNO_NIVEL', 'Nível', 'integer', null, false); $grid->addColumn('ALUNO_SEXO', 'Sexo', 'string'); $grid->addColumn('ALUNO_RGM', 'RGM', 'integer'); $grid->addColumn('ALUNO_RA', 'RA', 'string'); $grid->addColumn('ALUNO_STATUS', 'Status', 'string'); $grid->addColumn('TURMA_NOME', 'Turma', 'string', null, false); $grid->addColumn('ALUNO_DTNASC', 'Nascimento', 'date', NULL, true, 'ALUNO_NASCIMENTO'); //$grid->addColumn('firstname', 'Firstname', 'string'); //$grid->addColumn('age', 'Age', 'integer'); //$grid->addColumn('height', 'Height', 'float'); /* The column id_country and id_continent will show a list of all available countries and continents. So, we select all rows from the tables */ //$grid->addColumn('ALUNO_NOME', 'ALUNO', 'string' , fetch_pairs($mysqli,'SELECT ALUNO_CDG, ALUNO_NOME FROM ALUNO'),true); //$grid->addColumn('TURMA', 'Turma', 'STRING',NULL,false); //$grid->addColumn('id_continent', 'Continent', 'string' , fetch_pairs($mysqli,'SELECT id, name FROM continent'),true); //$grid->addColumn('id_country', 'Country', 'string', fetch_pairs($mysqli,'SELECT id, name FROM country'),true ); //$grid->addColumn('email', 'Email', 'email'); $grid->addColumn('ALUNO_LOGADO', 'Logado', 'boolean'); //$grid->addColumn('lastvisit', 'Lastvisit', 'date'); //$grid->addColumn('website', 'Website', 'string'); $grid->addColumn('action', 'Ações', 'html', NULL, false, 'id'); $Aluno = new Admin_Aluno(); $result = $Aluno->resultset_alunos($_SESSION['ESCOLA'], $turma_filtro, ''); $grid->renderJSON($result);