🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 02:44
This commit is contained in:
@@ -28,14 +28,17 @@ final class FileStorageService
|
||||
}
|
||||
|
||||
// 2. Generate path
|
||||
$dir = "{$this->storagePath}/invoices/{$tenantId}/{$companyId}";
|
||||
$dir = $this->storagePath . '/invoices/' . $tenantId . '/' . $companyId;
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir, 0775, true);
|
||||
if (!mkdir($dir, 0777, true)) {
|
||||
$err = error_get_last();
|
||||
throw new Exception("فشل إنشاء مجلد الحفظ: " . $dir . " - " . ($err['message'] ?? ''));
|
||||
}
|
||||
}
|
||||
|
||||
$extension = pathinfo($file['name'], PATHINFO_EXTENSION);
|
||||
$filename = hash('sha256', $file['name'] . time() . uniqid()) . '.' . $extension;
|
||||
$targetPath = "{$dir}/{$filename}";
|
||||
$targetPath = $dir . '/' . $filename;
|
||||
|
||||
if (isset($file['error']) && $file['error'] !== UPLOAD_ERR_OK) {
|
||||
throw new Exception("حدث خطأ أثناء رفع الملف من المتصفح. كود الخطأ: " . $file['error']);
|
||||
@@ -44,7 +47,8 @@ final class FileStorageService
|
||||
if (!move_uploaded_file($file['tmp_name'], $targetPath)) {
|
||||
// Fallback for some non-standard PHP environments
|
||||
if (!copy($file['tmp_name'], $targetPath)) {
|
||||
throw new Exception("فشل نقل الملف إلى المسار النهائي: " . $targetPath);
|
||||
$err = error_get_last();
|
||||
throw new Exception("فشل نقل الملف إلى: " . $targetPath . " - " . ($err['message'] ?? ''));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,8 @@
|
||||
<input type="password" id="usr-password" class="w-full bg-black/20 border border-white/10 rounded-xl px-4 py-3 text-white focus:border-primary outline-none" placeholder="كلمة المرور" required>
|
||||
<select id="usr-role" class="w-full bg-black/20 border border-white/10 rounded-xl px-4 py-3 text-white focus:border-primary outline-none" required>
|
||||
<option value="accountant">محاسب</option>
|
||||
<option value="manager">مدير</option>
|
||||
<option value="admin">مدير</option>
|
||||
<option value="employee">موظف</option>
|
||||
</select>
|
||||
|
||||
<div class="flex gap-3 mt-6 pt-4 border-t border-white/10">
|
||||
|
||||
Reference in New Issue
Block a user