index.php 2.74 KB
<?php $this->_extends('layout/admin_layout');?>


<?php $this->_block('main');?>

<h4>SNAP列表</h4>

<table class="table">
<caption style="text-align:left; padding-bottom:5px;">
    <button class="btn" style="float:left;" id="add_snap" href="javascript:void(0)">添加SNAP</button>
    </caption>
   <thead>
      <td>编号</td>
      <td>图片</td>
      <td>文字</td>
      <td>创建时间</td>
      <td>操作</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 $snap) :?>
       <tr>
           <td><?php echo $snap['id']?></td>
           <td>
            <?php 
                   $url = Lib_Images::getImageUrl($snap['pic'],'0200x0150','fragmentimg');
                   echo '<img src="'.$url.'" rel="'.$snap['pic'].'" width="40" height="30">';   
              ?>
           </td>
           <td><?php echo $snap['text']?></td>
           <td><?php echo $snap['create_time'];?></td>
           <td><button id="look_one_<?php echo $snap['id'];?>" class="btn look">编辑</button>
           <button val="<?php echo $snap['id'];?>" class="btn btn-danger del">删除</button>
           </td>
       </tr>
   <?php endforeach;?>
   <?php endif;?>
</table>
<?php $this->_component('Common_Pagination',array(
    'pagination' => $this->view->pagination,'show_count' =>true,
 ));?>
 
 <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>
                  <span id="upload_pics" key="<?php echo $this->view->key;?>"></span>
                  <button class="btn btn-info" type="button">上传</button>
                  <br>
                  <input type="hidden"  id="pic" name="pic" value=""/>
                  <img src=''/>
                  <input type="hidden" id="id" name="id"/>
              </td>
              <td>文本</td>
              <td>
                 <input type="text"  id="text" name="text" value=""/>
              </td>
            </tr>
            <tr>
              <td>创建时间</td>
              <td colspan="3">
                <input type="text" readonly="readonly" class='span3 Wdate' id="create_time" name="create_time" />
              </td>
            </tr>
          </tbody>
    </table>
</div>
<?php $this->_endblock();?>

<?php $this->_block('js');?>
<?php $this->_js('star.js', array(
    SITE_JS . '/lib/seajs.js',
));?>
<script type="text/javascript" src="<?php echo SITE_JS?>/lib/ui/date/WdatePicker.js"></script>
<script type="text/javascript">
seajs.use('admin/snap');
</script>
<?php $this->_endblock();?>