コード例 #1
0
ファイル: table.php プロジェクト: sergiokessler/perio
}
$form_search = sak_search_form($params_fs);
if ($params['conditions'] > 0) {
    echo $form_search;
}
echo "<a href=\"{$url_insert}\">{$title_insert}</a>";
echo '<br>';
if (isset($params['msg'])) {
    echo $params['msg'];
    unset($params['msg']);
}
echo '<br>';
$buscar = (bool) isset($_REQUEST['btnSubmit']) && $_REQUEST['btnSubmit'] == 'Buscar';
//    $buscar = $buscar ||
if ($buscar) {
    $params = sak_search_form_process($params);
    echo sak_display_list($params);
}
if ($params['op'] == 'select' and isset($params['record_id'])) {
    echo "<a href=\"{$url_update}\">{$title_update}</a>";
    echo '<br>';
    echo 'Visualizando un registro de la tabla "' . $params['table'] . '"';
    echo '<br>';
    echo sak_display_record($params);
    echo '<br>';
    echo sak_record_delete_form($params);
}
if ($params['op'] == 'insert' or $params['op'] == 'update') {
    $form_record->display();
    //        include_once 'footer.php';
}
コード例 #2
0
echo '<div class="page-header">';
echo '  <h1>Votos de una Urna y Lista<small></small></h1>';
echo '<a href="?action=' . $this_table . '_insert" class="btn btn-primary" role="button">Agregar ' . $this_table_label . '</a>';
echo '</div>';
$f_params['action'] = $this_table . '_list';
$f_params['sql_where'] = '';
$f_params['sql_order'] = '';
$f_params['sql_data'] = null;
//$params['enable_export'] = true;
$field_meta['search']['lista_nombre'] = 'Nombre de Lista';
$field_meta['search']['urna_nombre'] = 'Nombre de Urna';
echo sak_search_form($f_params, $field_meta);
echo '<br>';
$buscar = (bool) isset($_REQUEST['btnSubmit']) && $_REQUEST['btnSubmit'] == 'Buscar';
if ($buscar) {
    $f_result = sak_search_form_process($params);
    $sql = $sql . $f_result['sql_where'] . $f_result['sql_order'];
    $sql_data = $f_result['sql_data'];
    $db = new PDO($db_dsn, $db_user, $db_pass);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
    $st = $db->prepare($sql);
    $st->execute($sql_data);
    unset($params);
    $params['data'] = $st->fetchAll(PDO::FETCH_ASSOC);
    if (empty($params['data'])) {
        echo 'No se encontraron datos';
    } else {
        $params['primary_key'] = $this_primary_key;
        //$params['link_view'][$this_primary_key]['label'] = 'Ver registro';
        $params['link_view'][$this_primary_key]['href'] = '?action=' . $this_table;