<?php

class adminModel extends mainModel {

    public function __construct() {
        $registry = Registry::getInstance();
        $registry->Organization = new Organization;
        $registry->Invoice = new Invoice();
        $registry->Invoicepos = new InvoiceposSMCCustom();
        $registry->permission = new Permission();
        $registry->vehicle = new Vehicle;
        $registry->employee = new Employee();
        $registry->jv = new JV();
        $registry->product = new Product();
        $registry->currency = new Currency();
        $registry->material = new Material();
        $registry->factory = new RolePermissionFactory();
        $registry->return = new ReturnInvoice();
        $registry->customer = new Customer;
        $registry->supplier = new Supplier;
        $registry->depot = new WarehouseDepot;
        $registry->payment = new Payment;
        $registry->contra = new Contra;
        $registry->expense = new Expense;
        $registry->vendor = new Supplier;
        $registry->Product = new Product;
        $registry->production = new production();
        $registry->forms = new Forms();
        $registry->CommonACC = new CommonACC;
        $registry->crmClass = new crmClass();
        $registry->restaurantpos = new restaurant_pos();
        $registry->worktime = new WorkingTimes();
        $registry->job = new Job();
        $registry->role = new Role();
        $registry->user = new User();
        $registry->station = new Station();
        $registry->jobOrder = new JobOrder();
        $registry->shipping = new Shipping();
        $registry->purchase = new Purchase();
        $registry->subscription = new Subscriptions();
        $registry->common_inventory = new CommonInventory();
    }

    public static function getcategoriesPOS($parent_cat = 0) {
        $product = new Product();
        $categories = $product->getProductsCat($parent_cat, 1);
        for ($x = 0; $x < count($categories); $x++) {
            $Cat = $categories[$x];
            //if (count($Cat) == 2) {
            $SubC = (count($product->getProductsCat($Cat[0], 1)) > 0) || (count($product->getProduct(($Cat[0]))) > 0);
			$Cat[2] = $SubC;
            //$categories[$x] = array($Cat[0], $Cat[1], $SubC, $Cat[3], $Cat[4]);
			$categories[$x] = $Cat;
            //}
        }
        //            echo '<pre>';
        //            print_r($categories);
        return $categories;
    }

}
