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

//the global file operation
session_start();
ob_start();

//global varable
global $showoutside;

//to check if the page from .htacess
//$showoutside = $_GET['sn']; yf
// 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");

//Assets
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');



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


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

  Controller Name :- assetsCTRL

  OPERTATION in Controller

  1-display add form
  2- add in Assets tble
  3-display sucess or error
  4-display show form
  5-delete from Assets tbl
  6-edit in Assets data

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


//here goes the instances and general variables
$myAssets = new Asset();
$myAssetsRecord = new AssetsMySqlDAO();
$myAssetsEx = new AssetsMySqlExtDAO();


//Checkcontroller
//check and use the condetion that suite this action
if (empty($do)) {

} elseif ($do == "checkName") {
    $assetname = $_POST['assetname'];
    $txtUser = $_POST['txtuser'];
    echo $txtUser;
    $assetData = $myAssetsRecord->queryByAssetsName($assetname);
    if (empty($assetname)) {
        echo -1;
    } elseif (!empty($assetData)) {
        echo -2;
    } elseif (empty($txtUser)) {
        echo 0;
    }
}
?>