} $motd_reset = ' <fieldset id="motd_admin"> <legend>Admin Function</legend> <div class="instructions"> Administrators may edit the MOTD message (in HTML) under Site Admin / Edit Site Configuration. By default, members will be forced to view the MOTD every ' . MOTD_REPEAT_TIME . ' days. Pressing the reset button below (twice to confirm) will force all members to view the MOTD the next time they access this site. </div> <span id="total_views" class="total_views">' . $views_text . '</span> <input id="reset_motd" class="reset_motd" type="button" onblur="reset_motd(this,\'clear\')" onclick="reset_motd(this,\'set\')" value="RESET ALL MOTD VIEWS" title="Reset all MOTD views"> </div>'; } if ($_GET['display_as'] == 'popup') { $display_as_popup = true; // Make note that this member saw the MOTD ofs_put_status('motd_viewed', $_SESSION['member_id'], 'popup', MOTD_REPEAT_TIME * 24 * 60); } else { // Don't allow direct access to this page header('Location: ' . PATH . 'panel_member.php'); } $page_specific_javascript = ' <script type="text/javascript"> // This function requires two clicks to execute, changing style between. function reset_motd (obj, action) { if (action == "set") { if (jQuery(obj).hasClass("warn")) { jQuery.get("' . BASE_URL . PATH . 'motd.php?action=reset_motd", function(data) { // The returned value is the "total_views" text jQuery("#total_views").html(data); jQuery(obj).removeClass("warn"); })
$paypal_transaction_id = add_to_ledger(array('transaction_group_id' => $transaction_group_id, 'source_type' => 'internal', 'source_key' => 'paypal charges', 'target_type' => 'internal', 'target_key' => 'payment sent', 'amount' => $_POST['payment_fee'], 'text_key' => 'paypal charges', 'effective_datetime' => $effective_datetime, 'posted_by' => $row->member_id, 'replaced_by' => '', 'timestamp' => '', 'basket_id' => $row->basket_id, 'bpid' => '', 'site_id' => $row->site_id, 'delivery_id' => $row->delivery_id, 'pvid' => '', 'messages' => $paypal_message_array)); if (!is_numeric($paypal_transaction_id)) { debug_print("ERROR: 860224 ", array('Level' => 'WARNING', 'Scope' => 'PayPal API', 'File ' => __FILE__ . ' at line ' . __LINE__, 'Details' => array('Message' => 'Did not receive transaction_id when posting PayPal fee', 'IPN Data' => $_POST))); } // Second, post the Gross payment $payment_transaction_id = add_to_ledger(array('transaction_group_id' => $transaction_group_id, 'source_type' => 'internal', 'source_key' => 'payment received', 'target_type' => 'member', 'target_key' => $row->member_id, 'amount' => $_POST['payment_gross'], 'text_key' => 'payment received', 'effective_datetime' => $effective_datetime, 'posted_by' => $row->member_id, 'replaced_by' => '', 'timestamp' => '', 'basket_id' => $row->basket_id, 'bpid' => '', 'site_id' => $row->site_id, 'delivery_id' => $row->delivery_id, 'pvid' => '', 'messages' => $payment_message_array)); if (!is_numeric($payment_transaction_id)) { debug_print("ERROR: 785493 ", array('Level' => 'WARNING', 'Scope' => 'PayPal API', 'File ' => __FILE__ . ' at line ' . __LINE__, 'Details' => array('Message' => 'Did not receive transaction_id when posting PayPal payment', 'IPN Data' => $_POST))); } } else { // ERROR: Could not find basket die(debug_print("ERROR: 822345 ", array('Level' => 'FATAL', 'Scope' => 'PayPal API', 'File ' => __FILE__ . ' at line ' . __LINE__, 'Details' => array('Message' => 'Could not find basket information for basket #' . $number, 'IPN Data' => $_POST)))); } } elseif ($type == 'member') { // First update the status table with this posting ofs_put_status('paypal_txn_id', $_POST['txn_id'], $_POST['payment_gross'], PAYPAL_TTL); // Prepare to post the accounting $payment_message_array = array(); $payment_message_array['ledger comment'] = $_POST['memo']; $paypal_message_array = array(); $paypal_message_array['ledger paypal comment'] = 'From: ' . $_POST['payer_email']; $effective_datetime = date('Y-m-d H:i:s', strtotime($_POST['payment_date'])); $transaction_group_id = get_new_transaction_group_id(); include_once 'func.update_ledger.php'; // First, post the PayPal fee $paypal_transaction_id = add_to_ledger(array('transaction_group_id' => $transaction_group_id, 'source_type' => 'internal', 'source_key' => 'paypal charges', 'target_type' => 'internal', 'target_key' => 'payment sent', 'amount' => $_POST['payment_fee'], 'text_key' => 'paypal charges', 'effective_datetime' => $effective_datetime, 'posted_by' => $number, 'replaced_by' => '', 'timestamp' => '', 'basket_id' => '', 'bpid' => '', 'site_id' => '', 'delivery_id' => '', 'pvid' => '', 'messages' => $paypal_message_array)); if (!is_numeric($paypal_transaction_id)) { debug_print("ERROR: 275378 ", array('Level' => 'WARNING', 'Scope' => 'PayPal API', 'File ' => __FILE__ . ' at line ' . __LINE__, 'Details' => array('Message' => 'Did not receive transaction_id when posting PayPal fee', 'IPN Data' => $_POST))); } // Second, post the Gross payment $payment_transaction_id = add_to_ledger(array('transaction_group_id' => $transaction_group_id, 'source_type' => 'internal', 'source_key' => 'payment received', 'target_type' => 'member', 'target_key' => $number, 'amount' => $_POST['payment_gross'], 'text_key' => 'payment received', 'effective_datetime' => $effective_datetime, 'posted_by' => $number, 'replaced_by' => '', 'timestamp' => '', 'basket_id' => '', 'bpid' => '', 'site_id' => '', 'delivery_id' => '', 'pvid' => '', 'messages' => $payment_message_array));