import.excel.html.hook.php 981 B

1234567891011121314151617181920212223242526272829
  1. <?php if($this->app->rawModule == 'demand' and (common::hasPriv('demand', 'exportTemplate') or $this->app->user->admin)):?>
  2. <?php
  3. $exportDomHtml = html::a('javascript:void(0);', $this->lang->demand->exportTemplate, '', 'class="btn btn-link btn-active-text text-primary" onclick="exportTemplate()"');
  4. $templateLink = $this->createLink('demand', 'exportTemplate');
  5. js::set('exportDomHtml', $exportDomHtml);
  6. js::set('templateLink', $templateLink);
  7. ?>
  8. <form method='post' action="<?php echo $templateLink;?>" class='hidden' id='exportTemplateForm'>
  9. <?php echo html::input('num', 10, "class='form-control'");?>
  10. <?php echo html::input('fileType', 'xlsx', "class='form-control'");?>
  11. <?php echo html::submitButton();?>
  12. </form>
  13. <style>
  14. #mainContent .text-left a {margin-left: 20px;}
  15. </style>
  16. <script>
  17. $(function()
  18. {
  19. $('#mainContent .text-left').append($(exportDomHtml));
  20. });
  21. function exportTemplate()
  22. {
  23. $('#exportTemplateForm #submit').click();
  24. }
  25. </script>
  26. <?php endif;?>