<?php include_once 'header.php';?>

<div class="row">
  <div class="col-md-9">

    <div class="card">
      <div class="card-header card-header-icon card-header-rose">
        <div class="card-icon">
          <i class="material-icons">storage</i>
        </div>
        <h4 class="card-title "><?php echo $jkl["g51"];?></h4>
      </div>
      <div class="card-body">
        
        <div class="table-responsive">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>#</th>
                <th><?php echo $jkl["g53"];?></th>
                <th><?php echo $jkl["g52"];?></th>
                <th><?php echo $jkl["g47"];?></th>
                <th><?php echo $jkl["g48"];?></th>
              </tr>
            </thead>
            <?php if (isset($FILES_ALL) && is_array($FILES_ALL)) foreach($FILES_ALL as $v) { ?>
              <tr>
                <td><?php echo $v["id"];?></td>
                <td class="title"><a href="<?php echo JAK_rewrite::jakParseurl('files', 'edit', $v["id"]);?>"><?php echo $v["name"];?></a></td>
                <td class="desc"><?php echo $v["description"];?></td>
                <td><a class="btn btn-default btn-sm" href="<?php echo JAK_rewrite::jakParseurl('files', 'edit', $v["id"]);?>"><i class="fa fa-pencil"></i></a></td>
                <td><a class="btn btn-danger btn-sm btn-confirm" href="<?php echo JAK_rewrite::jakParseurl('files', 'delete', $v["id"]);?>" data-title="<?php echo addslashes($jkl["g48"]);?>" data-text="<?php echo addslashes($jkl["e32"]);?>" data-type="warning" data-okbtn="<?php echo addslashes($jkl["g279"]);?>" data-cbtn="<?php echo addslashes($jkl["g280"]);?>"><i class="fa fa-trash"></i></a></td>
              </tr>
            <?php } ?>
          </table>
          
        </div>
        
      </div>
    </div>    
  </div>
  <div class="col-md-3">

    <div class="card">
      <div class="card-header card-header-icon card-header-success">
        <div class="card-icon">
          <i class="material-icons">add</i>
        </div>
        <h4 class="card-title "><?php echo $jkl["g50"];?></h4>
      </div>
      <div class="card-body">
        

        <?php if (!empty($jakosub) && $jakosub['trial']) { ?>
          <div class="alert alert-info"><?php echo $jkl['i12'];?></div>

        <?php } elseif (!empty($jakosub) && !$jakosub['trial'] && !$jakosub['files']) { ?>
          <div class="alert alert-danger"><?php echo $jkl['i13'];?></div>
        <?php } else { ?>
          
          <?php if ($errors) { ?>
            <div class="alert alert-danger"><?php if (isset($errors["e"])) echo $errors["e"];
            if (isset($errors["e1"])) echo $errors["e1"];
            if (isset($errors["e2"])) echo $errors["e2"];?></div>
          <?php } ?>
          
          <form role="form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" enctype="multipart/form-data">

            <div class="form-group text-center">
              <div class="fileinput fileinput-new text-center" data-provides="fileinput">
                <div class="fileinput-new thumbnail">
                  <img src="<?php echo BASE_URL;?>img/image_placeholder.jpg" alt="placeholder">
                </div>
                <div class="fileinput-preview fileinput-exists thumbnail"></div>
                <div>
                  <span class="btn btn-rose btn-round btn-file">
                    <span class="fileinput-new"><?php echo $jkl["g9"];?></span>
                    <span class="fileinput-exists"><?php echo $jkl['i71'];?></span>
                    <input type="file" name="uploadedfile" id="file" />
                  </span>
                  <a href="javascript:void(0)" class="btn btn-danger btn-round fileinput-exists" data-dismiss="fileinput"><i class="fa fa-times"></i> <?php echo $jkl['i72'];?></a>
                </div>
              </div>
              <small id="emailHelp" class="form-text text-muted"><?php echo JAK_ALLOWEDO_FILES;?></small>
            </div>
            
            <div class="form-group">
              <label class="control-label" for="name"><?php echo $jkl["g53"];?></label>
              <input type="text" name="name" class="form-control<?php if (isset($errors["e1"])) echo " is-invalid";?>" value="<?php if (isset($_POST["name"])) echo $_POST["name"];?>">
            </div>
            <div class="form-group">
              <label class="control-label" for="description"><?php echo $jkl["g52"];?></label>
              <textarea name="description" class="form-control" rows="7"><?php if (isset($_POST["description"])) echo $_POST["description"];?></textarea>
            </div>
            
            <div class="form-actions">
              <button type="submit" name="insert_response" class="btn btn-primary btn-block"><?php echo $jkl["g38"];?></button>
            </div>
            
            <input type="hidden" name="max_file_size" value="10000000">

          </form>
        <?php } ?>
      </div>
    </div>
  </div>    
</div>

<?php include_once 'footer.php';?>
