<{$toolbar}>


<h2><{$smarty.const._MD_TADASSIGN_SELECT_ASSN}> </h2>

<form class="form-inline" >
  <select  class="form-control " onChange="window.location.href='show.php?assn='+this.value">
    <option value=''><{$smarty.const._MD_TADASSIGN_SELECT_ASSN}></option>
    <{if $select_assn_all}>
      <{foreach from=$select_assn_all item=data}>
        <option value='<{$data.assn}>' <{if $assn==$data.assn}>selected<{/if}>> <{$class_list_c[$data.class_id]}>  -- <{$data.title}> (<{$data.uid_name}>) </option>
      <{/foreach}>
    <{/if}>
  </select>
</form>



  <link rel='stylesheet' type='text/css' href='<{$xoops_url}>/modules/tadtools/css/iconize.css' />
  <script type='text/javascript' src='<{$xoops_url}>/modules/tadtools/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js'></script>
  <script type='text/javascript' language='javascript' src='<{$xoops_url}>/modules/tadtools/fancyBox/source/jquery.fancybox.js?v=2.1.4'></script>
  <link rel='stylesheet' href='<{$xoops_url}>/modules/tadtools/fancyBox/source/jquery.fancybox.css?v=2.1.4' type='text/css' media='screen' />
  <link rel='stylesheet' type='text/css' href='<{$xoops_url}>/modules/tadtools/fancyBox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5' />
  <script type='text/javascript' src='<{$xoops_url}>/modules/tadtools/fancyBox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5'></script>
  <link rel='stylesheet' type='text/css' href='<{$xoops_url}>/modules/tadtools/fancyBox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7' />
  <script type='text/javascript' src='<{$xoops_url}>/modules/tadtools/fancyBox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7'></script>
  <script type='text/javascript' src='<{$xoops_url}>/modules/tadtools/fancyBox/source/helpers/jquery.fancybox-media.js?v=1.0.5'></script>

  <link rel="stylesheet" href="css/star-rating.css" media="all" type="text/css"/>
  <link rel="stylesheet" href="css/theme-krajee-fa.css" media="all" type="text/css"/>

  <script src="css/star-rating.js" type="text/javascript"></script>


<style type="text/css">
  .fancybox-nav {
     width: 20%;
   }
   </style>

  <script type='text/javascript'>
    $(document).ready(function(){
      $(".assignment_fancy_<{$assn}>").fancybox({
      <{if  ($ifram_show) }>
      'type' : 'iframe' ,
      <{/if}>
      fitToView : true,
      width   : '90%',
      height    : '100%',
       autoSize  : true,
      closeClick  : false
      });

    });


    function delete_func(asfsn ,stud_id){
      var sure = window.confirm('<{$smarty.const._TAD_DEL_CONFIRM}>');
      if (!sure)  return;
      location.href="show.php?op=delete_tad_assignment_file&assn=<{$assn}>&asfsn=" + asfsn   + "&stud_id=" + stud_id  ;
    }
  </script>
<{if ($assn) }>
  <div class="row">
    <div class="col-xs-8"><h2><{$class_id}>班   <{$title}></h2></div>
    <div class="col-xs-4 text-right">
       <button class="btn btn-warning" type="button" onClick="window.location.reload()" title='重新載入畫面'>重整</button>
    	<a href="index.php?assn=<{$assn}>" class="btn btn-primary"><{$smarty.const._MD_SAVE}></a>
    	<{if $isAdmin}><a href="admin/score.php?assn=<{$assn}>" class="btn btn-success">評分</a><{/if}>

    </div>
  </div>
  <{if (!$open_show) }>
  	<div class="alert alert-info">
  	<strong>注意！</strong>
  	這項主題作業未開放展示，只顯示上傳記錄！
  	</div>
  <{/if}>
  <{if $isAdmin}>
  <div class="row">
    <div class="col-xs-12">
  <h5>未繳交作業：</h5>
  <{foreach from=$class_students  key=sit item=stud}>
  <{if (!$stud.in)  }>
  <span class="col-xs-2 col-xs-4"><span class="badge badge-info"><{ $sit }></span> <{ $stud.name }></span>
  <{/if}>
   <{/foreach}>
   </div>
    </div>
  <{/if}>
  <table class="table table-striped table-bordered table-hover">
  <tr>
  <th class='col-xs-2'><{$smarty.const._MD_TADASSIGN_UP_TIME}></th>
  <th class='col-xs-2'><{$smarty.const._MD_TADASSIGN_FILENAME}></th>
  <th  class='col-xs-2'><{$smarty.const._MD_TADASSIGN_AUTHOR}></th>
  <th  class='col-xs-2'>表現</th>
  <{if $isAdmin}><th  class='col-xs-2'><{$smarty.const._TAD_FUNCTION}></th><{/if}>
  </tr  >
  <tbody>
  <{foreach from=$file_data item=all}>

  <{ if ($all.old_file) }>
  <tr class='danger' title='舊檔案'>
  <{else}>
  <tr>
  <{/if}>
      <td  class='col-xs-2'><{$all.up_time}><br />..<{$all.up_ip}></td>
      <td  class='col-xs-2' style="word-break : break-all; overflow:hidden; " >
      <{if ($open_show)}>
          <{if  ($ifram_show) }>
          	<div  >
          	<a href="show_file.php?assn=<{$all.assn}>&stud_id=<{$all.stud_id}>&asfsn=<{$all.asfsn}>&sub_name=<{$all.sub_name}>&score_bar=<{$all.score_bar}>"  studfile='<{$smarty.const._TAD_ASSIGNMENT_UPLOAD_URL}><{$all.assn}>/<{$all.asfsn}>.<{$all.sub_name}>'  class="assignment_fancy_<{$assn}>" rel="group" title="<{$all.sit_id}>.<{$all.author}> (<{$all.up_time}>) <{$all.file_name}>"  target="show"><{$all.file_name |truncate 20}></a>
          	</div>
          	<div ><{  $all.memo}></div>
         <{else}>

         	 <a href='<{$smarty.const._TAD_ASSIGNMENT_UPLOAD_URL}><{$all.assn}>/<{$all.asfsn}>.<{$all.sub_name}>'  class="assignment_fancy_<{$assn}>" rel="group" title="<{$all.sit_id}>.<{$all.author}> (<{$all.up_time}>) <{$all.file_name}>"><{$all.file_name|truncate 20}></a>

          	<div ><{  $all.memo }></div>
         <{/if}>  <{*   / $ifram_show *}>
      <{else}>
      	<span >
 		<{$all.file_name|truncate 20}>
 	</span>
      <{/if}> <{*   / $open_show *}>
      </td>

      <td  class='col-xs-2' >   <span class="label label-success label-as-badge"><{$all.sit_id}></span> <{$all.author}></td>
      <td  class='col-xs-3'>
      <{if ($all.score) }>
      <div class="row">
       <input  type="text"   class="kv-fa rating-loading" value="<{$all.score_star}>" data-size="xs"       >

		<div class='col-xs-4'><{  $all.comment}></div>
       </div>
	  <{/if}>	 <{*   / $score *}>
	</td>
      <{if $isAdmin}>
      <td  class='col-xs-1'>
        <a href="javascript:delete_func(<{$all.asfsn}>,<{$all.stud_id}>);" class="btn btn-mini btn-danger"><{$smarty.const._TAD_DEL}></a>
      </td>
      <{/if}>  <{*   / $isAdmin *}>
    </tr>

  <{/foreach}>
  </tbody>
  </table>

  <script>
      //星等評分
      $(document).on('ready', function () {
          $('.kv-gly-star').rating({
              containerClass: 'is-star'
          });
/*
          $('.kv-fa').rating({
              theme: 'krajee-fa',
              starCaptions: function (rating) {
                  return rating =  rating + '';
              },
              filledStar: '<i class="fa fa-star"></i>',
              emptyStar: '<i class="fa fa-star-o"></i>'
          });*/
          $('.kv-fa').rating({
                //不顯示文字，只顯示
              showClear: false,
              showCaption: false,
              displayOnly:true,
              filledStar: '<i class="fa fa-star"></i>',
              emptyStar: '<i class="fa fa-star-o"></i>'
          });
      });
  </script>
<{/if}>
