Update: 2026-05-04 21:46:07
This commit is contained in:
@@ -41,11 +41,11 @@ try {
|
|||||||
// 3. Save to Database
|
// 3. Save to Database
|
||||||
$stmt = $db->prepare("
|
$stmt = $db->prepare("
|
||||||
INSERT INTO companies (
|
INSERT INTO companies (
|
||||||
tenant_id, name, name_en, tax_identification_number, commercial_registration_number,
|
id, tenant_id, name, name_en, tax_identification_number, commercial_registration_number,
|
||||||
city, address, contact_email, contact_phone,
|
city, address, contact_email, contact_phone,
|
||||||
jofotara_client_id_encrypted, jofotara_secret_key_encrypted,
|
jofotara_client_id_encrypted, jofotara_secret_key_encrypted,
|
||||||
created_at
|
created_at
|
||||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
");
|
");
|
||||||
|
|
||||||
// Determine tenant_id: Super Admin chooses, Admin uses own
|
// Determine tenant_id: Super Admin chooses, Admin uses own
|
||||||
@@ -60,6 +60,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
|
\App\Core\Database::generateUuid(),
|
||||||
$tenantId,
|
$tenantId,
|
||||||
$encryptedName,
|
$encryptedName,
|
||||||
$encryptedNameEn,
|
$encryptedNameEn,
|
||||||
|
|||||||
@@ -59,8 +59,9 @@ if ($decoded['role'] === 'super_admin') {
|
|||||||
|
|
||||||
// 4. Save to Database
|
// 4. Save to Database
|
||||||
try {
|
try {
|
||||||
$stmt = $db->prepare("INSERT INTO users (tenant_id, name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO users (id, tenant_id, name, email, email_hash, password_hash, role, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
|
\App\Core\Database::generateUuid(),
|
||||||
$tenantId,
|
$tenantId,
|
||||||
$encryptedName,
|
$encryptedName,
|
||||||
$encryptedEmail,
|
$encryptedEmail,
|
||||||
|
|||||||
Reference in New Issue
Block a user