static function deleteImageById($imageId) { $imageLink = ImageDBUtils::getImageLinkByImageId($imageId); $originalImageLink = ImageDBUtils::getOriginalImageLinkByImageId($imageId); ImageDBUtils::deleteImageById($imageId); @unlink(ABSPATH . $imageLink); @unlink(ABSPATH . $originalImageLink); }
if ($index % 2 == 0) { ?> grey_block<?php } else { ?> white_block<?php } ?> "> <div class="container stock-info"> <div class="col"> <div class="col-sm-3"> <div class="inner-container image"> <div class="inner-image-block"> <img src="<?php echo get_site_url() . ImageDBUtils::getImageLinkByImageId($stock->image_id); ?> " class="img-thumbnail stock-image" alt="<?php echo $stock->name; ?> "> </div> </div> <?php if (is_user_logged_in()) { ?> <div class="inner-container edit"> <a href="<?php echo esc_url(home_url('/edit-stock-page-controller.php?stock_id=' . $stock->stock_id)); ?> "><span class="label label-warning">Редактировать</span></a>
require_once ABSPATH . WPINC . '/lib/model/orphanage/class-orphanage.php'; require_once ABSPATH . WPINC . '/lib/model/orphanage/class-orphanage-priority.php'; require_once ABSPATH . WPINC . '/lib/model/orphanage_settings/class-orphanage-settings.php'; require_once ABSPATH . WPINC . '/lib/utils/db/class-needy-item-settings-db-utils.php'; $avatar = ""; $name = ""; $orphanagePriority = OrphanagePriority::DEFAULT_PRIORITY; $shortDescription = ""; $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">
float_right<?php } ?> "> <?php foreach ($subNeedyItems as $needyItem) { ?> <div class="needy-item"> <div class="view fifth-effect needy-image-container"> <div class="view"> <a href="<?php echo esc_url(home_url('/needy_info?needy_id=' . $needyItem->needy_id . '&"needy_type=' . $needyItem->needy_type)); ?> " title="Подробная информация"> <img src="<?php echo get_site_url() . ImageDBUtils::getImageLinkByImageId($needyItem->image_id); ?> " alt="<?php echo $needyItem->name; ?> "/> </a> </div> <div class="view status-overlay <?php if (NeedyItemUtils::isItemSupportStatus($needyItem)) { echo NeedyStatus::getNeedyClassByStatuses($needyItem->status); } ?> "> <a href="<?php echo esc_url(home_url('/needy_info?needy_id=' . $needyItem->needy_id . '&"needy_type=' . $needyItem->needy_type));
<?php if (is_user_logged_in()) { ?> <div class="inner-container edit"> <a href="<?php echo esc_url(home_url($editPageController)); ?> "><span class="label label-warning">Редактировать</span></a> </div> <?php } ?> <div class="inner-container image"> <div class="inner-image-block"> <img src="<?php echo get_site_url() . ImageDBUtils::getImageLinkByImageId($child->image_id); ?> " class="img-thumbnail child-image" alt="<?php echo $child->name; ?> "> </div> <div class="view status-overlay <?php if (NeedyItemUtils::isItemSupportStatus($child)) { echo NeedyStatus::getNeedyClassByStatuses($child->status); } ?> "> <img src="<?php echo get_template_directory_uri(); ?>