if (pn_is_ntf_mail_service_on() && $pn_request['transactionType'] == "CHARGE") { pn_send_email_notification($pn_request['email'], $pn_request['title'] . ' ' . $pn_request['firstName'] . ' ' . $pn_request['lastName'], $pn_request['productName'], $pn_request['contractName'], $pn_request['transactionDate']); } } } } else { foreach ($pn_request as $key => $val) { $rows_affected = $wpdb->insert($wpdb->prefix . "plimus_pn", array('pn_orn' => $transaction_id, 'pn_meta_key' => $key, 'pn_meta_value' => $val)); } foreach ($promotions as $key => $val) { foreach ($val as $or_key => $or_val) { $rows_affected = $wpdb->insert($wpdb->prefix . "plimus_pn", array('pn_orn' => $transaction_id, 'pn_meta_key' => $or_key, 'pn_meta_value' => $or_val)); } } if (pn_is_ntf_mail_service_on() && $pn_request['transactionType'] == "CHARGE") { pn_send_email_notification($pn_request['email'], $pn_request['title'] . ' ' . $pn_request['firstName'] . ' ' . $pn_request['lastName'], $pn_request['productName'], $pn_request['contractName'], $pn_request['transactionDate']); } } if ($pn_request['username'] != '' && pn_is_register_user_on() && $pn_request['transactionType'] == "CHARGE") { $pn_user = $pn_request['email']; $pn_email = $pn_request['email']; $pass_u = pn_create_user($pn_user, $pn_email, $pn_request['firstName'], $pn_request['lastName'], $pn_request['title']); if ($pass_u) { logToFile($pn_user . ', ' . $pn_email . ', ' . $pass_u); $m_sub = 'Account information'; $m_msg = html_entity_decode(get_option('pn_email_template')); $m_user = $pn_user; $m_pass = $pass_u; $m_login = get_bloginfo('wpurl') . '/wp-login.php'; $tmp_from = array('{USER_NAME}', '{PASSWORD}', '{LOGIN_URL}'); $tmp_to = array($m_user, $m_pass, $m_login);
function pn_handle_pdf_page() { global $pn_plugin_url; $action_url = $_SERVER['REQUEST_URI']; $run_file_path = $pn_plugin_url . "/plimusipn.php"; if (isset($_REQUEST['clear_all'])) { $plimus_pn = $wpdb->prefix . "plimus_pn"; $query_db = "DROP TABLE IF EXISTS {$plimus_pn}"; $drop = $wpdb->query($query_db); } if (isset($_REQUEST['save_settings']) != '') { $pn_options = array(); $pn_options['pn_email_template'] = stripslashes(htmlspecialchars($_POST['pn_email_tmp'])); $pn_options['pn_reg_email_on'] = isset($_POST['pn_reg_mail_on']) && $_POST['pn_reg_mail_on'] == 'on' ? 1 : 0; $pn_options['pn_reg_user_on'] = isset($_POST['pn_reg_user_on']) && $_POST['pn_reg_user_on'] == 'on' ? 1 : 0; $pn_options['pn_register_role'] = isset($_POST['pn_register_role']) ? $_POST['pn_register_role'] : 'subscriber'; $pn_options['pn_tpl_send'] = isset($_POST['pn_send_mail_on']) && $_POST['pn_send_mail_on'] == 'on' ? 1 : 0; $pn_options['pn_tpl_name'] = isset($_POST['your_name']) ? $_POST['your_name'] : ''; $pn_options['pn_tpl_email'] = isset($_POST['your_email']) ? $_POST['your_email'] : ''; $pn_options['pn_tpl_email_text'] = stripslashes(htmlspecialchars($_POST['email_tmp'])); $pn_options['pn_tpl_email_subject_text'] = stripslashes(htmlspecialchars($_POST['tpl_subject_text'])); foreach ($pn_options as $key => $val) { add_option($key, $val) or update_option($key, $val); } } if (isset($_REQUEST['refresh']) != '') { $pn_options['pn_tpl_send'] = $_POST['pn_send_mail_on'] == 'on' ? 1 : 0; $pn_options['pn_tpl_name'] = $_POST['your_name']; $pn_options['pn_tpl_email'] = $_POST['your_email']; $pn_options['pn_tpl_email_text'] = stripslashes(htmlspecialchars($_POST['email_tmp'])); $pn_options['pn_tpl_email_subject_text'] = stripslashes(htmlspecialchars($_POST['tpl_subject_text'])); foreach ($pn_options as $key => $val) { add_option($key, $val) or update_option($key, $val); } pn_send_email_notification($_REQUEST['your_email'], $_REQUEST['your_name'], 'Test Product Name', 'Test Contract Name', 'NOW', true); } $pn_options = pn_get_options(); if (!empty($pn_options)) { $pn_email_on = $pn_options['pn_tpl_send'] == 1 ? 'checked' : ''; $pn_reg_email_on = $pn_options['pn_reg_email_on'] == 1 ? 'checked' : ''; $pn_reg_user_on = $pn_options['pn_reg_user_on'] == 1 ? 'checked' : ''; $pn_your_name = $pn_options['pn_tpl_name'] != '' ? $pn_options['pn_tpl_name'] : 'Your Name'; $pn_your_email = $pn_options['pn_tpl_email'] != '' ? $pn_options['pn_tpl_email'] : 'Your Email'; $pn_tpl_reg_email_text = html_entity_decode($pn_options['pn_email_template'] != '' ? $pn_options['pn_email_template'] : "Account successfully created.<br />\n<br />\nUser name: {USER_NAME}<br />\nPassword: {PASSWORD}<br />\nLogin URL: {LOGIN_URL}\n<br />\n<br />\n"); $pn_tpl_reg_email_subject = html_entity_decode($pn_options['pn_tpl_email_subject_text'] != '' ? $pn_options['pn_tpl_email_subject_text'] : 'Insert Your Registration Email Subject Here'); $pn_tpl_email_text = html_entity_decode($pn_options['pn_tpl_email_text'] != '' ? $pn_options['pn_tpl_email_text'] : 'Insert Your Notification Email Template Here'); } if (!function_exists('wp_dropdown_roles')) { include_once ABSPATH . 'wp-admin/user-new.php'; } ?> <div class="wrap" style="min-width:1000px !important;"> <h2><a href="http://www.Bluesnap.com" title="Bluesnap - Take charge" target="_blank"><img src="<?php echo $pn_plugin_url; ?> /images/plimus_logo.png" alt="Bluesnap" id="plimus-logo" /></a>for WordPress Options</h2><br /> <h3>Bluesnap IPN URL</h3> <i id="note">* This is the path to Bluesnap IPN file. Copy and paste this URL to General Settings page in your Bluesnap dashboard.</i><br /><br /> <div id="plimus_run_path"><?php echo $run_file_path; ?> </div><br /><br /> <h3 id="notification">Registration Email</h3> <form action="<?php echo $action_url; ?> " method="post" id="settings_form"> <input type="checkbox" name="pn_reg_user_on" <?php echo $pn_reg_user_on; ?> /> Register new buyers as <select name="pn_register_role" id="adduser-role"> <?php wp_dropdown_roles(get_option('pn_register_role') != '' ? get_option('pn_register_role') : 'subscriber'); ?> </select> <input type="submit" name="save_settings" id="save_settings" value="Save Settings" class="button-primary"/><br /> <input type="checkbox" name="pn_reg_mail_on" <?php echo $pn_reg_email_on; ?> /> Send registration email to new users <br /><br /><i id="note">* you may use <code>{USER_NAME}</code> <code>{PASSWORD}</code> <code>{LOGIN_URL}</code> codes that will be replaced with new user data.</i><br /> <textarea cols="90" rows="10" name="pn_email_tmp" id="pn_email_tmp" ><?php echo $pn_tpl_reg_email_text; ?> </textarea> <div id="legend"></div> <div style="clear:both"></div> <h3 id="notification">Purchase Notification Email</h3> <input type="checkbox" name="pn_send_mail_on" <?php echo $pn_email_on; ?> /> Turn purchase notification email on <input type="submit" name="save_settings" id="save_settings" value="Save Settings" class="button-primary"/><br /> <div id="template_exp"> <i id="note">Set your subject, name and email, that will appear in e-mail header.</i> <br /><i id="note">* you may use <code>{NAME}</code> <code>{PRODUCT}</code> <code>{CONTRACT}</code> <code>{DATE}</code> codes that will be replaced with data from the invoice.</i><br /> </div> <input type="text" name="tpl_subject_text" id="tpl_subject_text" size="120" value="<?php echo $pn_tpl_reg_email_subject; ?> " /><br /> <input type="text" name="your_name" id="your_name" size="30" value="<?php echo $pn_your_name; ?> " /> <input type="text" name="your_email" id="your_email" size="60" value="<?php echo $pn_your_email; ?> " /><br /> <div id="template_exp"> </div> <textarea cols="90" rows="10" name="email_tmp" id="email_tmp" ><?php echo $pn_tpl_email_text; ?> </textarea> </form><br /> </div> </div> <h5><a href="http://www.prelovac.com" title="Plugin by Prelovac Media" ><img src="<?php echo $pn_plugin_url; ?> /images/logo.png" style="margin-top: 30px;"/></a> </h5> <br clear="both"> <?php }