<div id="centre" class="layout">
    <div class="broadCentre radius5">
        <div class="hd">
            <h3 class="h3">管理预约刷新</h3>
            <p class="more"><a class="link" href="<?php echo $documentation['refresh_project'];?>" target="_blank">使用说明&gt;&gt;</a></p>
        </div>
        <div class="mod">
            <div class="renovateFunBox">
                <div class="forms radius5 clearfix"> 
                    <label class="label">已有方案：</label>
                    <div class="fields">
                        <div class="fgInput ">
                            <div class="nameBtnBox">
                                <?php if(isset($project_arr) && !empty($project_arr)){ ?>
                                <?php foreach($project_arr as $key=>$val){ ?>
                                <?php if($id == $val['id']){ ?>
                                <a href="/reserve/project_manage/<?php echo $val['id'];?>/" class="btn btnCon btnConOn radius5 btnRelative">
                                <em id='<?php echo $val['id'];?>' class="closeItem projectDel" secret_key="<?php echo md5('HOUSE365_PROJECT_DELETE_'.$val['id']);?>" title="<?php echo $val['name'];?>">删除</em><?php echo $val['name'];?></a>
                                <?php }else{ ?>
                                <a href="/reserve/project_manage/<?php echo $val['id'];?>/" class="btn btnCon radius5 btnRelative">
                                <em id='<?php echo $val['id'];?>' class="closeItem projectDel" secret_key="<?php echo md5('HOUSE365_PROJECT_DELETE_'.$val['id']);?>" title="<?php echo $val['name'];?>">删除</em><?php echo $val['name']; ?></a>
                                <?php } ?>
                                <?php }} ?>
                                <?php if( $project_num < $project_max_num){ ?>
                                <a href="/reserve/project_new/" class="btn btnConColor btnColor radius5">新建方案</a>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                </div>
                <form <?php if( $id > 0) { ?> action="/reserve/update_project/"<?php }else{?> action="/reserve/add_project/"<?php } ?>id="project_form" name="project_form" method="post">
                    <div class="forms radius5">
                        <dl class="list">
                            <!---->
                            <dd class="list_item clearfix">
                                <label class="label ">修改名称：</label>
                                <div class="fields nameInput ">
                                    <div class="fgInput jsNameInput jsFgInput">
                                        <label class="labelPrev labelPrevN jslabelPrev" for="jsRenovateInput">最多6个字</label>
                                        <input type="text" id="jsRenovateInput" name="project_name" class="jsRenovateInput input_text w90" value="<?php echo $project_name;?>">
                                    </div>
                                    <div class="fgInput textFgErroy"></div>
                                </div>
                            </dd>
                            <!---->
                            <dd class="list_item clearfix">
                                <label class="label">设定时间：</label>
                                <div class="fields nameInput "> &nbsp; </div>
                            </dd>
                        </dl>
                        <div class="renovateFunTime clearfix"> 
                            <!---->
                            <div class="hourBox clearfix">
                                <div class="name">小时</div>
                                <div id="jsRenovateHour" class="time hour">
                                    <dl>
                                        <dd class="first"><a oid="05" <?php if(isset($ptime_arr['05'])){ ?>class="on"<?php } ?> href="#">05</a></dd>
                                        <dd><a oid="06" <?php if(isset($ptime_arr['06'])){ ?>class="on"<?php } ?> href="#">06</a></dd>
                                        <dd><a oid="07" <?php if(isset($ptime_arr['07'])){ ?>class="on"<?php } ?> href="#">07</a></dd>
                                        <dd><a oid="08" <?php if(isset($ptime_arr['08'])){ ?>class="on"<?php } ?> href="#">08</a></dd>
                                        <dd><a oid="09" <?php if(isset($ptime_arr['09'])){ ?>class="on"<?php } ?> href="#">09</a></dd>
                                        <dd><a oid="10" <?php if(isset($ptime_arr['10'])){ ?>class="on"<?php } ?> href="#">10</a></dd>
                                        <dd><a oid="11" <?php if(isset($ptime_arr['11'])){ ?>class="on"<?php } ?> href="#">11</a></dd>
                                        <dd><a oid="12" <?php if(isset($ptime_arr['12'])){ ?>class="on"<?php } ?> href="#">12</a></dd>
                                        <dd><a oid="13" <?php if(isset($ptime_arr['13'])){ ?>class="on"<?php } ?> href="#">13</a></dd>
                                        <dd><a oid="14" <?php if(isset($ptime_arr['14'])){ ?>class="on"<?php } ?> href="#">14</a></dd>
                                        <dd><a oid="15" <?php if(isset($ptime_arr['15'])){ ?>class="on"<?php } ?> href="#">15</a></dd>
                                        <dd><a oid="16" <?php if(isset($ptime_arr['16'])){ ?>class="on"<?php } ?> href="#">16</a></dd>
                                        <dd><a oid="17" <?php if(isset($ptime_arr['17'])){ ?>class="on"<?php } ?> href="#">17</a></dd>
                                        <dd><a oid="18" <?php if(isset($ptime_arr['18'])){ ?>class="on"<?php } ?> href="#">18</a></dd>
                                        <dd><a oid="19" <?php if(isset($ptime_arr['19'])){ ?>class="on"<?php } ?> href="#">19</a></dd>
                                        <dd><a oid="20" <?php if(isset($ptime_arr['20'])){ ?>class="on"<?php } ?> href="#">20</a></dd>
                                        <dd><a oid="21" <?php if(isset($ptime_arr['21'])){ ?>class="on"<?php } ?> href="#">21</a></dd>
                                        <dd><a oid="22" <?php if(isset($ptime_arr['22'])){ ?>class="on"<?php } ?> href="#">22</a></dd>
                                        <dd class="last"><a oid="23" <?php if(isset($ptime_arr['23'])){ ?>class="on"<?php } ?> href="#">23</a></dd>
                                        <!--<dd class="last"><a oid="24" <?php if(isset($ptime_arr['24'])){ ?>class="on"<?php } ?> href="#">24</a></dd>-->
                                    </dl>
                                </div>
                                <!----> 
                            </div>
                            <!---->
                            <div id="jsRenovateMinuteBox" class="minuteBox clearfix " <?php if($project_times_num <= 0){ ?>style="display:none;"<?php } ?>>
                                 <div class="name">分钟</div>
                                <div id="jsRenovateMinute" class="time minute">
                                    <?php if($project_times_num > 0){ ?>
                                    <?php foreach($ptime_arr as $key=>$val){ ?>
                                    <dl class="<?php echo $key;?>">
                                        <dt><?php echo $key;?></dt>
                                        <dd><a href="#" <?php if(isset($val['00']) && $val['00'] == '00'){ ?>class="on"<?php } ?>>00</a></dd>
                                        <dd class="mr49"><a href="#" <?php if(isset($val['05']) && $val['05'] == '05'){ ?>class="on"<?php } ?>>05</a></dd>
                                        <dd><a href="#" <?php if(isset($val['10']) && $val['10'] == '10'){ ?>class="on"<?php } ?>>10</a></dd>
                                        <dd><a href="#" <?php if(isset($val['15']) && $val['15'] == '15'){ ?>class="on"<?php } ?>>15</a></dd>
                                        <dd><a href="#" <?php if(isset($val['20']) && $val['20'] == '20'){ ?>class="on"<?php } ?>>20</a></dd>
                                        <dd class="mr50"><a href="#" <?php if(isset($val['25']) && $val['25'] == '25'){ ?>class="on"<?php } ?>>25</a></dd>
                                        <dd><a href="#" <?php if(isset($val['30']) && $val['30'] == '30'){ ?>class="on"<?php } ?>>30</a></dd>
                                        <dd><a href="#" <?php if(isset($val['35']) && $val['35'] == '35'){ ?>class="on"<?php } ?>>35</a></dd>
                                        <dd><a href="#" <?php if(isset($val['40']) && $val['40'] == '40'){ ?>class="on"<?php } ?>>40</a></dd>
                                        <dd class="mr49"><a href="#" <?php if(isset($val['45']) && $val['45'] == '45'){ ?>class="on"<?php } ?>>45</a></dd>
                                        <dd><a href="#" <?php if(isset($val['50']) && $val['50'] == '50'){ ?>class="on"<?php } ?>>50</a></dd>
                                        <dd class="mr0"><a href="#" <?php if(isset($val['55']) && $val['55'] == '55'){ ?>class="on"<?php } ?>>55</a></dd>
                                    </dl>
                                    <?php }} ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!---->
                    <div class="forms radius5 clearfix ">
                        <label class="label label2">预约房源</label>
                        <div class="fields">
                            <div class="fgInput tjNumendBox"> 
                                <p class="textFg textFg2">&nbsp;</p>
                                当前选择此预约刷新方案的房源条数：<span id="jsHouseNumber" class="color"><?php echo $project_houses_num;?></span>条
                                <span class="f">|</span>方案时间点：<span id="jsTimeNumber" class="color"><?php echo $project_times_num;?></span>个
                            </div>
                        </div>
                        <div id="jsHouseBoxFunction" class="houseBoxFunction clear">
                            <?php if( $project_houses_num > 0){
							
							?>
                            <?php foreach($project_houses_arr as $val){ ?>
                            <div class="houseItem houseItem_info">
                                <div class="houseItemInner">
                                    <a href="<?php echo $val['houseinfo']['url'];?>" class="houseLink"> 
                                        <em class="jsCloseItem closeItem" title="删除" id="<?php echo $val['houseinfo']['tbl'];?><?php echo $val['houseinfo']['rowid'];?>">关闭</em> 
                                        <span class="innr name"><?php echo csubstr2($val['houseinfo']['blockshowname'], 18); ?>
                                            <em style="font-weight:normal;margin-left:10px;">(<?php $nowtime = time(); $days = ceil(($val['endtime']-$nowtime)/86400);  echo $days >0 ? $days.'天' : '已到期'; ?>)</em>
                                        </span> 
                                        <span class="innr">
                                            <?php echo $val['houseinfo']['room'];?>室<?php echo $val['houseinfo']['hall'];?>厅   
                                            <?php echo $val['houseinfo']['buildarea'];?>㎡  
											<?php echo $val['houseinfo']['price'];?>
                                            <?php echo $val['houseinfo']['price_unit']; ?>
                                        </span> 
                                    </a> 
                                </div>
                                <input type="hidden" name="housearr[]" value="<?php echo $val['tbl'];?>-<?php echo $val['rowid'];?>-<?php echo $val['starttime'];?>-<?php echo $val['endtime'];?>" />
                            </div>
                            <?php }} ?>
                            <div class="houseItem">
                                <a class="addHouseLink" href="/sell/manage/active/"><span class="add">+</span>添加新房源 </a> 
                            </div>
                        </div>
                        <div id="jsPicDepotSZBtn" class="picDepotSZ">
                            <p class="jsZK innerSZ">展开房源</p>
                            <p class="jsSQ innerSZ innerSZ2">收起房源</p>
                        </div>
                    </div>
                    <!---->
                    <div class="renovateFunBtn clearfix"> 
                        <a href="#save" class="btn savebutton btn2 btnConColor radius5">保存并应用</a> 
                        <a href="/sell/manage/active/" class="btn btn3 btnCon radius5">返回房源管理</a>
                    </div>
                    <input type="hidden" id="jaRenovateHourHide" name="project_times" value="<?php echo $project_times_str;?>" />
                    <?php if( $id > 0) { ?>
                    <input type="hidden" name="pid" value="<?php echo $id;?>" />
                    <input type="hidden" name="action"  value="update_project" />
                    <input type="hidden" name="secret_key"  value="<?php echo md5('HOUSE365_PROJECT_UPDATE_'.$id);?>" />
                    <?php }else{ ?>
                    <input type="hidden" name="secret_key"  value="<?php echo md5('HOUSE365_PROJECT_UPDATE_'.$id);?>" />
                    <?php } ?>
                </form>
            </div>
        </div>
    </div>
</div>

<!--弹出层-->
<div id="jsDialog" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text"> </div>
    </div>
</div>


<!--弹出层-->
<div id="jsProjectDel" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text">确定要删除“<span id='jsProjectDel_name' style='color:blue;'>新的方案</span>”预约刷新方案吗？</div>
        <div style="padding:20px 0 0 65px;">
            <a href="####" class="btn delproject btnConColor radius5 close-win">确定</a>
            <a href="####" class="btn btnCon radius5 close-win">取消</a>
            <input type="hidden" id='pid' name='pid' value="" />
            <input type="hidden" id='secret_key' name='secret_key' value="" />
        </div>
    </div>
</div>

<!--弹出层-->
<div id="jsDialogDel" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text">确定将该房源从此预约刷新方案中删除？&nbsp;(保存后生效)</div>
        <div style="padding:20px 0 0 65px;"><a href="####" class="btn delhfp btnConColor radius5 close-win">确定</a><a href="####" class="btn btnCon radius5 close-win">取消</a><input type="hidden" id="delhfp_tex" value="" /></div>
    </div>
</div>

<!--弹出层-->
<div id="jsDialogSave" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialogSaveDiv">确定保存该预约刷新方案？</div>
        <div style="padding:20px 0 0 65px;"><a href="####" class="btn savePrjoect btnConColor radius5 close-win">确定</a><a href="####" class="btn btnCon radius5 close-win">取消</a><input type="hidden" id="delhfp_tex" value="" /></div>
    </div>
</div>

<!--页面处理中弹层-->
<div style="display:none; text-align: center;" id ='docation_loading'>
    <img src ="<?php echo STATIC_SOURCE_URL; ?>/common/images/loading_6.gif">
    <p style="font-size: 16px; font-family:'微软雅黑'; line-height: 30px; color: #fff;">正在处理</p>
</div>

<!--操作结果弹出提示框-->
<div id="dialogts" class="dialog radius5">
    <div class="hd">
        <h3 class="h3">提示</h3>
        <span title="关闭" class="close close-win">&Chi;</span> </div>
    <div class="mod">
        <div class="text" id="dialog_tip"></div>
    </div>
</div>