• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isFechaValida函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中isFechaValida函数的典型用法代码示例。如果您正苦于以下问题:PHP isFechaValida函数的具体用法?PHP isFechaValida怎么用?PHP isFechaValida使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了isFechaValida函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: validar

function validar() {
	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if ($_POST["texto"] == "") {
		echo "errores+= '- El campo Texto es obligatorio.<br />';";
		$errores = true;
	}

	if ($_POST["fileImg"] == "") {
		echo "errores+= '- El campo Imagen es obligatorio.<br />';";
		$errores = true;
	}

	if ($_POST["vigenciaDesde"] == "") {
		echo "errores+= '- El campo Vigencia Desde es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!isFechaValida($_POST["vigenciaDesde"])) {
		echo "errores+= '- El campo Vigencia Desde debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if ($_POST["vigenciaHasta"] == "") {
		echo "errores+= '- El campo Vigencia Hasta es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!isFechaValida($_POST["vigenciaHasta"])) {
		echo "errores+= '- El campo Vigencia Hasta debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if (dateDiff($_POST["vigenciaHasta"], $_POST["vigenciaDesde"]) > 0) {
		echo "errores+= '- La Vigencia Hasta debe ser mayor a la Vigencia Desde.<br />';";
		$errores = true;
	}


	if ($errores) {
		echo "body.style.cursor = 'default';";
		echo "getElementById('btnGuardar').style.display = 'inline';";
		echo "getElementById('imgProcesando').style.display = 'none';";
		echo "getElementById('errores').innerHTML = errores;";
		echo "getElementById('divErroresForm').style.display = 'block';";
		echo "getElementById('foco').style.display = 'block';";
		echo "getElementById('foco').focus();";
		echo "getElementById('foco').style.display = 'none';";
	}
	else {
		echo "getElementById('divErroresForm').style.display = 'none';";
	}

	echo "}";
	echo "</script>";

	return !$errores;
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:60,代码来源:guardar_nacimiento.php


示例2: validar

function validar() {
	if ($_REQUEST["empleado"] == "")
		throw new Exception("Debe ingresar el Empleado.");

	if ($_REQUEST["numeroDocumento"] == "")
		throw new Exception("Debe ingresar el N° de Doc.");

	if (!validarEntero($_REQUEST["numeroDocumento"]))
		throw new Exception("El N° de Doc. tiene un formato inválido.");

	if ($_REQUEST["email"] == "")
		throw new Exception("Debe ingresar el e-Mail.");

	if ($_POST["email"] != "") {
		$params = array(":email" => $_POST["email"]);
		$sql = "SELECT art.varios.is_validaemail(:email) FROM DUAL";
		if (valorSql($sql, "", $params) != "S")
			throw new Exception("El e-Mail debe tener un formato válido.");
	}

	if (($_POST["activarDesde"] != "") and (!isFechaValida($_POST["activarDesde"])))
		throw new Exception("El campo Activar Desde debe tener un formato válido.");

	if (($_POST["activarHasta"] != "") and (!isFechaValida($_POST["activarHasta"])))
		throw new Exception("El campo Activar Hasta debe tener un formato válido.");
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:26,代码来源:procesar_usuario.php


示例3: formatDate

function formatDate($formatoSalida, $fechaEntrada, $formatoEntrada = "d/m/y") {
	// El formato de entrada tiene que ser 'd', 'm' o 'y' en minúscula..
	// El formato de salida tiene que ser igual al formato de la función date de PHP..

	if (!isFechaValida($fechaEntrada))
		return $fechaEntrada;

	$arrFecha = explode("/", $fechaEntrada);
	$arrFormatoEntrada = explode("/", $formatoEntrada);

	switch ($arrFormatoEntrada[0]) {
		case "d":
			$dia = $arrFecha[0];
			break;
		case "m":
			$mes = $arrFecha[0];
			break;
		case "y":
			$ano = $arrFecha[0];
			break;
	}

	switch ($arrFormatoEntrada[1]) {
		case "d":
			$dia = $arrFecha[1];
			break;
		case "m":
			$mes = $arrFecha[1];
			break;
		case "y":
			$ano = $arrFecha[1];
			break;
	}

	switch ($arrFormatoEntrada[2]) {
		case "d":
			$dia = $arrFecha[2];
			break;
		case "m":
			$mes = $arrFecha[2];
			break;
		case "y":
			$ano = $arrFecha[2];
			break;
	}

	return date($formatoSalida, mktime(0, 0, 0, $mes, $dia, $ano));
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:48,代码来源:date_utils.php


示例4: validar

function validar() {
	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if ($_POST["fecha"] == "") {
		echo "errores+= '- El campo Fecha Feriado es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!isFechaValida($_POST["fecha"])) {
		echo "errores+= '- El campo Fecha Feriado debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if ($_POST["delegacion"] == -1) {
		echo "errores+= '- El campo Delegación es obligatorio.<br />';";
		$errores = true;
	}


	if ($errores) {
		echo "body.style.cursor = 'default';";
		echo "getElementById('btnGuardar').style.display = 'inline';";
		echo "getElementById('imgProcesando').style.display = 'none';";
		echo "getElementById('errores').innerHTML = errores;";
		echo "getElementById('divErroresForm').style.display = 'block';";
		echo "getElementById('foco').style.display = 'block';";
		echo "getElementById('foco').focus();";
		echo "getElementById('foco').style.display = 'none';";
	}
	else {
		echo "getElementById('divErroresForm').style.display = 'none';";
	}

	echo "}";
	echo "</script>";

	return !$errores;
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:41,代码来源:guardar_feriado.php


示例5: ValidarFechas

function ValidarFechas($fechaIngreso, $fechaInicio)
{
    // $fechaIngreso = formatDateSeparador("d/m/Y", $fechaIngreso, '-' );
    // $fechaInicio = formatDateSeparador("d/m/Y", $fechaInicio, '-' );
    // date_format($fechaInicio,"d/m/Y");
    if (!isFechaValida($fechaIngreso)) {
        return 'Fecha Ingreso Invalida ' . $fechaIngreso;
    }
    if (!isFechaValida($fechaInicio)) {
        return 'Fecha Inicio Invalida ' . $fechaInicio;
    }
    $dias = dateDiff($fechaIngreso, $fechaInicio);
    if ($dias < 0) {
        return 'Fecha Inicio de la exposicion, Debe ser mayor/igual a la fecha de Ingreso a la empresa. ';
    }
    $hoy = date("d/m/Y");
    $dias = dateDiff($fechaInicio, $hoy);
    if ($dias < 0) {
        return 'Fecha Inicio de la exposicion, Debe ser menor/igual a la fecha actual. ';
    }
    return '';
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:22,代码来源:RAR_funcionesValidacion.php


示例6: header

header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
session_start();

require_once($_SERVER["DOCUMENT_ROOT"]."/../Classes/provart/grid.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/date_utils.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/functions/general.php");


set_time_limit(120);

try {
	if (($_REQUEST["vigenciaDesde"] <> "") and (!isFechaValida($_REQUEST["vigenciaDesde"])))
		throw new Exception("El campo Vigencia Desde es inválido.");
	if (($_REQUEST["vigenciaHasta"] <> "") and (!isFechaValida($_REQUEST["vigenciaHasta"])))
		throw new Exception("El campo Vigencia Hasta es inválido.");


	$pagina = $_SESSION["BUSQUEDA_BANNER_BUSQUEDA"]["pagina"];
	if (isset($_REQUEST["pagina"]))
		$pagina = $_REQUEST["pagina"];

	$ob = $_SESSION["BUSQUEDA_BANNER_BUSQUEDA"]["ob"];
	if (isset($_REQUEST["ob"]))
		$ob = $_REQUEST["ob"];

	$sb = $_SESSION["BUSQUEDA_BANNER_BUSQUEDA"]["sb"];
	if (isset($_REQUEST["sb"]))
		$sb = ($_REQUEST["sb"] == "T");
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:30,代码来源:buscar_banner_busqueda.php


示例7: validar

function validar() {
	$errores = false;

	echo '<script src="/modules/usuarios_registrados/clientes/js/denuncia_siniestros.js" type="text/javascript"></script>';
	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if ($_POST["idTrabajador"] == -1) {
		echo "paso = 1;";
		echo "errores+= '- Apellido y Nombre vacío.<br />';";
		$errores = true;
	}

	if (!isFechaValida($_POST["fechaNacimiento"], false)) {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Fecha Nacimiento vacía o errónea.<br />';";
		$errores = true;
	}
	else {
		$edad = dateDiff($_POST["fechaNacimiento"], date("d/m/Y"), "A");
		if (($edad <= 16) or ($edad >= 90)) {
			if (!$errores)
				echo "paso = 1;";
			echo "errores+= '- La edad del trabajador debe estar entre 16 y 90 años.<br />';";
			$errores = true;
		}
	}

	if ($_POST["fechaIngreso"] != "")
		if (!isFechaValida($_POST["fechaIngreso"])) {
			if (!$errores)
				echo "paso = 1;";
			echo "errores+= '- Fecha Ingreso a la Empresa errónea.<br />';";
			$errores = true;
		}

	if ($_POST["idProvincia"] == -1) {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Domicilio vacío.<br />';";
		$errores = true;
	}

	if ($_POST["telefono"] == "") {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Teléfono vacío.<br />';";
		$errores = true;
	}

	if ($_POST["numero"] == "") {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Número de calle del domicilio vacío.<br />';";
		$errores = true;
	}

	if ($_POST["puesto"] == "") {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Puesto vacío.<br />';";
		$errores = true;
	}

	if (($_POST["horaDesde"] == "-1") or ($_POST["minutoDesde"] == "-1") or ($_POST["horaHasta"] == "-1") and ($_POST["minutoHasta"] == "-1")) {
		if (!$errores)
			echo "paso = 1;";
		echo "errores+= '- Horario habitual de Trabajo vacío.<br />';";
		$errores = true;
	}

	if ($_POST["tipoSiniestro"] == -1) {
		if (!$errores)
			echo "paso = 2;";
		echo "errores+= '- Tipo de Siniestro vacío.<br />';";
		$errores = true;
	}

	if (!isFechaValida($_POST["fechaSiniestro"])) {
		if (!$errores)
			echo "paso = 2;";
		echo "errores+= '- Fecha Siniestro vacía o inválida.<br />';";
		$errores = true;
	}
	elseif (!fechaEnRango($_POST["fechaSiniestro"], "01/07/1996", date("d/m/Y"))) {
		if (!$errores)
			echo "paso = 2;";
		echo "errores+= '- La Fecha del Siniestro no puede ser posterior al día de hoy.<br />';";
		$errores = true;
	}

	if ($_POST["fechaRecaida"] != "") {
		if (!isFechaValida($_POST["fechaRecaida"])) {
			if (!$errores)
				echo "paso = 2;";
			echo "errores+= '- Fecha de Recaída inválida.<br />';";
			$errores = true;
		}
//.........这里部分代码省略.........
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:101,代码来源:procesar_denuncia.php


示例8: importarTrabajadores

function importarTrabajadores() {
	global $conn;

	try {
		if ($_FILES["archivo"]["name"] == "")
			throw new Exception("Debe elegir el Archivo a subir.");

		if (!validarExtension($_FILES["archivo"]["name"], array("xls")))
			throw new Exception("El Archivo a subir debe ser de extensión \".xls\".");


		// Borro los registros temporales que se pudieran haber generado en otra oportunidad..
		$params = array(":idusuario" => $_SESSION["idUsuario"], ":ipusuario" => $_SERVER["REMOTE_ADDR"]);
		$sql =
			"DELETE FROM tmp.tcm_cargamasivatrabajadoresweb
						 WHERE cm_idusuario = :idusuario
							 AND cm_ipusuario = :ipusuario";
		DBExecSql($conn, $sql, $params, OCI_DEFAULT);


		error_reporting(E_ALL ^ E_NOTICE);
		$excel = new Spreadsheet_Excel_Reader($_FILES["archivo"]["tmp_name"]);

		for ($row=2; $row<=$excel->rowcount(); $row++) {		// Empiezo desde la 2, porque en la 1 viene la cabecera..
			// Meto los valores de las columnas en un array..
			$cols = array();
			for ($col=65; $col<=87; $col++)
				$cols[chr($col)] = trim($excel->val($row, chr($col)));

			// Si todas las columnas estan vacías lo tomo como un EOF y salgo del loop principal..
			$existeValor = false;
			foreach ($cols as $key => $value)
				if ($value != "")
					$existeValor = true;
			if (!$existeValor)
				break;


			// *** - INICIO VALIDACIONES..
			$errores = "11111111111111111111111";

			// Columna A - CUIL..
			if (!validarCuit($cols["A"]))
				$errores[0] = "0";

			// Columna B - Nombre..
			if ($cols["B"] == "")
				$errores[1] = "0";

			// Columna C - Sexo..
			if (($cols["C"] != "F") and ($cols["C"] != "M"))
				$errores[2] = "0";

			// Columna D - Nacionalidad..
			if ($cols["D"] != "") {
				$params = array(":descripcion" => $cols["D"]);
				$sql =
					"SELECT 1
						 FROM cna_nacionalidad
						WHERE na_fechabaja IS NULL
							AND UPPER(na_descripcion) = UPPER(:descripcion)";
				if (!existeSql($sql, $params))
					$errores[3] = "0";
			}

			// Columna E - Otra nacionalidad..
			$errores[4] = "1";

			// Columna F - Fecha de nacimiento..
			try {
				if (isFechaValida($cols["F"])) {
					$edad = dateDiff($cols["F"], date("d/m/Y"), "A");
					if (($edad < 16) or ($edad > 90))
						$errores[5] = "0";
				}
				else
					$errores[5] = "0";
			}
			catch (Exception $e) {
				$errores[5] = "0";
			}

			// Columna G - Estado Civil..
			if ($cols["G"] != "") {
				$params = array(":descripcion" => $cols["G"]);
				$sql =
					"SELECT 1
						 FROM ctb_tablas
						WHERE tb_clave = 'ESTAD'
							AND tb_fechabaja IS NULL
							AND UPPER(tb_descripcion) = UPPER(:descripcion)";
				if (!existeSql($sql, $params))
					$errores[6] = "0";
			}

			// Columna H - Fecha de ingreso..
			if (!isFechaValida($cols["H"]))
				$errores[7] = "0";

			// Columna I - Establecimiento..
//.........这里部分代码省略.........
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:101,代码来源:importar_trabajadores.php


示例9: require_once

require_once($_SERVER["DOCUMENT_ROOT"]."/functions/general.php");


try {
	if (getUserID() != $_POST["id"])
		throw new Exception("Usuario inválido.");

	$params = array(":id" => $_POST["id"]);
	$sql =
		"SELECT TO_CHAR(se_fechacumple, 'yyyy') anocumple, TO_CHAR(se_fechacumple, 'dd/mm') fechacumple
			 FROM use_usuarios
			WHERE se_id = :id";
	$stmt = DBExecSql($conn, $sql, $params);
	$row = DBGetQuery($stmt);

	if (!isFechaValida($_POST["cumpleaños"]."/".$row["ANOCUMPLE"]))
		throw new Exception("La fecha ingresada es inválida.");

	$params = array(":fechacumple" => $_POST["cumpleaños"]."/".$row["ANOCUMPLE"], ":id" => $_POST["id"], ":usumodif" => getWindowsLoginName(true));
	$sql =
		"UPDATE use_usuarios
				SET se_fechamodif = SYSDATE,
						se_fechacumple = :fechacumple,
						se_usumodif = :usumodif
			WHERE se_id = :id";
	DBExecSql($conn, $sql, $params);
}
catch (Exception $e) {
	DBRollback($conn);
?>
	<script language="JavaScript" src="/js/functions.js"></script>
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:31,代码来源:guardar_cumpleanos.php


示例10: validar

function validar() {
	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if ($_POST["preguntasAdicionales"] == "t") {		// Valido el formulario de preguntas adicionales..
		// Valido que se contesten todas las preguntas..
		$preguntaContestada = true;
		foreach ($_POST as $key => $value)
			if (substr($key, 0, 10) == "Hpregunta_")
				if (!isset($_POST[substr($key, 1)])) {
					$preguntaContestada = false;
					break;
				}
		if (!$preguntaContestada) {
			echo "errores+= '- Debe contestar todas las preguntas.<br />';";
			$errores = true;
		}

		// Valido que si hay alguna planilla desplegada se haya seleccionado 'si' en algún item..
		$idPlanillas = array();
		foreach ($_POST as $key => $value)
			if (substr($key, 0, 19) == "Hplanilla_pregunta_")
				$idPlanillas[] = $value;

		$preguntaSi = true;
		foreach ($idPlanillas as $id) {
			if (!$preguntaSi)
				break;

			if ((isset($_POST["pregunta_".$id])) and ($_POST["pregunta_".$id] == "S")) {
				$preguntaSi = false;
				foreach ($_POST as $key => $value)
					if ((substr($key, 0, 7) == "Hextra_") and (substr($key, -10 - strlen($id)) == "_pregunta_".$id))
						if ((isset($_POST["extra_".$value])) and ($_POST["extra_".$value] == "S")) {
							$preguntaSi = true;
							break;
						}
			}
		}
		if (!$preguntaSi) {
			echo "errores+= '- Debe seleccionar SÍ en al menos un item de cada planilla.<br />';";
			$errores = true;
		}
	}
	else {		// Valido el formulario RGRL..
		// Valido que se contesten todas las preguntas..
		$preguntaContestada = true;
		foreach ($_POST as $key => $value)
			if (substr($key, 0, 10) == "Hpregunta_")
				if (!isset($_POST[substr($key, 1)])) {
					$preguntaContestada = false;
					break;
				}
		if (!$preguntaContestada) {
			echo "errores+= '- Debe contestar todas las preguntas.<br />';";
			$errores = true;
		}

		if ($preguntaContestada) {
			// Valido que si se contesta con N debe requerirse una fecha de regularización solo para los items cuyo campo ia_idtipoformanexo sea null..
			$fechaOk = true;
			foreach ($_POST as $key => $value)
				if (substr($key, 0, 10) == "Hpregunta_"){
					if (($_POST[substr($key, 1)] == "N") and (!isset($_POST["Hplanilla_pregunta_".$value])) and (!isFechaValida($_POST["fecha_".$value]))) {
						$fechaOk = false;
						break;
					}
				}
			if (!$fechaOk) {
				echo "errores+= '- Debe ingresar una fecha de regularización válida para los campos que contestó como \"No\".<br />';";
				$errores = true;
			}
		}

		// La fecha de regularización debe ser mayor a la fecha actual..
		$fechaOk = true;
		foreach ($_POST as $key => $value)
			if (substr($key, 0, 6) == "fecha_")
				if (isset($_POST["pregunta_".substr($key, 6)]))
					if ($_POST["pregunta_".substr($key, 6)] == "N")		// Si la pregunta está cargada como "N"..
						if (($value != "") and (dateDiff(date("d/m/Y"), $value) < 0)) {
							$fechaOk = false;
							break;
						}
		if (!$fechaOk) {
			echo "errores+= '- La Fecha de Regularización debe ser mayor o igual a la fecha actual en todos los casos.<br />';";
			$errores = true;
		}

		// Valido que si hay alguna planilla desplegada se haya seleccionado 'si' en algún item..
		$idPlanillas = array();
		foreach ($_POST as $key => $value)
			if (substr($key, 0, 19) == "Hplanilla_pregunta_")
				$idPlanillas[] = $value;

		$preguntaSi = true;
		foreach ($idPlanillas as $id) {
//.........这里部分代码省略.........
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:101,代码来源:procesar_rgrl.php


示例11: date

	}

	if (!move_uploaded_file($tmpfile, $folder.$filename)) {
		$error = "El archivo no pudo ser guardado.";
		return false;
	}

	return true;
}


$extension = "";
$filename = "";
$mostrarImagen = false;
if ((isset($_REQUEST["cargar"])) and ($_REQUEST["cargar"] == "t")) {
	if (!isFechaValida($_POST["fecha"], false))
		echo "<span style='color:#f00;'>Debe ingresar una fecha válida.</span>";
	elseif (!isset($_REQUEST["tipoSello"]))
		echo "<span style='color:#f00;'>Debe indicar el tipo de sello.</span>";
	elseif ($_FILES["imagen"]["name"] == "")
		echo "<span style='color:#f00;'>Debe seleccionar un archivo.</span>";
	else {
		$error = "";
		$filename = date("Ymdhmi")."_".getWindowsLoginName();
		if (!subirArchivo($_FILES["imagen"], DATA_AVISO_OBRA_PATH, $filename, array("jpg", "jpeg", "pdf", "png"), $error, $extension))
			echo "<span style='color:#f00;'>".$error."</span>";
		else		// Si entra acá es porque pasó todas las validaciones..
			$mostrarImagen = true;
	}
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:30,代码来源:index.php


示例12: validar

function validar($validarAltaTemprana) {
	global $campoError;

	if ($_POST["cuil"] == "") {
		$campoError = "cuil";
		throw new Exception("Debe ingresar la C.U.I.L.");
	}

	if (!validarCuit($_POST["cuil"])) {
		$campoError = "cuil";
		throw new Exception("La C.U.I.L. ingresada es inválida");
	}

	if ($_POST["nombre"] == "") {
		$campoError = "nombre";
		throw new Exception("Debe ingresar el Nombre y Apellido.");
	}

	if (($validarAltaTemprana) and ($_POST["codigoAltaTemprana"] == "")) {
		$campoError = "codigoAltaTemprana";
		throw new Exception("Debe ingresar el Código de Alta Temprana.");
	}

	if ((!validarEntero(substr($_POST["codigoAltaTemprana"], 0, 8))) or (!validarEntero(substr($_POST["codigoAltaTemprana"], 8, 8))) or (!validarEntero(substr($_POST["codigoAltaTemprana"], 16, 8)))) {
		$campoError = "codigoAltaTemprana";
		throw new Exception("El Código de Alta Temprana debe ser un valor numérico.");
	}

	if ($_POST["sexo"] == -1) {
		$campoError = "sexo";
		throw new Exception("Debe elegir el Sexo.");
	}

	if ($_POST["nacionalidad"] == -1) {
		$campoError = "nacionalidad";
		throw new Exception("Debe elegir la Nacionalidad.");
	}

	if ($_POST["fechaNacimiento"] == "") {
		$campoError = "fechaNacimiento";
		throw new Exception("Debe ingresar la Fecha de Nacimiento.");
	}

	if (!isFechaValida($_POST["fechaNacimiento"])) {
		$campoError = "fechaNacimiento";
		throw new Exception("La Fecha de Nacimiento es inválida.");
	}

	if ($_POST["estadoCivil"] == -1) {
		$campoError = "estadoCivil";
		throw new Exception("Debe elegir el Estado Civil.");
	}

	if ($_POST["fechaIngreso"] == "") {
		$campoError = "fechaIngreso";
		throw new Exception("Debe ingresar la F. de Ingreso en la Empresa.");
	}

	if (!isFechaValida($_POST["fechaIngreso"])) {
		$campoError = "fechaIngreso";
		throw new Exception("La F. de Ingreso en la Empresa es inválida.");
	}

	return true;
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:65,代码来源:procesar_trabajador.php


示例13: validar

function validar() {
	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";


	if (($_POST["fechaNacimiento"] != "") and (!isFechaValida($_POST["fechaNacimiento"]))) {
		echo "errores+= '- El campo Fecha Nacimiento debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if (($_POST["piso"] != "") and (!validarEntero($_POST["piso"]))) {
		echo "errores+= '- El campo Piso debe ser un entero válido.<br />';";
		$errores = true;
	}

	if (($_POST["codigoInternoRRHH"] != "") and (!validarEntero($_POST["codigoInternoRRHH"]))) {
		echo "errores+= '- El campo Código Interno RRHH debe ser un entero válido.<br />';";
		$errores = true;
	}

	if ($_POST["legajoRRHH"] == "") {
		echo "errores+= '- El campo Legajo RRHH es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!validarEntero($_POST["legajoRRHH"])) {
		echo "errores+= '- El campo Legajo RRHH debe ser un entero válido.<br />';";
		$errores = true;
	}

	if (($_POST["cuil"] != "") and (!validarCuit($_POST["cuil"]))) {
		echo "errores+= '- El campo C.U.I.L. debe ser una C.U.I.L. válida.<br />';";
		$errores = true;
	}

	if ($_POST["id"] == $_POST["respondeA"]) {
		echo "errores+= '- El usuario no puede responder a si mismo.<br />';";
		$errores = true;
	}

	if (($_POST["relacionLaboral"] == 1) and ($_POST["legajoRRHH"] != 0)) {
		$params = array(":id" => $_POST["id"], ":legajorrhh" => $_POST["legajoRRHH"]);
		$sql =
			"SELECT 1
				 FROM use_usuarios
				WHERE se_legajorrhh = :legajorrhh
					AND se_id <> :id";
		if (existeSql($sql, $params, 0)) {		// Valido que no exista el Nº de Legajo..
			echo "errores+= '- El Legajo RRHH ya fue asignado a otro usuario.<br />';";
			$errores = true;
		}
	}


	if ($errores) {
		echo "body.style.cursor = 'default';";
		echo "getElementById('btnGuardar').style.display = 'inline';";
		echo "getElementById('imgProcesando').style.display = 'none';";
		echo "getElementById('errores').innerHTML = errores;";
		echo "getElementById('divErroresForm').style.display = 'block';";
		echo "getElementById('foco').style.display = 'block';";
		echo "getElementById('foco').focus();";
		echo "getElementById('foco').style.display = 'none';";
	}
	else {
		echo "getElementById('divErroresForm').style.display = 'none';";
	}

	echo "}";
	echo "</script>";

	return !$errores;
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:75,代码来源:guardar_usuario.php


示例14: validar

function validar($multiLink) {
	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if ($_POST["id"] == 0)		// Si es un alta valido que suba una imagen..
		if ($_POST["fileImg"] == "") {
			echo "errores+= '- Debe seleccionar una imagen.<br />';";
			$errores = true;
		}

	if (($_POST["link"] != "") and (substr($_POST["link"], 0, 7) != "mailto:"))
		if ($_POST["destino"] == -1) {
		echo "errores+= '- El campo Destino es obligatorio.<br />';";
		$errores = true;
	}

	if (($_POST["posicion"] != "") and (!validarEntero($_POST["posicion"]))) {
		echo "errores+= '- El campo Posición debe ser numérico.<br />';";
		$errores = true;
	}

	if ($_POST["vigenciaDesde"] == "") {
		echo "errores+= '- El campo Vigencia Desde es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!isFechaValida($_POST["vigenciaDesde"])) {
		echo "errores+= '- El campo Vigencia Desde debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if ($_POST["vigenciaHasta"] == "") {
		echo "errores+= '- El campo Vigencia Hasta es obligatorio.<br />';";
		$errores = true;
	}
	elseif (!isFechaValida($_POST["vigenciaHasta"])) {
		echo "errores+= '- El campo Vigencia Hasta debe ser una fecha válida.<br />';";
		$errores = true;
	}

	if (dateDiff($_POST["vigenciaHasta"], $_POST["vigenciaDesde"]) > 0) {
		echo "errores+= '- La Vigencia Hasta debe ser mayor a la Vigencia Desde.<br />';";
		$errores = true;
	}

	if ($multiLink == "S") {
		$arrGrupos = array();
		foreach($_REQUEST as $key => $value)
			if (substr($key, 0, 8) == "idGrupo_") {
				$num = substr($key, 8);
				if ((isset($_REQUEST["usuariosGrupo".$num])) and ($_REQUEST["bajaGrupo".$num] == "f"))
					$arrGrupos[] = $num;
			}

			$arrIdUsuarios = array();
			foreach($arrGrupos as $key)
				for ($i=0; $i<count($_REQUEST["usuariosGrupo".$key]); $i++)
					$arrIdUsuarios[] = $_REQUEST["usuariosGrupo".$key][$i];
			$arrIdUsuarios = array_count_values($arrIdUsuarios);

			$arrUsuarios = array();
			foreach($arrIdUsuarios as $key => $value)
				if ($value > 1) {
					$params = array(":id" => $key);
					$sql =
						"SELECT se_nombre
							 FROM use_usuarios
							WHERE se_id = :id";
				$arrUsuarios[] = valorSql($sql, "", $params);
				}

			if (count($arrUsuarios) == 1) {
				echo "errores+= '- El usuario ".implode($arrUsuarios)." está en mas de un grupo.<br />';";
				$errores = true;
			}

			if (count($arrUsuarios) > 1) {
				echo "errores+= '- Los usuarios ".implode(",", $arrUsuarios)." están en mas de un grupo.<br />';";
				$errores = true;
			}
	}

	if ($errores) {
		echo "body.style.cursor = 'default';";
		echo "getElementById('btnGuardar').style.display = 'inline';";
		echo "getElementById('imgProcesando').style.display = 'none';";
		echo "getElementById('errores').innerHTML = errores;";
		echo "getElementById('divErroresForm').style.display = 'block';";
		echo "getElementById('foco').style.display = 'block';";
		echo "getElementById('foco').focus();";
		echo "getElementById('foco').style.display = 'none';";
	}
	else {
		echo "getElementById('divErroresForm').style.display = 'none';";
	}

	echo "}";
	echo "</script>";
//.........这里部分代码省略.........
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:101,代码来源:guardar_banner.php


示例15: validar

function validar() {
	global $mostrarEnPortada;

	$errores = false;

	echo "<script type='text/javascript'>";
	echo "with (window.parent.document) {";
	echo "var errores = '';";

	if (!isset($_POST["tipo"])) {
		echo "errores+= '- El campo Tipo es obligatorio.<br />';";
		$errores = true;
	}

	if ($_POST["tipo"] == "M")
		if ($_POST["cuerpo"] == "") {
			echo "errores+= '- El campo Cuerpo es obligatorio.<br />';";
			$errores = true;
		}

	if ($mostrarEnPortada == "S") {
		if ($_POST["ubicacion"] == -1) {
			echo "errores+= '- El campo Ubicación es obligatorio.<br />';";
			$errores = true;
		}

		if ($_POST["titulo"] == "") {
			echo "errores+= '- El campo Título es obligatorio.<br />';";
			$errores = true;
		}

		if (($_POST["posicion"] != "") and (!validarEntero($_POST["posicion"]))) {
			echo "errores+= '- El campo Posición debe ser numérico.<br />';";
			$errores = true;
		}

		if ($_POST["vigenciaDesde"] == "") {
			echo "errores+= '- El campo Vigencia Desde es obligatorio.<br />';";
			$errores = true;
		}
		elseif (!isFechaValida($_POST["vigenciaDesde"])) {
			echo "errores+= '- El campo Vigencia Desde debe ser una fecha válida.<br />';";
			$errores = true;
		}

		if ($_POST["vigenciaHasta"] == "") {
			echo "errores+= '- El campo Vigencia Hasta es obligatorio.<br />';";
			$errores = true;
		}
		elseif (!isFechaValida($_POST["vigenciaHasta"])) {
			echo "errores+= '- El campo Vigencia Hasta debe ser una fecha válida.<br />';";
			$errores = true;
		}

		if (dateDiff($_POST["vigenciaHasta"], $_POST["vigenciaDesde"]) > 0) {
			echo "errores+= '- La Vigencia Hasta debe ser mayor a la Vigencia Desde.<br />';";
			$errores = true;
		}
	}


	if ($errores) {
		echo "body.style.cursor = 'default';";
		echo "getElementById('btnGuardar').style.display = 'inline';";
		echo "getElementById('imgProcesando').style.display = 'none';";
		echo "getElementById('errores').innerHTML = errores;";
		echo "getElementById('divErroresForm').style.display = 'block';";
		echo "getElementById('foco').style.display = 'block';";
		echo "getElementById('foco').focus();";
		echo "getElementById('foco').style.display = 'none';";
	}
	else {
		echo "getElementById('divErroresForm').style.display = 'none';";
	}

	echo "}";
	echo "</script>";

	return !$errores;
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:80,代码来源:guardar_articulo.php


示例16: dateDiff

		if ($cols["J"] != "")
			if (!isFechaValida($cols["J"])) {
				$error = "Columna J: Fecha de Egreso inválida, el formato correcto es dd/mm/yyyy.";
				insertarRegistroError($seqTrans, $row, $error);
			}

		// ***  Verifico que si la columna K tiene un valor, sea un entero  ***
		if ($cols["K"] != "")
			if (!validarEntero($cols["K"])) {
				$error = "Columna K: Nº de Establecimiento inválido.";
				insertarRegistroError($seqTrans, $row, $error);
			}

		// ***  Verifico que si la columna T tiene un valor, sea una fecha válida  ***
		if ($cols["T"] != "")
			if (!isFechaValida($cols["T"])) {
				$error = "Columna T: Fecha de Nacimiento inválida, el formato correcto es dd/mm/yyyy.";
				insertarRegistroError($seqTrans, $row, $error);
			}
			else {
				// ***  Verifico que el trabajador tenga una edad razonable..  ***
				$edad = dateDiff($cols["T"], date("d/m/Y"), "A");

				if (($edad <= 16) or ($edad >= 90)) {
					$error = "Columna T: La edad del trabajador tiene que ser de entre 16 y 90 años.";
					insertarRegistroError($seqTrans, $row, $error);
				}
			}

		// ***  Verifico que si la columna U tiene un valor, sea un valor numérico mayor o igual a cero  ***
		if (!validarNumero($cols["U"])) {
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:31,代码来源:procesar_archivo.php


示例17: header

header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
session_start();

require_once($_SERVER["DOCUMENT_ROOT"]."/../Classes/provart/grid.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/date_utils.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/functions/general.php");


set_time_limit(120);

try {
	if (($_REQUEST["fechaDesdeBusqueda"] <> "") and (!isFechaValida($_REQUEST["fechaDesdeBusqueda"])))
		throw new Exception("El campo Fecha Feriado Desde es inválido.");
	if (($_REQUEST["fechaHastaBusqueda"] <> "") and (!isFechaValida($_REQUEST["fechaHastaBusqueda"])))
		throw new Exception("El campo Fecha Feriado Hasta es inválido.");


	$pagina = $_SESSION["BUSQUEDA_FERIADOS_CALENDARIO"]["pagina"];
	if (isset($_REQUEST["pagina"]))
		$pagina = $_REQUEST["pagina"];

	$ob = $_SESSION["BUSQUEDA_FERIADOS_CALENDARIO"]["ob"];
	if (isset($_REQUEST["ob"]))
		$ob = $_REQUEST["ob"];

	$sb = $_SESSION["BUSQUEDA_FERIADOS_CALENDARIO"]["sb"];
	if (isset($_REQUEST["sb"]))
		$sb = ($_REQUEST["sb"] == "T");
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:30,代码来源:buscar_feriado_busqueda.php


示例18: validar

function validar($id, $alta, $rowCotizacion, $isSoloPCP, $idVendedor, $datosEmpleadorManual, $sumaAseguradaRC, $formaPago, $iva, $iibb) {
	global $campoError;
	global $modulo;

	if (!isset($_SESSION["isAgenteComercial"]))
		throw new Exception("Usted no tiene permiso para acceder a este módulo.");

	// Bloque 1.1.1..
	if ($_POST["fechaSuscripcion"] == "") {
		$campoError = "fechaSuscripcion";
		throw new Exception("Debe ingresar la Fecha de Suscripción.");
	}

	if (!isFechaValida($_POST["fechaSuscripcion"])) {
		$campoError = "fechaSuscripcion";
		throw new Exception("La Fecha de Suscripción debe tener un formato válido.");
	}

	$params = array(":fechaalta" => $_POST["fechaSuscripcion"], ":id" => $id);
	if ($modulo == "R")		// Si es una revisión de precio..
		$sql =
			"SELECT 1
				 FROM asr_solicitudreafiliacion
				WHERE sr_id = :id
					AND TRUNC(sr_fechaalta) > TO_DATE(:fechaalta, 'DD/MM/YYYY')";
	else		// Si es una solicitud de cotización..
		$sql =
			"SELECT 1
				 FROM asc_solicitudcotizacion
				WHERE sc_id = :id
					AND TRUNC(sc_fechaalta) > TO_DATE(:fechaalta, 'DD/MM/YYYY')";
	if (existeSql($sql, $params)) {
		$campoError = "fechaSuscripcion";
		throw new Exception("La Fecha de Suscripción no puede ser anterior a la fecha de la solicitud de cotización.");
	}

	$params = array(":fechasuscripcion" => $_POST["fechaSuscripcion"], ":fechavencimiento" => $_POST["fechaVencimiento"]);
	$sql =
		"SELECT 1
			 FROM DUAL
			WHERE TO_DATE(:fechasuscripcion, 'DD/MM/YYYY') > TO_DATE(:fechavencimiento, 'DD/MM/YYYY')";
	if (existeSql($sql, $params)) {
		$campoError = "fechaSuscripcion";
		throw new Exception("La Fecha de Suscripción no puede ser posterior a la fecha de vigencia de la cotización (".$_POST["fechaVencimiento"].").");
	}

	if ($alta) {
		$params = array(":fechasuscripcion" => $_POST["fechaSuscripcion"]);
		$sql =
			"SELECT 1
				 FROM DUAL
				WHERE TO_DATE(:fechasuscripcion, 'DD/MM/YYYY') < ART.ACTUALDATE";
		if (existeSql($sql, $params)) {
			$campoError = "fechaSuscripcion";
			throw new Exception("La Fecha de Suscripción no puede ser anterior a la fecha actual.");
		}
	}
	else {
		$params = array(":fechasuscripcion" => $_POST["fechaSuscripcion"], ":id" => $id);
		$sql =
			"SELECT 1
				 FROM asa_solicitudafiliacion
				WHERE ((TO_DATE(:fechasuscripcion, 'DD/MM/YYYY') < TRUNC(sa_fechaalta)) OR (TO_DATE(:fechasuscripcion, 'DD/MM/YYYY') > ART.ACTUALDATE))
					AND TRUNC(sa_fechaafiliacion) <> TO_DATE(:fechasuscripcion, 'DD/MM/YYYY')
					AND ".$rowCotizacion["FORMULARIOFIELD"]." = :id";
		if (existeSql($sql, $params)) {
			$campoError = "fechaSuscripcion";
			throw new Exception("La Fecha de Suscripción no puede ser ni anterior a la fecha previamente cargada ni posterior a la fecha actual.");
		}
	}

	// Bloque 1.2..
	if ($_POST["razonSocial&qu 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isFile函数代码示例发布时间:2022-05-15
下一篇:
PHP isError函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap