HEX
Server: nginx/1.22.1
System: Linux VM-16-9-centos 3.10.0-1160.99.1.el7.x86_64 #1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64
User: www (1001)
PHP: 7.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/oa.sanjiangapp.com/app/sys/file/view/browse.html.php
<?php
/**
 * The browse view file of file module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     file 
 * @version     $Id: browse.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.com
 */
?>
<div class="modal-dialog" style='width:1000px'>
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      <h4 class="modal-title" id="ajaxModalTitle"><i class="icon-paper-clip"></i> <?php echo $lang->file->browse;?></h4>
    </div>
    <div class="modal-body">
      <table class='table table-bordered'>
        <thead>
          <tr>
            <th><?php echo $lang->file->id;?></th>
            <th><?php echo $lang->file->common;?></th>
            <th><?php echo $lang->file->extension;?></th>
            <th><?php echo $lang->file->size;?></th>
            <th><?php echo $lang->file->createdBy;?></th>
            <th><?php echo $lang->file->createdDate;?></th>
            <th><?php echo $lang->file->downloads;?></th>
            <th><?php echo $lang->actions;?></th>
          </tr>          
        </thead>
        <tbody>
          <?php foreach($files as $file):?>
          <tr class='text-middle'>
            <td><?php echo $file->id;?></td>
            <td>
              <?php
              if($file->isImage)
              {
                  echo html::a(inlink('download', "id=$file->id"), html::image($file->smallURL, "class='image-small' title='{$file->title}'"), "target='_blank'");
                  if($file->primary == 1) echo '<small class="label label-success">'. $lang->file->primary .'</small>';
              }
              else
              {
                  echo html::a(inlink('download', "id=$file->id"), "{$file->title}.{$file->extension}", "target='_blank'");
              }
              ?>
            </td>
            <td><?php echo $file->extension;?></td>
            <td><?php echo $file->size;?></td>
            <td><?php echo $file->createdBy;?></td>
            <td><?php echo formatTime($file->createdDate, DT_DATETIME1);?></td>
            <td><?php echo $file->downloads;?></td>
            <td>
            <?php
            echo html::a(inlink('edit',   "id=$file->id"), $lang->edit, "class='edit'");
            echo html::a(inlink('delete', "id=$file->id"), $lang->delete, "class='deleter'");
            if($file->isImage) echo html::a(inlink('setPrimary', "id=$file->id"), $lang->file->setPrimary, "class='option'");
            ?>
            </td>
          </tr>
          <?php endforeach;?>          
        </tbody>

      </table>
      <?php if(commonModel::hasPriv('file', 'upload')):?>
      <form id="fileForm" method='post' enctype='multipart/form-data' action='<?php echo inlink('upload', "objectType=$objectType&objectID=$objectID");?>'>
        <table class='table table-form'>
          <?php if($writable):?>
          <tr>
            <td class='text-middle'><?php echo $lang->file->upload . $lang->file->limit;?></td>
            <td><?php echo $this->fetch('file', 'buildForm');?></td>
          </tr>
          <tr><td colspan='2' class='text-center form-actions'><?php echo html::submitButton();?></td></tr>
          <?php else:?>
          <tr><td colspan='2'><h5 class='text-danger'><?php echo $lang->file->errorUnwritable;?></h5></td></tr>
          <?php endif;?>
        </table>
      </form>
      <?php endif;?>
    </div>
  </div>
</div>
<script>
$(document).ready(function()
{   
    $.setAjaxForm('#fileForm', function(data)
    {
        if(data.result == 'success') $.reloadAjaxModal(1500);
    }); 
    $.setAjaxLoader('.edit', '#ajaxModal');
    $('a.option').click(function(data)
    {
        $.getJSON($(this).attr('href'), function(data) 
        {
            if(data.result == 'success')
            {
                $.reloadAjaxModal();
            }
            else
            {
                alert(data.message);
            }
        });
        return false;
    });

    $(".modal-backdrop").click(function()
    {
        $('.modal').modal('hide');
    });
});
</script>