'',"; $r1 = " 'plate_no' => '',\n 'bank_account' => '',\n 'bank_name' => '',\n 'bank_branch' => '',"; $s2 = " 'plate_no' => trim(\" $_POST['plate_no'] ?? ''\"),"; $r2 = " 'plate_no' => trim(\" $_POST['plate_no'] ?? ''\"),\n 'bank_account' => trim(\" $_POST['bank_account'] ?? ''\"),\n 'bank_name' => trim(\" $_POST['bank_name'] ?? ''\"),\n 'bank_branch' => trim(\" $_POST['bank_branch'] ?? ''\"),"; $s3 = " $plateNo = trim(\" $_POST['plate_no'] ?? ''\");"; $r3 = " $plateNo = trim(\" $_POST['plate_no'] ?? ''\");\n $bankAccount = trim(\" $_POST['bank_account'] ?? ''\");\n $bankName = trim(\" $_POST['bank_name'] ?? ''\");\n $bankBranch = trim(\" $_POST['bank_branch'] ?? ''\");"; $s4 = " if ($truckType === '' || $loadCapacity === '' || $plateNo === '') {\n $errors[] = 'Please complete truck details.';\n } elseif (!is_numeric($loadCapacity) || (float)$loadCapacity <= 0) {"; $r4 = " if ($truckType === '' || $loadCapacity === '' || $plateNo === '') {\n $errors[] = 'Please complete truck details.';\n } elseif ($bankAccount === '' || $bankName === '' || $bankBranch === '') {\n $errors[] = 'Please complete bank account details.';\n } elseif (!is_numeric($loadCapacity) || (float)$loadCapacity <= 0) {"; $s5 = <<prepare( "INSERT INTO truck_owner_profiles (user_id, phone, country_id, city_id, address_line, truck_type, load_capacity, plate_no, id_card_path, truck_pic_path, registration_path)" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); $ownerStmt->execute([ $userId, $phone, $countryId, $cityId, $addressLine, $truckType, $loadCapacity, $plateNo, json_encode($idCardPaths, JSON_UNESCAPED_SLASHES), $truckPic, json_encode($regPaths, JSON_UNESCAPED_SLASHES), ]); PHP; $r5 = <<prepare( "INSERT INTO truck_owner_profiles (user_id, phone, country_id, city_id, address_line, truck_type, load_capacity, plate_no, bank_account, bank_name, bank_branch, id_card_path, truck_pic_path, registration_path)" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); $ownerStmt->execute([ $userId, $phone, $countryId, $cityId, $addressLine, $truckType, $loadCapacity, $plateNo, $bankAccount, $bankName, $bankBranch, json_encode($idCardPaths, JSON_UNESCAPED_SLASHES), $truckPic, json_encode($regPaths, JSON_UNESCAPED_SLASHES), ]); PHP; $s7 = << HTML; $r7 = <<

Bank Details for Payouts

HTML; $content = str_replace($s1, $r1, $content); $content = str_replace($s2, $r2, $content); $content = str_replace($s3, $r3, $content); $content = str_replace($s4, $r4, $content); $content = str_replace($s5, $r5, $content); $content = str_replace($s7, $r7, $content); file_put_contents('register.php', $content); echo "Replaced in register.php\n";