Ejemplo n.º 1
0
$longDescription = "";
$purpose = "";
$contactInfo = "";
$showStat = false;
$additionAmount = 0.0;
$formRequestUrl = "/add-orphanage-controller.php";
if (isset($orphanage)) {
    $avatar = "<img src='" . get_site_url() . ImageDBUtils::getImageLinkByImageId($orphanage->image_id) . "' class='file-preview-image' alt='avatar' title='avatar'>";
    $name = $orphanage->name;
    $orphanagePriority = $orphanage->priority;
    $shortDescription = $orphanage->short_description;
    $longDescription = $orphanage->long_description;
    $contactInfo = $orphanage->contact_info;
    $purpose = $orphanage->purpose;
    $showStat = NeedyItemSettingsDBUtils::isSetShowOrphanageStat($orphanage->orphanage_id);
    $additionAmountObj = NeedyItemSettingsDBUtils::getAdditionAmount($child->child_id, NeedyType::ORPHANAGE);
    $additionAmount = $additionAmountObj->addition_amount;
    $formRequestUrl = "/edit-orphanage-controller.php";
}
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="orphanage_form" action="<?php 
echo esc_url(home_url($formRequestUrl));
?>
" method="post" enctype="multipart/form-data">
                <div class="col">
                    <div class="col-md-3">
        if ($needyItem->purpose && $needyItem->status != NeedyStatus::HELPED) {
            ?>
                      <p class="purpose"><span>Нужно: </span><?php 
            echo $needyItem->purpose;
            ?>
</p>
                    <?php 
        }
        ?>

                    <?php 
        if (NeedyItemSettingsDBUtils::isSetShowNeedyItemStat($needyItem->needy_id, $needyItem->needy_type)) {
            ?>
                        <?php 
            $collected = NeedyStatDBUtils::getNeedyItemStat($needyItem->needy_id, $needyItem->needy_type);
            $addition = NeedyItemSettingsDBUtils::getAdditionAmount($needyItem->needy_id, $needyItem->needy_type);
            $result = $collected->amount + $addition->addition_amount;
            ?>
                        <p class="collected"><span>Собрано: </span><?php 
            echo intval($result);
            ?>
 руб. <span class="count-donate"><img src="<?php 
            echo get_template_directory_uri();
            ?>
/images/count_donate.png" alt="" /><?php 
            echo intval($collected->count);
            ?>
</span></p>
                    <?php 
        }
        ?>