<?php 
require_once ("../var/res.php");
$tpeid = $_REQUEST['tpe_id'];
?>
<!-- select2 -->
<script>
    $(document).ready(function() {
      $(".select2_single").select2({
        placeholder: "Select a state",
        allowClear: true
      });
      $(".select2_group").select2({});
      $(".select2_multiple").select2({
        maximumSelectionLength: 4,
        placeholder: "With Max Selection limit 4",
        allowClear: true
      });
    });
  </script>
  <!-- /select2 -->

<div class="form-group row"> 

<label class="col-form-label col-2 col-lg-2 form-label text-lg-right">Document Files<span class="required" style="color:red">*</span></label>
<div class="col-3 col-lg-3">
    <input type="file" name="file[]" id="file" class="form-control-file" multiple required>   
</div>               

<?php 
if($tpeid==1){
?>
 <input type="hidden" class="form-control" name="prjc" value="0" required>
<?php }else{?>
<label class="col-form-label col-2 col-lg-2 form-label text-lg-right">Project code<span class="required" style="color:red">*</span></label>
    <div class="col-3 col-lg-3">
        <select class="select2_single" name="prjc" id="prjc" data-placeholder="-project code-" required>
        <option></option>
            <?php
                $sth = $db->query('SELECT * FROM tbl_projects WHERE prjsts != 10 ORDER BY projid DESC');
                try
                {
                    while ($rr2 = $sth->fetch(PDO::FETCH_ASSOC)) {
                    ?>
                        <option value="<?php echo $rr2['projid']; ?>"><?php echo $rr2['codeproj']; ?></option>
                    <?php
                        }
                    }
                    catch (PDOException $ex) {
                    //Something went wrong rollback!
                    echo $ex->getMessage();
                    }
            ?>	
        </select>
    </div>  
  </div>

<?php }?>