<?php use_helper('Validation') ?>
<?php use_helper('Javascript');?>
<?php use_helper("I18N");?>
<?php echo form_tag('document/createbatch' ,array('multipart'=>'true', 'name'=>'uform'))?>
  <fieldset style="width:60%; margin-left:20%">

      <div class="form-row-upload-batch">
        <?php echo form_error('createbatch') ?>
        <label for="createbatch"><?php echo __('File name')?>:</label>
        <?php echo input_file_tag('createbatch',  array('value'=>$sf_params->get('createbatch'),'size'=>'50')) ?>
        <div class="sf_admin_edit_help">
            <?php echo __('You must read manual')?>
        </div>
        <div style="text-align:center">
            <?php echo input_hidden_tag('referer', $sf_request->getAttribute('referer')) ?>
            <?php echo submit_tag(__('Upload')) ?>
            
            <input type="button" value="<?php echo __("Cancel")?>" onclick="window.history.back()">
        </div>
      </div>

      <br>
      <fieldset class="upload-batch-help">
	    <div class="innerheader clearfix"><h3><?php echo __("Manual")?></h3></div>
	    <br>
	    <div class="help_toc">
	       <li><?php echo __('Format file upload')?>
	          <ul><li><?php echo __('Format 1') ?></li></ul>
	          <ul> <li><?php echo __('Format 2') ?></li></ul>
	          <ul> <li><?php echo __('Format 3').link_to("template.xls", "document/downloadTemplate") ?></li></ul>
	       </li>
	    </div>
      </fieldset>
      <br>
  </fieldset>
</form>

<?php use_stylesheet('/sf/sf_admin/css/main') ?>

<?php if(isset($reports) && $reports):?>
<div id="sf_admin_container" style="width:60%; margin-left:20%">
<table cellspacing='0' class='sf_admin_list'>
    <thead>
        <tr><th colspan="2" style="text-align:center">
            <?php echo __('Batch').": " ;
                echo $uploadInfo['name']."&nbsp;&nbsp;";
                echo __('Success').": "; 
                echo $uploadInfo['succ']."&nbsp;&nbsp;";
                echo __('Error').": ";
                echo $uploadInfo['error'];
            ?>
        </th></tr>
    </thead>
    <tbody>
    <?php foreach ($reports as $key => $report):?>
        <?php $i = $key%2 ?>
        <tr class='sf_admin_row_<?php echo $i ?>'>
            <td>
                <?php echo $key;?>
            </td>
            <td>
                <?php echo $report;?>
            </td>
        </tr>
    <?php endforeach;?>
    </tbody>
</table>
</div>
<?php endif;?>
