<?php
!defined('IN_ONEZ') && exit('Access Denied');
$action=onez()->gp('action');
if($action=='delete'){
  $id=(int)onez()->gp('id');
  $G['this']->data()->open('task')->delete("userid='$G[userid]' and id='$id' and key1='new'");
  onez()->ok('删除成功','reload');

}elseif($action=='status'){
  $id=(int)onez()->gp('id');
  $status=onez()->gp('status');
  $T=$G['this']->data()->open('task')->one("userid='$G[userid]' and id='$id'");
  $A['id']=$id;
  $A['change']=($T['key1']!=$status);
  $A['status']=$T['key1'];
  $A['html']=$G['this']->showstatus($T);
  onez()->output($A);

}
$record=array();
$record[]=array('type'=>'desktop','name'=>'电脑客户端(标准)','summary'=>'输入网址，直接生成电脑本地版客户端，或setup安装包。格式为.exe');
$record[]=array('type'=>'desktopnw','name'=>'电脑客户端(Node-webkit)','summary'=>'基于node.js和chromium的应用程序运行环境，直接生成电脑本地版客户端，或setup安装包。格式为.exe');
$record[]=array('type'=>'android','name'=>'安卓客户端','summary'=>'输入网址，生成安卓版手机客户端。格式为.apk');
?>
<style>
.pictext2{
  padding-left: 40px;
  position: relative;
}
.pictext2 img{
  width:32px;height:32px;
  position: absolute;
  left: 0;
  top: 2px;
}
</style>
<div class="panel panel-primary">
	<div class="panel-heading">请选择您要生成的客户端类型</div>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>类型</th>
        <th>描述</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody class="todo-list">
      <?php foreach($record as $rs){?>
      <tr>
        <td style="vertical-align: middle"><?=$rs['name']?></td>
        <td style="vertical-align: middle"><?=$rs['summary']?></td>
        <td style="vertical-align: middle">
          <a href="<?=onez()->href('/index.php?menu=build.'.$rs['type'])?>" class="url-build btn btn-info">
            封装<?=$rs['name']?>
          </a>
        </td>
      </tr>
      <?php }?>
    </tbody>
  </table>
</div>