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/assetTypeAjaxController.php
<?php

// get the config file
include_once("../public/config.php");

//here the db files that include in the file
include("../public/include_dao.php");

//Asset
require_once('../models/dao/AssetsDAO.class.php');
require_once('../models/dto/Asset.class.php');
require_once('../models/mysql/AssetsMySqlDAO.class.php');
require_once('../models/mysql/ext/AssetsMySqlExtDAO.class.php');
//Assetscat
require_once('../models/dao/AssetscatDAO.class.php');
require_once('../models/dto/Assetscat.class.php');
require_once('../models/mysql/AssetscatMySqlDAO.class.php');
require_once('../models/mysql/ext/AssetscatMySqlExtDAO.class.php');


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

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

  Controller Name :- clientTypeCTRL

  OPERTATION in Controller

  1-
  2-
  3-
  4-

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


//here goes the instances and general variables
//Assetscat
$Assetscat = new Assetscat();
$AssetscatDAO = new AssetscatMySqlDAO();
$AssetscatEX = new AssetscatMySqlExtDAO();




//check and use the condetion that suite this action
if ($do == "checkname") {
    $cattitel = $_POST['name'];
    $assetscatid = (int) $_POST['assetscatid'];
    if ($assetscatid == 0) {
        $assetscatData = $AssetscatDAO->queryByCattitel($cattitel);
    } else {
        $assetscatData = $AssetscatEX->queryByCattitelNotEqId($cattitel, $assetscatid);
    }



    if (empty($cattitel)) {
        echo -1;
    } elseif (!empty($assetscatData)) {
        echo -2;
    }
}
?>