Exemplo n.º 1
0
 public function update($re_read = false)
 {
     if (!$this->before_update()) {
         return false;
     }
     $retval = _update();
     if ($retval) {
         return $this->after_update();
     } else {
         return false;
     }
 }
function render_admin_validaredicion($param)
{
    list($aid, $sid, $folios, $signatura, $siglos, $periodo, $resumen, $notas, $oldid) = vwVarFromInput("aid", "sid", "folios", "signatura", "siglos", "periodo", "resumen", "notas", 'oldid');
    // Comprobamos que el documento no existe ya
    list($db) = Getdb();
    $tbl = GetTable('documentos');
    $col = GetCols('documentos');
    $seccion = array("did" => $oldid, "aid" => $aid, "sid" => $sid, "folios" => htmlentities($folios, ENT_QUOTES), "signatura" => htmlentities($signatura, ENT_QUOTES), "siglos" => htmlentities($siglos, ENT_QUOTES), "periodo" => ParsePeriod($periodo), "resumen" => htmlentities($resumen, ENT_QUOTES), "notas" => htmlentities($notas, ENT_QUOTES));
    //$seccion=fromcmstodb($seccion,'documentos');
    $result = _update($seccion);
    if ($result) {
        $mensaje = "Los datos del archivo han sido cambiados correctamente";
    } else {
        $mensaje = "Ha habido un error en la actualizaci&oacute;n de los datos.<br>{$result}";
    }
    /* $resultado= SmartyInit();
    		$resultado->assign("mensaje",$mensaje);
    		$plantilla="mensaje.tpl";
    		$salida=$resultado->fetch($plantilla);
    		return $salida; */
    $url = vwSessionGetVar('urlantigua');
    vwSessionDelVar('urlantigua');
    return render_msg($mensaje, 3, $url);
}
Exemplo n.º 3
0
        case 'c':
        case 'clear':
            $CLEAR = true;
            break;
        case 'q':
        case 'quiet':
            $QUIET = true;
            break;
    }
}
#------------------------------------------------------------------------------
# Action
if ($CLEAR) {
    _clearindex();
}
_update();
#------------------------------------------------------------------------------
function _usage()
{
    print "Usage: indexer.php <options>\n\n    Updates the searchindex by indexing all new or changed pages\n    when the -c option is given the index is cleared first.\n\n    OPTIONS\n        -h, --help     show this help and exit\n        -c, --clear    clear the index before updating\n        -q, --quiet    don't produce any output\n";
}
function _update()
{
    global $conf;
    $data = array();
    _quietecho("Searching pages... ");
    search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true));
    _quietecho(count($data) . " pages found.\n");
    foreach ($data as $val) {
        _index($val['id']);
    }
Exemplo n.º 4
0
$id = $_GET['id'] ? $_GET['id'] + 0 : 0;
_connect();
$field = array('id', 'name', 'kemu', 'fenshu');
$result = _find('stu', $field, $id);
_close($link);
/**
 * 修改表单处理
 */
if (!empty($_POST['submit'])) {
    $id = htmlspecialchars(addslashes($_GET['id'] + 0));
    $name = htmlspecialchars(addslashes($_POST['username']));
    $kemu = htmlspecialchars(addslashes($_POST['kemu']));
    $fenshu = htmlspecialchars(addslashes($_POST['fenshu']));
    $data = array('id' => $id, 'name' => $name, 'kemu' => $kemu, 'fenshu' => $fenshu);
    _connect();
    $ok = _update('stu', $data);
    if ($ok) {
        echo '修改成功';
    } else {
        echo '修改失败';
    }
    _close($link);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>数据库修改表单</title>
</head>
<body>