Ben paranın zaman değerini hesaplamak için kullanmayı planlıyorsanız özel bir kütüphane ile benim CI genişletmeye çalışıyorum. Ben bir iç sunucu hatası alıyorum sınıfı yüklemek her bir konudur, ve ben neden pek emin değilim. Başka öneri varsa da, bana bildirin lütfen.
Teşekkürler
Burada kütüphane yüklemeye çalışıyorum denetleyici olduğunu.
class Timevalueshow extends Controller{
$params = array('years' => 0,
'rate' => 0,
'principle' => 0,
'periods' => 0,
'isCont' => true
);
$this->load->library('timevalue',$params);
function index(){
$this->load->view('Timevalueshow_view');
return true;
}
}
Burada uygulama / kütüphanelerin altında kaydedilen kütüphane,
class Timevalue{
private $years;
private $rate;
private $principle;
private $periods;
private $isCont;
//zeros to test
function Timevalue($params) {
$this->years = $params['years'];
$this->rate = $params['rate'];
$this->principle = $params['principle'];
$this->periods = $params['periods'];
$this->isCont = $params['isCont'];
}
//General Getters
function getYears(){
return $this->years;
}
function getRate(){
return $this->rate;
}
function getPrinciple(){
return $this->principle;
}
function getPeriods(){
return $this->periods;
}
//Factors
function FVFactor(){
if($this->isCont){
$new_rate = $this->rate / $this->periods;
$new_periods = $this->periods * $this->years;
return pow(1+$new_rate,$new_periods);
}
else{
return exp($this->rate*$this->years);
}
}
function PVFactor(){
if($this->isCont){
return pow($this->FVFactor(),-1);
}
else{
return pow($this->FVFactor(),-1);
}
}
//General Print
function leprint(){
echo "<br />Years: " . $this->years;
echo "<br />Rate(dec): " . $this->rate;
echo "<br />Principle: $" . $this->principle;
echo "<br /># of Periods: " . $this->periods;
echo "<br />isCont: " . ($this->isCont ? "True" : "False");
}
}