/** * get the user name from post */ if (empty($_POST['Ownership'])) { $errors[] = "Ownership Should be filled"; } else { $Name = $_POST['Ownership']; } if (empty($_POST['Ownership_Amharic'])) { $errors[] = "Ownership should be filled in amharic"; } else { $Name_Amharic = $_POST["Ownership_Amharic"]; } if (empty($errors)) { $Ownership_C = new Ownership($Name, $Name_Amharic); if ($encoder_con->Ownership_Exist($Ownership_C)) { encoder_place_redirect(Error_Type::SAME_REGISTERED_DATA); } $added = $encoder_con->Add_Ownership($Ownership_C); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Ownership_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } }