<?php
class postsModel extends mainModel {

    public function __construct() {
        $registry = Registry::getInstance();
        $registry->dashboard = new AccountingDashboard;
        $registry->currency = new Currency;
        $registry->invoicepos = new InvoiceposSMCCustom;
        $registry->expense = new Expense;

    }

    public function get() {
    }
    public static function pie(){
        $dashboard = new AccountingDashboard;
        $PieTopSold =$dashboard->PieChart('tbl_invoice_products_details',5,'QTY');
        $arrName=array();
        for($i=0;$i<count($PieTopSold)/2;$i++) {
            array_push($arrName,$PieTopSold[$i]);


        }
        $arrValue=array();
        for($i=count($PieTopSold)/2;$i<count($PieTopSold);$i++) {
            array_push($arrValue,$PieTopSold[$i]);

        }
        return [$arrName,$arrValue];
    }

}