diff --git a/admin_truck_owner_edit.php b/admin_truck_owner_edit.php index eb8c642..d24c173 100644 --- a/admin_truck_owner_edit.php +++ b/admin_truck_owner_edit.php @@ -23,7 +23,7 @@ $stmt = db()->prepare(" SELECT u.id, u.email, u.full_name, u.status, u.role, p.phone, p.address_line, p.country_id, p.city_id, p.bank_account, p.bank_name, p.bank_branch, - p.id_card_path, p.is_company + p.id_card_path, p.is_company, p.ctr_number, p.notes FROM users u LEFT JOIN truck_owner_profiles p ON u.id = p.user_id WHERE u.id = ? AND u.role = 'truck_owner' @@ -70,6 +70,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { validate_csrf_token(); $bankName = trim($_POST['bank_name'] ?? ''); $bankBranch = trim($_POST['bank_branch'] ?? ''); $isCompany = isset($_POST['is_company']) ? 1 : 0; + $ctrNumber = trim($_POST['ctr_number'] ?? ''); + $notes = trim($_POST['notes'] ?? ''); if ($fullName === '') $errors[] = 'Full name is required.'; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) $errors[] = 'Valid email is required.'; @@ -95,10 +97,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { validate_csrf_token(); $stmtProfile = db()->prepare(" UPDATE truck_owner_profiles SET phone = ?, address_line = ?, country_id = ?, city_id = ?, - bank_account = ?, bank_name = ?, bank_branch = ?, is_company = ? + bank_account = ?, bank_name = ?, bank_branch = ?, is_company = ?, + ctr_number = ?, notes = ? WHERE user_id = ? "); - $stmtProfile->execute([$phone, $addressLine, $countryId, $cityId, $bankAccount, $bankName, $bankBranch, $isCompany, $userId]); + $stmtProfile->execute([$phone, $addressLine, $countryId, $cityId, $bankAccount, $bankName, $bankBranch, $isCompany, $ctrNumber, $notes, $userId]); db()->commit(); $flash = 'Truck Owner profile updated successfully.'; @@ -121,8 +124,8 @@ if (!$isAjax):