<style type="text/css">
  <?php include("html.css")?>
</style>

<table align="center" class="generalbox">
  <tr>
    <td align="center">
<!--
      <table border="0" style="margin: -20px 0px -20px 0px;">
-->
      <table border="0" style="margin: 0px 0px 0px 0px;">
        <tr><td>
          <?php echo $OUTPUT->heading(get_string('class_settings','block_autoattend').' :: '.$course->fullname); ?>
        </td></tr>
      </table>
    </td>
  </tr>

  <tr>
    <td class="generalboxcontent" align="center">  
      <table border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center">
            <form name="update" method="post" action="<?php echo $wwwMyURL;?>">
              <?php $count = class_settings_show_table($classes); ?>
              <?php if ($count>0) { ?>
                <input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
                <input type="hidden" name="course"  value="<?php echo $courseid;?>" />
                <input type="submit" name="updateclass" value="<?php echo get_string("updateordel",'block_autoattend');?>" />
              <?php } ?>
            </form>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="center">
<!--
            <table border="0" style="margin: -30px 0px -30px 0px;">
-->
            <table border="0" style="margin: 0px 0px 0px 0px;">
              <tr><td>
                <form name="gsess" method="post" action="<?php echo $wwwMyURL;?>">
                  <input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
                  <input type="hidden" name="course"  value="<?php echo $courseid;?>" />
                  <input type="text"   name="classname" size="24" maxlength="32" value="" />
                  <input type="submit" name="addclass" value="<?php echo get_string('add','block_autoattend');?>" />
                </form>
              </td></tr>
            </table>
            <br />
 
            <!-- by Emilio Arjona 2015 -->
            <table border="0" style="margin: 0px 0px 0px 0px;">
              <tr><td align="center">
                <form name="groupings" method="post" action="<?php echo $wwwMyURL;?>">
                  <?php $groupings = autoattend_choose_grouping($courseid, $wwwMyURL, '') ?>
                  <select name="groupingid">
                    <option value=""><?php echo get_string('choosegrouping','block_autoattend');?></option>
                    <?php foreach ($groupings as $key=>$groupname) { ?>
                      <option value="<?php echo $key; ?>"><?php echo $groupname; ?></option>
                    <?php } ?>
                  </select>
                  <input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
                  <input type="hidden" name="course"  value="<?php echo $courseid;?>" />
                  <input type="submit" name="groupingtoclass" value="<?php echo get_string("add",'block_autoattend');?>" />
                  <?php echo "&nbsp;".$OUTPUT->help_icon('choosegrouping','block_autoattend');?>
                </form>
              </td></tr>
            </table>

          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
