コード例 #1
0
 public function actionMonthStorage()
 {
     $dates = explode('-', $_POST['dates']);
     $number = cal_days_in_month(CAL_GREGORIAN, $dates[1], $dates[0]);
     $realized = array();
     $expenses = array();
     $startCount = array();
     $endCount = array();
     $curEndCount = array();
     $realize = new Realize();
     $depRealize = new DepFaktura();
     $inexp = new Expense();
     $balance = new Balance();
     for ($i = 1; $i <= $number; $i++) {
         $tempDate = $dates[0] . "-" . $dates[1] . "-" . $i;
         $listDate[$i] = $tempDate;
         $realized[$tempDate] = $realize->getRealizeSumm($tempDate);
         $expenses[$tempDate] = $inexp->getInExp($tempDate) + $depRealize->getDepRealizeSumm($tempDate);
         $tempBalance = $balance->getBalanceSumm($tempDate);
         $startCount[$tempDate] = $tempBalance[0];
         $endCount[$tempDate] = $tempBalance[1];
         $curEndCount[$tempDate] = $tempBalance[2];
     }
     $this->renderPartial('monthStorage', array('tempDate' => $listDate, 'realized' => $realized, 'expenses' => $expenses, 'startCount' => $startCount, 'endCount' => $endCount, 'curEndCount' => $curEndCount));
 }