All pastes #483758 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-11 21:34 UTC
rendered paste body
		if (!$print&&($this_user||$this_admin)&&$now_due&&$_GATEWAYS['mod_paypal']['mod_enabled']) {
                        $pp_item_number=$this_invoice["invoice_id"];
                        $pp_amount=$this_invoice["invoice_amount"]-$this_invoice["invoice_amount_paid"];

                        // Show extra futurepay link
                        if ($_GATEWAYS['mod_paypal']['sub_enabled']) {

                            $sql = "SELECT * FROM invoice_log i, client_package cp WHERE i.cp_id = cp.cp_id AND i.invoice_id = $this_invoice[invoice_id]";
                            $result = mysql_query_logger($sql);
                            while($this_cp = mysql_fetch_array($result)) {

                                  // set first instancse of billing cycle
                                  if (!isset($last_cp_billing_cycle)) {
                                      $last_cp_billing_cycle = $this_cp[cp_billing_cycle];
                                  }
                                  // check for different billing cycles
                                  if ($last_cp_billing_cycle != $this_cp[cp_billing_cycle]) {
                                      $multiple_cycles = TRUE;
                                  }

                            }

                            // if only one billing cycle, then show futurepay payment
                            if (!$multiple_cycles) {
                                 $order_totals['cp_billing_cycle'] = $last_cp_billing_cycle;
                                 $order_totals['due_next_renewal_tax_included'] = $pp_amount;
                            }

                        }

                        echo generate_paypal_link($pp_item_name,$pp_item_number,$pp_amount,"button");

                    }
                    if ( ($this_invoice['client_id']=='2') ) {
                        $pp_item_number=$this_invoice["invoice_id"];
 			$pp_amount=$this_invoice["invoice_amount"]-$this_invoice["invoice_amount_paid"];

                        // Show extra futurepay link
                        if ($_GATEWAYS['mod_paypalUSD']['sub_enabled']) {

                            $sql = "SELECT * FROM invoice_log i, client_package cp WHERE i.cp_id = cp.cp_id AND i.invoice_id = $this_invoice[invoice_id]";
                            $result = mysql_query_logger($sql);
                            while($this_cp = mysql_fetch_array($result)) {

                                  // set first instancse of billing cycle
                                  if (!isset($last_cp_billing_cycle)) {
                                      $last_cp_billing_cycle = $this_cp[cp_billing_cycle];
                                  }
                                  // check for different billing cycles
                                  if ($last_cp_billing_cycle != $this_cp[cp_billing_cycle]) {
                                      $multiple_cycles = TRUE;
                                  }

                            }

                            // if only one billing cycle, then show futurepay payment
                            if (!$multiple_cycles) {
                                 $order_totals['cp_billing_cycle'] = $last_cp_billing_cycle;
                                 $order_totals['due_next_renewal_tax_included'] = $pp_amount;
                            }
                        }

                        echo generate_paypal_link_USD($pp_item_name,$pp_item_number,$pp_amount,"button");

                    }