if ($numero_filas > 0) { $existe = true; } } return $existe; } $arrvalormatricula = precios($_POST[idprograma], $_POST["nivel"], $link, $cedula); $valor_matricula = $arrvalormatricula[0]; if ($valor_seguro == '' || $porcentaje_extra == '') { /* $valor_seguro = 3000; $porcentaje_extra = 10; $fecha_extra = 5; */ $conexion = Conectarse() or die(errores(1)); mysql_select_db("bdilud") or die(errores(1)); $sql = "SELECT valor_seguro, porcentaje_extra, fecha_ext FROM parametros_recibos "; $consulta = mysql_query($sql, $conexion); while ($filaParam = mysql_fetch_array($consulta, MYSQL_ASSOC)) { $valor_seguro = $filaParam['valor_seguro']; $porcentaje_extra = $filaParam['porcentaje_extra']; $fecha_extra = $filaParam['fecha_ext']; } } if ($valor_matricula <= '150000') { $valor_seguro = 0; } $fecha_const_matricula = $matriculita->sumaDia($fechamatricula, 1); $valor_matricula_extra = $valor_matricula + $valor_matricula * $porcentaje_extra / 100; if ($arrvalormatricula[1] == 0) { $idmatricula = $matriculita->ins_matricula1($numatricula, $fechamatricula, $idperiodo, $_POST[idprograma], $nivelgrupo, $_POST[cedula], $valor_matricula, $fecha_const_matricula, $refcarne, $consigcarne, $valor_carne, $valor_seguro, $valor_matricula_extra);
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT); $file = fopen("ENTIDAD.txt", "r") or exit("Unable to open file!"); $con = 0; $sSql = "delete from entidad"; phpmkr_query($sSql, $conn); while (!feof($file)) { $linea = fgets($file) . "\n"; $valores[] = explode(";", $linea); $value1 = trim(str_replace('"', "", $valores[$con][0])); $value2 = trim(str_replace('"', "", $valores[$con][1])); $value3 = trim(str_replace('"', "", $valores[$con][2])); $value4 = trim(str_replace('"', "", $valores[$con][3])); $value5 = trim(str_replace('"', "", $valores[$con][4])); $sSql = "insert into entidad values('{$value1}','{$value2}','{$value3}',{$value4},'{$value5}')"; phpmkr_query($sSql, $conn); errores($con); $con = $con + 1; } echo "Listo!"; fclose($file); // $file = fopen("INDICADORES.txt", "r") or exit("Unable to open file!"); // $con=0; // $sSql="delete from indicadores"; // phpmkr_query($sSql,$conn); // while(!feof($file)){ // $linea = fgets($file). "\n"; // $valores[]=explode(";", $linea); // $id = trim(str_replace('"', "", $valores[$con][0])); // $grupo = trim(str_replace('"', "", $valores[$con][1])); // $descripcion_indicador = trim(str_replace('"', "", $valores[$con][2])); // $tipo = trim(str_replace('"', "", $valores[$con][3]));
return $error; } if (!empty($nurad)) { $isqlDepR = "SELECT \r\n ANEX_NOMB_ARCHIVO AS NOMBRE\r\n ,ANEX_DESC\r\n FROM \r\n ANEXOS\r\n WHERE \r\n ANEX_RADI_NUME='{$nurad}' \r\n AND ANEX_BORRADO='N'"; $rsDepR = $db->conn->Execute($isqlDepR); $file = $rsDepR->fields['NOMBRE']; while (!$rsDepR->EOF) { $sali[] = array('path' => $ruta_raiz . "bodega/" . substr($file, 0, 4) . "/" . $dependencia . "/docs/" . $file, 'desc' => $rsDepR->fields['ANEX_DESC']); $rsDepR->MoveNext(); } } $datoserror = explode('-', $errores); sort($datoserror); $noerrores = $datoserror[0]; for ($i = 0; $i < count($datoserror); $i++) { $error1 .= errores($datoserror[$i]) . '<br/>'; } if (empty($errores)) { $salida = 'ok'; } $smarty->assign("krd", $krd); $smarty->assign("noerror", $noerrores); $smarty->assign("error", $error1); $smarty->assign("nurad", $nurad); $smarty->assign("sali", $sali); $smarty->assign("salida", $salida); $smarty->assign("sid", SID); //Envio de session por get $smarty->assign("dependencia", $dependencia); //Envio de session por get $smarty->display('salidaRespuesta.tpl');
function nomNivel($varNiv) { $conexion = Conectar() or die(errores(1)); mysql_select_db("bdilud") or die(errores(2)); $sql = "SELECT * FROM niveles WHERE id_nivel = '{$varNiv}' "; $consulta = mysql_query($sql, $conexion) or die(errores(2)); $cursor = mysql_fetch_row($consulta); mysql_close($conexion); return $cursor[1]; }
/** * * @todo Funcion que registra todas las acciones en la atraves de la aplicacion OpenPhoneTaxi * @author Jean Carlos Nuñez * @param int $var_cod_usu * @param string $var_accion * @param db $conne * @return Null * */ function auditoria_openphonetaxi($var_cod_usu, $var_accion, $conne) { $rs = phpmkr_query("select fecha from fecha_aplicacion ", $conne) or die("Fallo al ejecutar la consulta en la linea" . __LINE__ . ": " . phpmkr_error($conne) . '<br>SQL: ' . $sSql); while ($row_rs = $rs->fetch_assoc()) { $var_fecha_actual = $row_rs['fecha']; } $rs = phpmkr_query("select auditoria from operaciones_generales ", $conne) or die("Fallo al ejecutar la consulta en la linea" . __LINE__ . ": " . phpmkr_error($conne) . '<br>SQL: ' . $sSql); while ($row_rs = $rs->fetch_assoc()) { $var_auditoria = $row_rs['auditoria']; } $rs = phpmkr_query("select curtime() as hora_actual ", $conne) or die("Fallo al ejecutar la consulta en la linea" . __LINE__ . ": " . phpmkr_error($conne) . '<br>SQL: ' . $sSql); while ($row_rs = $rs->fetch_assoc()) { $hora = $row_rs['hora_actual']; } $rs = phpmkr_query("select fecha_hasta from operaciones_generales ", $conne) or die("Fallo al ejecutar la consulta en la linea" . __LINE__ . ": " . phpmkr_error($conne) . '<br>SQL: ' . $sSql); while ($row_rs = $rs->fetch_assoc()) { $var_fecha_hasta = $row_rs['fecha_hasta']; } if ($var_fecha_actual > $var_fecha_hasta) { header("Location: index.php"); exit; } if ($var_auditoria == 1) { $var_ip = $_SERVER['REMOTE_ADDR']; $contador = validar_ip_autorizada($var_ip); $today = date("Y-m-d"); if ($contador > 0) { phpmkr_query("insert into auditoria values({$var_cod_usu},'{$today}','{$hora}','{$var_accion}','{$var_ip}') ", $conne); } else { $var_accion = "IP NO ENCONTRADA, " . $var_accion; $sSql = "insert into auditoria values({$var_cod_usu},'{$today}','{$hora}','{$var_accion}','{$var_ip}') "; errores($sSql); phpmkr_query($sSql, $conne); } } }