Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1361340928 | |||
| 1bda30e957 | |||
| a87423d879 | |||
| 24cda34681 | |||
| 2c514a8ab6 | |||
| b1ea728c15 | |||
| 9d5c20113f | |||
| 47762a8557 | |||
| 939a4fe03e | |||
| 493de65892 | |||
| 23ae8e1b1d | |||
| 7ad20993d9 | |||
| 8978980901 | |||
| 6d66c5cf97 | |||
| b3f19be47d | |||
| 13e73abc5d | |||
| 14d91b6d6e | |||
| c004636b6c | |||
| 4c4c6e3153 | |||
| 7d0824d01f | |||
| 32c0966801 | |||
| 57ab20ed1f | |||
| c533973420 | |||
| b092abf8c7 | |||
| 78089cadc1 | |||
| 3816bf5a20 | |||
| e8b15d8096 | |||
| d925726ecd | |||
| aaad0a6bda |
@@ -38,3 +38,8 @@ PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
# Credenziali API VisualLims
|
||||
API_BASE_URL=https://93.43.5.102/limsapi
|
||||
API_USERNAME=WebApiUser
|
||||
API_PASSWORD=webapiuser01
|
||||
@@ -21,3 +21,14 @@ yarn-error.log
|
||||
.env.backup
|
||||
.env.production
|
||||
auth.json
|
||||
# File di debug e temporanei JSON e log
|
||||
/public/userarea/*.json
|
||||
/public/userarea/*.log
|
||||
/public/userarea/*.txt
|
||||
|
||||
# File di log nella sottocartella class
|
||||
/public/userarea/class/*.log
|
||||
|
||||
# File XLSX temporanei importati
|
||||
/public/userarea/imported_trf/*.xlsx
|
||||
/public/userarea/xlstemplates/*.xlsx
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Userarea;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class UploadPhotosMobileController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$iddatadb = $request->query('iddatadb');
|
||||
|
||||
if (empty($iddatadb)) {
|
||||
return response('ID riga non fornito', 400);
|
||||
}
|
||||
|
||||
// Show the upload form
|
||||
return view('userarea.upload_photos_mobile', [
|
||||
'iddatadb' => $iddatadb
|
||||
]);
|
||||
}
|
||||
|
||||
public function upload(Request $request)
|
||||
{
|
||||
// Validation
|
||||
$request->validate([
|
||||
'photo' => 'required|file|mimes:jpeg,png,gif,heic,heif|max:5120', // 5MB
|
||||
'iddatadb' => 'required|integer'
|
||||
]);
|
||||
|
||||
$iddatadb = $request->input('iddatadb');
|
||||
$photo = $request->file('photo');
|
||||
$iduserlogin = auth()->id(); // assuming Laravel authentication
|
||||
|
||||
// Check if user exists
|
||||
$userExists = DB::table('auth_users')->where('id', $iduserlogin)->exists();
|
||||
if (!$userExists) {
|
||||
return response()->json(['success' => false, 'message' => 'Utente non valido']);
|
||||
}
|
||||
|
||||
// Upload folder
|
||||
$uploadDir = public_path('photostrf');
|
||||
if (!is_dir($uploadDir)) {
|
||||
mkdir($uploadDir, 0755, true);
|
||||
}
|
||||
if (!is_writable($uploadDir)) {
|
||||
return response()->json(['success' => false, 'message' => 'La cartella photostrf non è scrivibile']);
|
||||
}
|
||||
|
||||
// New filename
|
||||
$timestamp = now()->format('YmdHis');
|
||||
$originalName = pathinfo($photo->getClientOriginalName(), PATHINFO_FILENAME);
|
||||
$extension = strtolower($photo->getClientOriginalExtension());
|
||||
|
||||
$newFileName = "{$iddatadb}-{$timestamp}-{$originalName}.{$extension}";
|
||||
$destination = $uploadDir . '/' . $newFileName;
|
||||
|
||||
// Move uploaded file
|
||||
$photo->move($uploadDir, $newFileName);
|
||||
|
||||
// Save DB record
|
||||
DB::table('datadb_photos')->insert([
|
||||
'iddatadb' => $iddatadb,
|
||||
'file_path' => $newFileName,
|
||||
'file_name' => $newFileName,
|
||||
'uploaded_by' => $iduserlogin
|
||||
]);
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Foto caricata con successo']);
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class LoginController extends Controller
|
||||
if ($user->hasRole('Admin')) {
|
||||
return redirect()->to('userarea/import_dashboard.php');
|
||||
} elseif ($user->hasRole('User')) {
|
||||
return redirect()->to('userarea/index.php');
|
||||
return redirect()->to('userarea/import_dashboard.php');
|
||||
}
|
||||
|
||||
// Se il ruolo non è specificato, reindirizza alla home predefinita
|
||||
|
||||
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 571 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 517 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 522 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 517 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 509 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 507 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 512 B |
|
After Width: | Height: | Size: 516 B |
|
After Width: | Height: | Size: 511 B |