コード例 #1
0
ファイル: BOKFRateCalculator.php プロジェクト: srccn/f3
 public function getPurchaseRate()
 {
     parent::calculateAllAdjusts();
     Util::dump("Adjusts Details", $this->adjusts);
     Util::dump("Total adjust is ", Util::getSumValue($this->adjusts));
     return parent::getPurchaseRateType1();
 }
コード例 #2
0
ファイル: myClass.php プロジェクト: srccn/f3
 function signout()
 {
     //$this->f3->SESSION['user'] = '******';
     session_destroy();
     Util::dump($this->f3->SESSION);
     $this->f3->reroute('/home');
 }
コード例 #3
0
ファイル: SecondaryRateCalculator.php プロジェクト: srccn/f3
 function getSecondaryRate()
 {
     $rate = 4.49;
     $secondaryLoanAmount = $this->secondaryLoanAmount;
     $yearTerm = $this->loanYearTerm;
     Util::dump("Secondary loan {$secondaryLoanAmount} at hard coded Rate 4.49 % ");
     return array("purchaser" => "PartiotsBank", "rate" => $rate, "credit" => 0, "localDays" => 45, "monthlyPayment" => Util::calMonthlyPayment($secondaryLoanAmount, $rate, $yearTerm));
 }
コード例 #4
0
ファイル: BBTRateCalculator.php プロジェクト: srccn/f3
 public function getPurchaseRate()
 {
     parent::calculateAllAdjusts();
     $this->getSuperConfirmingAdj();
     Util::dump("Adjustment", $this->adjusts);
     Util::dump("Total adjust is ", Util::getSumValue($this->adjusts));
     return $this->getPurchaseRateType1();
 }
コード例 #5
0
ファイル: MailController.php プロジェクト: srccn/f3
 function mailTest()
 {
     $headers = $this->header;
     $to = "*****@*****.**";
     $subject = "My subject";
     $msg = "Hello from php email";
     // $headers .= "CC: somebodyelse@example.com";
     if (empty($to) || empty($subject) || empty($msg) || empty($headers)) {
         Util::dump("Failed send email " . $to . ";" . $subject . ";" . $msg . ";" . $From);
     } else {
         Util::dump("Send email " . $to . ";" . $subject . ";" . $msg . ";");
         mail($to, $subject, $msg, $headers);
     }
 }
コード例 #6
0
ファイル: LoadAdj_ltv_ccController.php プロジェクト: srccn/f3
 public function loadDataFromExcel()
 {
     $mydatamap = $this->mapData->getAdjLtvCcMap();
     $purchaser_id = $this->getPurchaserId();
     $adjusts = array_keys($mydatamap);
     $adjusts_count = count($adjusts);
     for ($i = 0; $i < $adjusts_count; $i++) {
         $worksheet = $mydatamap[$adjusts[$i]]['sheetName'];
         $range = $mydatamap[$adjusts[$i]]['range'];
         $this->objPHPExcel->setActiveSheetIndexByName($worksheet);
         $result0 = $this->objPHPExcel->getActiveSheet()->rangeToArray($range, NULL, TRUE, FALSE);
         $result = Util::cleanTable($result0);
         //see if we need to rotate table
         if (isset($mydatamap[$adjusts[$i]]['rotate'])) {
             $result = Util::rotateTable($result);
         }
         Util::dump("Array to load for LTV credit adj table. ", $result);
         $result_count = count($result);
         for ($j = 0; $j < $result_count; $j++) {
             //compose array purchaser_id, ltv_value, cc_value, adjust
             $cc_value = $mydatamap[$adjusts[$i]]['cc'][$j];
             $ltvs = $mydatamap[$adjusts[$i]]['ltv'];
             $ltvs_count = count($ltvs);
             for ($k = 0; $k < $ltvs_count; $k++) {
                 $adjust = $result[$j][$k];
                 //echo $purchaser_id . "," . $mydatamap[$adjusts[$i]]['ltv'][$k] . "," . $cc_value . ",". $adjust . "<br>" ;
                 $insert_row = [$purchaser_id, $mydatamap[$adjusts[$i]]['ltv'][$k], $cc_value, $adjust];
                 $insert_row_string = "(" . implode(",", $insert_row) . ")";
                 array_push($this->insert_data, $insert_row_string);
             }
             //$k each row read
         }
         // $j for each row
     }
     //$i each of the adjustsment
     unset($this->objPHPExcel);
 }
コード例 #7
0
ファイル: PropertyController.php プロジェクト: srccn/f3
 function searchRate()
 {
     //create LoanProperty base on inputs
     $property = new LoanProperty($this->inputs);
     $this->f3->set('loanProperty', $property->getShowArray());
     $this->f3->set('propertyLabel', $property->getPropertLabel());
     //set Closing options and time stamp
     $this->closingOption = $property->getClosingOption();
     $this->f3->set('ClosingOption', $this->closingOption);
     date_default_timezone_set('EST');
     $this->f3->set('searchStamp', date("m-d-Y g:i a"));
     //determine purchaser list
     if (in_array("ALL", $property->purchaserSelection)) {
         //do ntohing take default all;
     } else {
         $this->setPurchasers($property->purchaserSelection);
     }
     //determine loanName - what kind of loan selected.
     if (in_array("all", $property->loanNameSelection)) {
         //do ntohing take default all;
     } else {
         $this->setLoanNames($property->loanNameSelection);
     }
     //find loan amount options
     $myoptions = $property->loanAmountOptions;
     //build calculation target list use loanAmount, loanName, purchaser
     $calTargetArray = Util::arrayComb(array($this->loanNames, $property->loanAmountOptions, $this->purchasers));
     //var_dump($calTargetArray);
     //calculate fees for each option in an array
     $myFeeCalculator = new FeeCalculator($property);
     $totalFeeByOptions = $myFeeCalculator->getOptionsFee();
     $this->f3->set('feeOptions', $totalFeeByOptions);
     //get all purchaser and loan names
     $purchasers = $this->purchasers;
     $loanNames = $this->loanNames;
     foreach ($loanNames as $loanName) {
         $property->loanName = $loanName;
         $property->setLoanTypeId();
         Util::dump("--------" . $loanName);
         $this->viewRecords[$loanName] = array();
         //$purchasers=["BOKF"];
         foreach ($purchasers as $purchaser) {
             $myRecord = new ViewRecord();
             $myRecord->product = $loanName;
             $myRecord->purchaser = $purchaser;
             foreach ($myoptions as $opt) {
                 $property_clone = clone $property;
                 Util::dump("=== purchaser {$purchaser}, loan option = {$opt['1']} + {$opt['2']}");
                 if ($opt[2] > 0) {
                     Util::dump("=== Primary loan", "");
                 }
                 $myRecord1 = clone $myRecord;
                 $myRecord1->loanAmount = $opt[1];
                 $property_clone->loanAmount = $opt[1];
                 $property_clone->calculateDerives();
                 $property_clone->setLoanTypeId();
                 //Util::dump ( "Loan Property : ",  $property_clone);
                 $purchaserCalculatorName = $purchaser . "RateCalculator";
                 $myRateCalculator = new $purchaserCalculatorName();
                 $myRateCalculator->setProperty($property_clone);
                 //set total fee for this option
                 $myRateCalculator->setTotalFee($totalFeeByOptions[$opt[0]][2]);
                 $myresult = $myRateCalculator->calculteRate();
                 if ($myresult == null) {
                     //incase no valid result found, skip to next
                     continue;
                 }
                 $this->setResultRecord($myRecord1, $myresult);
                 $myRecord2 = null;
                 if ($opt[2] > 0) {
                     Util::dump("=== Secondary loan");
                     $myRecord2 = clone $myRecord;
                     $mySecondaryRateCalculator = new SecondaryRateCalculator($opt[2], $property_clone->loanTerm);
                     $myresult2 = $mySecondaryRateCalculator->getSecondaryRate();
                     $myRecord2->loanAmount = $opt[2];
                     $this->setResultRecord($myRecord2, $myresult2);
                 }
                 $resultRecord = array("part1" => $myRecord1, "part2" => $myRecord2, "option" => $opt[0], "fees" => $totalFeeByOptions[$opt[0]]);
                 // var_dump ($resultRecord );
                 array_push($this->viewRecords[$loanName], $resultRecord);
             }
             //option
         }
         //purchaser
         $r = usort($this->viewRecords[$loanName], 'Util::cmp');
         $bestResult = Util::bestResult($this->viewRecords[$loanName]);
         $this->viewRecords[$loanName] = $bestResult;
         Util::dump("Calculate result for {$loanName}", $this->viewRecords[$loanName]);
     }
     //loanName
     //echo json_encode($this->viewRecords)."<br>";
     $this->f3->set('SearchResults', $this->viewRecords);
     //$this->f3->set('SearchResults', $bestResult);
 }
コード例 #8
0
ファイル: FeeCalculator.php プロジェクト: srccn/f3
 function getTotalFees($optionAmount = 0)
 {
     $this->property->loanAmount = $optionAmount;
     Util::dump("Appraisal fee", $this->getAppraisalFee());
     Util::dump("Lender Insurance fee", $this->getLenderInsuranceFee());
     Util::dump("Title Insurance fee", $this->getTitleInsuranceFee());
     Util::dump("Recording fee", $this->getRecordingFee());
     Util::dump("Recording other fee", $this->getRecordingOtherFee());
     Util::dump("Attorney fee", $this->getAttoneyFee());
     Util::dump("Total Fee is ", Util::getSumValue($this->fees));
     return intVal(Util::getSumValue($this->fees));
 }
コード例 #9
0
ファイル: simpleKMLTest.php プロジェクト: rccc/simpleGeo
<?php

require_once 'lib/Format/KML.class.php';
$options = array("extractStyles" => true);
$test = new KML($options);
/** read **/
$test->read("KML_Samples.kml");
//Util::dump($test->features, "features");
/** write **/
$kml = $test->write($test->features);
Util::dump($kml, "kml !");
コード例 #10
0
 public function calculateAllAdjusts()
 {
     Util::dump("ltv cc adjust", $this->getLtvCcAdj());
     Util::dump("ltv cc pmi adjust", $this->getLtvCcPmiAdj());
     Util::dump("ltv other adjust", $this->getLtvOtherAdj());
     Util::dump("Misc adjust", $this->getMiscAdj());
     return true;
 }
コード例 #11
0
<?php

$base_folder =  dirname( __FILE__ );
require_once( $base_folder . '/start.php5');
require_once( APP_ROOT . '/lib/dabble_parser.php5');
require_once( APP_ROOT . '/load_dia.php5');
require_once( APP_ROOT . '/load_orm.php5');
require_once( 'dia_supporter.php' );
$supporters = ORM::factory( 'diaSupporter')->find_all( );

$dia = default_dia_connection( );
foreach( $supporters as $supporter ) {
    $dia_memberships = $dia->get_objects( 'supporter_groups', array( 'condition' => "supporter_KEY={$supporter->supporter_key}" ));
    if( empty( $dia_memberships )) {
        print "no groups for supporter {$supporter->supporter_key}\n";
        $dia_record = $dia->get_object( 'supporter', $supporter->supporter_key );
        Util::dump( $dia_record );
        continue;
    }
    foreach( $dia_memberships as $membership_data ){
        $dia->delete( 'supporter_groups', $membership_data['supporter_groups_KEY'] );
    }
    $dia->delete( 'supporter', $supporter->supporter_key );
    print "deleted supporter {$supporter->supporter_key} / {$supporter->id} \n";

}

コード例 #12
0
ファイル: LoanProperty.php プロジェクト: srccn/f3
 public function printProperty()
 {
     echo "<hr>";
     print "number of Unit is : {$this->numberUnit}<br>";
     echo "property type is : {$this->type}<br>";
     echo "Occupancy is {$this->occType}<br>";
     echo "Purchase od refinance is : {$this->purchaseType}<br>";
     echo "Loan amount is : {$this->loanAmount}<br>";
     echo "Property zip code is : {$this->zip}<br>";
     echo "Property marcket price is : {$this->marketPrice}<br>";
     echo "Credit Score is : {$this->creditScore}<br>";
     echo "loanName : {$this->loanName}<br>";
     echo "lockDays : {$this->lockDays}<br>";
     echo "confirming Margin : {$this->confirmingmargin}<br>";
     echo "Jumbo Margin : {$this->jumbomargin} <br>";
     Util::dump("------ derived values ------ ");
     Util::dump("State is : {$this->state}<br>");
     Util::dump("LTV is : {$this->LTV} ");
     Util::dump("Confirming Upper limit :", $this->confirmingUpperLimit);
     Util::dump("is Confirming :", $this->isConfirming);
     Util::dump("Loan limit check passed :", $this->loanLimitCheck);
     Util::dump("Margin for calculation :", $this->margin);
     Util::dump("Minimum Credit :", $this->mincredit);
     Util::dump($this->loanAmountOptions);
     echo "<hr>";
 }