mirror of
https://github.com/itflow-org/itflow
synced 2026-03-06 13:54:51 +00:00
Add Acceptable File formats on the Client side, also allow webp for image file uploads in assets, locations, expenses and contact
This commit is contained in:
@@ -378,7 +378,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Upload Photo</label>
|
<label>Upload Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -383,7 +383,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Upload / Replace Photo</label>
|
<label>Upload / Replace Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Upload Photo</label>
|
<label>Upload Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -239,7 +239,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Photo</label>
|
<label>Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Photo</label>
|
<label>Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Upload Photo</label>
|
<label>Upload Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Upload Photo</label>
|
<label>Upload Photo</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
|
|
||||||
<div class="form-group col-md">
|
<div class="form-group col-md">
|
||||||
<label>Receipt</label>
|
<label>Receipt</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*, application/pdf">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Receipt</label>
|
<label>Receipt</label>
|
||||||
<input type="file" class="form-control-file" name="file">
|
<input type="file" class="form-control-file" name="file" accept="image/*, application/pdf">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!empty($expense_receipt)) { ?>
|
<?php if (!empty($expense_receipt)) { ?>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (isset($_POST['add_asset'])) {
|
|||||||
$asset_id = mysqli_insert_id($mysqli);
|
$asset_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Add Photo
|
// Add Photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ if (isset($_POST['edit_asset'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update Photo
|
// Update Photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
// Set directory in which the uploaded file will be moved
|
// Set directory in which the uploaded file will be moved
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ if (isset($_POST['add_contact'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for and process image/photo
|
// Check for and process image/photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ if (isset($_POST['edit_contact'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_pin = '$pin', contact_notes = '$notes', contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical, contact_department = '$department', contact_location_id = $location_id, contact_user_id = $contact_user_id WHERE contact_id = $contact_id");
|
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_extension = '$extension', contact_mobile = '$mobile', contact_email = '$email', contact_pin = '$pin', contact_notes = '$notes', contact_important = $contact_important, contact_billing = $contact_billing, contact_technical = $contact_technical, contact_department = '$department', contact_location_id = $location_id, contact_user_id = $contact_user_id WHERE contact_id = $contact_id");
|
||||||
|
|
||||||
// Upload Photo
|
// Upload Photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
// Set directory in which the uploaded file will be moved
|
// Set directory in which the uploaded file will be moved
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if (isset($_POST['add_expense'])) {
|
|||||||
// Check for and process attachment
|
// Check for and process attachment
|
||||||
$extended_alert_description = '';
|
$extended_alert_description = '';
|
||||||
|
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'pdf'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ if (isset($_POST['edit_expense'])) {
|
|||||||
|
|
||||||
// Check for and process attachment
|
// Check for and process attachment
|
||||||
$extended_alert_description = '';
|
$extended_alert_description = '';
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'pdf'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if(isset($_POST['add_location'])){
|
|||||||
mysqli_query($mysqli,"UPDATE locations SET location_primary = 1 WHERE location_id = $location_id");
|
mysqli_query($mysqli,"UPDATE locations SET location_primary = 1 WHERE location_id = $location_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ if(isset($_POST['edit_location'])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if (isset($_POST['add_rack'])) {
|
|||||||
$rack_id = mysqli_insert_id($mysqli);
|
$rack_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
// Add Photo
|
// Add Photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ if (isset($_POST['edit_rack'])) {
|
|||||||
mysqli_query($mysqli,"UPDATE racks SET rack_name = '$name', rack_description = '$description', rack_type = '$type', rack_model = '$model', rack_depth = '$depth', rack_units = $units, rack_location_id = $location, rack_physical_location = '$physical_location', rack_notes = '$notes' WHERE rack_id = $rack_id");
|
mysqli_query($mysqli,"UPDATE racks SET rack_name = '$name', rack_description = '$description', rack_type = '$type', rack_model = '$model', rack_depth = '$depth', rack_units = $units, rack_location_id = $location, rack_physical_location = '$physical_location', rack_notes = '$notes' WHERE rack_id = $rack_id");
|
||||||
|
|
||||||
// Add Photo
|
// Add Photo
|
||||||
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) {
|
if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png', 'webp'))) {
|
||||||
|
|
||||||
$file_tmp_path = $_FILES['file']['tmp_name'];
|
$file_tmp_path = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user