Update: 2026-05-03 22:26:56

This commit is contained in:
Hamza-Ayed
2026-05-03 22:26:56 +03:00
parent ab9625839e
commit 2732229642
3 changed files with 69 additions and 5 deletions

View File

@@ -37,8 +37,9 @@ $emailHash = hash('sha256', strtolower($data['email'])); // For fast lookup duri
// 4. Save to Database
try {
$stmt = $db->prepare("INSERT INTO users (name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?)");
$stmt = $db->prepare("INSERT INTO users (tenant_id, name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt->execute([
$decoded['tenant_id'],
$encryptedName,
$encryptedEmail,
$emailHash,

View File

@@ -166,11 +166,11 @@
</div>
<div>
<label class="block text-xs text-gray-500 uppercase mb-1">الرقم الضريبي</label>
<input type="text" x-model="newCompany.tax_number" class="w-full bg-gray-950 border border-gray-800 p-3 rounded outline-none focus:border-emerald-500">
<input type="text" x-model="newCompany.tax_identification_number" class="w-full bg-gray-950 border border-gray-800 p-3 rounded outline-none focus:border-emerald-500">
</div>
<div>
<label class="block text-xs text-gray-500 uppercase mb-1">رقم التسجيل</label>
<input type="text" x-model="newCompany.registration_number" class="w-full bg-gray-950 border border-gray-800 p-3 rounded outline-none focus:border-emerald-500">
<input type="text" x-model="newCompany.commercial_registration_number" class="w-full bg-gray-950 border border-gray-800 p-3 rounded outline-none focus:border-emerald-500">
</div>
<div>
<label class="block text-xs text-gray-500 uppercase mb-1">العنوان</label>
@@ -196,7 +196,7 @@
showAddModal: false,
showAddCompanyModal: false,
newUser: { name: '', email: '', password: '', role: 'employee' },
newCompany: { name: '', tax_number: '', registration_number: '', address: '' },
newCompany: { name: '', tax_identification_number: '', commercial_registration_number: '', address: '' },
init() {
if (!this.user) window.location.href = '/login.php';
@@ -266,7 +266,7 @@
const json = await res.json();
if (json.success) {
this.showAddCompanyModal = false;
this.newCompany = { name: '', tax_number: '', registration_number: '', address: '' };
this.newCompany = { name: '', tax_identification_number: '', commercial_registration_number: '', address: '' };
this.loadCompanies();
alert('تم إنشاء الشركة بنجاح');
} else {

View File

@@ -0,0 +1,63 @@
import os
import re
def mask_env_value(line):
if '=' not in line:
return line
key, value = line.split('=', 1)
value = value.strip()
if len(value) <= 6:
masked = '*' * len(value)
else:
masked = value[:3] + '*' * (len(value) - 6) + value[-3:]
return f"{key}={masked}"
def document_project(root_dir, output_file):
skip_dirs = {'.git', 'vendor', 'node_modules', 'storage', '.gemini'}
extensions = {'.php', '.js', '.css', '.html', '.sql', '.env', '.json', '.sh'}
with open(output_file, 'w', encoding='utf-8') as f:
f.write("# Musadaq Project Documentation\n\n")
f.write("This file contains the complete source code of the project (excluding dependencies and sensitive data).\n\n")
for root, dirs, files in os.walk(root_dir):
# Skip unwanted directories
dirs[:] = [d for d in dirs if d not in skip_dirs]
for file in files:
file_path = os.path.join(root, file)
rel_path = os.path.relpath(file_path, root_dir)
# Check if file should be included
_, ext = os.path.splitext(file)
if ext not in extensions:
continue
f.write(f"## File: `{rel_path}`\n\n")
lang = ext.replace('.', '')
if lang == 'env':
lang = 'bash'
elif lang == 'php':
lang = 'php'
f.write(f"```{lang}\n")
try:
with open(file_path, 'r', encoding='utf-8') as src:
for line in src:
if ext == '.env':
f.write(mask_env_value(line) + "\n")
else:
f.write(line)
except Exception as e:
f.write(f"// Error reading file: {e}\n")
f.write("\n```\n\n")
if __name__ == "__main__":
current_dir = os.getcwd()
output_path = os.path.join(current_dir, "PROJECT_DOCUMENTATION.md")
print(f"Documenting project in: {current_dir}...")
document_project(current_dir, output_path)
print(f"Documentation generated at: {output_path}")