function ValidateForm() { global $Language, $gsFormError; // Initialize form error message $gsFormError = ""; // Check if validation required if (!EW_SERVER_VALIDATE) { return $gsFormError == ""; } if (!$this->id_actividad->FldIsDetailKey && !is_null($this->id_actividad->FormValue) && $this->id_actividad->FormValue == "") { ew_AddMessage($gsFormError, $Language->Phrase("EnterRequiredField") . " - " . $this->id_actividad->FldCaption()); } if (!ew_CheckEmail($this->mail->FormValue)) { ew_AddMessage($gsFormError, $this->mail->FldErrMsg()); } if (!ew_CheckPhone($this->tel->FormValue)) { ew_AddMessage($gsFormError, $this->tel->FldErrMsg()); } if (!ew_CheckPhone($this->cel->FormValue)) { ew_AddMessage($gsFormError, $this->cel->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; }
function ValidateForm() { global $Language, $gsFormError; // Initialize form error message $gsFormError = ""; // Check if validation required if (!EW_SERVER_VALIDATE) { return $gsFormError == ""; } if (!$this->usuario->FldIsDetailKey && !is_null($this->usuario->FormValue) && $this->usuario->FormValue == "") { ew_AddMessage($gsFormError, str_replace("%s", $this->usuario->FldCaption(), $this->usuario->ReqErrMsg)); } if (!$this->nombre->FldIsDetailKey && !is_null($this->nombre->FormValue) && $this->nombre->FormValue == "") { ew_AddMessage($gsFormError, str_replace("%s", $this->nombre->FldCaption(), $this->nombre->ReqErrMsg)); } if (!$this->_email->FldIsDetailKey && !is_null($this->_email->FormValue) && $this->_email->FormValue == "") { ew_AddMessage($gsFormError, str_replace("%s", $this->_email->FldCaption(), $this->_email->ReqErrMsg)); } if (!ew_CheckEmail($this->_email->FormValue)) { ew_AddMessage($gsFormError, $this->_email->FldErrMsg()); } if (!ew_CheckPhone($this->cel->FormValue)) { ew_AddMessage($gsFormError, $this->cel->FldErrMsg()); } if ($this->activo->FormValue == "") { ew_AddMessage($gsFormError, str_replace("%s", $this->activo->FldCaption(), $this->activo->ReqErrMsg)); } // Return validate result $ValidateForm = $gsFormError == ""; // Call Form_CustomValidate event $sFormCustomError = ""; $ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError); if ($sFormCustomError != "") { ew_AddMessage($gsFormError, $sFormCustomError); } return $ValidateForm; }
function ValidateForm() { global $gsFormError, $Customers; // Initialize $gsFormError = ""; // Check if validation required if (!EW_SERVER_VALIDATE) { return $gsFormError == ""; } if (!ew_CheckEmail($Customers->zEmail->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect email - Email"; } if ($Customers->Password->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Password"; } if ($Customers->FirstName->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - First Name"; } if ($Customers->LastName->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Last Name"; } if (!ew_CheckPhone($Customers->ContactPhone->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect phone number - Contact Phone"; } if (!ew_CheckZip($Customers->DeliveryZip->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect ZIP code - Delivery Zip"; } if (!ew_CheckZip($Customers->BillingZip->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect ZIP code - Billing Zip"; } if (!ew_CheckPhone($Customers->BillingPhone->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect phone number - Billing Phone"; } if (!ew_CheckInteger($Customers->BillingCardNumber->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect integer - Billing Card Number"; } if (!ew_CheckInteger($Customers->CIMCustID->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect integer - Authorize.net Customer Profile ID"; } if (!ew_CheckInteger($Customers->CIMPymtProfID->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect integer - Authorize.net Payment Profile ID"; } if (!ew_CheckUSDate($Customers->First_Order_Date->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect date, format = mm/dd/yyyy - First Order Date"; } if (!ew_CheckEuroDate($Customers->Last_Order_Date->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect date, format = dd/mm/yyyy - Last Order Date"; } if ($Customers->Total_Orders->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Total Orders"; } if (!ew_CheckInteger($Customers->Total_Orders->FormValue)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Incorrect integer - Total Orders"; } if ($Customers->WeeklyMeals->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Subscription Weekly Meals"; } if (!ew_CheckRange($Customers->WeeklyMeals->FormValue, 0, 255)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Number must be between 0 and 255 - Subscription Weekly Meals"; } if ($Customers->WeeklyReg->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Subscription Regular Meals"; } if (!ew_CheckRange($Customers->WeeklyReg->FormValue, 0, 255)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Number must be between 0 and 255 - Subscription Regular Meals"; } if ($Customers->WeeklyVeg->FormValue == "") { $gsFormError .= $gsFormError != "" ? "<br>" : ""; $gsFormError .= "Please enter required field - Subscription vegetarian Meals"; } if (!ew_CheckRange($Customers->WeeklyVeg->FormValue, 0, 255)) { if ($gsFormError != "") { $gsFormError .= "<br>"; } $gsFormError .= "Number must be between 0 and 255 - Subscription vegetarian Meals"; } // 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; }
function ValidateSearch() { global $gsSearchError; // Initialize $gsSearchError = ""; // Check if validation required if (!EW_SERVER_VALIDATE) { return TRUE; } if (!ew_CheckInteger($this->id->AdvancedSearch->SearchValue)) { ew_AddMessage($gsSearchError, $this->id->FldErrMsg()); } if (!ew_CheckPhone($this->cel->AdvancedSearch->SearchValue)) { ew_AddMessage($gsSearchError, $this->cel->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; }