<{$bootstrap}>
<{$jquery}>
<{$toolbar}>


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

<div class="row-fluid">
  <select onChange="window.location.href='show.php?assn='+this.value" class="span6">
    <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>
</div>



  <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>

<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-fluid">
    <div class="span8"><h2><{$class_id}>班   <{$title}></h2></div>
    <div class="span4 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-fluid">
    <div class="span12">
  <h5>未繳交作業：</h5>
  <{foreach from=$class_students  key=sit item=stud}>
  <{if (!$stud.in)  }>
  <span class="span2"><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="span2" ><{$smarty.const._MD_TADASSIGN_UP_TIME}></th>
  <th   class="span2" ><{$smarty.const._MD_TADASSIGN_FILENAME}></th>
  <th   class="span2" ><{$smarty.const._MD_TADASSIGN_AUTHOR}></th>
  <th   class="span2" >表現</th>
  <{if $isAdmin}><th><{$smarty.const._TAD_FUNCTION}></th><{/if}>
  </tr>
  <tbody>
  <{foreach from=$file_data item=all}>

    <tr>
      <td   class="span2" ><{$all.up_time}></td>
      <td  class="span2" style="word-break : break-all; overflow:hidden; " >
      <{if ($open_show)}>
          <{if  ($ifram_show) }>
          <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><{  $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}></a>
          <div><{  $all.memo}></div>
         <{/if}>  <{*   / $ifram_show *}>
      <{else}>
 		<{$all.file_name |truncate 20 }>
      <{/if}> <{*   / $open_show *}>
      </td>

      <td   class="span2" >   <span class="badge badge-info"><{$all.sit_id}></span> <{$all.author}></td>
      <td   class="span2" >
          <{if ($all.score) }>
      		<div class="progress progress-success progress-striped">
			<div class="bar" style="width: <{$all.bar}>%"></div>
		</div>
		<div><{  $all.comment}></div>
	  <{/if}>	 <{*   / $score *}>
	</td >
      <{if $isAdmin}>
      <td   class="span2" >
        <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>
<{/if}>
