static function validateBaseChildParameters($parameters)
 {
     return isset($parameters[Child::NAME_FIELD]) && ValidateHelper::validateTextField($parameters[Child::NAME_FIELD], Child::MIN_NAME_LENGTH, Child::MAX_NAME_LENGTH) && (isset($parameters[Child::SHORT_DESCRIPTION_FIELD]) && ValidateHelper::validateTextField($parameters[Child::SHORT_DESCRIPTION_FIELD], Child::MIN_SHORT_DESCRIPTION_LENGTH, Child::MAX_SHORT_DESCRIPTION_LENGTH)) && (isset($parameters[Child::LONG_DESCRIPTION_FIELD]) && ValidateHelper::validateTextField($parameters[Child::LONG_DESCRIPTION_FIELD], Child::MIN_LONG_DESCRIPTION_LENGTH, Child::MAX_LONG_DESCRIPTION_LENGTH)) && (isset($parameters[Child::CONTACT_INFO_FIELD]) && ValidateHelper::validateTextField($parameters[Child::CONTACT_INFO_FIELD], Child::MIN_CONTACT_LENGTH, Child::MAX_CONTACT_LENGTH)) && (isset($parameters[Child::STATUS_FIELD]) && ValidateHelper::validateSelectField($parameters[Child::STATUS_FIELD], ChildStatus::getNeedyStatuses())) && (isset($parameters[Child::PRIORITY_FIELD]) && ValidateHelper::validateNumberField($parameters[Child::PRIORITY_FIELD], ChildPriority::MIN_PRIORITY, ChildPriority::MAX_PRIORITY));
 }
Ejemplo n.º 2
0
if (isset($child)) {
    $avatar = "<img src='" . get_site_url() . ImageDBUtils::getImageLinkByImageId($child->image_id) . "' class='file-preview-image' alt='avatar' title='avatar'>";
    $name = $child->name;
    $childStatus = $child->status;
    $childPriority = $child->priority;
    $shortDescription = $child->short_description;
    $longDescription = $child->long_description;
    $contactInfo = $child->contact_info;
    $purpose = $child->purpose;
    $showStat = NeedyItemSettingsDBUtils::isSetShowChildStat($child->child_id);
    $additionAmountObj = NeedyItemSettingsDBUtils::getAdditionAmount($child->child_id, NeedyType::CHILD);
    $additionAmount = $additionAmountObj->addition_amount;
    $formRequestUrl = "/edit-child-controller.php";
}
$childStatusesText = ChildStatus::getNeedyStatusesText();
$childStatuses = implode(",", ChildStatus::getNeedyStatuses());
get_header();
?>

<div class="child-form">
    <div class="container">
        <div id="kv-avatar-errors" class="center-block" style="width:800px;display:none"></div>
        <form name="child_form" action="<?php 
echo esc_url(home_url($formRequestUrl));
?>
" method="post" enctype="multipart/form-data">
            <div class="col">
                <div class="col-md-3">
                    <div class="form-group kv-avatar">
                        <div class="alert alert-danger" style="display: none;">Аватар не выбран.</div>
                        <input id="<?php