$lang[perhaps_you_were_looking_something_else]"; } elseif ($action == 'Preview') { if (!array_key_exists('rezform', $_SESSION)) $_SESSION['rezform']=array(); if (!is_array($_SESSION['rezform'])) $_SESSION['rezform']=array(); foreach ($_REQUEST as $ElementIndexValue => $ElementContents) { // this stuff is input that's already been dealt with if ($ElementIndexValue == "PHPSESSID") { // do nothing } elseif ($ElementIndexValue == "action") { // do nothing } elseif ($ElementIndexValue == "Form_ID") { // do nothing } elseif ($ElementIndexValue == "edit") { // do nothing } else { $_SESSION['rezform'][$ElementIndexValue] = $ElementContents; } } //var_dump($_REQUEST); // //var_dump($_SESSION); //echo "
"; var_dump($_SESSION['rezform']); echo ""; $kes = getDetails('FormsDB', 'Form_ID = '.$Form_ID, 'PreviewTemplate'); //$asra = $kes['PreviewTemplate']; if (trim($kes['PreviewTemplate']) == '') { echo "$lang[perhaps_you_were_looking_something_else]"; } global $HTTP_POST_VARS, $pass_the_form, $fail_message; $pass_the_form = validateForm2('FormsElements', $Form_ID, $_SESSION['rezform']); if ($pass_the_form == "No") { // if we're not going to pass it, tell that they forgot to fill in one of the fields //echo '
'.$fail_message.'
'; $kes = getDetails('FormsDB', 'Form_ID = '.$Form_ID, 'Template'); //$asra = $kes['PreviewTemplate']; if (trim($kes['Template']) == '') { echo "$lang[perhaps_you_were_looking_something_else]"; } //include_once($config['template_path']."/user_top.html"); include_once($config['basepath'].$kes['Template']); } else { include_once($config['basepath'].$kes['PreviewTemplate']); } } // end elseif ($listingID != "") elseif ($action == 'OkSend') { //include_once($config['template_path']."/user_top.html"); if (!array_key_exists('rezform', $_SESSION)) { echo "$lang[perhaps_you_were_looking_something_else]"; } elseif (!is_array($_SESSION['rezform'])) { echo "$lang[perhaps_you_were_looking_something_else]"; } elseif (count($_SESSION['rezform']) < 1) { echo "$lang[perhaps_you_were_looking_something_else]"; } else { $_SESSION['rezform']['ReferenceNo'] = getReferenceNo(); global $HTTP_POST_VARS, $pass_the_form; $pass_the_form = validateForm2('FormsElements', $Form_ID, $_SESSION['rezform']); if ($pass_the_form == "No") { // if we're not going to pass it, tell that they forgot to fill in one of the fields echo ''.$fail_message.'
'; } else { // what the program should do if the form is valid // now that that's taken care of, it's time to insert all the rest // of the variables into the database $message = updateFormData ($Form_ID, $_SESSION['rezform']); if ($message == "success") { $kes = getDetails('FormsDB', 'Form_ID = '.$Form_ID, array('OKTemplate','AdAlani', 'SoyadAlani', 'EmailAlani', 'EmailTemplate', 'Emails')); $emails = explode("\n",$kes['Emails']); if(!is_array($emails)) die('Email System Error: Email Address is false'); if(count($emails)<1) die('Email System Error: Email Address is false'); foreach($emails as $key => $dat) { if (trim($dat) != '') { $yaba = explode(":", $dat); if(!is_array($yaba)) die('Email System Error: Email Address is false 2'); if(count($yaba)<3) die('Email System Error: Email Address is false 2a'); $yaba[2] = strtr($yaba[2], array( "\n" => '')); $yaba[2] = strtr($yaba[2], array( "\r" => '')); $emails[$key] = array ( 'Ad' => $yaba[0], 'Email' => $yaba[1], 'Template' => $yaba[2] ); } else { unset($emails[$key]); } } $html = dosyaoku($config['basepath'].$kes['EmailTemplate']); //echo ""; var_dump($emails); echo ""; /* $conf["to"] : kime $conf["toemail"] : kime email $conf["from"] : kimden $conf["fromemail"] : kimden email $conf["type"] : Email Turu(html || platin) $conf["subject"] : Emailin konusu $conf["message"] : Emailin içeriği */ $emailconfig = array( 'to' => verial($kes['AdAlani']).((trim(verial($kes['SoyadAlani'])) == '') ? '' : (' '.trim($kes['SoyadAlani']) )), 'toemail' => verial($kes['EmailAlani']), 'from' => $config['site_name'], 'fromemail' => $config['contact_email'], 'type' => 'platin', 'subject' => $_POST['subject'], 'message' => $html ); if (SendMail($emailconfig)) { $emailconfig['from'] = $emailconfig['to']; $emailconfig['fromemail'] = $emailconfig['toemail']; foreach($emails as $key => $dat) { $emailconfig['to'] = $emails[$key]['Ad']; $emailconfig['toemail'] = $emails[$key]['Email']; $emailconfig['message'] = dosyaoku($config['basepath'].$emails[$key]['Template']); if (!SendMail($emailconfig)) { echo "Email didn't send. $lang[alert_site_admin]"; break; } } include_once($config['basepath'].$kes['OKTemplate']); } else { echo "Email didn't send. $lang[alert_site_admin]"; } } // end if else { echo "
$lang[alert_site_admin]
"; } // end else } // end if } } else { $kes = getDetails('FormsDB', 'Form_ID = '.$Form_ID, 'Template'); //$asra = $kes['PreviewTemplate']; if (trim($kes['Template']) == '') { echo "$lang[perhaps_you_were_looking_something_else]"; } //include_once($config['template_path']."/user_top.html"); include_once($config['basepath'].$kes['Template']); } include_once("$config[template_path]/user_bottom.html"); ?>