index.php 3.71 KB
<?php $this->_extends('layout/admin_layout');?>
<?php $this->_block('main');?>
<ul class="nav nav-tabs">
  <li <?php echo $this->view->type == 1 ? 'class="active"' :''; ?>>
  		<a href="/admin/index/index/type/1">banner列表</a>
  </li>
  <li <?php echo $this->view->type == 2 ? 'class="active"' :'';?>>
  		<a href="/admin/index/index/type/2">右侧广告</a>
  </li>
  <li <?php echo $this->view->type == 3 ? 'class="active"' :'';?>>
  		<a href="/admin/index/index/type/3">品牌广告位</a>
  </li>
  <li <?php echo $this->view->type == 4 ? 'class="active"' :'';?>>
  		<a href="/admin/index/index/type/4">详情页广告位</a>
  </li>  
</ul>
<table class="table">
<caption style="text-align:left; padding-bottom:5px;">
    <button class="btn" style="float:left;" id="add_index" href="javascript:void(0)">添加
    <?php echo $this->view->typeDescription[$this->view->type];?></button>
</caption>
   <thead>
      <td width="10%">编号</td>
      <td width="25%">标题</td>
      <td width="15%">排序 (值越大,排序越靠前)</td>
      <td width="15%">图片</td>
      <td width="25%">链接</td>
      <td width="20%">操作</td>
   </thead>
   <?php if (empty($this->view->data)) :?>
   <tr><td colspan="10" style="text-align: center">无记录</td></tr>
   <?php else :?>
   
   <?php foreach ($this->view->data as $index) :?>
       <tr>
           <td><?php echo $index['id']?></td>
           <td><?php echo $index['text']?></td>
           <td><?php echo $index['sort']?></td>
           <td relaurl="<?php echo $index['res'];?>">
             <img width="80" height="60" src="<?php echo Lib_Images::getImageUrl($index['res'],'0200x0150','fragmentimg');?>"/>
           </td>
           <td style="table-layout:fixed;word-break:break-all;"><?php echo $index['url'];?></td>
           <td><button id="look_one_<?php echo $index['id'];?>" class="btn look">查看</button><button val="<?php echo $index['id'];?>" class="btn btn-danger del">删除</button></td>
       </tr>
   <?php endforeach;?>
   <?php endif;?>
</table>
 
 <div id="form_pan" admin="<?php echo $this->view->admin?>" style="display:none">
       <table class="table table-bordered">
          <tbody>
             <tr>
              <td>标题<span class="text-error"> * </span></td>
              <td colspan="3">
                 <input type="hidden" id="id" name="id"/>
                 <input type="text" style="width:605px;"  id="text" name="text" value=""/>
              </td>
             </tr>
             <tr>
              <td>链接地址<span class="text-error"> * </span></td>
              <td colspan="3">
                 <textarea row=1 style="width:605px;"  id="url" name="url" value=""></textarea>
              </td>
              </tr>
             <tr>
              <td>图片
                 <?php echo sprintf('(%s)', $this->view->sizeDescription[$this->view->type]);?></td>
              <td colspan="3"> 
                <span id="upload_pic"></span>
                <button class="btn btn-info" type="button">上传</button>
                <input type="hidden" id="res" name="res" key="<?php echo $this->view->key;?>"/>
                <img src="" width="80" height="60"/>
              </td>
            </tr>
            <tr>
              <td>排序</td>
              <td colspan="3"> 
     			 <input type="text" style="width:605px;"  id="sort" name="sort" value="0" />
     			 <input type="hidden" name="type" id="type" value="<?php echo $this->view->type;?>" />
              </td>
            </tr>
          </tbody>
    </table>
</div>
<?php $this->_endblock();?>

<?php $this->_block('js');?>
<?php $this->_js('index.js', array(
    SITE_JS . '/lib/seajs.js',
));?>
<script type="text/javascript">
seajs.use('admin/index');
</script>
<?php $this->_endblock();?>