🧲 New features Custom user role permissions Employee edit form updated Employee daily task list Attendance and employee distribution charts on dashboard Improvements to company structure and company assets module Improved tables for displaying data in several modules Faster data loading (specially for employee module) Initials based profile pictures Re-designed login page Re-designed user profile page Improvements to filtering New REST endpoints for employee qualifications 🐛 Bug fixes Fixed, issue with managers being able to create performance reviews for employees who are not their direct reports Fixed, issues related to using full profile image instead of using smaller version of profile image Changing third gender to other Improvements and fixes for internal frontend data caching
81 lines
2.8 KiB
PHP
81 lines
2.8 KiB
PHP
<?php
|
|
error_reporting(E_ERROR);
|
|
$fileTypesImages = "jpg,bmp,gif,png,jpeg"; // images
|
|
$fileTypesDocuments = "csv,doc,xls,docx,xlsx,txt,ppt,pptx,rtf,pdf,xml"; // documents
|
|
if($_REQUEST['file_type']=="image"){
|
|
$fileTypes = $fileTypesImages;
|
|
}else if($_REQUEST['file_type']=="doc"){
|
|
$fileTypes = $fileTypesDocuments;
|
|
}else if($_REQUEST['file_type']=="all"){
|
|
$fileTypes = $fileTypesDocuments.",".$fileTypesImages;
|
|
}else{
|
|
|
|
$clist = explode(",", $_REQUEST['file_type']);
|
|
$supportedList = explode(",", $fileTypesDocuments.",".$fileTypesImages);
|
|
|
|
if(count(array_intersect($clist, $supportedList)) == count($clist)){
|
|
$fileTypes = $_REQUEST['file_type'];
|
|
}else{
|
|
$fileTypes = $fileTypesDocuments.",".$fileTypesImages;
|
|
}
|
|
}
|
|
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<script type="text/javascript" src="<?=BASE_URL?>js/jquery.js"></script>
|
|
<script type="text/javascript" src="<?=BASE_URL?>js/jquery.form.js"></script>
|
|
<script type="text/javascript" src="<?=BASE_URL?>js/date.js"></script>
|
|
<script type="text/javascript" src="<?=BASE_URL?>js/json2.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<script>
|
|
function uploadfile(){
|
|
var form = document.getElementById('upload_data');
|
|
form.submit();
|
|
}
|
|
|
|
function checkFileType (elementName, fileTypes) {
|
|
var fileElement = document.getElementById(elementName);
|
|
var fileExtension = "";
|
|
if (fileElement.value.lastIndexOf(".") > 0) {
|
|
fileExtension = fileElement.value.substring(fileElement.value.lastIndexOf(".") + 1, fileElement.value.length);
|
|
}
|
|
|
|
fileExtension = fileExtension.toLowerCase();
|
|
|
|
var allowed = fileTypes.split(",");
|
|
|
|
if (allowed.indexOf(fileExtension) < 0) {
|
|
fileElement.value = "";
|
|
alert('Selected file type is not supported');
|
|
clearFileElement(elementName);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
function clearFileElement (elementName) {
|
|
|
|
var control = $("#"+elementName);
|
|
control.replaceWith( control = control.val('').clone( true ) );
|
|
}
|
|
</script>
|
|
<div id="upload_form">
|
|
<form id="upload_data" method="post" action="<?=CLIENT_BASE_URL?>fileupload.php" enctype="multipart/form-data">
|
|
<input id="file_name" name="file_name" type="hidden" value="<?=$_REQUEST['id']?>"/>
|
|
<input id="file_group" name="file_group" type="hidden" value="<?=$_REQUEST['file_group']?>"/>
|
|
<input id="user" name="user" type="hidden" value="<?=$_REQUEST['user']?>"/>
|
|
<label id="upload_status"><?=$_REQUEST['msg']?></label><input id="file" name="file" type="file" onChange="if(checkFileType('file','<?=$fileTypes?>')){uploadfile();}"></input>
|
|
</form>
|
|
</div>
|
|
<div id="upload_result" style="display:none;text-align: center;">
|
|
<p id="upload_result_header"></p>
|
|
<p id="upload_result_body"></p>
|
|
</div>
|
|
<script type="text/javascript">document.body.style.overflow = 'hidden';</script>
|
|
</body>
|
|
</html>
|