'; echo 'Goal Preferences '; echo 'center'>'; echo ''; ShowDropBox('use_goal', 'Choose which goal type you would like to use.', '', '', ''); echo ' '; $query_Recordset1 = "SELECT * FROM ".$xoopsDB->prefix("donations_config")." WHERE name = 'week_goal' AND subtype<>'Default'"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); $desc = htmlentities($row_Recordset1['text']); echo ''; $query_Recordset1 = "SELECT * FROM ".$xoopsDB->prefix("donations_config")." WHERE name = 'month_goal' AND subtype<>'Default'"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); $desc = htmlentities($row_Recordset1['text']); echo ''; echo 'center'>'; ShowTextBox('swing_day', 'Month Swing Day', '175', '4', 'onChange="return validInt(this,'Swing Day',1);"'); echo ' '; $query_Recordset1 = "SELECT * FROM ".$xoopsDB->prefix("donations_config")." WHERE name = 'quarter_goal' AND subtype<>'Default'"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); $desc = htmlentities($row_Recordset1['text']); echo ' '; echo 'center' width='100%'> | '; echo ' '; echo ''; } function ConfigUpdate() { global $tr_config, $modversion, $xoopsDB; echo " #0000FF">If you see this screen then an SQL error was encountered" . "You should see a message in #FF0000">RED below indicating what the error is
"; $ERR = 1; $ilog=""; $ilog .= " "; foreach( $_POST as $option => $value ) { /// Look for form variables if( preg_match("/var_/",$option)) { $varnm = preg_replace("/var_/","",$option); // Check for subtype field if( preg_match("/-(.*)/",$varnm,$subtype) ) { echo " subtype = $subtype[1] "; $temp = $varnm; $varnm = preg_replace("/-.*/","",$temp); // Is this is a text field? if( preg_match("/([^-]*)-txt/",$subtype[1], $subtype2) ) { if (!get_magic_quotes_gpc()) { $textarea = addslashes($value); } else { $textarea = $value; } echo "$varnm $subtype2[1] text=> " . nl2br(htmlspecialchars($textarea)) . " "; $ERR &= UpdateDb($varnm, $subtype2[1], "0", $textarea); } else { echo "$varnm $subtype[1] => $value "; $ERR &= UpdateDbShort($varnm, $subtype[1], $value, ""); } } else { echo "$varnm => $value "; $ERR &= UpdateDbShort($varnm, "", $value, ""); } } } // If there were no errors if( $ERR == 0 ) Header("Location: index.php?op=Config#AdminTop"); } function IpnRec() { global $tr_config, $modversion, $xoopsDB, $curr_sign; $query_Recordset1 = "select `date` as recdate from ".$xoopsDB->prefix("donations_financial")."" ." where name='PayPal IPN' order by date desc limit 1"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); if($row_Recordset1){ $recdate = "payment_date > '".$row_Recordset1['recdate']."' and"; }else{ $recdate = ''; } $query_Recordset1 = "select `payment_date` as curdate from ".$xoopsDB->prefix("donations_transactions")."" ." where payment_status='Completed' and (txn_type='send_money' or txn_type='web_accept')" ." order by payment_date desc limit 1"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); $curdate = $row_Recordset1['curdate']; $query_Recordset1 = "select sum(mc_gross - mc_fee) as ipn_total, count(*) as numrecs" ." from ".$xoopsDB->prefix("donations_transactions")." where ($recdate payment_date <= '$curdate')" ." and payment_status = 'Completed' and (txn_type='send_money' or txn_type='web_accept')"; $Recordset1 = $xoopsDB->query($query_Recordset1); $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); echo "title">Update register with PayPal IPN
"; if( $row_Recordset1['numrecs'] == 0 ) echo "There are no new IPN records to import! "; else { $insert_set = "INSERT INTO `".$xoopsDB->prefix("donations_financial")."` (`date`,`num`,`name`,`descr`,`amount`) VALUES ('$curdate','','PayPal IPN','Auto-Reconcile','".$row_Recordset1['ipn_total']."')"; if($xoopsDB->queryF($insert_set)) echo "$row_Recordset1[numrecs] IPN records have been imported for a total of $curr_sign" . sprintf("%0.2f", $row_Recordset1['ipn_total']); else echo " ERROR : There are $row_Recordset1[numrecs] to import, but there was an " ."error encoutered during db record insertion into Financial table. Insertion " ."FAILED"; } echo "
|