CMXX - Cartest update
This commit is contained in:
@@ -2,15 +2,37 @@
|
||||
defined($security_key) or exit;
|
||||
|
||||
//------------------------------------------
|
||||
// Products
|
||||
// cartests
|
||||
//------------------------------------------
|
||||
|
||||
//Connect to DB
|
||||
$pdo = dbConnect($dbname);
|
||||
|
||||
//SoldTo is empty
|
||||
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
||||
|
||||
//default whereclause
|
||||
$whereclause = '';
|
||||
|
||||
switch ($permission) {
|
||||
case '4':
|
||||
$whereclause = '';
|
||||
break;
|
||||
case '3':
|
||||
$whereclause = '';
|
||||
break;
|
||||
case '2':
|
||||
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
|
||||
$whereclause = 'WHERE accounthierarchy like :condition ';
|
||||
break;
|
||||
default:
|
||||
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search.'___shipto___'.substr($partner->shipto, 0, strpos($partner->shipto, "-")).'%___location___'.substr($partner->location, 0, strpos($partner->location, "-")).'%';
|
||||
$whereclause = 'WHERE accounthierarchy like :condition ';
|
||||
break;
|
||||
}
|
||||
|
||||
//NEW ARRAY
|
||||
$criterias = [];
|
||||
$whereclause = '';
|
||||
$clause = '';
|
||||
|
||||
//Check for $_GET variables and build up clause
|
||||
|
||||
@@ -24,6 +24,20 @@ $clause = '';
|
||||
$clause_insert ='';
|
||||
$input_insert = '';
|
||||
|
||||
//INCLUDE ACCOUNTHIERARCHY
|
||||
$account = array(
|
||||
"salesid"=>$partner->salesid,
|
||||
"soldto"=>$partner->soldto,
|
||||
"shipto"=>$partner->shipto,
|
||||
"location"=>$partner->location,
|
||||
"section"=>$partner->section
|
||||
);
|
||||
|
||||
// CREATE ACCOUNTHIERARCHY JSON FROM ACCOUNT ARRAY
|
||||
$accounthierarchy = json_encode($account, JSON_UNESCAPED_UNICODE);
|
||||
// add to post_content
|
||||
$post_content['accounthierarchy'] = $accounthierarchy;
|
||||
|
||||
//ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE
|
||||
if ($command == 'insert'){
|
||||
$post_content['created'] = $date;
|
||||
|
||||
Reference in New Issue
Block a user