HEX
Server: Apache
System: Linux darrell.nocdirect.com 4.18.0-513.18.2.el8_9.x86_64 #1 SMP Sat Mar 30 06:10:41 EDT 2024 x86_64
User: joderbya (1358)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/joderbya/wlsa.quick-step-ei.com2/detreccount.php
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

require_once("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 

$mSTable = postvalue("mSTable");
if(!checkTableName($mSTable)){
	
	$respObj = array("success"=>false, "error"=>'Wrong master short table name');
	echo (my_json_encode($respObj));
	return;
}	
require_once("include/".$mSTable."_variables.php");

$dSTable = postvalue("dSTable");
if(!checkTableName($dSTable)){
	
	$respObj = array("success"=>false, "error"=>'Wrong detail short table name');
	echo (my_json_encode($respObj));
	return;
}	
require_once("include/".$dSTable."_variables.php");


require_once('include/xtempl.php');

$mKeys = my_json_decode(postvalue("mKeys"));
$mTable = postvalue("mTable");
$dTable = postvalue("dTable");
$pageType = postvalue("pageType");

$xt = new Xtempl();
//array of params for classes
$params = array("pageType" =>$pageType);
$params['xt'] = &$xt;
$params["tName"] = $mTable;
$params["needSearchClauseObj"] = false;
$pageObject = new RunnerPage($params);
//$pageObject->init();

for($dInd = 0; $dInd < count($pageObject->allDetailsTablesArr); $dInd ++) 
{
	if($pageObject->allDetailsTablesArr[$dInd]['dDataSourceTable'] == $dTable)
		break;
}
$output = $pageObject->countDetailsRecsNoSubQ($dInd,$mKeys);

$respObj = array('success'=>true, 'recsCount'=>$output);
echo printJSON($respObj);
?>