load->model( $models ); $this->load->library( $libraries ); } public function index() { } public function recapProjects( $archive ) { $recapprojects = new Recapprojects( $archive ); $projects = $recapprojects->getProjects(); $this->json( $projects ); } public function getMonthlyEmployeeHoursPerProject( $employeeID, $year ) { $monthlyhours = Projecthour::getMonthlyEmployeeHoursPerProject( $employeeID, $year ); $this->json( $monthlyhours ); } public function getMonthlyEmployeehours( $month, $year ) { $sql = QEmployeeHours::fire( $month, $year ); $query = $this->db->query( $sql ); $result = $query->result(); foreach ( $result as $user ) { $user->targethours = Employeetarget::getTargetHoursPerEmployee( $user->user_id, $year, $month ); } $this->json( $result ); } public function getInvoiceOverview( $year = FALSE, $orderType, $orderDirection, $archive ) { $invoices = new Invoices( $year, $orderType, $orderDirection, $archive ); $invoiceReport = $invoices->getInvoiceReport(); $this->json( $invoiceReport ); } public function createInvoicesSpreadsheet( $year = FALSE ) { $invoices = new Invoices( $year ); $invoiceReport = $invoices->getInvoiceReport(); new InvoiceSpreadsheet( $invoiceReport ); } public function saveCurrentFinnacialYear( $projectID ) { $amount = $this->input->post( 'amount' ); Project::whereId( $projectID )->update( ['current_financial_year' => $amount] ); } }