Esempio n. 1
0
 function UploadAllowedFileExt($filename)
 {
     return ew_CheckFileType($filename);
 }
Esempio n. 2
0
 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;
 }
 function ValidateForm()
 {
     global $gsFormError, $ItemDetails;
     // Initialize
     $gsFormError = "";
     if (!ew_CheckFileType($ItemDetails->Image->Upload->FileName)) {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "File type is not allowed.";
     }
     if ($ItemDetails->Image->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0) {
         if ($ItemDetails->Image->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 == "";
     }
     // 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 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;
 }
Esempio n. 5
0
 function ValidateForm()
 {
     global $gsFormError, $exam_data;
     // Initialize
     $gsFormError = "";
     if (!ew_CheckFileType($exam_data->Soap->Upload->FileName)) {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "File type is not allowed.";
     }
     if ($exam_data->Soap->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0) {
         if ($exam_data->Soap->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 ($exam_data->ExamDataNo->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Exam Data No";
     }
     if (!ew_CheckInteger($exam_data->ExamDataNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Exam Data No";
     }
     if ($exam_data->PatientMainNo->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Patient Main No";
     }
     if (!ew_CheckInteger($exam_data->PatientMainNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Patient Main No";
     }
     if ($exam_data->InstitutionNo->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Institution No";
     }
     if (!ew_CheckInteger($exam_data->InstitutionNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Institution No";
     }
     if (!ew_CheckInteger($exam_data->ImageDetailNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Image Detail No";
     }
     if (!ew_CheckInteger($exam_data->PatientKindNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Patient Kind No";
     }
     if ($exam_data->PatientSubKindNo->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Patient Sub Kind No";
     }
     if (!ew_CheckInteger($exam_data->PatientSubKindNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Patient Sub Kind No";
     }
     if (!ew_CheckInteger($exam_data->PatientTypeNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Patient Type No";
     }
     if (!ew_CheckInteger($exam_data->DepartmentNo->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect integer - Department No";
     }
     if (!ew_CheckDate($exam_data->SpecialExamDate->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect date, format = yyyy/mm/dd - Special Exam Date";
     }
     if ($exam_data->ExamDate->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Exam Date";
     }
     if (!ew_CheckDate($exam_data->ExamDate->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect date, format = yyyy/mm/dd - Exam Date";
     }
     if ($exam_data->ExamTime->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Exam Time";
     }
     if (!ew_CheckTime($exam_data->ExamTime->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect time (hh:mm:ss) - Exam Time";
     }
     if ($exam_data->LogDate->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Log Date";
     }
     if (!ew_CheckDate($exam_data->LogDate->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect date, format = yyyy/mm/dd - Log Date";
     }
     if (!ew_CheckDate($exam_data->ModifyDate->FormValue)) {
         if ($gsFormError != "") {
             $gsFormError .= "<br>";
         }
         $gsFormError .= "Incorrect date, format = yyyy/mm/dd - Modify Date";
     }
     if ($exam_data->CreatePart->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Create Part";
     }
     if ($exam_data->ModifyPart->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Modify Part";
     }
     if ($exam_data->Status->FormValue == "") {
         $gsFormError .= $gsFormError != "" ? "<br>" : "";
         $gsFormError .= "Please enter required field - Status";
     }
     // 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;
 }