email; if (!empty($_POST['email'])) { $from = $_POST['name'] . ' <' . $_POST['email'] . '>'; } else { $from = "{$setup->short_name} "; } $headers = 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=windows-1251' . "\n"; $headers .= "From: $from" . "\n"; $headers .= "Reply-To: $from" . "\n"; $message = "$subject"; $message .= ""; $message .= ""; if (!empty($_POST['company'])) { $message .= ""; } if (!empty($_POST['email'])) { $message .= ""; } $message .= ""; $message .= ""; $message .= ""; if (!empty($_POST['additional'])) { $message .= ""; $message .= ""; } $message .= "
Контактное лицо:{$_POST['name']}
Предприятие:{$_POST['company']}
E-mail:{$_POST['email']}
Телефон:{$_POST['phone']}
Наименование продукции:{$_POST['product']}
Количество:{$_POST['quantity']}
Дополнительная информация
{$_POST['additional']}
"; mail($to, $subject, $message, $headers); $data['success'] = true; } $data['errors'] = $errors; $data['product'] = $_POST['product']; $data['quantity'] = $_POST['quantity']; } else { $id = (isset($_GET['id'])) ? intval($_GET['id']) : 0; if ($id) { $data['product'] = $mysql->select('title')->from('products')->where('id', $id)->fetch_value(); $data['quantity'] = 1; } else { $data['product'] = ''; $data['quantity'] = ''; } $data['errors'] = array(); } $data['page'] = new Page(7); $data['title'] = $data['page']->title; $data['layout'] = 'order'; load_template('main', $data); ?>