<?php
    $primary_school_name=$item->primary_school_name;
    if(!strstr($primary_school_name,'義務教育学校')){$primary_school_name=str_replace('学校','',$primary_school_name);}
    $primary_school_name2=$item->primary_school_name2;
    if(!strstr($primary_school_name2,'義務教育学校')){$primary_school_name2=str_replace('学校','',$primary_school_name2);}
    $primary_school_name3=$item->primary_school_name3;
    if(!strstr($primary_school_name3,'義務教育学校')){$primary_school_name3=str_replace('学校','',$primary_school_name3);}
    $secondary_school_name=$item->secondary_school_name;
    if(!strstr($secondary_school_name,'義務教育学校')){$secondary_school_name=str_replace('学校','',$secondary_school_name);}
    $secondary_school_name2=$item->secondary_school_name2;
    if(!strstr($secondary_school_name2,'義務教育学校')){$secondary_school_name2=str_replace('学校','',$secondary_school_name2);}
    $secondary_school_name3=$item->secondary_school_name3;
    if(!strstr($secondary_school_name3,'義務教育学校')){$secondary_school_name3=str_replace('学校','',$secondary_school_name3);}
?>

<div class="p-detail-main-sheet__right fright vertical-table-detail">
    <div>
        <table class="p-detail-main-sheet__right-tbl table-striped custom-table">
        <tr>
            <th class="w-100">所在地</th>
        </tr>
        <tr>
            <td class="w-100" class="clearfix" style="height: auto">
                

                <?php echo e($item->address_info); ?>
















            </td>
        </tr>
        <tr>
            <th class="w-100">交通</th>
        </tr>
        <tr>
            <td class="w-100">
                <?php echo $__env->make('business.objects.projects.traffic-info-other', ['article' => $mansion ?? $item], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            </td>
        </tr>
        <tr>
            <th class="w-50">間取り</th>
            <th class="w-50">階数</th>
        </tr>
        <tr>
            <td class="w-50"><?php echo e($item->floor_plan); ?><?php echo e($item->floor_plan_name); ?></td>
            <td class="w-50">
                <?php if($item->underground): ?>
                    地上<?php echo e($item->floor ? $item->floor.'階' : ''); ?>地下<?php echo e($item->underground ? $item->underground.'階' : ''); ?>建
                <?php else: ?>
                    <?php echo e($item->floor ? $item->floor.'階' : ''); ?>建
                <?php endif; ?>
            </td>
        </tr>

        <tr>
            <th class="w-50">構造</th>
            <?php if(empty($mansion)): ?>
                <?php if($item->age_year == null && $item->age_month == null && $item->completed_contract_month != null): ?>
                    <th class="w-50 ">完成予定</th>
                <?php elseif($item->age_year > date("Y") || ($item->age_year == date("Y") && $item->age_month >= date("m") )): ?>
                    <th class="w-50 ">完成予定</th>
                <?php else: ?>
                    <th class="w-50">築年月</th>
                <?php endif; ?>
            <?php else: ?>
                <?php if($mansion->age_year == null && $mansion->age_month == null): ?>
                    <th class="w-50">築年月</th>
                <?php elseif($mansion->age_year > date("Y") || ($mansion->age_year == date("Y") && $mansion->age_month >= date("m") )): ?>
                    <th class="w-50 ">完成予定</th>
                <?php else: ?>
                    <th class="w-50">築年月</th>
                <?php endif; ?>
            <?php endif; ?>
        </tr>

        <tr>
            <td class="w-50">
                <?php echo e($item->construction_name); ?>


                <?php if($item->construction_sub_name != ""): ?>他<?php endif; ?></td>
            </td>
            <?php if(empty($mansion)): ?>
                <?php if($item->age_year == null && $item->age_month == null && $item->completed_contract_month != null): ?>
                    <td class="w-50">契約後<?php echo e($item->completed_contract_month); ?>ヶ月</td>
                <?php elseif($item->age_year > date("Y") || ($item->age_year == date("Y") && $item->age_month >= date("m") )): ?>
                    <td class="w-50"><?php echo e($item->age_year?? "-"); ?>年<?php echo e($item->age_month?? "-"); ?>月<?php echo e($item->completed_text??''); ?></td>
                <?php else: ?>
                    <td class="w-50"><?php echo e($item->age_year?? "-"); ?>年<?php echo e($item->age_month?? "-"); ?>月<?php echo e($item->completed_text??''); ?></td>
                <?php endif; ?>
            <?php else: ?>
                <?php if($mansion->age_year == null && $mansion->age_month == null): ?>
                    <td class="w-50">-</td>
                <?php elseif($mansion->age_year > date("Y") || ($mansion->age_year == date("Y") && $mansion->age_month >= date("m") )): ?>
                    <td class="w-50"><?php echo e($mansion->age_year?? "-"); ?>年<?php echo e($mansion->age_month?? "-"); ?>月<?php echo e($item->completed_text??''); ?></td>
                <?php else: ?>
                    <td class="w-50"><?php echo e($mansion->age_year?? "-"); ?>年<?php echo e($mansion->age_month?? "-"); ?>月<?php echo e($item->completed_text??''); ?></td>
                <?php endif; ?>
            <?php endif; ?>
        </tr>

        <tr>
            <th class="w-50 ">土地面積</th>
            <th class="w-50 ">建物面積</th>
        </tr>
        <tr>
            <td class="w-50"><?php echo e($item->land_area_val); ?>&nbsp;m&sup2;</td>
            <td class="w-50"><?php echo e($item->total_area_val); ?>&nbsp;m&sup2;</td>
        </tr>



        <tr>
            <th class="w-50 ">建ぺい率</th>
            <th class="w-50 ">容積率</th>

        </tr>
        <tr>
            <td class="w-50"><?php echo e($item->building_rate?? '-'); ?>%</td>
            <td class="w-50"><?php echo e($item->volume_rate?? '-'); ?>%</td>
        </tr>


        <tr>
            <th class="w-50">現況</th>
            <th class="w-50">引渡し</th>
        </tr>

        <tr>
            <td class="w-50" >
                <?php echo e(getCurrentStatusName($item->current_status, $item->property)); ?>

                <?php if(getCurrentStatusName($item->current_status, $item->property)=='賃貸中' and ($item->current_status_val or $item->current_status_rate)): ?>
                    （
                    <?php if($item->current_status_val): ?>賃料：<?php echo e(number_format(is_numeric($item->current_status_val) ? $item->current_status_val : intval(str_replace(',', '', $item->current_status_val)), 0, ",", ",")); ?>円/月　<?php endif; ?>
                    <?php if($item->current_status_rate): ?>利回り：<?php echo e($item->current_status_rate); ?>％<?php endif; ?>
                    ）
                <?php endif; ?>
            </td>
            <td class="w-50">
                <?php if($item->move_in == 1): ?>
                    即
                <?php elseif($item->move_in == 2): ?>
                    相談
                <?php elseif($item->move_in == 3): ?>
                    <?php echo e($item->move_in_year); ?>年<?php echo e($item->move_in_month); ?>月
                <?php elseif($item->move_in == 4): ?>
                    契約後<?php echo e($item->move_in_contract_month); ?>ヶ月
                <?php elseif($item->move_in == 5): ?>
                    不明
                <?php else: ?>
                    -
                <?php endif; ?>
                
            </td>
        </tr>

        <?php if($item->property_sub === \App\Models\MstPropertyType::NEW): ?>
            <tr>
                <th class="w-50 ">私道負担</th>
                <th class="w-50 ">建築確認</th>
            </tr>
            <tr>
                <td class="w-50"><?php echo e($item->getRoadBurdenName()); ?></td>
                <td class="w-50"><?php echo e($item->architecture_no ?? '-'); ?> </td>
            </tr>
        <?php else: ?>
            <tr>
                <th class="w-100">私道負担</th>
            </tr>
            <tr>
                <td class="w-100"><?php echo e($item->getRoadBurdenNamePrint()); ?></td>
            </tr>
        <?php endif; ?>

        <tr>
            <th class="w-100">用途地域</th>
        </tr>
        <tr>
            <td class="w-100">
                <?php echo e($item->use_area_name??'-'); ?><?php if($item->use_area_name != "" || $item->use_area_name != null): ?>
                <?php endif; ?>










                <?php if($item->use_area_name_sub != "" || $item->use_area_name_sub2 != ""): ?>
                    ・他
                <?php endif; ?>

            </td>
        </tr>
    </table>
    </div>
</div>
