<?php

//the global file operation
session_start();
ob_start();
//global varable
global $showoutside;

//to check if the page from .htacess
//$showoutside = $_GET['sn'];
// get the config file
include_once("../public/config.php");

//here the db files that include in the file
include("../public/include_dao.php");
//Supplier
require_once('../models/dao/SupplierDAO.class.php');
require_once('../models/dto/Supplier.class.php');
require_once('../models/mysql/SupplierMySqlDAO.class.php');
require_once('../models/mysql/ext/SupplierMySqlExtDAO.class.php');

//get the do the action
$do = $_GET['do'];

/* ======================
  Controller Name :- supplierDeficitControllerAjax
  OPERTATION in Controller
  1- get current supplier dept
  ======================== */

//here goes the instances and general variables
//Supplier
$supplier = new Supplier();
$supplierDAO = new SupplierMySqlDAO();
$supplierExt = new SupplierMySqlExtDAO();

$today = date("y-m-d");

//check and use the condition that suite this action
if (empty($do)) {
    //here the permssion check


    getSupplierDept();
}

/* ===============================
  function in this CONTROLLER
  ================================ */

function getSupplierDept() {
    global $supplierDAO;
    $supplierId = $_GET['id'];
    $supplierData = $supplierDAO->load($supplierId);
    $supplierCurrentDept = $supplierData->suppliercurrentDebt;
    echo $supplierCurrentDept; //output
}

?>