function run()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $displayData = array();
     $lYear = $displayData['lYear'] = (int) trim($_POST['ddlYear']);
     $lACOID = (int) trim($_POST['rdoACO']);
     //------------------------------------------------
     // libraries and utilities
     //------------------------------------------------
     $this->load->model('sponsorship/msponsorship', 'clsSpon');
     $this->load->model('sponsorship/msponsor_charge_pay', 'clsSCP');
     $this->load->model('admin/madmin_aco', 'clsACO');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $this->load->helper('dl_util/time_date');
     $this->load->helper('dl_util/web_layout');
     $params = array('enumStyle' => 'terse', 'clsRpt');
     $this->load->library('generic_rpt', $params);
     //------------------------------------------------
     // ACO Info
     //------------------------------------------------
     $this->clsACO->loadCountries(false, true, true, $lACOID);
     $displayData['cACO'] =& $this->clsACO->countries[0];
     //------------------------------------------------
     // stripes
     //------------------------------------------------
     $this->load->model('util/mbuild_on_ready', 'clsOnReady');
     $this->clsOnReady->addOnReadyTableStripes();
     $this->clsOnReady->closeOnReady();
     $displayData['js'] = $this->clsOnReady->strOnReady;
     //------------------------------------------------
     // load a year's worth of charges/payments
     //------------------------------------------------
     $this->clsSCP->bUseDateRange = true;
     $income = array();
     for ($idx = 1; $idx <= 12; ++$idx) {
         $income[$idx] = new stdClass();
         $this->clsSCP->dteStart = dteMonthStart($idx, $lYear);
         $this->clsSCP->dteEnd = dteMonthEnd($idx, $lYear);
         $income[$idx]->curCharge = $this->clsSCP->curCumulativeChargeVia_ACOID(null, $lACOID);
         $income[$idx]->curPay = $this->clsSCP->curCumulativeSponVia_ACOID(false, null, false, null, $lACOID);
     }
     $displayData['income'] =& $income;
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['pageTitle'] = anchor('main/menu/reports', 'Reports', 'class="breadcrumb"') . ' | ' . anchor('reports/pre_spon_income/showOpts', 'Sponsorship Income', 'class="breadcrumb"') . ' | View Report';
     $displayData['title'] = CS_PROGNAME . ' | Reports';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'reports/pre_spon_income_rpt_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
function strMonthBetween($lMonth, $lYear)
{
    //-------------------------------------------------------------------------
    // return a string that represents the timespan encompased by a month
    // in mySQL date format
    //-------------------------------------------------------------------------
    $strStartDate = strPrepDateTime(dteMonthStart($lMonth, $lYear));
    $strEndDate = strPrepDateTime(dteMonthEnd($lMonth, $lYear));
    return $strStartDate . ' AND ' . $strEndDate;
}