HEX
Server: Apache
System: Linux server1.royalgt4.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
User: mostafedeg (1125)
PHP: 5.6.40
Disabled: mail,passthru,parse_ini_file,show_source,eval,assert,pcntl_exec,dl,putenv,proc_open,popen
Upload Files
File: /home/mostafedeg/public_html/erp/controllers/profitproductAjaxController.php
<?php

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
// GOES HERE ....................
include("../public/include_dao.php");

//Product
require_once('../models/dao/ProductDAO.class.php');
require_once('../models/dto/Product.class.php');
require_once('../models/mysql/ProductMySqlDAO.class.php');
require_once('../models/mysql/ext/ProductMySqlExtDAO.class.php');





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


/* ======================

  Controller Name :- profitreportCTRL تقرير يومية الخزينة

  OPERTATION in Controller

  1-load save data
  2-display show form
  3-display details form for save
  4-display details for operation in savedaily

  ======================== */

//here goes the instances and general variables
//Product
$myProductRecord = new ProductMySqlDAO();
$myProductEx = new ProductMySqlExtDAO();


//check and use the condetion that suite this action

if ($do == "loadproduct") {
    $productcatId = $_GET['catid'];

    $productData = loadProductByCatId($productcatId);
    $smarty->assign("productData", $productData);

    $smarty->display("profitproductview/product.html");
}






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

function loadProductByCatId($productCatId) {
    global $myProductEx;

    $productData = $myProductEx->queryWithProductcatIdAndConditions($productCatId);

    return $productData;
}

?>