paypal_active = file_exists(ABSPATH . '/contents/paypal_ipn.php'); $page = get_var('page', 'full'); $method = get_var('method', $tpl->paypal_active ? 'paypal' : 'nachnahme'); $f = get_var('f', 'buy'); $p_id = get_var('id', '0'); if($p_id == 0) list_all(); get_header(); echo '
'; $row = $wpdb->get_row("SELECT * FROM {$table_prefix}produkte WHERE id='$p_id'", ARRAY_A); //----------------------------------------------------------- if(empty($row['id']) || $row['preis'] == '-') { $row = array(); $row['id'] = $p_id; $row['re'] = get_settings('siteurl'); $row['seitentitel'] = 'Seite nicht gefunden'; $tpl->assign($row); $tpl->display("tpl_notfound_$page.php"); exit; } $tpl->assign($row); $tpl->method = $method; $tpl->siteurl = get_settings('siteurl'); $tpl->waehrung = get_settings('waehrung'); $tpl->paypal_email = get_settings('paypal_email'); $tpl->err = &$err; $tpl->email = get_var('email'); if(TESTING && TESTING_MAIL) $sendmail = TESTING_MAIL; $tpl->sendmail = $sendmail; // $sendmail is in include_funcs.php $tpl->seitentitel = $tpl->titel; $tpl->disclaim = ""; //"Sie können dieses Produkt <-method_wechsel_moeglich-> per <-Method-> bestellen.
\n"; $tpl->method_wechsel_moeglich = "auch"; $tpl->agb = 'AGB'; if($tpl->preis == 0) $tpl->method = 'andere'; else if($tpl->method == 'andere') exit("----"); $tpl->wechsel_link = "$tpl->siteurl/produkt.php?id=$p_id&method="; if($tpl->method == 'paypal') { $tpl->Method = "Banküberweisung"; $tpl->wechsel_link .= "nachnahme"; } else { $tpl->Method = "PayPal"; $tpl->wechsel_link .= "paypal"; } if($tpl->service_preis == '-') $tpl->method_wechsel_moeglich = "nicht"; else $tpl->Method = "$tpl->Method"; $recur = preg_recur($tpl->recur, $tpl->preis); if($recur === true) { $tpl->cmd = '_xclick'; $tpl->preis_input = ''; } else { $tpl->method = 'paypal'; $tpl->Method = "Banküberweisung"; $tpl->disclaim .= "Der Abonnementpreis fällt wiederkehrend. Auf der Paypal Seite erfahren Sie mehr.
\n"; $tpl->method_wechsel_moeglich = "nicht"; $tpl->cmd = '_xclick-subscriptions'; //$recur = preg_recur($row['recur']); if(empty($recur['input'])) { $info .= "Recurring info unvollstaendig.\n"; $err .= 1; } else { $tpl->preis_input = $recur['input']; $tpl->preis = $recur['a3']; } } if(! $tpl->paypal_active) { if($tpl->method == 'paypal') { $tpl->method = 'nachnahme'; $tpl->method_wechsel_moeglich = "nicht"; } } else $tpl->disclaim .= "Sie können dieses Produkt $tpl->method_wechsel_moeglich per $tpl->Method bestellen.
\n"; $tpl->re = "$tpl->siteurl/produkt.php?id=$tpl->id&f=done&method=$tpl->method#formular"; //&email=".urlencode($row['email'])." $tpl->voll_preis = intval(@$tpl->service_preis) + @$tpl->preis; if($tpl->method == 'nachnahme') $tmp = "Bestellung per Bankueberweisung - $tpl->titel"; else $tmp = "Gratis Bestellung - $tpl->titel"; $tpl->mail_office_betreff = $tpl->mail_kunde_betreff = $tmp; // require_once $tpl->loadTemplate("inc_initials.php"); $subseq = get_var('subseq'); if(($tpl->method == 'nachnahme' || $tpl->method == 'andere') && $f != 'done') { $showform = $subseq?'':'1'; if($method == 'nachnahme') { $attributes = array( 'email', 'first_name', 'last_name' #'address_street', #'address_zip', #'address_city', #'address_country' ); foreach($attributes as $tmp) { $tpl->$tmp = get_var($tmp); if(empty($tpl->$tmp) && $subseq) { $tpl->{$tmp.'style'} = "background-color:#FF6633"; $showform = 1; } } // if(empty($tpl->address_country) && !$subseq) $tpl->address_country = "Oesterreich"; } $tpl->nickname = get_var('nickname'); if(!is_email($tpl->email) && $subseq) { $tpl->emailstyle = "background-color:#FF6633"; $showform = 1; } if(!$showform) { $tpl->mail_user_pass = true; $tpl->pass = rand_str(); $tpl->user_id = get_user_id($tpl->email, $tpl->pass, true); if($method == 'nachnahme') { $tpl_mail_kunde = "tpl_mail_kunde_nachnahme.php"; $err .= save_aktion($aktion_id, $tpl->method, $tpl->email, $tpl->id, 0); if(!empty($aktion_id)) { $info .= "Aktion ID: $aktion_id.\n"; $err .= save_aktion_data($aktion_id /* , $_POST */ ); } if(!get_usermeta($tpl->user_id,'first_name')) update_usermeta($tpl->user_id, 'first_name', $tpl->first_name); if(!get_usermeta($tpl->user_id,'last_name')) update_usermeta($tpl->user_id, 'last_name', $tpl->last_name); } else { // $method == 'andere' $err .= set_status($tpl->email,$tpl->id,'an'); // not forced to subscribe if($tpl->nickname) update_usermeta($tpl->user_id, 'nickname', $tpl->nickname); $err .= save_aktion($aktion_id, $tpl->method, $tpl->email, $tpl->id, 0, 1, 0, 'voll'); $tpl_mail_kunde = "tpl_mail_p$tpl->id.php"; if(!@is_file($tpl->loadTemplate($tpl_mail_kunde))) $tpl_mail_kunde = "tpl_mail_kunde_pass.php"; } $tpl->aktion_id = $aktion_id; if($tmp = $tpl->fetch($tpl_mail_kunde)) mail($tpl->email,$tpl->mail_kunde_betreff,$tmp,"From: {$tpl->sendmail}\r\n"); $tmp = $tpl->fetch("tpl_mail_office.php")."\n\n------------\n$info"; if($err) $tpl->mail_office_betreff = "Fehler - " . $tpl->mail_office_betreff; mail($sendmail,$tpl->mail_office_betreff,$tmp,"From: $sendmail\r\n"); $f = 'done'; } } else $tpl->assign($row); if($f == 'done') $tpl->pagetpl = "tpl_danke.php"; else $tpl->pagetpl = "tpl_{$tpl->method}_$page.php"; $tpl->formulartpl = "tpl_{$tpl->method}_formular.php"; $tpl->display($tpl->pagetpl); echo '
'; //@get_sidebar(); get_footer(); /* */ //echo ""; function list_all() { global $wpdb,$table_prefix,$info; get_header(); echo '
'; $rows = $wpdb->get_results("SELECT * FROM $table_prefix"."produkte WHERE preis NOT LIKE '-'", ARRAY_A); if(empty($rows[0]['id'])) echo '

Keine Produkte vorhanden.

'; else foreach($rows as $p) { ?>

'; // @get_sidebar(); get_footer(); exit(); } ?>