<{includeq file="db:tad_web_header.html"}>

<{if $op=="show_one_tad_web"}>

  <{if $all_mems}>

  <style>
	.draggable {padding: 5px; margin: 0 10px 10px 0; font-size: 12px; border:0px dotted gray;position:absolute;}
	#snaptarget {width:640px;height: 540px; border:1px solid black;background:#CC6633 url(images/classroom2.png) center center no-repeat;position:relative;}

	</style>

	<script>
	function IsNumeric(n){
    return !isNaN(n);
  }

  $(function(){

      $('#getit').click(function() {

          var numLow = <{$min}>;
          var numHigh = <{$max}>;

          var adjustedHigh = (parseFloat(numHigh) - parseFloat(numLow)) + 1;

          var numRand = Math.floor(Math.random()*adjustedHigh) + parseFloat(numLow);

          if ((IsNumeric(numLow)) && (IsNumeric(numHigh)) && (parseFloat(numLow) <= parseFloat(numHigh)) && (numLow != '') && (numHigh != '')) {
              $('#randomnumber').html('<{$smarty.const._MD_TCW_GOT_YOU}>' + numRand +'<{$smarty.const._MD_TCW_NUMBER}>');
              $('#'+numRand).clone().appendTo('#MemRandList').css('top','0px').css('left','0px').css('position','relative').css('float','left');
          } else {
              $('#randomnumber').html('<{$smarty.const._MD_TCW_AGAIN}>');
          }

          return false;
      });


      $('#clear').click(function() {
        $('#MemRandList').html('');
        $('#randomnumber').html('');
      });

  });
	</script>
	<div class="row-fluid">
    <div class="span5 well" style="background-image:url(<{$teacher_pic}>);background-repeat:no-repeat;background-size:cover;background-position:center; height:350px;"></div>
    <div class="span7">
      <div><{$smarty.const._MD_TCW_OWNER_NAME}><{$smarty.const._TAD_FOR}><{$WebOwner}></div>
      <div><{$smarty.const._MD_TCW_MEM_AMOUNT}><{$smarty.const._TAD_FOR}> <{$smarty.const._MD_TCW_TOTAL}> <{$class_total}> <{$smarty.const._MD_TCW_PEOPLE}> <span class="label label-success"><{$smarty.const._MD_TCW_BOY}></span> <{$class_boy}> <{$smarty.const._MD_TCW_PEOPLE}> <span class="label label-important"><{$smarty.const._MD_TCW_GIRL}></span> <{$class_girl}> <{$smarty.const._MD_TCW_PEOPLE}></div>
      <hr>
      <div class="row-fluid">
        <div class="span12">
          <{if $isMine}><button class="btn btn-success" onClick="location.href='aboutus.php?op=tad_web_adm&WebID=<{$WebID}>'"><{$smarty.const._MD_TCW_ADMIN}></button><{/if}>
          <button id="clear" class="btn btn-danger"><{$smarty.const._MD_TCW_CLEAR}></button>
          <button id="getit" class="btn btn-info"><{$smarty.const._MD_TCW_GET_SOMEONE}></button>
        </div>
      	<div id="randomnumber" style="font-size:16px;"></div>
      	<div id="out" class="span12">
          <div id="MemRandList"></div>
        </div>
      </div>
    </div>
  </div>


    <div class="demo">
      <div id="snaptarget">
      	<{$students1}>
      </div>

      <br style="clear:both;" />
      <{$students2}>

      <br style="clear:both;" />
    </div>
  <{else}>
    <{includeq file="db:tad_web_adm.html"}>
  <{/if}>
<{elseif $op=="tad_web_adm"}>
  <{includeq file="db:tad_web_adm.html"}>
<{elseif $op=="tad_web_config"}>
  <{includeq file="db:tad_web_config.html"}>
<{elseif $op=="import_excel"}>

  <h1><{$smarty.const._MD_TCW_IMPORT_PREVIEW}></h1>
  <{$smarty.const._MD_TCW_IMPORT_DESCRIPT}>
  
  <form action="aboutus.php" method="post">
  <table class="table table-striped table-bordered table-hover table-condensed">
  <tr>
    <th><{$smarty.const._MD_TCW_MEM_NUM}></th>
    <th><{$smarty.const._MD_TCW_MEM_NAME}></th>
    <th><{$smarty.const._MD_TCW_MEM_UNICODE}></th>
    <th><{$smarty.const._MD_TCW_MEM_BIRTHDAY}></th>
    <th><{$smarty.const._MD_TCW_MEM_SEX}></th>
    <th><{$smarty.const._MD_TCW_MEM_NICKNAME}></th>
  </tr>
  <{$main}>
  </table>
  <input type="hidden" name="op" value="import2DB">
  <input type="hidden" name="WebID" value="<{$WebID}>">
  <button type="submit" class="btn btn-primary"><{$smarty.const._MD_TCW_IMPORT}></button>
  </form>


  
<{else}>
  <{$FooTableJS}>
  <div class="row-fluid">
    <{includeq file="db:tad_web_common_aboutus.html"}>
  </div>
  
<{/if}>