本文整理汇总了PHP中ew_CheckNumber函数的典型用法代码示例。如果您正苦于以下问题:PHP ew_CheckNumber函数的具体用法?PHP ew_CheckNumber怎么用?PHP ew_CheckNumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ew_CheckNumber函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ew_CheckRange
function ew_CheckRange($value, $min, $max)
{
if (strval($value) == "") {
return TRUE;
}
if (is_int($min) || is_float($min) || is_int($max) || is_float($max)) {
// Number
if (ew_CheckNumber($value)) {
$value = floatval(ew_StrToFloat($value));
}
}
if (!is_null($min) && $value < $min || !is_null($max) && $value > $max) {
return FALSE;
}
return TRUE;
}
示例2: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
if (!ew_CheckFileType($this->teacher_avatar->Upload->FileName)) {
ew_AddMessage($gsFormError, $Language->Phrase("WrongFileType"));
}
if ($this->teacher_avatar->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $this->teacher_avatar->Upload->FileSize > EW_MAX_FILE_SIZE) {
ew_AddMessage($gsFormError, str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize")));
}
if (in_array($this->teacher_avatar->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
ew_AddMessage($gsFormError, $Language->Phrase("PhpUploadErr" . $this->teacher_avatar->Upload->Error));
}
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckInteger($this->teacher_active->FormValue)) {
ew_AddMessage($gsFormError, $this->teacher_active->FldErrMsg());
}
if (!ew_CheckInteger($this->teacher_sex->FormValue)) {
ew_AddMessage($gsFormError, $this->teacher_sex->FldErrMsg());
}
if (!ew_CheckNumber($this->teacher_rate->FormValue)) {
ew_AddMessage($gsFormError, $this->teacher_rate->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例3: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckRange($this->mes->FormValue, 1, 12)) {
ew_AddMessage($gsFormError, $this->mes->FldErrMsg());
}
if (!ew_CheckRange($this->anio->FormValue, 2012, 2100)) {
ew_AddMessage($gsFormError, $this->anio->FldErrMsg());
}
if (!ew_CheckEuroDate($this->fecha->FormValue)) {
ew_AddMessage($gsFormError, $this->fecha->FldErrMsg());
}
if (!ew_CheckNumber($this->monto->FormValue)) {
ew_AddMessage($gsFormError, $this->monto->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例4: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckNumber($this->importe->FormValue)) {
ew_AddMessage($gsFormError, $this->importe->FldErrMsg());
}
if (!ew_CheckEuroDate($this->fecha_creacion->FormValue)) {
ew_AddMessage($gsFormError, $this->fecha_creacion->FldErrMsg());
}
// Validate detail grid
$DetailTblVar = explode(",", $this->getCurrentDetailTable());
if (in_array("socios_cuotas", $DetailTblVar) && $GLOBALS["socios_cuotas"]->DetailAdd) {
if (!isset($GLOBALS["socios_cuotas_grid"])) {
$GLOBALS["socios_cuotas_grid"] = new csocios_cuotas_grid();
}
// get detail page object
$GLOBALS["socios_cuotas_grid"]->ValidateGridForm();
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例5: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!$this->idservicio_medico->FldIsDetailKey && !is_null($this->idservicio_medico->FormValue) && $this->idservicio_medico->FormValue == "") {
ew_AddMessage($gsFormError, str_replace("%s", $this->idservicio_medico->FldCaption(), $this->idservicio_medico->ReqErrMsg));
}
if (!$this->costo->FldIsDetailKey && !is_null($this->costo->FormValue) && $this->costo->FormValue == "") {
ew_AddMessage($gsFormError, str_replace("%s", $this->costo->FldCaption(), $this->costo->ReqErrMsg));
}
if (!ew_CheckNumber($this->costo->FormValue)) {
ew_AddMessage($gsFormError, $this->costo->FldErrMsg());
}
// Validate detail grid
$DetailTblVar = explode(",", $this->getCurrentDetailTable());
if (in_array("doctor_servicio_medico_prestado", $DetailTblVar) && $GLOBALS["doctor_servicio_medico_prestado"]->DetailAdd) {
if (!isset($GLOBALS["doctor_servicio_medico_prestado_grid"])) {
$GLOBALS["doctor_servicio_medico_prestado_grid"] = new cdoctor_servicio_medico_prestado_grid();
}
// get detail page object
$GLOBALS["doctor_servicio_medico_prestado_grid"]->ValidateGridForm();
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例6: ValidateForm
function ValidateForm()
{
global $gsFormError, $Orders;
// Initialize
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if ($Orders->CustomerID->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Customer";
}
if (!ew_CheckInteger($Orders->TransactionNumber->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect integer - Transaction Number";
}
if ($Orders->DateOrdered->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Date Ordered";
}
if (!ew_CheckUSDate($Orders->DateOrdered->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect date, format = mm/dd/yyyy - Date Ordered";
}
if ($Orders->Total->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Total";
}
if (!ew_CheckNumber($Orders->Total->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect floating point number - Total";
}
if ($Orders->DeliveryDate->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Delivery Date";
}
if (!ew_CheckUSDate($Orders->DeliveryDate->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect date, format = mm/dd/yyyy - Delivery Date";
}
if ($Orders->Timestamp->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Timestamp";
}
if (!ew_CheckUSDate($Orders->Timestamp->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect date, format = mm/dd/yyyy - Timestamp";
}
if (!ew_CheckInteger($Orders->Sequence->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect integer - Sequence";
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= $sFormCustomError;
}
return $ValidateForm;
}
示例7: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckEuroDate($this->fecha->FormValue)) {
ew_AddMessage($gsFormError, $this->fecha->FldErrMsg());
}
if (!ew_CheckNumber($this->iva->FormValue)) {
ew_AddMessage($gsFormError, $this->iva->FldErrMsg());
}
if (!ew_CheckNumber($this->Importe->FormValue)) {
ew_AddMessage($gsFormError, $this->Importe->FldErrMsg());
}
if (!ew_CheckInteger($this->id_hoja_mantenimiento->FormValue)) {
ew_AddMessage($gsFormError, $this->id_hoja_mantenimiento->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例8: ValidateSearch
function ValidateSearch()
{
global $gsSearchError;
// Initialize
$gsSearchError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return TRUE;
}
if (!ew_CheckRange($this->mes->AdvancedSearch->SearchValue, 1, 12)) {
ew_AddMessage($gsSearchError, $this->mes->FldErrMsg());
}
if (!ew_CheckRange($this->anio->AdvancedSearch->SearchValue, 2012, 2100)) {
ew_AddMessage($gsSearchError, $this->anio->FldErrMsg());
}
if (!ew_CheckEuroDate($this->fecha->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $this->fecha->FldErrMsg());
}
if (!ew_CheckNumber($this->monto->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $this->monto->FldErrMsg());
}
// Return validate result
$ValidateSearch = $gsSearchError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsSearchError, $sFormCustomError);
}
return $ValidateSearch;
}
示例9: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckNumber($this->porcentaje_comision->FormValue)) {
ew_AddMessage($gsFormError, $this->porcentaje_comision->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例10: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!$this->idinternado->FldIsDetailKey && !is_null($this->idinternado->FormValue) && $this->idinternado->FormValue == "") {
ew_AddMessage($gsFormError, str_replace("%s", $this->idinternado->FldCaption(), $this->idinternado->ReqErrMsg));
}
if (!$this->idcuenta->FldIsDetailKey && !is_null($this->idcuenta->FormValue) && $this->idcuenta->FormValue == "") {
ew_AddMessage($gsFormError, str_replace("%s", $this->idcuenta->FldCaption(), $this->idcuenta->ReqErrMsg));
}
if (!ew_CheckEuroDate($this->fecha->FormValue)) {
ew_AddMessage($gsFormError, $this->fecha->FldErrMsg());
}
if (!$this->costo->FldIsDetailKey && !is_null($this->costo->FormValue) && $this->costo->FormValue == "") {
ew_AddMessage($gsFormError, str_replace("%s", $this->costo->FldCaption(), $this->costo->ReqErrMsg));
}
if (!ew_CheckNumber($this->costo->FormValue)) {
ew_AddMessage($gsFormError, $this->costo->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例11: ValidateForm
function ValidateForm()
{
global $Language, $gsFormError, $t_produits_stockage;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!is_null($t_produits_stockage->produit->FormValue) && $t_produits_stockage->produit->FormValue == "") {
ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $t_produits_stockage->produit->FldCaption());
}
if (!ew_CheckInteger($t_produits_stockage->produit->FormValue)) {
ew_AddMessage($gsFormError, $t_produits_stockage->produit->FldErrMsg());
}
if (!is_null($t_produits_stockage->stockage->FormValue) && $t_produits_stockage->stockage->FormValue == "") {
ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $t_produits_stockage->stockage->FldCaption());
}
if (!is_null($t_produits_stockage->quantite->FormValue) && $t_produits_stockage->quantite->FormValue == "") {
ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $t_produits_stockage->quantite->FldCaption());
}
if (!ew_CheckNumber($t_produits_stockage->quantite->FormValue)) {
ew_AddMessage($gsFormError, $t_produits_stockage->quantite->FldErrMsg());
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsFormError, $sFormCustomError);
}
return $ValidateForm;
}
示例12: ValidateForm
function ValidateForm()
{
global $gsFormError, $Items;
// Initialize
$gsFormError = "";
if (!ew_CheckFileType($Items->Image->Upload->FileName)) {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "File type is not allowed.";
}
if ($Items->Image->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0) {
if ($Items->Image->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, "Max. file size (%s bytes) exceeded.");
}
}
if (!ew_CheckFileType($Items->PDF->Upload->FileName)) {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "File type is not allowed.";
}
if ($Items->PDF->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0) {
if ($Items->PDF->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, "Max. file size (%s bytes) exceeded.");
}
}
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if ($Items->MenuID->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Menu";
}
if ($Items->ItemName->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Item Name";
}
if ($Items->Description->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Description";
}
if (!ew_CheckNumber($Items->Price->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect floating point number - Price";
}
if ($Items->Vegetarian->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Vegetarian";
}
if (!ew_CheckNumber($Items->Vegetarian_Price->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect floating point number - Vegetarian Price";
}
if ($Items->Sequence->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Sequence";
}
if (!ew_CheckRange($Items->Sequence->FormValue, 0, 65535)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Number must be between 0 and 65535 - Sequence";
}
if ($Items->Active->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Active";
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= $sFormCustomError;
}
return $ValidateForm;
}
示例13: ValidateForm
function ValidateForm()
{
global $gsFormError, $OrderDetails;
// Initialize
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return $gsFormError == "";
}
if (!ew_CheckInteger($OrderDetails->OrderID->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect integer - Order ID";
}
if ($OrderDetails->CustomerID->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Customer";
}
if ($OrderDetails->ItemID->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Item Name";
}
if ($OrderDetails->Count->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Regular Servings";
}
if (!ew_CheckRange($OrderDetails->Count->FormValue, 0, 65535)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Number must be between 0 and 65535 - Regular Servings";
}
if ($OrderDetails->VegCount->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Vegetarian Servings";
}
if (!ew_CheckInteger($OrderDetails->VegCount->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect integer - Vegetarian Servings";
}
if ($OrderDetails->Amount->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Amount";
}
if (!ew_CheckNumber($OrderDetails->Amount->FormValue)) {
if ($gsFormError != "") {
$gsFormError .= "<br>";
}
$gsFormError .= "Incorrect floating point number - Amount";
}
if ($OrderDetails->Chefs_Tasting->FormValue == "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= "Please enter required field - Chefs Tasting";
}
// Return validate result
$ValidateForm = $gsFormError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
$gsFormError .= $gsFormError != "" ? "<br>" : "";
$gsFormError .= $sFormCustomError;
}
return $ValidateForm;
}
示例14: ValidateSearch
function ValidateSearch()
{
global $gsSearchError, $t_produits_vins;
// Initialize
$gsSearchError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE) {
return TRUE;
}
if (!ew_CheckInteger($t_produits_vins->id->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->id->FldErrMsg());
}
if (!ew_CheckInteger($t_produits_vins->vin->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->vin->FldErrMsg());
}
if (!ew_CheckInteger($t_produits_vins->millesime->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->millesime->FldErrMsg());
}
if (!ew_CheckInteger($t_produits_vins->code->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->code->FldErrMsg());
}
if (!ew_CheckNumber($t_produits_vins->prix_vente->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->prix_vente->FldErrMsg());
}
if (!ew_CheckNumber($t_produits_vins->prix_achat->AdvancedSearch->SearchValue)) {
ew_AddMessage($gsSearchError, $t_produits_vins->prix_achat->FldErrMsg());
}
// Return validate result
$ValidateSearch = $gsSearchError == "";
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError != "") {
ew_AddMessage($gsSearchError, $sFormCustomError);
}
return $ValidateSearch;
}
示例15: ew_CheckRange
function ew_CheckRange($value, $min, $max)
{
if (strval($value) == "") {
return TRUE;
}
if (!ew_CheckNumber($value)) {
return FALSE;
}
return ew_NumberRange($value, $min, $max);
}