- <?php
- $rootdir = dirname(__FILE__);
- $rootdir = substr($rootdir, 0, strpos($rootdir, '/modules/translationkings'));
- include($rootdir.'/system/config.inc.php'); /* Likefiction note for author: if this script is unsecure, database passwords will be revealed! */
- include($rootdir.'/modules/translationkings/language/'.$_COOKIE['lang'].'/quote.inc.php');
- $qcorder = $_GET['order'];
- $qcitem_values = $_GET['item_values'];
- $qcsources = $_GET['sources'];
- $qctargets = $_GET['targets'];
- $qcprice = $_GET['price'];
- if ($qcorder == "1") {$qcorder = "Document translation";}
- if ($qcorder == "2") {$qcorder = "Web translation";}
- if ($qcorder == "3") {$qcorder = "Document/Web translation proofreading";}
- function check_email_address($email)
- {
- return(eregi("^[a-z0-9_]+@[a-z0-9\-]+\.[a-z\-\.]+$",$email));
- }
- if(isset($_POST['submit']))
- {
- $error = '';
- if($_POST['email'] == '' || !check_email_address($_POST['email']))
- $error = $l['error_no_email'];
- if($_POST['name'] == '')
- $error = $l['error_no_name'];
- if($error != '')
- echo '<div class="error">'.$error.'</div>';
- else
- {
- switch($_POST['order'])
- {
- case 1:
- $qcorder = $l['document_translation'];
- break;
- case 2:
- $qcorder = $l['web_translation'];
- break;
- case 3:
- $qcorder = $l['web_document_translation_proofreading'];
- break;
- }
- /****
- Upload the files
- ****/
- $files = array ();
- $n = count ($_FILES['userfile']['error']);
- for ($i = 0; $i < $n; $i++) {
- if (!$_FILES['userfile']['error'][$i]) {
- $tmp = $_FILES['userfile']['tmp_name'][$i];
- $name = $_FILES['userfile']['name'][$i];
- $dir = 'uploads/';
- $path = $dir . $name;
- if (is_uploaded_file ($tmp)) {
- if (move_uploaded_file ($tmp, $path)) {
- chmod ($path, 0644);
- array_push ($files, $path);
- }
- }
- }
- }
- /****
- Send the email
- ****/
- $name = $_POST['name'];
- $email = $_POST['email'];
- //email values
- $subject = 'Order Translation Kings';
- $from = "no-reply@translationkings.nl";
- $headers = "From: $from";
- $to = "info@translationkings.nl";
- $message = 'Naam: '.$name.'
- Email: '.$email.'
- Telefoonnummer: '.$_POST['telephone'].'
- Opmerkingen: '.$_POST['comments'].'
- ORDER - '.$_POST['order'].'
- Aantal woorden: '.$_POST['item_values'].' '.$_POST['items'].'
- Taal Document: '.$_POST['sources'].'
- Vertaling(en): '.$_POST['targets'].'
- Prijs: '.$_POST['price'].'';
- /*
- Create the email with attachments
- */
- // boundary
- $semi_rand = md5(time());
- $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
- // headers for attachment
- $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
- // multipart boundary
- $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
- $message .= "--{$mime_boundary}\n";
- // preparing attachments
- for($x=0;$x<count($files);$x++)
- {
- $file = fopen($files[$x],"rb");
- $data = fread($file,filesize($files[$x]));
- fclose($file);
- $data = chunk_split(base64_encode($data));
- $message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$files[$x]\"\n" .
- "Content-Disposition: attachment;\n" . " filename=\"$files[$x]\"\n" .
- "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
- $message .= "--{$mime_boundary}\n";
- }
- //send the email
- mail($to, $subject, $message, $headers);
- echo '<p style="font-family: Arial, Verdana;">';
- echo $l['mail_send'];
- echo '</p>';
- exit();
- }
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
- <link type="text/css" rel="stylesheet" href="style.css" />
- <title>TranslationKings English | © 2009</title>
- <script type="text/javascript" src="mootools/mootools.js"></script>
- <script type="text/javascript">
- window.addEvent ('domready', function () {
- $$('a.add').each (function (item) {
- item.addEvent ('click', function (e) {
- e = new Event (e).preventDefault ();
- var p = item.getParent ();
- var clone = p.clone().injectBefore(p);
- var a = clone.getLast ();
- a.remove ();
- var remove = document.createElement ('a');
- remove.innerHTML = 'verwijderen';
- remove.href = '#';
- remove.addEvent ('click', function (e) {
- e = new Event (e).preventDefault ();
- this.getParent ().remove ();
- });
- clone.appendChild (remove);
- var f = p.getFirst ();
- f.value = '';
- });
- });
- });
- </script>
- </head>
- <body style="font-family:Arial, Helvetica, sans-serif;">
- <form id="my_form" method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'].'?lang='.$language; ?>">
- <?php
- echo '<input type="hidden" name="order" value="'.$qcorder.'" />';
- echo '<input type="hidden" name="item_values" value="'.$qcitem_values.'" />';
- echo '<input type="hidden" name="sources" value="'.$qcsources.'" />';
- echo '<input type="hidden" name="targets" value="'.$qctargets.'" />';
- echo '<input type="hidden" name="price" value="'.$qcprice.'" />';
- echo $l['full_name'].' *<br />';
- echo '<input type="text" name="name" value="'.$_POST['name'].'" /><br />';
- echo $l['email'].' *<br />';
- echo '<input type="text" name="email" value="'.$_POST['email'].'" /><br />';
- echo $l['telephone'].'<br />';
- echo '<input type="text" name="telephone" value="'.$_POST['telephone'].'" /><br />';
- echo "<div>";
- echo $l['upload'].'<br />';
- echo '<input name="userfile[]" type="file" /><br /> <a class="add" id="toevoegen" href="#">'.$l['extraUpload'].'</a>';
- echo "</div>";
- echo $l['comments'].'<br />';
- echo '<textarea name="comments" class="comments_textarea"></textarea><br />';
- echo '<input type="submit" name="submit" value="'.$l['order'].'" />';
- ?>
- </form>
- <!-- Google Code for bestelling site Conversion Page -->
- <script type="text/javascript">
- <!--
- var google_conversion_id = 1041142269;
- var google_conversion_language = "nl";
- var google_conversion_format = "3";
- var google_conversion_color = "ffffff";
- var google_conversion_label = "_USnCNm-mgEQ_aO68AM";
- var google_conversion_value = 0;
- //-->
- </script>
- <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
- </script>
- <noscript>
- <div style="display:inline;">
- <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1041142269/?label=_USnCNm-mgEQ_aO68AM&guid=ON&script=0"/>
- </div>
- </noscript>
- </body>
- </html>
