$db->Execute($sql); } echo '<meta http-equiv="refresh" content="3;url=refrescar.php"'; } } header("Cache-control: no-store,no-cache,must-revalidate"); } $imprimir = null; $formulario = new cForm(); $formulario->_method='post'; $formulario->_name='seguimiento'; $imprimir .= "<table align=center border=0> <caption><H2>SEGUIMIENTO</H2></caption>"; if (!$_REQUEST['t_orden_1']){ $formulario->add_text('orden', 1, 0); $formulario->input('t_orden_1', $_POST['t_orden_1'], '15', '15', '', 0, 1); } else { $oden = $_REQUEST['t_orden_1'];
function ingreso() { global $db; $imprimir = null; $formulario = new cForm(); $formulario->_method='post'; $imprimir .= "<table align=center border=0> <caption><H2>INGRESO</H1></caption>"; $formulario->add_text('<h3>Nombre Usuari</h3>o', 1, 0); $formulario->input('t_nombre_usuario_1', $nombre_usuario, '20', '30', '', 0, 1); $formulario->add_text('<h3>Contraseña</h3>', 1, 0); $formulario->password('t_password_1', $password, '20', 0, 1); $imprimir .= $formulario->drawwithout('enviar', 'Enviar', '', 'center', '', 1, 1, '', 1, 2); $imprimir .= "</table>"; return $imprimir; }
<? require_once('include/header.inc.php'); if ($_SESSION['valid_user'] != 't') echo '<meta http-equiv="refresh" content="0;url=ingreso.php?invalid=invalid"'; ?> <script language="javascript" src="script/cal2.js"></script> <script language="javascript" src="script/cal_conf2.js"></script> <? $imprimir = null; $imprimir .= "<table align=center border=0> <caption><H2>Reporte</H2></caption>"; $formulario = new cForm(); $formulario->_name = 'freporte'; $formulario->add_text('fecha_inicio', 0, 0); $formulario->inputcal('t_fecha_inicio_4', '', '12', '10', '', 0, 0, 1, 1, "javascript:showCal('Calendar1')", 'imagenes/cal.gif'); $formulario->add_text('fecha_fin', 0, 0); $formulario->inputcal('t_fecha_fin_4', '', '12', '10', '', 0, 0, 1, 1, "javascript:showCal('Calendar2')", 'imagenes/cal.gif'); $imprimir .= $formulario->drawwithout('enviar', 'Enviar', '', 'center', '', 1, 1, '', 1, 2); $imprimir .= "</table>"; echo $imprimir; if ($_POST['enviar']) { $fv = new FormValidator($_POST); $fv->doValidation();
<? require_once('include/header.inc.php'); //include_once('include/sql2excel.class.php'); if ($_SESSION['valid_user'] != 't') echo '<meta http-equiv="refresh" content="0;url=ingreso.php?invalid=invalid"'; $imprimir .= "<table align=center border=0> <caption><H2>Reporte</H2></caption>"; $formulario = new cForm(); $formulario->_name = 'freporte'; $dias = date('t'); $formulario->add_text('<h3>Fecha Inicio</h3>', 0, 0); $formulario->inputcal('t_fecha_inicio_0', date('Y/m/d H:i', time() - $dias * 24 * 60 * 60), '20', '20', '', 0, 0, 1, 1, "onclick=\"displayCalendar(document.forms[0].t_fecha_inicio_0,'yyyy/mm/dd hh:ii',this,true)\"", 'imagenes/cal.gif'); $formulario->add_text('<h3>Fecha Fin</h3>', 0, 0); $formulario->inputcal('t_fecha_fin_0', date('Y/m/d H:i', time()), '20', '20', '', 0, 0, 1, 1, "onclick=\"displayCalendar(document.forms[0].t_fecha_fin_0,'yyyy/mm/dd hh:ii',this,true)\"", 'imagenes/cal.gif'); $imprimir .= $formulario->drawwithout('enviar', 'Enviar', '', 'center', '', 1, 1, '', 1, 2); $imprimir .= "</table>"; echo $imprimir; function separeDate($date){ $fecha = explode('/', $date); $day = explode(' ', $fecha[2]);
/** * validates a value and returns error string, or false if field is valid. * * @param string $value * @param string $datatype * @param int $min * @param int $max */ static function validateValue($value, $datatype, $min, $max) { $invert_match = true; $invalidated = false; switch ($datatype) { case "num": $pattern = "/[^\\d]/"; break; case "float": $pattern = "/[^\\d\\.]/"; break; case "date": // two types: ymd, dmy $pattern = "/([\\d]{4}-[\\d]{1,2}-[\\d]{1,2}|[\\d]{1,2}-[\\d]{1,2}-[\\d]{4})/"; $invert_match = false; /* dates only HAVE certain ranges */ $max = 10; if ($min > 0) { $min = 8; } else { if (empty($value)) { return true; } } $a = explode("-", $value); if (count($a) != 3) { $invalidated = true; break; } list($d1, $d2, $d3) = $a; if (empty($d1) || empty($d2) || empty($d3)) { $invalidated = true; break; } if (strlen($d1) == 4) { $y = $d1; $m = $d2; $d = $d3; } else { if (strlen($d3) == 4) { if ($d2 < 12) { $d = $d1; $m = $d2; $y = $d3; } else { $m = $d1; $d = $d2; $y = $d3; } } else { $invalidated = true; break; } } if (!checkdate($m, $d, $y)) { $invalidated = "Impossible date"; break; } break; case "string": $pattern = "/[^\\w\\s\\.\\/\\&\\+\\(\\)\\:,-@\\.]/"; break; case "allstring": $pattern = "/[^\\w\\s\\.\\/\\&\\+\\(\\)\\:\\!,-@\\.]/"; break; case "email": $pattern = '/^([.0-9a-z_-]+)@(([0-9a-z-]+\\.)+[0-9a-z]{2,4})$/i'; $invert_match = false; break; case "url": $pattern = "/[^\\w\\.\\(\\)-]/"; break; case "phone": $pattern = "/[^\\d\\(\\)\\s\\+-]/"; break; default: $pattern = "/[^\\w\\s\\.,-]/"; } /* validate field */ if (strlen($value) < $min) { if ($min == 1) { $invalidated = "Required field."; } else { $invalidated = "Needs to be at least {$min} characters, is " . strlen($value) . "."; } } else { if (strlen($value) > $max) { $invalidated = "May not exceed {$max} characters, is " . strlen($value) . "."; } else { if (preg_match($pattern, $value)) { if ($invert_match) { $invalidated = cForm::valexpl($datatype); } } else { if (!$invert_match && strlen($value) > 0) { $invalidated = cForm::valexpl($datatype); } } } } if ($invalidated === true) { $invalidated = "Invalid value."; } return $invalidated; }
<?php require_once 'include/header.inc.php'; if ($_SESSION['valid_user'] != 't') { echo '<meta http-equiv="refresh" content="0;url=ingreso.php?invalid=invalid"'; } ?> <?php $form = new cForm(); $form->add_feedback("texto del campo", "", 1, 0); $form->input('campo', '', '10', '10', '', 0, 1); $form->checkbox('chequear', '5', '', 1, 0, ''); $form->add_text('presione aca', 0, 1); $form->draw('enviar', 'enviar', '', 'center', '', 1, 1); //$rs = $db->Execute('select * from usuario.estudiante'); $sql = 'select * from cliente'; $pager = new ADODB_Pager($db, $sql); $pager->Render($rows_per_page = 30); //$Dbg->add('DEBUG INFO'); //$Dbg->display(); require_once 'include/footer.inc.php'; ?> </body> </html>
$db->Execute($sql); } //echo '<meta http-equiv="refresh" content="3;url=refrescar.php"'; } } header("Cache-control: no-store,no-cache,must-revalidate"); } $imprimir = null; $formulario = new cForm(); $formulario->_method='post'; $formulario->_name='seguimiento'; $imprimir .= "<table align=center border=0> <caption><H2>SEGUIMIENTO</H2></caption>"; if (!$_REQUEST['t_orden_1']){ $formulario->add_text('<h3>Lote</h3>', 1, 0); $formulario->input('t_orden_1', $_REQUEST['t_orden_1'], '15', '15', '', 0, 1, 1, 1, '', false, 't_orden_1', 'onkeyup="pasarMayusculas(this)"'); } elseif (!$_REQUEST['t_proceso_1']) {
function import($frm) { /* @var $frm cForm */ if ($frm->validate("import")) { return view($frm); } /* get field indexes */ $stkcod = false; $price = false; foreach ($_REQUEST["fld"] as $fi => $ft) { if ($ft != "ignore") { ${$ft} = $fi; } } /* import file if all field types specified */ if ($stkcod === false || $price === false) { $frm->setmsg("<li class='err'>Not all field types satisfied</li>"); } else { $qry = new dbSelect("spricelist", "exten", grp(m("cols", "listid"), m("where", "suppid='{$_REQUEST['supid']}'"))); $qry->run(); if ($qry->num_rows() <= 0) { $suppinfo = qrySupplier($_REQUEST["supid"]); $cols = grp(m("suppid", $_REQUEST["supid"]), m("listname", $suppinfo["supname"]), m("div", USER_DIV)); $upd = new dbUpdate("spricelist", "exten", $cols); $upd->run(DB_INSERT); $listid = $upd->lastid("listid"); } else { $listid = $qry->fetch_result(); } $upd = new dbDelete("splist_prices", "exten", "listid='{$listid}'"); $upd->run(); $upd = new dbUpdate("splist_prices", "exten"); $invalid_fields = array(); $nosuch_fields = array(); $file = ucfs::file("supplist"); foreach ($file as $rd) { $ri = explode(",", $rd); $ri[$stkcod] = trim($ri[$stkcod]); $ri[$price] = trim($ri[$price]); if (cForm::validateValue($ri[$stkcod], "string", 1, 250) || cForm::validateValue($ri[$price], "float", 1, 40)) { $invalid_fields[] = $ri[$stkcod]; continue; } $stkid = suppStkid($_REQUEST["supid"], $ri[$stkcod]); if ($stkid === false) { $stkinfo = array("stkid" => "0", "catid" => "0", "prdcls" => "0"); } else { $stkinfo = qryStock($stkid, "stkid, catid, prdcls"); } if (!isset($_REQUEST["vatinc"])) { $ri[$price] += $ri[$price] * TAX_VAT / 100; } $cols = grp(m("listid", $listid), m("stkid", $stkinfo["stkid"]), m("catid", $stkinfo["catid"]), m("clasid", $stkinfo["prdcls"]), m("price", $ri[$price]), m("div", USER_DIV), m("supstkcod", $ri[$stkcod])); $upd->setCols($cols); $upd->run(); } if (count($invalid_fields) > 0) { $msg = "<br />The following items weren't imported because they contain\n\t\t\t\tinvalid values for either the stock code or the price:<br />"; foreach ($invalid_fields as $v) { $msg .= " - {$v}<br />"; } } else { $msg = ""; } $frm->setmsg("<li class='err'>Successfully imported new pricelist.{$msg}</li>"); } return view($frm); }
{ document.freporte.t_orden_1.disabled = false; document.freporte.s_cliente_1.disabled = true; } } </script> <? $imprimir = null; $imprimir .= "<table align=center border=0> <caption><H2>Reporte</H2></caption>"; $formulario = new cForm(); $formulario->_name = 'freporte'; /*$formulario->radio('reporte', array('cliente'=>'cliente', 'orden'=>'orden'), '', 1, 1, 1, 1, 8, '', 'activar()'); $formulario->add_text('Cliente', 0, 0, 1, 1, '', '', '');*/ /*$formulario->radio('reporte', 'orden', '', 1, 0, 1, 0, 1, ''); $formulario->add_text('Orden', 0, 1, 1, 1, '', '', '');*/ $formulario->add_text('orden', 1, 0); $formulario->input('t_orden_1', $orden, '15', '15', '', 0, 0, 1, 1, '', false); /*$formulario->add_text('cliente', 0, 0); $sql = "select * from cliente order by nombre_usuario"; $data = $db->Execute($sql); $values = array(); while (!$data->EOF)