本文整理汇总了PHP中params_encode函数的典型用法代码示例。如果您正苦于以下问题:PHP params_encode函数的具体用法?PHP params_encode怎么用?PHP params_encode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了params_encode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: params_encode
$st_chart->execute($sql_data);
$chart_params['data'] = $st_chart->fetchAll(PDO::FETCH_ASSOC);
$chart_params['ejex'] = 'zona';
$chart_params['ejey'] = 'cantidad';
echo '<img src="share/chart_3dpie.php?params=' . params_encode($chart_params) . '">';
echo '<h2>Chart por Valoración de notas de Plan Nacer</h2>';
$sql_chart = $sql_group_nsp_1 . $sql_where . $sql_group_nsp_2;
$st_chart = $db->prepare($sql_chart);
$st_chart->execute($sql_data);
$chart_params['data'] = $st_chart->fetchAll(PDO::FETCH_ASSOC);
$chart_params['ejex'] = 'valoracion';
$chart_params['ejey'] = 'cantidad';
echo '<img src="share/chart_3dpie.php?params=' . params_encode($chart_params) . '">';
echo '<h2>Chart por Valoración de notas de salud en general</h2>';
$sql_chart = $sql_group_no_nsp_1 . $sql_where . $sql_group_no_nsp_2;
$st_chart = $db->prepare($sql_chart);
$st_chart->execute($sql_data);
$chart_params['data'] = $st_chart->fetchAll(PDO::FETCH_ASSOC);
$chart_params['ejex'] = 'valoracion';
$chart_params['ejey'] = 'cantidad';
echo '<img src="share/chart_3dpie.php?params=' . params_encode($chart_params) . '">';
// end graficos
if ($reg_count > 0) {
$params['primary_key'] = 'nota_id';
$params['link_view']['nota_id']['label'] = 'Ver registro';
$params['link_view']['nota_id']['href'] = '?action=nota';
include_once 'share/data_display.php';
echo sak_display_array_list($params);
}
}
include_once 'footer.php';
示例2: implode
/****************************************************************
* insert the record
*/
$cols = implode(', ', array_keys($new_row));
$vals = implode(', ', array_fill(0, count($new_row), '?'));
$sql = "insert into {$params['table']} ({$cols}) values ({$vals})";
$sql_data = array_values($new_row);
echo $config['db']['dsn'];
$db = new PDO($config['db']['dsn']);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$st = $db->prepare($sql);
$st->execute($sql_data);
$msg = "El registro a sido ingresado satisfactoriamente.";
$record_id = $db->lastInsertId();
/*
* end insert the record
****************************************************************/
unset($params_cont);
$params_cont['msg'] = $msg;
$params_cont['record_id'] = $record_id;
$params_cont = params_encode($params_cont);
$continue = '?action=' . $params['continue'] . '¶ms=' . $params_cont;
} else {
// <UI>
include_once 'header.php';
echo '<div class="page-header">';
echo ' <h1>Región<small> Agregar un registro</small></h1>';
echo '</div>';
echo $form;
include_once 'footer.php';
}
示例3: array
}
$params['table'] = 'libros';
$params['primary_key'] = 'inventario';
$sql_record1 = <<<END
select
*
from
{$params['table']}
where
{$params['primary_key']} = ?
END;
$sql_data = array($record_id);
include_once 'share/data_display.php';
include_once 'header.php';
echo '<div class="page-header">';
echo ' <h1>Visualizando un registro</h1>';
echo '</div>';
unset($params_upd);
$params_upd['record_id'] = $record_id;
$params_upd = params_encode($params_upd);
if (isset($params['record_id'])) {
$db = new PDO($config['db']['dsn']);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$st = $db->prepare($sql_record1);
$st->execute($sql_data);
$params_rec['data'] = $st->fetch(PDO::FETCH_ASSOC);
$params_rec['link_view']['archivo_digital']['label'] = $params_rec['data']['archivo_digital'];
$params_rec['link_view']['archivo_digital']['href'] = 'files/' . $params_rec['data']['archivo_digital'];
echo sak_display_array_record($params_rec);
}
include_once 'footer.php';
示例4: sak_record_form_process
if ($params['op'] == 'insert') {
$params['msg'] = 'Insertando un registro en la tabla "' . $params['table'] . '"';
}
if ($params['op'] == 'update') {
$params['msg'] = 'Editando un registro en la tabla "' . $params['table'] . '"';
}
}
}
if ($params['op'] == 'delete') {
if (isset($_REQUEST['btnSubmit']) and $_REQUEST['btnSubmit'] == 'Eliminar registro') {
require_once 'share/data_manage.php';
$msg = sak_record_form_process();
$params['msg'] = $msg;
$params['op'] = 'select';
unset($params['record_id']);
$params = params_encode($params);
$continue = 'action=table¶ms=' . $params;
return;
}
}
//if ( (!isset($_REQUEST['btnSubmit']))
// or
// ($_REQUEST['btnSubmit'] != 'Guardar') )
//{
include_once 'header.php';
require_once 'share/data_display.php';
unset($params['sql_where']);
unset($params['sql_data']);
$params_fs = $params;
unset($params_fs['msg']);
if (isset($_REQUEST['btnSubmit']) and $_REQUEST['btnSubmit'] == 'Mas opciones') {
示例5: unset
<?php
/*
$Id: menu_operador.php,v 1.1 2006/04/12 15:06:31 sak Exp $
*/
// armamos menu principal
unset($data_menu_op);
$params_r = null;
$params_r = params_encode($params_r);
$data_menu_op[] = array('title' => 'Reportes', 'url' => 'index.php?action=report');
$data_menu_op[] = array('title' => 'Notas', 'url' => 'index.php?action=nota_search');
echo 'Seleccione una opcion:';
echo '<br>';
echo '<br>';
echo '<div id="menucontainer">';
echo '<ul id="navlist">';
foreach ($data_menu_op as $menu) {
echo '<li><a href="' . $menu['url'] . '">' . $menu['title'] . '</a></li>';
}
echo '</ul>';
echo '</div>';
示例6: sak_record_delete_form
function sak_record_delete_form($params)
{
$params['op'] = 'delete';
$params_f = params_encode($params);
$delete_form = '<form method="post" name="delete_record">';
$delete_form .= '<input type="hidden" name="action" value="' . $params['action'] . '">';
$delete_form .= '<input type="hidden" name="params" value="' . $params_f . '">';
$delete_form .= '<input type="submit" name="btnSubmit" value="Eliminar registro">';
$delete_form .= '</form>';
return $delete_form;
}
示例7: sak_record_form
function sak_record_form($params)
{
global $config;
$table_info2qf['varchar'] = 'text';
$table_info2qf['int4'] = 'text';
$table_info2qf['date'] = 'date';
$table_info2qf['text'] = 'textarea';
$date_options = array('language' => 'es', 'format' => 'dMY');
$date_defaults = array('d' => date('d'), 'M' => date('m'), 'Y' => date('Y'));
$campos_cortos = array('size' => 3);
$campos_medios = array('size' => 8);
$campos_largos = array('size' => 64);
$table = $params['table'];
$primary_key = $params['primary_key'];
$op = $params['op'];
if ($op == 'update') {
$record_id = $params['record_id'];
}
$db = DB::connect($config['db']);
if (PEAR::isError($db)) {
die($db->getMessage());
}
$params_f = params_encode($params);
$form =& new HTML_QuickForm('form_record', 'post');
$form->addElement('hidden', 'action', 'table');
$form->addElement('hidden', 'params', $params_f);
$table_info = $db->tableInfo($table);
foreach ($table_info as $field_info) {
$name = $field_info['name'];
$type = null;
$options = null;
if (isset($params['type'][$op][$name])) {
$type = $params['type'][$op][$name];
}
if ($type == 'disable') {
continue;
}
if ($name == $primary_key) {
continue;
}
$type = $type == '' ? $table_info2qf[$field_info['type']] : $type;
$label = get_label($field_info['name']);
$size = $field_info['len'];
if ($type == 'date') {
$options = $date_options;
}
if ($type == 'textarea') {
$options = array('rows' => 6, 'cols' => 70);
}
if ($type == 'text') {
$options = array('size' => 40);
}
if (isset($params['options'][$name])) {
$type = 'select';
$options = $params['options'][$name];
}
if (isset($params['lookup'][$name])) {
$type = 'select';
$lookup_table = $params['lookup'][$name]['table'];
$lookup_field_key = $params['lookup'][$name]['field_key'];
$lookup_field_list = $params['lookup'][$name]['field_list'];
$sql_options = "select {$lookup_field_key}, {$lookup_field_list} from {$lookup_table} order by {$lookup_field_list}";
$options = array('' => '') + $db->getAssoc($sql_options);
}
if (isset($params['defaults'][$name])) {
$defaults[$name] = $params['defaults'][$name];
}
$input_name = "new_row[{$name}]";
$form->addElement($type, $input_name, $label, $options);
if ($field_info['flags'] != '') {
$not_null = strpos($field_info['flags'], 'not_null');
if (!($not_null === false)) {
$form->addRule($input_name, 'Campo obligatorio', 'required');
}
}
if ($field_info['type'] == 'int4') {
$form->addRule($input_name, 'Campo numerico', 'numeric');
}
}
if ($op == 'update') {
$edit_sql = "select * from {$table} where {$primary_key} = ?";
$edit_sql_data = array($record_id);
$edit_row = $db->getRow($edit_sql, $edit_sql_data, DB_FETCHMODE_ASSOC);
foreach ($edit_row as $key => $value) {
$defaults['new_row[' . $key . ']'] = stripslashes($value);
}
$form->setDefaults($defaults);
}
$form->addElement('submit', 'btnSubmit', 'Guardar');
return $form;
}
示例8: params_encode
<?php
require_once 'HTML/QuickForm2.php';
require_once 'share/form_common.php';
$form_params = params_encode($params);
/*
$db = new PDO($config['db']['dsn']);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$materia_select = array('' => '-- Select --');
$sql_sel = "select materia_id, nombre from materia order by nombre";
$st = $db->query($sql_sel);
while ($row = $st->fetch(PDO::FETCH_ASSOC)) {
$materia_select[$row['nombre']] = $row['nombre'];
}
*/
$materia_select = $boolean_select;
$form_update = false;
if (isset($record_id)) {
$form_update = true;
}
$form = new HTML_QuickForm2('form', 'post');
if ($form_update and empty($_POST)) {
$st = $db->prepare('select * from ' . $params['table'] . ' where ' . $params['primary_key'] . ' = ?');
$st->execute(array($record_id));
$edit_row = $st->fetch(PDO::FETCH_ASSOC);
$defaults['new_row'] = $edit_row;
$form->addDataSource(new HTML_QuickForm2_DataSource_Array($defaults));
} else {
// defaults
$form->addDataSource(new HTML_QuickForm2_DataSource_Array(array('new_row' => array('fecha' => time()))));
示例9: params_encode
$params_t['lookup']['jurado_3']['field_key'] = 'apellido_nombre';
$params_t['lookup']['jurado_3']['field_list'] = 'apellido_nombre';
$params_t['options']['estado']['1. En proceso'] = '1. En proceso';
$params_t['options']['estado']['2. Presentada'] = '2. Presentada';
$params_t['options']['estado']['3. Aprobada'] = '3. Aprobada';
//$params_t['fecha_inicio']['defaults'] = $date_defaults;
$params_t = params_encode($params_t);
$data_menu_op[] = array('title' => 'Tesis', 'url' => 'index.php?action=table¶ms=' . $params_t);
unset($params_t);
$params_t['table'] = 'persona';
$params_t['primary_key'] = 'persona_id';
$params_t['op'] = 'select';
$params_t['sql_list'] = 'select * from persona order by apellido_nombre ';
$params_t['sql_record'] = 'select * from persona where persona_id = ?';
$params_t['conditions'] = 1;
$params_t['search']['apellido_nombre'] = 'Apellido Nombre';
$params_t['search']['documento_nro'] = 'Documento nro';
$params_t['search']['legajo'] = 'Legajo';
$params_t = params_encode($params_t);
$data_menu_op[] = array('title' => 'Personas', 'url' => 'index.php?action=table¶ms=' . $params_t);
echo '<br>';
echo 'Seleccione una opcion:';
echo '<br>';
echo '<br>';
echo '<div id="menucontainer">';
echo '<ul id="navlist">';
foreach ($data_menu_op as $menu) {
echo '<li><a href="' . $menu['url'] . '">' . $menu['title'] . '</a></li>';
}
echo '</ul>';
echo '</div>';
示例10: PDO
echo ' <div class="jumbotron">';
echo ' <h2>Biblioteca de la Facultad de Periodismo y Comunicación Social de la UNLP</h2>';
echo ' <p></p>';
echo ' <p><a href="?action=material_search" class="btn btn-lg btn-success">Buscar material del CDM</a></p>';
echo ' </div>';
// mostramos los ultimos ingresos
$sql = 'select * from libros order by inventario desc limit 5';
$db = new PDO($config['db']['dsn']);
$st = $db->query($sql);
if ($st === false) {
die(print_r($st->errorInfo()));
}
$data = $st->fetchAll(PDO::FETCH_ASSOC);
//echo '<div class="row">';
echo '<h2>Ultimos ingresos:</h2>';
foreach ($data as $rec) {
$params['record_id'] = $rec['inventario'];
// echo '<div class="span4">';
echo htmlentities($rec['autor'], null, $encoding = 'ISO-8859-1');
echo '<p>';
echo '<i>';
echo '<a href="?action=material_select&params=' . params_encode($params) . '">';
echo $rec['inventario'];
echo '</a>';
echo '</i> - ';
echo nl2br(htmlentities($rec['titulo'], null, $encoding = 'ISO-8859-1'));
echo '</p>';
// echo '</div>';
}
//echo '</div>';
include_once 'footer.php';
示例11: implode
* update the record
**/
$set = implode('=?, ', array_keys($new_row));
$set .= '=?';
$sql = "update {$params['table']} set {$set} where {$params['primary_key']} = ?";
$sql_data = array_values($new_row);
$sql_data[] = $record_id;
$st = $db->prepare($sql);
$st->execute($sql_data);
/**
***********************************************************/
$msg = "El registro a sido actualizado satisfactoriamente.";
$params_cont = null;
$params_cont['msg'] = $msg;
$params_cont['record_id'] = $record_id;
$continue = '?action=' . $params['continue'] . '¶ms=' . params_encode($params_cont);
} else {
// <UI>
include_once 'header.php';
echo '<div class="page-header">';
echo ' <h1>Nota <small>Editando un registro</small></h1>';
echo '</div>';
/*
* Un usuario solo puede modificar lo cargado por el mismo
* excepto saludymedios
*/
/*
if ( ($_SESSION['u'] != 'admin') and ($_SESSION['u'] != $edit_row['carga_usuario']) ) {
echo 'Ud. no puede editar este registro, fué cargado por otra persona. Presione el boton de Atras';
include_once 'footer.php';
exit();
示例12: params_encode
$params_cont = null;
$params_cont['msg'] = $msg;
$continue = '?action=' . $params['continue'] . '¶ms=' . params_encode($params_cont);
return;
}
// <UI>
include 'header.php';
echo '<div class="page-header">';
echo ' <img class="pull-right" src="img/logo_sumar_small.png">';
echo ' <h1>Borrando un registro</h1>';
echo '</div>';
// show the actual data and ask for confirmation
$st = $db->prepare($sql_record1);
$st->execute(array($record_id));
$data = $st->fetch(PDO::FETCH_ASSOC);
$params_rec['data'] = $data;
echo sak_display_array_record($params_rec);
unset($params_delete);
$params_delete['record_id'] = $record_id;
$params_delete = params_encode($params_delete);
echo '<br>';
echo '<br>';
echo '<form method="post">';
echo '<div class="form-actions">';
echo '<input type="hidden" name="params" value="' . $params_delete . '">';
echo '<input type="submit" name="btnSubmit" class="btn btn-danger" value="' . $btnSubmitValue . '">';
echo ' ';
echo '<a class="btn" href="javascript:history.go(-1)">Cancelar y volver</a>';
echo '</div>';
echo '</form>';
include 'footer.php';
示例13: sak_record_form
function sak_record_form($params, $field_meta, $field_mapping = null)
{
global $config;
$table_info2qf['varchar'] = 'text';
$table_info2qf['string'] = 'textarea';
$table_info2qf['int4'] = 'text';
$table_info2qf['int'] = 'text';
$table_info2qf['date'] = 'date';
$table_info2qf['timestamp'] = 'date';
$table_info2qf['text'] = 'textarea';
$table_info2qf['blob'] = 'textarea';
$type_options['date'] = array('language' => 'es', 'format' => 'dMY');
$type_options['text'] = array('size' => 64);
$type_options['textarea'] = array('rows' => 5, 'cols' => 64);
$date_defaults = array('d' => date('d'), 'M' => date('m'), 'Y' => date('Y'));
$table = $params['table'];
$primary_key = $params['primary_key'];
$op = $params['op'];
if ($op == 'update') {
$record_id = $params['record_id'];
}
$db = DB::connect($config['db']);
if (PEAR::isError($db)) {
var_dump($db);
die($db->getMessage());
}
$params_f = params_encode($params);
$form =& new HTML_QuickForm('form_record', 'post');
$form->setRequiredNote('<span style="color:#ff0000;">*</span> = campos requeridos.');
$form->addElement('hidden', 'action', 'table');
$form->addElement('hidden', 'params', $params_f);
$table_info = $db->tableInfo($table);
foreach ($table_info as $field_info) {
$name = $field_info['name'];
$element_type = null;
$element_options = null;
if (isset($field_meta['type'][$op][$name])) {
if ($field_meta['type'][$op][$name] == 'disable') {
continue;
} else {
$element_type = $field_meta['type'][$op][$name];
}
}
// if ($name == $primary_key)
// continue;
$element_type = $element_type == '' ? $table_info2qf[$field_info['type']] : $element_type;
if (isset($field_mapping[$field_info['name']])) {
$label = $field_mapping[$field_info['name']];
} else {
$label = get_label($field_info['name']);
}
$size = $field_info['len'];
$element_options = $type_options[$element_type];
if (isset($field_meta['select'][$name])) {
$element_type = 'select';
if (isset($field_meta['select'][$name]['data'])) {
$element_options = $field_meta['select'][$name]['data'];
} else {
$lookup_sql = $field_meta['select'][$name]['sql'];
$element_options = $db->getAssoc($lookup_sql);
}
}
$element_name = "new_row[{$name}]";
if (isset($field_meta['defaults'][$name])) {
$defaults[$element_name] = $field_meta['defaults'][$name];
}
$form->addElement($element_type, $element_name, $label, $element_options);
if ($field_info['flags'] != '') {
$not_null = strpos($field_info['flags'], 'not_null');
if (!($not_null === false)) {
$form->addRule($element_name, 'Campo obligatorio', 'required');
}
}
if ($field_info['type'] == 'int4') {
$form->addRule($element_name, 'Campo numerico', 'numeric');
}
}
if ($op == 'update') {
$edit_sql = "select * from {$table} where {$primary_key} = ?";
$edit_sql_data = array($record_id);
$edit_row = $db->getRow($edit_sql, $edit_sql_data, DB_FETCHMODE_ASSOC);
foreach ($edit_row as $key => $value) {
$defaults['new_row[' . $key . ']'] = stripslashes($value);
}
}
// echo '<pre>';
// var_dump($defaults);
// echo '</pre>';
if (isset($defaults)) {
$form->setDefaults($defaults);
}
return $form;
}
示例14: unset
echo '<b>Datos de la persona</b> ';
$update_title = 'Editar este registro';
$update_url = 'index.php?action=' . $params['table'] . '_update¶ms=' . $params_upd;
echo "<a href=\"{$update_url}\">{$update_title}</a> ";
$delete_title = 'Borrar este registro';
$delete_url = 'index.php?action=' . $params['table'] . '_delete¶ms=' . $params_upd;
echo "<a href=\"{$delete_url}\">{$delete_title}</a> ";
echo '<br>';
echo '<br>';
unset($params_display);
$params_display['sql_record'] = $sql_record1;
$params_display['record_id'] = $record_id;
echo sak_display_record($params_display);
}
echo '<br>';
echo '<br>';
echo '<b>Cargos de la persona</b> ';
$params_cargo_insert['record_id'] = $record_id;
$params_cargo_insert = params_encode($params_cargo_insert);
$link_url = 'index.php?action=cargo_insert¶ms=' . $params_cargo_insert;
$link_label = 'Agregar un nuevo cargo';
echo "<a href=\"{$link_url}\">{$link_label}.</a> ";
echo '<br>';
unset($params_display);
$params_display['sql_full'] = $sql_record2;
$params_display['sql_data'] = array($record_id);
$params_display['primary_key'] = 'cargo_id';
$params_display['link_view']['field_name'] = 'cargo_id';
$params_display['link_view']['action'] = 'cargo';
echo sak_display_list($params_display);
include_once 'footer.php';
示例15: params_encode
$msg = 'El registro ha sido borrado satisfactoriamente.';
$params_cont = null;
$params_cont['msg'] = $msg;
$continue = '?action=' . $params['continue'] . '¶ms=' . params_encode($params_cont);
return;
}
// <UI>
include 'header.php';
echo '<div class="page-header">';
echo ' <h1>Borrando un registro</h1>';
echo '</div>';
// show the actual data and ask for confirmation
$st = $db->prepare($sql_record1);
$st->execute(array($record_id));
$data = $st->fetch(PDO::FETCH_ASSOC);
$params_rec['data'] = $data;
echo sak_display_array_record($params_rec);
unset($params_next);
$params_next['record_id'] = $record_id;
$params_next = params_encode($params_next);
echo '<br>';
echo '<br>';
echo '<form method="post">';
echo '<div class="form-actions">';
echo '<input type="hidden" name="params" value="' . $params_next . '">';
echo '<input type="submit" name="btnSubmit" class="btn btn-danger" value="' . $btnSubmitValue . '">';
echo ' ';
echo '<a href="javascript:history.go(-1)">Cancelar y volver</a>';
echo '</div>';
echo '</form>';
include 'footer.php';