function formsave() { $option = $_POST['option']; if (isset($this->PageOptions[$option])) { $options = $_POST; unset($options['option']); unset($options['task']); $options = removeslashes($options); update_option($option, $options); } echo 'New configuration saved'; }
} $order_id = md5($data['id_order'] . CarRental::$hash_salt . $data['email']); $emailBody = str_replace('[CustomerName]', $data['first_name'] . " " . $data['last_name'], $emailBody); $emailBody = str_replace('[ReservationDetails]', $data['vehicle'] . ', ' . $data['enter_date'] . ' (' . $data['enter_loc'] . ') - ' . $data['return_date'] . ' (' . $data['return_loc'] . ')', $emailBody); $emailBody = str_replace('[Car]', $data['vehicle'], $emailBody); $emailBody = str_replace('[pickupdate]', $date_from, $emailBody); $emailBody = str_replace('[dropoffdate]', $date_to, $emailBody); $emailBody = str_replace('[pickup_location]', $data['enter_loc'], $emailBody); $emailBody = str_replace('[dropoff_location]', $data['return_loc'], $emailBody); $emailBody = str_replace('[rental_days]', $diff_days, $emailBody); $emailBody = str_replace('[ReservationNumber]', $data['id_order'], $emailBody); $emailBody = str_replace('[ReservationLink]', home_url() . '?page=carrental&summary=' . $order_id, $emailBody); $emailBody = str_replace('[ReservationLinkStart]', '<a href="' . home_url() . '?page=carrental&summary=' . $order_id . '">', $emailBody); $emailBody = str_replace('[ReservationLinkEnd]', '</a>', $emailBody); $emailBody = '<html><body>' . $emailBody . '</body></html>'; $emailBody = removeslashes(nl2br($emailBody)); $emailSubject = str_replace('[CustomerName]', $data['first_name'] . " " . $data['last_name'], $emailSubject); $emailSubject = str_replace('[ReservationDetails]', $data['vehicle'] . ', ' . $data['enter_date'] . ' (' . $data['enter_loc'] . ') - ' . $data['return_date'] . ' (' . $data['return_loc'] . ')', $emailSubject); $emailSubject = str_replace('[Car]', $data['vehicle'], $emailSubject); $emailSubject = str_replace('[pickupdate]', $date_from, $emailSubject); $emailSubject = str_replace('[dropoffdate]', $date_to, $emailSubject); $emailSubject = str_replace('[pickup_location]', $data['enter_loc'], $emailSubject); $emailSubject = str_replace('[dropoff_location]', $data['return_loc'], $emailSubject); $emailSubject = str_replace('[rental_days]', $diff_days, $emailSubject); $emailSubject = str_replace('[ReservationNumber]', $data['id_order'], $emailSubject); $emailSubject = str_replace('[ReservationLink]', home_url() . '?page=carrental&summary=' . $order_id, $emailSubject); $emailSubject = str_replace('[ReservationLinkStart]', '<a href="' . home_url() . '?page=carrental&summary=' . $order_id . '">', $emailSubject); $emailSubject = str_replace('[ReservationLinkEnd]', '</a>', $emailSubject); $recipient = $data['email']; $subject = $emailSubject == '' ? "Thank you email" : $emailSubject; $company = unserialize(get_option('carrental_company_info'));