Merge branch 'development'
This commit is contained in:
@@ -68,6 +68,32 @@ if(isset($get_content) && $get_content!=''){
|
|||||||
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='target' || $v[0] =='success_msg'){
|
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='history' || $v[0] =='target' || $v[0] =='success_msg'){
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
elseif ($v[0] == 'serialnumber') {
|
||||||
|
//build up serialnumber
|
||||||
|
//check if multiple serialnumbers are provided
|
||||||
|
if (str_contains($v[1], ',')){
|
||||||
|
$inputs = explode(",",$v[1]);
|
||||||
|
$new_querystring = ''; //empty querystring
|
||||||
|
$x=0;
|
||||||
|
foreach($inputs as $input){
|
||||||
|
//create key
|
||||||
|
$new_key = $v[0].'_'.$x;
|
||||||
|
//inject new key/value to array
|
||||||
|
$criterias[$new_key] = $input;
|
||||||
|
$new_querystring .= ':'.$new_key.',';
|
||||||
|
$x++;
|
||||||
|
}
|
||||||
|
//remove obsolete last character from new_querystring
|
||||||
|
$new_querystring = substr($new_querystring,0, -1);
|
||||||
|
//add new_querystring to clause
|
||||||
|
$clause .= ' AND e.serialnumber IN ('.$new_querystring.')';
|
||||||
|
//remove original key/value from array
|
||||||
|
unset($criterias[$v[0]]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$clause .= ' AND e.serialnumber IN (:'.$v[0].')';
|
||||||
|
}
|
||||||
|
}
|
||||||
else {//create clause
|
else {//create clause
|
||||||
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||||
}
|
}
|
||||||
@@ -155,6 +181,10 @@ switch ($action) {
|
|||||||
$sql = 'SELECT YEAR(h.created) AS year, QUARTER(h.created) AS quarter, MONTH(h.created) as month, count(h.rowID) AS count FROM history h LEFT JOIN equipment e ON h.equipmentid = e.rowID where h.type = "ServiceReport" AND NOT e.productrowid = "31" GROUP BY YEAR(h.created), QUARTER(h.created), MONTH(h.created)';
|
$sql = 'SELECT YEAR(h.created) AS year, QUARTER(h.created) AS quarter, MONTH(h.created) as month, count(h.rowID) AS count FROM history h LEFT JOIN equipment e ON h.equipmentid = e.rowID where h.type = "ServiceReport" AND NOT e.productrowid = "31" GROUP BY YEAR(h.created), QUARTER(h.created), MONTH(h.created)';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'contract_usage_servicereports':
|
||||||
|
$sql = 'SELECT YEAR(h.created) AS year, QUARTER(h.created) AS quarter, MONTH(h.created) as month, count(h.rowID) AS count FROM history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.' GROUP BY YEAR(h.created), QUARTER(h.created), MONTH(h.created)';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'report_usage_firmware':
|
case 'report_usage_firmware':
|
||||||
$sql = 'SELECT YEAR(h.created) AS year,QUARTER(h.created) AS quarter, MONTH(h.created) as month, count(h.rowID) AS count FROM history h LEFT JOIN equipment e ON h.equipmentid=e.rowID where h.type="Firmware" AND NOT e.productrowid="31" GROUP BY YEAR(h.created),QUARTER(h.created), MONTH(h.created)';
|
$sql = 'SELECT YEAR(h.created) AS year,QUARTER(h.created) AS quarter, MONTH(h.created) as month, count(h.rowID) AS count FROM history h LEFT JOIN equipment e ON h.equipmentid=e.rowID where h.type="Firmware" AND NOT e.productrowid="31" GROUP BY YEAR(h.created),QUARTER(h.created), MONTH(h.created)';
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -8,11 +8,33 @@ defined($security_key) or exit;
|
|||||||
//Connect to DB
|
//Connect to DB
|
||||||
$pdo = dbConnect($dbname);
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//Get user_rights from users.php
|
||||||
|
$partner = json_decode($partnerhierarchy);
|
||||||
|
|
||||||
//SoldTo is empty
|
//SoldTo is empty
|
||||||
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
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
|
//NEW ARRAY
|
||||||
$whereclause ='';
|
|
||||||
$criterias = [];
|
$criterias = [];
|
||||||
$clause = '';
|
$clause = '';
|
||||||
|
|
||||||
|
|||||||
140
api/v1/get/products_versions.php
Normal file
140
api/v1/get/products_versions.php
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Products
|
||||||
|
//------------------------------------------
|
||||||
|
|
||||||
|
//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;
|
||||||
|
default:
|
||||||
|
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
|
||||||
|
$whereclause = 'WHERE accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//NEW ARRAY
|
||||||
|
$criterias = [];
|
||||||
|
$clause = '';
|
||||||
|
|
||||||
|
//Check for $_GET variables and build up clause
|
||||||
|
if(isset($get_content) && $get_content!=''){
|
||||||
|
//GET VARIABLES FROM URL
|
||||||
|
$requests = explode("&", $get_content);
|
||||||
|
//Check for keys and values
|
||||||
|
foreach ($requests as $y){
|
||||||
|
$v = explode("=", $y);
|
||||||
|
//INCLUDE VARIABLES IN ARRAY
|
||||||
|
$criterias[$v[0]] = $v[1];
|
||||||
|
|
||||||
|
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='list' || $v[0] =='history'|| $v[0] =='success_msg'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
elseif ($v[0] == 'search') {
|
||||||
|
//build up search
|
||||||
|
$clause .= ' AND productcode like :'.$v[0];
|
||||||
|
}
|
||||||
|
else {//create clause
|
||||||
|
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($whereclause == '' && $clause !=''){
|
||||||
|
$whereclause = 'WHERE '.substr($clause, 4);
|
||||||
|
} else {
|
||||||
|
$whereclause .= $clause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ENSURE PRODUCTROWID IS SEND
|
||||||
|
if (isset($criterias['productrowid']) && $criterias['productrowid'] != ''){
|
||||||
|
|
||||||
|
//CHECK IF ALLOWED TO CRUD VERSIONS
|
||||||
|
$sql = "SELECT * FROM products WHERE rowID = ? '.$whereclause.'";
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$criterias['productrowid']]);
|
||||||
|
$product_data = $stmt->fetch();
|
||||||
|
$product_owner = ($product_data['rowID'])? 1 : 0;
|
||||||
|
|
||||||
|
//IF PRODUCT IS OWNED THEN CRUD is ALLOWED
|
||||||
|
if ($product_owner === 1 ){
|
||||||
|
|
||||||
|
//Define Query
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||||
|
//Request for total rows
|
||||||
|
$sql = 'SELECT count(*) as count FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
elseif (isset($criterias['list']) && $criterias['list'] =='') {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
|
||||||
|
//Bind to query
|
||||||
|
if (str_contains($whereclause, ':condition')){
|
||||||
|
$stmt->bindValue('condition', $condition, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($criterias)){
|
||||||
|
foreach ($criterias as $key => $value){
|
||||||
|
$key_condition = ':'.$key;
|
||||||
|
if (str_contains($whereclause, $key_condition)){
|
||||||
|
if ($key == 'search'){
|
||||||
|
$search_value = '%'.$value.'%';
|
||||||
|
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add paging details
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||||
|
$stmt->execute();
|
||||||
|
$messages = $stmt->fetch();
|
||||||
|
$messages = $messages[0];
|
||||||
|
}
|
||||||
|
elseif(isset($criterias['list']) && $criterias['list']==''){
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
|
||||||
|
//$stmt->bindValue('page', ($current_page - 1) * $page_rows_products, PDO::PARAM_INT);
|
||||||
|
//$stmt->bindValue('num_products', $page_rows_products, PDO::PARAM_INT);
|
||||||
|
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
//Encrypt results
|
||||||
|
$messages = generate_payload($messages);
|
||||||
|
|
||||||
|
//Send results
|
||||||
|
echo $messages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -23,6 +23,7 @@ if ($stmt->rowCount() == 1) {
|
|||||||
$servicekey = $user_data['service'];
|
$servicekey = $user_data['service'];
|
||||||
$language = $user_data['language'];
|
$language = $user_data['language'];
|
||||||
$partner = json_decode($partnerhierarchy);
|
$partner = json_decode($partnerhierarchy);
|
||||||
|
$clientsecret = $user_data['userkey'];
|
||||||
|
|
||||||
//Update Lastlogin
|
//Update Lastlogin
|
||||||
$logindate = date('Y-m-d H:i:s');
|
$logindate = date('Y-m-d H:i:s');
|
||||||
|
|||||||
@@ -13,9 +13,26 @@ $post_content = json_decode(decode_payload($input),true);
|
|||||||
//SoldTo is empty
|
//SoldTo is empty
|
||||||
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
||||||
|
|
||||||
//default whereclause to check if data is owned buy user
|
//default whereclause
|
||||||
$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 = ' AND 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 = ' AND accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//SET PARAMETERS FOR QUERY
|
//SET PARAMETERS FOR QUERY
|
||||||
$id = $post_content['rowID'] ?? ''; //check for rowID
|
$id = $post_content['rowID'] ?? ''; //check for rowID
|
||||||
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
@@ -27,17 +44,161 @@ $clause = '';
|
|||||||
$clause_insert ='';
|
$clause_insert ='';
|
||||||
$input_insert = '';
|
$input_insert = '';
|
||||||
|
|
||||||
|
//remove blanks from array
|
||||||
|
if (isset($post_content['servicetool'])){
|
||||||
|
$post_content['servicetool'] = array_map('trim', $post_content['servicetool']);
|
||||||
|
$post_content['servicetool'] = array_filter($post_content['servicetool'], 'strlen');
|
||||||
|
}
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
$post_content['assigned_users'] = array_map('trim', $post_content['assigned_users']);
|
||||||
|
$post_content['assigned_users'] = array_filter($post_content['assigned_users'], 'strlen');
|
||||||
|
}
|
||||||
|
if ($id != ''){
|
||||||
|
|
||||||
|
//DEFINE ACCOUNTHIERARCHY
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM contracts WHERE rowID = ?');
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$contract_data = $stmt->fetch();
|
||||||
|
|
||||||
|
$contract_old = json_decode($contract_data['accounthierarchy']);
|
||||||
|
$salesid_new = (($post_content['salesid'] != '' && $post_content['salesid'] != $contract_old->salesid)? $post_content['salesid'] : $contract_old->salesid);
|
||||||
|
$soldto_new = (($post_content['soldto'] != '' && $post_content['soldto'] != $contract_old->soldto)? $post_content['soldto'] : $contract_old->soldto);
|
||||||
|
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $contract_old->shipto)? $post_content['shipto'] : $contract_old->shipto);
|
||||||
|
$location_new = (($post_content['location'] != '' && $post_content['location'] != $contract_old->location)? $post_content['location'] : $contract_old->location);
|
||||||
|
|
||||||
|
if ($permission == 4){
|
||||||
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$salesid_new,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$contract_old->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$contract_old->salesid,
|
||||||
|
"soldto"=>$contract_old->soldto,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//CHECK FOR CHANGES IN ASSIGNED_USERS
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
$assigned_users_current = json_decode($contract_data['assigned_users'],true);
|
||||||
|
$assigned_users_new = $post_content['assigned_users'];
|
||||||
|
|
||||||
|
// Find deleted items (items in current but not in new)
|
||||||
|
$deletedItems = array_diff($assigned_users_current, $assigned_users_new);
|
||||||
|
// Find added items (items in new but not in current)
|
||||||
|
$addedItems = array_diff($assigned_users_new, $assigned_users_current);
|
||||||
|
|
||||||
|
//When deleted items are found
|
||||||
|
if (!empty($deletedItems)){
|
||||||
|
foreach ($deletedItems as $item){
|
||||||
|
//CALL TO API FOR General information
|
||||||
|
$api_url = '/v2/users/username='.$item;
|
||||||
|
$responses = ioApi($api_url,'',$clientsecret);
|
||||||
|
if (!empty($responses)){
|
||||||
|
$response = json_decode($responses,true);
|
||||||
|
|
||||||
|
//If response is not null update the service flag of the user
|
||||||
|
if (count($response) != 0){
|
||||||
|
$id_removed_user = $response[0]['id'];
|
||||||
|
//Remove serviceflag from user
|
||||||
|
$sql = 'UPDATE users SET service = "" WHERE id = ? ';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$id_removed_user]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//ID is empty => INSERT / NEW RECORD
|
||||||
|
if ($permission == 4){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$post_content['salesid'],
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$partner->soldto,
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CREATE ACCOUNTHIERARCHY JSON FROM ACCOUNT ARRAY
|
||||||
|
$post_content['accounthierarchy'] = json_encode($account, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
if ($command == 'insert' && !isset($post_content['delete'])){
|
if ($command == 'insert' && !isset($post_content['delete'])){
|
||||||
$post_content['created'] = $date;
|
$post_content['created'] = $date;
|
||||||
$post_content['createdby'] = $username;
|
$post_content['createdby'] = $username;
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_content['assigned_users'] = json_encode($post_content['assigned_users'], JSON_UNESCAPED_UNICODE);
|
//remove blanks from array
|
||||||
|
if (isset($post_content['servicetool'])){
|
||||||
|
$post_content['servicetool'] = json_encode($post_content['servicetool'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
//Check for all users in array if exist then update service or create
|
||||||
|
foreach ($post_content['assigned_users'] as $user_assigned){
|
||||||
|
//CALL TO API FOR General information
|
||||||
|
$responses = ioApi('/v2/users/username='.$user_assigned,'',$clientsecret);
|
||||||
|
if (!empty($responses)){
|
||||||
|
$response = json_decode($responses,true);
|
||||||
|
|
||||||
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
//If response is not null update the service flag of the user
|
||||||
|
if (count($response) != 0){
|
||||||
|
$id_exist_user = $response[0]['id'];
|
||||||
|
$generate_service = bin2hex(random_bytes(25));
|
||||||
|
//Remove serviceflag from user
|
||||||
|
$sql = 'UPDATE users SET service = ? WHERE id = ? ';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$generate_service,$id_exist_user]);
|
||||||
|
} else {
|
||||||
|
//Decode the account structure of the contract and create user
|
||||||
|
$ah_array = json_decode($post_content['accounthierarchy'],true);
|
||||||
|
$data = json_encode(array("username" => $user_assigned, "email"=> $user_assigned,"view" => 2 ,"settings"=>"service","service"=> 1,"userkey"=> 1, "salesid" => $ah_array['salesid'], "soldto" => $ah_array['soldto'],"shipto" => $ah_array['shipto'],"location" => $ah_array['location']), JSON_UNESCAPED_UNICODE);
|
||||||
|
//call the API to create user
|
||||||
|
ioApi('/v2/users',$data,$clientsecret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPDATE TO JSON
|
||||||
|
$post_content['assigned_users'] = json_encode($post_content['assigned_users'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREATE NEW ARRAY AND MAP TO CLAUSE
|
||||||
if(isset($post_content) && $post_content!=''){
|
if(isset($post_content) && $post_content!=''){
|
||||||
foreach ($post_content as $key => $var){
|
foreach ($post_content as $key => $var){
|
||||||
if ($key == 'submit' || $key == 'delete' || $key == 'rowID'|| $key == 'id' || str_contains($key, 'old_')|| $key == 'salesid' || $key == 'soldto'){
|
if ($key == 'submit' || $key == 'delete' || $key == 'rowID'|| $key == 'id' || str_contains($key, 'old_')|| $key == 'salesid' || $key == 'soldto' || $key == 'shipto' || $key == 'location'){
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -61,6 +222,7 @@ if ($command == 'update' && !isset($post_content['delete']) && isAllowed('contra
|
|||||||
$execute_input[] = $id;
|
$execute_input[] = $id;
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute($execute_input);
|
$stmt->execute($execute_input);
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('contract',$profile,$permission,'C') === 1){
|
elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('contract',$profile,$permission,'C') === 1){
|
||||||
$sql = 'INSERT INTO contracts ('.$clause_insert.') VALUES ('.$input_insert.')';
|
$sql = 'INSERT INTO contracts ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ if ($id != ''){
|
|||||||
|
|
||||||
$owner_equipment = (($equipment_data['createdby'] == $username)? 1 : 0);
|
$owner_equipment = (($equipment_data['createdby'] == $username)? 1 : 0);
|
||||||
|
|
||||||
if ($permission == 3 || $permission == 4){
|
if ($permission == 4){
|
||||||
//ADMIN ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$salesid_new,
|
"salesid"=>$salesid_new,
|
||||||
"soldto"=>$soldto_new,
|
"soldto"=>$soldto_new,
|
||||||
@@ -71,7 +71,18 @@ if ($id != ''){
|
|||||||
"location"=>$location_new,
|
"location"=>$location_new,
|
||||||
"section"=>$section_new
|
"section"=>$section_new
|
||||||
);
|
);
|
||||||
} else {
|
}
|
||||||
|
elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$equipment_old->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new,
|
||||||
|
"section"=>$section_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$equipment_old->salesid,
|
"salesid"=>$equipment_old->salesid,
|
||||||
"soldto"=>$equipment_old->soldto,
|
"soldto"=>$equipment_old->soldto,
|
||||||
@@ -83,7 +94,7 @@ if ($id != ''){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//ID is empty => INSERT / NEW RECORD
|
//ID is empty => INSERT / NEW RECORD
|
||||||
if ($permission == 3 || $permission == 4){
|
if ($permission == 4){
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$post_content['salesid'],
|
"salesid"=>$post_content['salesid'],
|
||||||
"soldto"=>$post_content['soldto'],
|
"soldto"=>$post_content['soldto'],
|
||||||
@@ -92,7 +103,17 @@ else {
|
|||||||
"section"=>$post_content['section']
|
"section"=>$post_content['section']
|
||||||
|
|
||||||
);
|
);
|
||||||
} else {
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location'],
|
||||||
|
"section"=>$post_content['section']
|
||||||
|
|
||||||
|
);
|
||||||
|
}else {
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$partner->salesid,
|
"salesid"=>$partner->salesid,
|
||||||
"soldto"=>$partner->soldto,
|
"soldto"=>$partner->soldto,
|
||||||
|
|||||||
105
api/v1/post/products_versions.php
Normal file
105
api/v1/post/products_versions.php
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Products
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//CONTENT FROM API (POST)
|
||||||
|
$post_content = json_decode(decode_payload($input),true);
|
||||||
|
|
||||||
|
//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;
|
||||||
|
default:
|
||||||
|
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
|
||||||
|
$whereclause = ' AND accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ENSURE PRODUCTROWID IS SEND
|
||||||
|
if (isset($post_content['productrowid']) && $post_content['productrowid'] != ''){
|
||||||
|
|
||||||
|
//CHECK IF ALLOWED TO CRUD VERSIONS
|
||||||
|
$sql = 'SELECT * FROM products WHERE rowID = ? '.$whereclause.'';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$post_content['productrowid']]);
|
||||||
|
$product_data = $stmt->fetch();
|
||||||
|
$product_owner = ($product_data['rowID'])? 1 : 0;
|
||||||
|
|
||||||
|
//IF PRODUCT IS OWNED THEN CRUD is ALLOWED
|
||||||
|
if ($product_owner === 1 ){
|
||||||
|
//SET PARAMETERS FOR QUERY
|
||||||
|
$id = $post_content['rowID'] ?? ''; //check for rowID
|
||||||
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//CREATE EMPTY STRINGS
|
||||||
|
$clause = '';
|
||||||
|
$clause_insert ='';
|
||||||
|
$input_insert = '';
|
||||||
|
|
||||||
|
if ($command == 'insert'){
|
||||||
|
$post_content['created'] = $date;
|
||||||
|
$post_content['createdby'] = $username;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
||||||
|
if(isset($post_content) && $post_content!=''){
|
||||||
|
foreach ($post_content as $key => $var){
|
||||||
|
if ($key == 'submit' || $key == 'rowID'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$criterias[$key] = $var;
|
||||||
|
$clause .= ' , '.$key.' = ?';
|
||||||
|
$clause_insert .= ' , '.$key.'';
|
||||||
|
$input_insert .= ', ?'; // ? for each insert item
|
||||||
|
$execute_input[]= $var; // Build array for input
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLEAN UP INPUT
|
||||||
|
$clause = substr($clause, 2); //Clean clause - remove first comma
|
||||||
|
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
||||||
|
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||||
|
|
||||||
|
//QUERY AND VERIFY ALLOWED
|
||||||
|
if ($command == 'update' && isAllowed('products_versions',$profile,$permission,'U') === 1){
|
||||||
|
$sql = 'UPDATE products_versions SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
|
||||||
|
$execute_input[] = $id;
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert' && isAllowed('products_versions',$profile,$permission,'C') === 1){
|
||||||
|
$sql = 'INSERT INTO products_versions ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'delete' && isAllowed('products_versions',$profile,$permission,'D') === 1){
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM products_versions WHERE rowID = ? '.$whereclause.'');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
|
||||||
|
//Add deletion to changelog
|
||||||
|
changelog($dbname,'products_versions',$id,'Delete','Delete',$username);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -14,7 +14,7 @@ $owner_user = 0;
|
|||||||
//SoldTo is empty
|
//SoldTo is empty
|
||||||
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
||||||
|
|
||||||
//default whereclause to check if data is owned buy user
|
//default whereclause to check if data is owned by user
|
||||||
$whereclause = '';
|
$whereclause = '';
|
||||||
|
|
||||||
switch ($permission) {
|
switch ($permission) {
|
||||||
@@ -35,7 +35,7 @@ switch ($permission) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//SET PARAMETERS FOR QUERY
|
//SET PARAMETERS FOR QUERY
|
||||||
$id = $post_content['id'] ?? ''; //check for rowID
|
$id = (isset($post_content['id'])) ? $post_content['id']: ''; //check for rowID
|
||||||
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
if (isset($post_content['reset'])){$command = 'reset';} //change command to reset
|
if (isset($post_content['reset'])){$command = 'reset';} //change command to reset
|
||||||
@@ -64,15 +64,24 @@ $soldto_new = ((isset($post_content['soldto']) && $post_content['soldto'] != ''
|
|||||||
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $partnerhierarchy_old->shipto)? $post_content['shipto'] : $partnerhierarchy_old->shipto);
|
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $partnerhierarchy_old->shipto)? $post_content['shipto'] : $partnerhierarchy_old->shipto);
|
||||||
$location_new = (($post_content['location'] != '' && $post_content['location'] != $partnerhierarchy_old->location)? $post_content['location'] : $partnerhierarchy_old->location);
|
$location_new = (($post_content['location'] != '' && $post_content['location'] != $partnerhierarchy_old->location)? $post_content['location'] : $partnerhierarchy_old->location);
|
||||||
|
|
||||||
if ($permission == 3 || $permission == 4){
|
if ($permission == 4){
|
||||||
//ADMIN ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$salesid_new,
|
"salesid"=>$salesid_new,
|
||||||
"soldto"=>$soldto_new,
|
"soldto"=>$soldto_new,
|
||||||
"shipto"=>$shipto_new,
|
"shipto"=>$shipto_new,
|
||||||
"location"=>$location_new
|
"location"=>$location_new
|
||||||
);
|
);
|
||||||
} else {
|
}elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$partner->salesid,
|
"salesid"=>$partner->salesid,
|
||||||
"soldto"=>$partner->soldto,
|
"soldto"=>$partner->soldto,
|
||||||
@@ -82,15 +91,25 @@ if ($permission == 3 || $permission == 4){
|
|||||||
}
|
}
|
||||||
} elseif ($command == 'insert') {
|
} elseif ($command == 'insert') {
|
||||||
//ID is empty => INSERT / NEW RECORD
|
//ID is empty => INSERT / NEW RECORD
|
||||||
if ($permission == 3 || $permission == 4){
|
if ($permission == 4){
|
||||||
//ADMIN ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$post_content['salesid'],
|
"salesid"=>$post_content['salesid'],
|
||||||
"soldto"=>$post_content['soldto'],
|
"soldto"=>$post_content['soldto'],
|
||||||
"shipto"=>$post_content['shipto'],
|
"shipto"=>$post_content['shipto'],
|
||||||
"location"=>$post_content['location']
|
"location"=>$post_content['location']
|
||||||
);
|
);
|
||||||
} else {
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$account = array(
|
$account = array(
|
||||||
"salesid"=>$partner->salesid,
|
"salesid"=>$partner->salesid,
|
||||||
"soldto"=>$partner->soldto,
|
"soldto"=>$partner->soldto,
|
||||||
@@ -124,14 +143,15 @@ $accounthierarchy = json_encode($account, JSON_UNESCAPED_UNICODE);
|
|||||||
//Create resetkey & tokens
|
//Create resetkey & tokens
|
||||||
$headers = array('alg'=>'HS256','typ'=>'JWT');
|
$headers = array('alg'=>'HS256','typ'=>'JWT');
|
||||||
$payload = array('username'=>$post_content['username'], 'exp'=>(time() + 1800));
|
$payload = array('username'=>$post_content['username'], 'exp'=>(time() + 1800));
|
||||||
$post_content['service'] = ($post_content['service'] == 1) ? bin2hex(random_bytes(25)) : '';
|
$post_content['service'] = (isset($post_content['service']) && $post_content['service'] == 1) ? bin2hex(random_bytes(25)) : '';
|
||||||
$post_content['userkey'] = ($post_content['userkey'] == 1) ? bin2hex(random_bytes(25)) : '';
|
$post_content['userkey'] = (isset($post_content['userkey']) && $post_content['userkey'] == 1) ? bin2hex(random_bytes(25)) : '';
|
||||||
|
|
||||||
//ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE
|
//ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE
|
||||||
if ($command == 'update'){
|
if ($command == 'update'){
|
||||||
$post_content['partnerhierarchy'] = $accounthierarchy;
|
$post_content['partnerhierarchy'] = $accounthierarchy;
|
||||||
}
|
}
|
||||||
elseif ($command == 'insert'){
|
elseif ($command == 'insert'){
|
||||||
|
$post_content['resetkey'] = $resetkey = generate_jwt($headers, $payload);
|
||||||
$post_content['password'] = generate_jwt($headers, $payload);
|
$post_content['password'] = generate_jwt($headers, $payload);
|
||||||
$post_content['partnerhierarchy'] = $accounthierarchy;
|
$post_content['partnerhierarchy'] = $accounthierarchy;
|
||||||
$post_content['salesID'] = $partner->salesid;
|
$post_content['salesID'] = $partner->salesid;
|
||||||
@@ -230,10 +250,6 @@ elseif ($command == 'insert' && isAllowed('user',$profile,$permission,'C') === 1
|
|||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute($execute_input);
|
$stmt->execute($execute_input);
|
||||||
|
|
||||||
//STEP 1- create resetkey
|
|
||||||
$headers = array('alg'=>'HS256','typ'=>'JWT');
|
|
||||||
$payload = array('username'=>$post_content['username'], 'exp'=>(time() + 1800));
|
|
||||||
$resetkey = generate_jwt($headers, $payload);
|
|
||||||
//STEP 2- Send to user
|
//STEP 2- Send to user
|
||||||
include_once './assets/mail/email_template_new.php';
|
include_once './assets/mail/email_template_new.php';
|
||||||
send_mail($post_content['email'],$subject,$message,'','');
|
send_mail($post_content['email'],$subject,$message,'','');
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ defined($security_key) or exit;
|
|||||||
$user_credentials = json_decode($input,true);
|
$user_credentials = json_decode($input,true);
|
||||||
//Connect to DB
|
//Connect to DB
|
||||||
$pdo = dbConnect($dbname);
|
$pdo = dbConnect($dbname);
|
||||||
$username = $user_credentials['username'] ?? '';
|
//User username or clientID
|
||||||
|
$username = (isset($user_credentials['username']))? $user_credentials['username'] : (isset($user_credentials['clientID'])? $user_credentials['clientID'] : '');
|
||||||
//Define Query
|
//Define Query
|
||||||
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = ?');
|
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = ?');
|
||||||
//Excute Query
|
//Excute Query
|
||||||
@@ -21,7 +22,7 @@ if ($stmt->rowCount() == 1) {
|
|||||||
$user_data = $stmt->fetch();
|
$user_data = $stmt->fetch();
|
||||||
$permission = userRights($user_data['view']);
|
$permission = userRights($user_data['view']);
|
||||||
$profile = getProfile($user_data['settings'],$permission);
|
$profile = getProfile($user_data['settings'],$permission);
|
||||||
$password = $user_credentials['password'];
|
$password = (isset($user_credentials['password']))? $user_credentials['password'] : (isset($user_credentials['clientsecret'])? $user_credentials['clientsecret'] : '');
|
||||||
|
|
||||||
if ($user_data['login_count'] < 5){
|
if ($user_data['login_count'] < 5){
|
||||||
if (array_key_exists('resetkey', $user_credentials)){
|
if (array_key_exists('resetkey', $user_credentials)){
|
||||||
@@ -51,9 +52,10 @@ if ($stmt->rowCount() == 1) {
|
|||||||
|
|
||||||
//RETURN JWT AND CLIENTSECRET
|
//RETURN JWT AND CLIENTSECRET
|
||||||
$user = array(
|
$user = array(
|
||||||
'clientID' => $user_data['id'],
|
'clientID' => $user_data['username'],
|
||||||
'token' => $token,
|
'token' => $token,
|
||||||
'clientsecret' => $user_data['userkey']
|
'token_valid' => date('Y-m-d H:i:s',time() + 1800),
|
||||||
|
'userkey' => $user_data['userkey']
|
||||||
);
|
);
|
||||||
|
|
||||||
//Reset login count after succesfull attempt
|
//Reset login count after succesfull attempt
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
//JSON_DECODE
|
//JSON_ENCODE
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
||||||
//Send results
|
//Send results
|
||||||
|
|||||||
134
api/v2/get/contracts.php
Normal file
134
api/v2/get/contracts.php
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// contracts
|
||||||
|
//------------------------------------------
|
||||||
|
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//Get user_rights from users.php
|
||||||
|
$partner = json_decode($partnerhierarchy);
|
||||||
|
|
||||||
|
//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 = [];
|
||||||
|
$clause = '';
|
||||||
|
|
||||||
|
//Check for $_GET variables and build up clause
|
||||||
|
if(isset($get_content) && $get_content!=''){
|
||||||
|
//GET VARIABLES FROM URL
|
||||||
|
$requests = explode("&", $get_content);
|
||||||
|
//Check for keys and values
|
||||||
|
foreach ($requests as $y){
|
||||||
|
$v = explode("=", $y);
|
||||||
|
//INCLUDE VARIABLES IN ARRAY
|
||||||
|
$criterias[$v[0]] = $v[1];
|
||||||
|
|
||||||
|
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='list' || $v[0] =='history'|| $v[0] =='success_msg'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
elseif ($v[0] == 'search') {
|
||||||
|
//build up search
|
||||||
|
$clause .= ' AND reference like :'.$v[0];
|
||||||
|
}
|
||||||
|
else {//create clause
|
||||||
|
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($whereclause == '' && $clause !=''){
|
||||||
|
$whereclause = 'WHERE '.substr($clause, 4);
|
||||||
|
} else {
|
||||||
|
$whereclause .= $clause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Define Query
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||||
|
//Request for total rows
|
||||||
|
$sql = 'SELECT count(*) as count FROM contracts '.$whereclause.'';
|
||||||
|
}
|
||||||
|
elseif (isset($criterias['list']) && $criterias['list'] =='') {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM contracts '.$whereclause.'';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM contracts '.$whereclause.' LIMIT :page,:num_products';
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
|
||||||
|
//Bind to query
|
||||||
|
if (str_contains($whereclause, ':condition')){
|
||||||
|
$stmt->bindValue('condition', $condition, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($criterias)){
|
||||||
|
foreach ($criterias as $key => $value){
|
||||||
|
$key_condition = ':'.$key;
|
||||||
|
if (str_contains($whereclause, $key_condition)){
|
||||||
|
if ($key == 'search'){
|
||||||
|
$search_value = '%'.$value.'%';
|
||||||
|
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add paging details
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||||
|
$stmt->execute();
|
||||||
|
$messages = $stmt->fetch();
|
||||||
|
$messages = $messages[0];
|
||||||
|
}
|
||||||
|
elseif(isset($criterias['list']) && $criterias['list']==''){
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
|
||||||
|
$stmt->bindValue('page', ($current_page - 1) * $page_rows_contracts, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue('num_products', $page_rows_contracts, PDO::PARAM_INT);
|
||||||
|
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
//JSON_ENCODE
|
||||||
|
//------------------------------------------
|
||||||
|
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//Send results
|
||||||
|
echo $messages;
|
||||||
|
?>
|
||||||
@@ -11,7 +11,6 @@ $pdo = dbConnect($dbname);
|
|||||||
//Get user_rights from users.php
|
//Get user_rights from users.php
|
||||||
$partner = json_decode($partnerhierarchy);
|
$partner = json_decode($partnerhierarchy);
|
||||||
|
|
||||||
|
|
||||||
//SoldTo is empty
|
//SoldTo is empty
|
||||||
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
||||||
|
|
||||||
@@ -293,7 +292,7 @@ else {
|
|||||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
//JSON_DECODE
|
//JSON_EnCODE
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
|
|||||||
142
api/v2/get/products_versions.php
Normal file
142
api/v2/get/products_versions.php
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Products
|
||||||
|
//------------------------------------------
|
||||||
|
|
||||||
|
//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;
|
||||||
|
default:
|
||||||
|
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
|
||||||
|
$whereclause = 'WHERE accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//NEW ARRAY
|
||||||
|
$criterias = [];
|
||||||
|
$clause = '';
|
||||||
|
|
||||||
|
//Check for $_GET variables and build up clause
|
||||||
|
if(isset($get_content) && $get_content!=''){
|
||||||
|
//GET VARIABLES FROM URL
|
||||||
|
$requests = explode("&", $get_content);
|
||||||
|
//Check for keys and values
|
||||||
|
foreach ($requests as $y){
|
||||||
|
$v = explode("=", $y);
|
||||||
|
//INCLUDE VARIABLES IN ARRAY
|
||||||
|
$criterias[$v[0]] = $v[1];
|
||||||
|
|
||||||
|
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='list' || $v[0] =='history'|| $v[0] =='success_msg'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
elseif ($v[0] == 'search') {
|
||||||
|
//build up search
|
||||||
|
$clause .= ' AND productcode like :'.$v[0];
|
||||||
|
}
|
||||||
|
else {//create clause
|
||||||
|
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($whereclause == '' && $clause !=''){
|
||||||
|
$whereclause = 'WHERE '.substr($clause, 4);
|
||||||
|
} else {
|
||||||
|
$whereclause .= $clause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ENSURE PRODUCTROWID IS SEND
|
||||||
|
if (isset($criterias['productrowid']) && $criterias['productrowid'] != ''){
|
||||||
|
|
||||||
|
//CHECK IF ALLOWED TO CRUD VERSIONS
|
||||||
|
$sql = "SELECT * FROM products WHERE rowID = ? '.$whereclause.'";
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$criterias['productrowid']]);
|
||||||
|
$product_data = $stmt->fetch();
|
||||||
|
$product_owner = ($product_data['rowID'])? 1 : 0;
|
||||||
|
|
||||||
|
//IF PRODUCT IS OWNED THEN CRUD is ALLOWED
|
||||||
|
if ($product_owner === 1 ){
|
||||||
|
|
||||||
|
//Define Query
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||||
|
//Request for total rows
|
||||||
|
$sql = 'SELECT count(*) as count FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
elseif (isset($criterias['list']) && $criterias['list'] =='') {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT * FROM products_versions '.$whereclause.'';
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
|
||||||
|
//Bind to query
|
||||||
|
if (str_contains($whereclause, ':condition')){
|
||||||
|
$stmt->bindValue('condition', $condition, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($criterias)){
|
||||||
|
foreach ($criterias as $key => $value){
|
||||||
|
$key_condition = ':'.$key;
|
||||||
|
if (str_contains($whereclause, $key_condition)){
|
||||||
|
if ($key == 'search'){
|
||||||
|
$search_value = '%'.$value.'%';
|
||||||
|
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add paging details
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||||
|
$stmt->execute();
|
||||||
|
$messages = $stmt->fetch();
|
||||||
|
$messages = $messages[0];
|
||||||
|
}
|
||||||
|
elseif(isset($criterias['list']) && $criterias['list']==''){
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
|
||||||
|
//$stmt->bindValue('page', ($current_page - 1) * $page_rows_products, PDO::PARAM_INT);
|
||||||
|
//$stmt->bindValue('num_products', $page_rows_products, PDO::PARAM_INT);
|
||||||
|
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
//------------------------------------------
|
||||||
|
//JSON_ENCODE
|
||||||
|
//------------------------------------------
|
||||||
|
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//Send results
|
||||||
|
echo $messages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
126
api/v2/get/users.php
Normal file
126
api/v2/get/users.php
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Users
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
//Get user_rights from users.php
|
||||||
|
$partner = json_decode($partnerhierarchy);
|
||||||
|
//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 partnerhierarchy 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 partnerhierarchy like :condition ';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//NEW ARRAY
|
||||||
|
$criterias = [];
|
||||||
|
$clause = '';
|
||||||
|
|
||||||
|
//Check for $_GET variables and build up clause
|
||||||
|
if(isset($get_content) && $get_content!=''){
|
||||||
|
//GET VARIABLES FROM URL
|
||||||
|
$requests = explode("&", $get_content);
|
||||||
|
//Check for keys and values
|
||||||
|
foreach ($requests as $y){
|
||||||
|
$v = explode("=", $y);
|
||||||
|
//INCLUDE VARIABLES IN ARRAY
|
||||||
|
$criterias[$v[0]] = $v[1];
|
||||||
|
|
||||||
|
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='success_msg'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
elseif ($v[0] == 'search') {
|
||||||
|
//build up search
|
||||||
|
$clause .= ' AND username like :'.$v[0];
|
||||||
|
}
|
||||||
|
elseif ($v[0] == 'partnerid') {
|
||||||
|
//check accounthierarchy related users
|
||||||
|
$clause .= ' AND partnerhierarchy like :'.$v[0];
|
||||||
|
}
|
||||||
|
else {//create clause
|
||||||
|
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($whereclause == '' && $clause !=''){
|
||||||
|
$whereclause = 'WHERE '.substr($clause, 4);
|
||||||
|
} else {
|
||||||
|
$whereclause .= $clause;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||||
|
//Request for total rows
|
||||||
|
$sql = 'SELECT count(*) as count from users '.$whereclause.'';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//SQL for Paging
|
||||||
|
$sql = 'SELECT id,username, email, salesID, partnerhierarchy, view, created, service, settings, lastlogin, userkey, language,login_count FROM users '.$whereclause.' ORDER BY lastlogin DESC LIMIT :page,:num_products';
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
|
||||||
|
//Bind to query
|
||||||
|
if (str_contains($whereclause, ':condition')){
|
||||||
|
$stmt->bindValue('condition', $condition, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($criterias)){
|
||||||
|
foreach ($criterias as $key => $value){
|
||||||
|
$key_condition = ':'.$key;
|
||||||
|
if (str_contains($whereclause, $key_condition)){
|
||||||
|
if ($key == 'search'){
|
||||||
|
$search_value = '%'.$value.'%';
|
||||||
|
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
elseif ($key == 'partnerid'){
|
||||||
|
$search_value = '%"_"'.$value.'-%';
|
||||||
|
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add paging details
|
||||||
|
if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||||
|
$stmt->execute();
|
||||||
|
$messages = $stmt->fetch();
|
||||||
|
$messages = $messages[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
|
||||||
|
$stmt->bindValue('page', ($current_page - 1) * $page_rows_users, PDO::PARAM_INT);
|
||||||
|
$stmt->bindValue('num_products', $page_rows_users, PDO::PARAM_INT);
|
||||||
|
//Excute Query
|
||||||
|
$stmt->execute();
|
||||||
|
//Get results
|
||||||
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
//JSON_ENCODE
|
||||||
|
//------------------------------------------
|
||||||
|
$messages = json_encode($messages, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//Send results
|
||||||
|
echo $messages;
|
||||||
243
api/v2/post/contracts.php
Normal file
243
api/v2/post/contracts.php
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// contracts
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//CONTENT FROM API (POST)
|
||||||
|
$post_content = json_decode($input,true);
|
||||||
|
|
||||||
|
//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 = ' AND 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 = ' AND accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//SET PARAMETERS FOR QUERY
|
||||||
|
$id = $post_content['rowID'] ?? ''; //check for rowID
|
||||||
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//CREATE EMPTY STRINGS
|
||||||
|
$clause = '';
|
||||||
|
$clause_insert ='';
|
||||||
|
$input_insert = '';
|
||||||
|
|
||||||
|
//remove blanks from array
|
||||||
|
if (isset($post_content['servicetool'])){
|
||||||
|
$post_content['servicetool'] = array_map('trim', $post_content['servicetool']);
|
||||||
|
$post_content['servicetool'] = array_filter($post_content['servicetool'], 'strlen');
|
||||||
|
}
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
$post_content['assigned_users'] = array_map('trim', $post_content['assigned_users']);
|
||||||
|
$post_content['assigned_users'] = array_filter($post_content['assigned_users'], 'strlen');
|
||||||
|
}
|
||||||
|
if ($id != ''){
|
||||||
|
|
||||||
|
//DEFINE ACCOUNTHIERARCHY
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM contracts WHERE rowID = ?');
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$contract_data = $stmt->fetch();
|
||||||
|
|
||||||
|
$contract_old = json_decode($contract_data['accounthierarchy']);
|
||||||
|
$salesid_new = (($post_content['salesid'] != '' && $post_content['salesid'] != $contract_old->salesid)? $post_content['salesid'] : $contract_old->salesid);
|
||||||
|
$soldto_new = (($post_content['soldto'] != '' && $post_content['soldto'] != $contract_old->soldto)? $post_content['soldto'] : $contract_old->soldto);
|
||||||
|
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $contract_old->shipto)? $post_content['shipto'] : $contract_old->shipto);
|
||||||
|
$location_new = (($post_content['location'] != '' && $post_content['location'] != $contract_old->location)? $post_content['location'] : $contract_old->location);
|
||||||
|
|
||||||
|
if ($permission == 4){
|
||||||
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$salesid_new,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$contract_old->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$contract_old->salesid,
|
||||||
|
"soldto"=>$contract_old->soldto,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//CHECK FOR CHANGES IN ASSIGNED_USERS
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
$assigned_users_current = json_decode($contract_data['assigned_users'],true);
|
||||||
|
$assigned_users_new = $post_content['assigned_users'];
|
||||||
|
|
||||||
|
// Find deleted items (items in current but not in new)
|
||||||
|
$deletedItems = array_diff($assigned_users_current, $assigned_users_new);
|
||||||
|
// Find added items (items in new but not in current)
|
||||||
|
$addedItems = array_diff($assigned_users_new, $assigned_users_current);
|
||||||
|
|
||||||
|
//When deleted items are found
|
||||||
|
if (!empty($deletedItems)){
|
||||||
|
foreach ($deletedItems as $item){
|
||||||
|
//CALL TO API FOR General information
|
||||||
|
$api_url = '/v2/users/username='.$item;
|
||||||
|
$responses = ioApi($api_url,'',$clientsecret);
|
||||||
|
if (!empty($responses)){
|
||||||
|
$response = json_decode($responses,true);
|
||||||
|
|
||||||
|
//If response is not null update the service flag of the user
|
||||||
|
if (count($response) != 0){
|
||||||
|
$id_removed_user = $response[0]['id'];
|
||||||
|
//Remove serviceflag from user
|
||||||
|
$sql = 'UPDATE users SET service = "" WHERE id = ? ';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$id_removed_user]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//ID is empty => INSERT / NEW RECORD
|
||||||
|
if ($permission == 4){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$post_content['salesid'],
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$partner->soldto,
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CREATE ACCOUNTHIERARCHY JSON FROM ACCOUNT ARRAY
|
||||||
|
$post_content['accounthierarchy'] = json_encode($account, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
if ($command == 'insert' && !isset($post_content['delete'])){
|
||||||
|
$post_content['created'] = $date;
|
||||||
|
$post_content['createdby'] = $username;
|
||||||
|
}
|
||||||
|
|
||||||
|
//remove blanks from array
|
||||||
|
if (isset($post_content['servicetool'])){
|
||||||
|
$post_content['servicetool'] = json_encode($post_content['servicetool'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
if (isset($post_content['assigned_users'])){
|
||||||
|
//Check for all users in array if exist then update service or create
|
||||||
|
foreach ($post_content['assigned_users'] as $user_assigned){
|
||||||
|
//CALL TO API FOR General information
|
||||||
|
$responses = ioApi('/v2/users/username='.$user_assigned,'',$clientsecret);
|
||||||
|
if (!empty($responses)){
|
||||||
|
$response = json_decode($responses,true);
|
||||||
|
|
||||||
|
//If response is not null update the service flag of the user
|
||||||
|
if (count($response) != 0){
|
||||||
|
$id_exist_user = $response[0]['id'];
|
||||||
|
$generate_service = bin2hex(random_bytes(25));
|
||||||
|
//Remove serviceflag from user
|
||||||
|
$sql = 'UPDATE users SET service = ? WHERE id = ? ';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$generate_service,$id_exist_user]);
|
||||||
|
} else {
|
||||||
|
//Decode the account structure of the contract and create user
|
||||||
|
$ah_array = json_decode($post_content['accounthierarchy'],true);
|
||||||
|
$data = json_encode(array("username" => $user_assigned, "email"=> $user_assigned,"view" => 2 ,"settings"=>"service","service"=> 1,"userkey"=> 1, "salesid" => $ah_array['salesid'], "soldto" => $ah_array['soldto'],"shipto" => $ah_array['shipto'],"location" => $ah_array['location']), JSON_UNESCAPED_UNICODE);
|
||||||
|
//call the API to create user
|
||||||
|
ioApi('/v2/users',$data,$clientsecret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPDATE TO JSON
|
||||||
|
$post_content['assigned_users'] = json_encode($post_content['assigned_users'], JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREATE NEW ARRAY AND MAP TO CLAUSE
|
||||||
|
if(isset($post_content) && $post_content!=''){
|
||||||
|
foreach ($post_content as $key => $var){
|
||||||
|
if ($key == 'submit' || $key == 'delete' || $key == 'rowID'|| $key == 'id' || str_contains($key, 'old_')|| $key == 'salesid' || $key == 'soldto' || $key == 'shipto' || $key == 'location'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$criterias[$key] = $var;
|
||||||
|
$clause .= ' , '.$key.' = ?';
|
||||||
|
$clause_insert .= ' , '.$key.'';
|
||||||
|
$input_insert .= ', ?'; // ? for each insert item
|
||||||
|
$execute_input[]= $var; // Build array for input
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLEAN UP INPUT
|
||||||
|
$clause = substr($clause, 2); //Clean clause - remove first comma
|
||||||
|
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
||||||
|
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||||
|
|
||||||
|
//QUERY AND VERIFY ALLOWED
|
||||||
|
if ($command == 'update' && !isset($post_content['delete']) && isAllowed('contract',$profile,$permission,'U') === 1){
|
||||||
|
$sql = 'UPDATE contracts SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
|
||||||
|
$execute_input[] = $id;
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert' && !isset($post_content['delete']) && isAllowed('contract',$profile,$permission,'C') === 1){
|
||||||
|
$sql = 'INSERT INTO contracts ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'delete' && isAllowed('contract',$profile,$permission,'D') === 1){
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM contracts WHERE rowID = ? '.$whereclause.'');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
|
||||||
|
//Add deletion to changelog
|
||||||
|
changelog($dbname,'contracts',$id,'Delete','Delete',$username);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
248
api/v2/post/equipments.php
Normal file
248
api/v2/post/equipments.php
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// equipments
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//CONTENT FROM API (POST)
|
||||||
|
$post_content = json_decode($input,true);
|
||||||
|
|
||||||
|
//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 = ' AND 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 = ' AND accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//SET PARAMETERS FOR QUERY
|
||||||
|
$id = $post_content['rowID'] ?? ''; //check for rowID
|
||||||
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//CREATE EMPTY STRINGS
|
||||||
|
$owner_equipment = 0;
|
||||||
|
$clause = '';
|
||||||
|
$clause_insert ='';
|
||||||
|
$input_insert = '';
|
||||||
|
|
||||||
|
|
||||||
|
if ($id != ''){
|
||||||
|
//DEFINE ACCOUNTHIERARCHY
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM equipment WHERE rowID = ?');
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$equipment_data = $stmt->fetch();
|
||||||
|
|
||||||
|
$equipment_old = json_decode($equipment_data['accounthierarchy']);
|
||||||
|
|
||||||
|
$salesid_new = (($post_content['salesid'] != '' && $post_content['salesid'] != $equipment_old->salesid)? $post_content['salesid'] : $equipment_old->salesid);
|
||||||
|
$soldto_new = (($post_content['soldto'] != '' && $post_content['soldto'] != $equipment_old->soldto)? $post_content['soldto'] : $equipment_old->soldto);
|
||||||
|
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $equipment_old->shipto)? $post_content['shipto'] : $equipment_old->shipto);
|
||||||
|
$location_new = (($post_content['location'] != '' && $post_content['location'] != $equipment_old->location)? $post_content['location'] : $equipment_old->location);
|
||||||
|
$section_new = (($post_content['section'] != '' && $post_content['section'] != $equipment_old->section)? $post_content['section'] : $equipment_old->section);
|
||||||
|
|
||||||
|
$owner_equipment = (($equipment_data['createdby'] == $username)? 1 : 0);
|
||||||
|
|
||||||
|
if ($permission == 4){
|
||||||
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$salesid_new,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new,
|
||||||
|
"section"=>$section_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$equipment_old->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new,
|
||||||
|
"section"=>$section_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$equipment_old->salesid,
|
||||||
|
"soldto"=>$equipment_old->soldto,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new,
|
||||||
|
"section"=>$section_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//ID is empty => INSERT / NEW RECORD
|
||||||
|
if ($permission == 4){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$post_content['salesid'],
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location'],
|
||||||
|
"section"=>$post_content['section']
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location'],
|
||||||
|
"section"=>$post_content['section']
|
||||||
|
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$partner->soldto,
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location'],
|
||||||
|
"section"=>$post_content['section']
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//CHECK IF PARTNER HAS PARTNER RECORD - IF NOT CREATE AND USE
|
||||||
|
foreach ($account as $key => $value){
|
||||||
|
if ($key != "section"){
|
||||||
|
//CHECK for id- pattern
|
||||||
|
if (empty($value) ||$value == '' || preg_match('/\-.*/',$value)){
|
||||||
|
//Do Nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//No partner ID found
|
||||||
|
switch ($key) {
|
||||||
|
case 'salesid':
|
||||||
|
$p_type = 'SalesID';
|
||||||
|
break;
|
||||||
|
case 'soldto':
|
||||||
|
$p_type = 'SoldTo';
|
||||||
|
break;
|
||||||
|
case 'shipto':
|
||||||
|
$p_type = 'ShipTo';
|
||||||
|
break;
|
||||||
|
case 'location':
|
||||||
|
$p_type = 'Location';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//Create partner and push to array account
|
||||||
|
$account[$key] = createPartner($partner->salesid,$partner->soldto,$value,$p_type,$userkey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// CREATE ACCOUNTHIERARCHY JSON FROM ACCOUNT ARRAY
|
||||||
|
$accounthierarchy = json_encode($account, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE
|
||||||
|
if ($command == 'update'){
|
||||||
|
|
||||||
|
//RESET WARRANTY AND SERVICE DATES WHEN STATUS IS CHANGED TO SEND(3)
|
||||||
|
if (isset($post_content['status']) && $post_content['status'] == 3 && $equipment_data['status'] != 3)
|
||||||
|
{
|
||||||
|
$post_content['service_date'] = $date;
|
||||||
|
$post_content['warranty_date'] = $date;
|
||||||
|
|
||||||
|
}
|
||||||
|
//UPDATE CHANGELOG BASED ON STATUS CHANGE
|
||||||
|
if (isset($post_content['status']) && $post_content['status'] != $equipment_data['status'])
|
||||||
|
{
|
||||||
|
changelog($dbname,'equipment',$equipment_data['rowID'],'status',$post_content['status'],$username);
|
||||||
|
}
|
||||||
|
//UPDATE CHANGELOG BASED ON ORDER_REF change
|
||||||
|
if (isset($post_content['order_ref']) && $post_content['order_ref'] != $equipment_data['order_ref'])
|
||||||
|
{
|
||||||
|
changelog($dbname,'equipment',$equipment_data['rowID'],'order_ref',$post_content['order_ref'],$username);
|
||||||
|
}
|
||||||
|
|
||||||
|
$post_content['accounthierarchy'] = $accounthierarchy;
|
||||||
|
|
||||||
|
//CHECK for special permissions
|
||||||
|
if (isAllowed('equipment_manage_edit',$profile,$permission,'U') === 0 && $owner_equipment === 0 ){
|
||||||
|
$post_content['status'] = $equipment_data['status'];
|
||||||
|
$post_content['serialnumber'] = $equipment_data['serialnumber'];
|
||||||
|
$post_content['service_date'] = $equipment_data['service_date'];
|
||||||
|
$post_content['warranty_date'] = $equipment_data['warranty_date'];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert'){
|
||||||
|
$post_content['created'] = $date;
|
||||||
|
$post_content['createdby'] = $username;
|
||||||
|
$post_content['accounthierarchy'] = $accounthierarchy;
|
||||||
|
$post_content['service_date'] = $date;
|
||||||
|
$post_content['warranty_date'] = $date;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
||||||
|
if(isset($post_content) && $post_content!=''){
|
||||||
|
foreach ($post_content as $key => $var){
|
||||||
|
if ($key == 'submit' || $key == 'rowID' || str_contains($key, 'old_') || $key == 'salesid' || $key == 'soldto' || $key == 'shipto' || $key == 'location' || $key == 'section' || str_contains($key, 'productcode') || str_contains($key, 'productname')){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$criterias[$key] = $var;
|
||||||
|
$clause .= ' , '.$key.' = ?';
|
||||||
|
$clause_insert .= ' , '.$key.'';
|
||||||
|
$input_insert .= ', ?'; // ? for each insert item
|
||||||
|
$execute_input[]= $var; // Build array for input
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLEAN UP INPUT
|
||||||
|
$clause = substr($clause, 2); //Clean clause - remove first comma
|
||||||
|
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
||||||
|
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||||
|
|
||||||
|
//QUERY AND VERIFY ALLOWED
|
||||||
|
if ($command == 'update' && (isAllowed('equipment_manage',$profile,$permission,'U') === 1 || isAllowed('equipments_mass_update',$profile,$permission,'U') === 1 || $owner_equipment === 1)){
|
||||||
|
$sql = 'UPDATE equipment SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
|
||||||
|
$execute_input[] = $id;
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert' && isAllowed('equipment_manage',$profile,$permission,'C') === 1){
|
||||||
|
$sql = 'INSERT INTO equipment ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'delete' && (isAllowed('equipment_manage',$profile,$permission,'D') === 1 || $owner_equipment === 1)){
|
||||||
|
//delete equipment
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM equipment WHERE rowID = ? '.$whereclause.'');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
//delete history related to equipment
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM history WHERE equipmentid = ?');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
//Add deletion to changelog
|
||||||
|
changelog($dbname,'equipment',$id,'Delete','Delete',$username);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
105
api/v2/post/products_versions.php
Normal file
105
api/v2/post/products_versions.php
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// Products
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//CONTENT FROM API (POST)
|
||||||
|
$post_content = json_decode($input,true);
|
||||||
|
|
||||||
|
//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;
|
||||||
|
default:
|
||||||
|
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
|
||||||
|
$whereclause = ' AND accounthierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ENSURE PRODUCTROWID IS SEND
|
||||||
|
if (isset($post_content['productrowid']) && $post_content['productrowid'] != ''){
|
||||||
|
|
||||||
|
//CHECK IF ALLOWED TO CRUD VERSIONS
|
||||||
|
$sql = "SELECT * FROM products WHERE rowID = ? '.$whereclause.'";
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$post_content['productrowid']]);
|
||||||
|
$product_data = $stmt->fetch();
|
||||||
|
$product_owner = ($product_data['rowID'])? 1 : 0;
|
||||||
|
|
||||||
|
//IF PRODUCT IS OWNED THEN CRUD is ALLOWED
|
||||||
|
if ($product_owner === 1 ){
|
||||||
|
//SET PARAMETERS FOR QUERY
|
||||||
|
$id = $post_content['rowID'] ?? ''; //check for rowID
|
||||||
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//CREATE EMPTY STRINGS
|
||||||
|
$clause = '';
|
||||||
|
$clause_insert ='';
|
||||||
|
$input_insert = '';
|
||||||
|
|
||||||
|
if ($command == 'insert'){
|
||||||
|
$post_content['created'] = $date;
|
||||||
|
$post_content['createdby'] = $username;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
||||||
|
if(isset($post_content) && $post_content!=''){
|
||||||
|
foreach ($post_content as $key => $var){
|
||||||
|
if ($key == 'submit' || $key == 'rowID'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$criterias[$key] = $var;
|
||||||
|
$clause .= ' , '.$key.' = ?';
|
||||||
|
$clause_insert .= ' , '.$key.'';
|
||||||
|
$input_insert .= ', ?'; // ? for each insert item
|
||||||
|
$execute_input[]= $var; // Build array for input
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLEAN UP INPUT
|
||||||
|
$clause = substr($clause, 2); //Clean clause - remove first comma
|
||||||
|
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
||||||
|
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||||
|
|
||||||
|
//QUERY AND VERIFY ALLOWED
|
||||||
|
if ($command == 'update' && isAllowed('products_versions',$profile,$permission,'U') === 1){
|
||||||
|
$sql = 'UPDATE products_versions SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
|
||||||
|
$execute_input[] = $id;
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert' && isAllowed('products_versions',$profile,$permission,'C') === 1){
|
||||||
|
$sql = 'INSERT INTO products_versions ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
}
|
||||||
|
elseif ($command == 'delete' && isAllowed('products_versions',$profile,$permission,'D') === 1){
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM products_versions WHERE rowID = ? '.$whereclause.'');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
|
||||||
|
//Add deletion to changelog
|
||||||
|
changelog($dbname,'products_versions',$id,'Delete','Delete',$username);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
279
api/v2/post/users.php
Normal file
279
api/v2/post/users.php
Normal file
@@ -0,0 +1,279 @@
|
|||||||
|
<?php
|
||||||
|
defined($security_key) or exit;
|
||||||
|
|
||||||
|
//------------------------------------------
|
||||||
|
// users
|
||||||
|
//------------------------------------------
|
||||||
|
//Connect to DB
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
|
||||||
|
//CONTENT FROM API (POST)
|
||||||
|
$post_content = json_decode($input,true);
|
||||||
|
$owner_user = 0;
|
||||||
|
|
||||||
|
//SoldTo is empty
|
||||||
|
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
|
||||||
|
|
||||||
|
//default whereclause to check if data is owned by user
|
||||||
|
$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 = ' AND partnerhierarchy 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 = ' AND partnerhierarchy like "'.$condition.'"';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//SET PARAMETERS FOR QUERY
|
||||||
|
$id = (isset($post_content['id'])) ? $post_content['id']: ''; //check for rowID
|
||||||
|
$command = ($id == '')? 'insert' : 'update'; //IF rowID = empty then INSERT
|
||||||
|
if (isset($post_content['delete'])){$command = 'delete';} //change command to delete
|
||||||
|
if (isset($post_content['reset'])){$command = 'reset';} //change command to reset
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
//CREATE EMPTY STRINGS
|
||||||
|
$clause = '';
|
||||||
|
$clause_insert ='';
|
||||||
|
$input_insert = '';
|
||||||
|
|
||||||
|
//GET EXISTING USER DATA
|
||||||
|
if ($id != '' && $command != 'reset'){
|
||||||
|
//Define Query
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM users WHERE id = ?');
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$user_data = $stmt->fetch();
|
||||||
|
|
||||||
|
$owner_user = (($user_data['username'] == $username)? 1 : 0);
|
||||||
|
|
||||||
|
$user_name_old = $user_data['username'];
|
||||||
|
$view_old = $user_data['view'];
|
||||||
|
$partnerhierarchy_old = json_decode($user_data['partnerhierarchy']);
|
||||||
|
|
||||||
|
$salesid_new = ((isset($post_content['salesid']) && $post_content['salesid'] != '' && $post_content['salesid'] != $partnerhierarchy_old->salesid)? $post_content['salesid'] : $partnerhierarchy_old->salesid);
|
||||||
|
$soldto_new = ((isset($post_content['soldto']) && $post_content['soldto'] != '' && $post_content['soldto'] != $partnerhierarchy_old->soldto)? $post_content['soldto'] : $partnerhierarchy_old->soldto);
|
||||||
|
$shipto_new = (($post_content['shipto'] != '' && $post_content['shipto'] != $partnerhierarchy_old->shipto)? $post_content['shipto'] : $partnerhierarchy_old->shipto);
|
||||||
|
$location_new = (($post_content['location'] != '' && $post_content['location'] != $partnerhierarchy_old->location)? $post_content['location'] : $partnerhierarchy_old->location);
|
||||||
|
|
||||||
|
if ($permission == 4){
|
||||||
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$salesid_new,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}elseif ($permission == 3) {
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$soldto_new,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$partner->soldto,
|
||||||
|
"shipto"=>$shipto_new,
|
||||||
|
"location"=>$location_new
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif ($command == 'insert') {
|
||||||
|
//ID is empty => INSERT / NEW RECORD
|
||||||
|
if ($permission == 4){
|
||||||
|
//ADMIN+ ONLY ARE ALLOWED TO CHANGE SALES AND SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$post_content['salesid'],
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($permission == 3){
|
||||||
|
//ADMIN ONLY ARE ALLOWED TO CHANGE SOLD
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$post_content['soldto'],
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$account = array(
|
||||||
|
"salesid"=>$partner->salesid,
|
||||||
|
"soldto"=>$partner->soldto,
|
||||||
|
"shipto"=>$post_content['shipto'],
|
||||||
|
"location"=>$post_content['location']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif ($id != '' && $command == 'reset'){
|
||||||
|
//Reset user requested
|
||||||
|
//Get username
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM users WHERE id = ?');
|
||||||
|
$stmt->execute([$id]);
|
||||||
|
$user_data = $stmt->fetch();
|
||||||
|
//generate resetkey
|
||||||
|
$post_content['resetkey'] = generate_jwt($headers, $payload);
|
||||||
|
//STEP 1- create resetkey
|
||||||
|
$headers = array('alg'=>'HS256','typ'=>'JWT');
|
||||||
|
$payload = array('username'=>$user_data['username'], 'exp'=>(time() + 1800));
|
||||||
|
$resetkey = generate_jwt($headers, $payload);
|
||||||
|
//STEP 2- Store resetkey
|
||||||
|
$sql = 'UPDATE users SET resetkey = ? WHERE id = ? '.$whereclause.'';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute([$resetkey,$id]);
|
||||||
|
//STEP 3 - Send to user
|
||||||
|
include_once './assets/mail/email_template_reset.php';
|
||||||
|
send_mail($user_data['email'],$subject,$message,'','');
|
||||||
|
}
|
||||||
|
|
||||||
|
$accounthierarchy = json_encode($account, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//Create resetkey & tokens
|
||||||
|
$headers = array('alg'=>'HS256','typ'=>'JWT');
|
||||||
|
$payload = array('username'=>$post_content['username'], 'exp'=>(time() + 1800));
|
||||||
|
$post_content['service'] = (isset($post_content['service']) && $post_content['service'] == 1) ? bin2hex(random_bytes(25)) : '';
|
||||||
|
$post_content['userkey'] = (isset($post_content['userkey']) && $post_content['userkey'] == 1) ? bin2hex(random_bytes(25)) : '';
|
||||||
|
|
||||||
|
//ADD STANDARD PARAMETERS TO ARRAY BASED ON INSERT OR UPDATE
|
||||||
|
if ($command == 'update'){
|
||||||
|
$post_content['partnerhierarchy'] = $accounthierarchy;
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert'){
|
||||||
|
$post_content['resetkey'] = $resetkey = generate_jwt($headers, $payload);
|
||||||
|
$post_content['password'] = generate_jwt($headers, $payload);
|
||||||
|
$post_content['partnerhierarchy'] = $accounthierarchy;
|
||||||
|
$post_content['salesID'] = $partner->salesid;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
//CREAT NEW ARRAY AND MAP TO CLAUSE
|
||||||
|
if(isset($post_content) && $post_content!=''){
|
||||||
|
foreach ($post_content as $key => $var){
|
||||||
|
if ($key == 'submit' || $key == 'id' || str_contains($key, 'old_') || $key == 'salesid' || $key == 'soldto' || $key == 'shipto' || $key == 'location'){
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$criterias[$key] = $var;
|
||||||
|
$clause .= ' , '.$key.' = ?';
|
||||||
|
$clause_insert .= ' , '.$key.'';
|
||||||
|
$input_insert .= ', ?'; // ? for each insert item
|
||||||
|
$execute_input[]= $var; // Build array for input
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//CLEAN UP INPUT
|
||||||
|
$clause = substr($clause, 2); //Clean clause - remove first comma
|
||||||
|
$clause_insert = substr($clause_insert, 2); //Clean clause - remove first comma
|
||||||
|
$input_insert = substr($input_insert, 1); //Clean clause - remove first comma
|
||||||
|
|
||||||
|
//QUERY AND VERIFY ALLOWED
|
||||||
|
if ($command == 'update' && (isAllowed('user',$profile,$permission,'U') === 1 || $owner_user === 1)){
|
||||||
|
$sql = 'UPDATE users SET '.$clause.' WHERE id = ? '.$whereclause.'';
|
||||||
|
|
||||||
|
$execute_input[] = $id;
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
|
||||||
|
//Update the username in all tables when changed
|
||||||
|
if ($post_content['username'] != $user_name_old){
|
||||||
|
$sql_like = '%'.$user_name_old.'%';
|
||||||
|
$sql1= 'UPDATE equipment SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql2= 'UPDATE communication SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql3= 'UPDATE contracts SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql4= 'UPDATE feedback SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql5= 'UPDATE history SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql6= 'UPDATE opportunities SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql7= 'UPDATE orders SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql8= 'UPDATE products SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql_users = 'UPDATE account SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
$sql_partner = 'UPDATE partner SET createdby = REPLACE(createdby, ? , ?) WHERE createdby LIKE ?';
|
||||||
|
|
||||||
|
//SQL_users
|
||||||
|
$stmt = $pdo->prepare($sql_users);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL_partners
|
||||||
|
$stmt = $pdo->prepare($sql_partner);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
|
||||||
|
$pdo = dbConnect($dbname);
|
||||||
|
//SQL1
|
||||||
|
$stmt = $pdo->prepare($sql1);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL2
|
||||||
|
$stmt = $pdo->prepare($sql2);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL3
|
||||||
|
$stmt = $pdo->prepare($sql3);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL4
|
||||||
|
$stmt = $pdo->prepare($sql4);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL5
|
||||||
|
$stmt = $pdo->prepare($sql5);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL6
|
||||||
|
$stmt = $pdo->prepare($sql6);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL7
|
||||||
|
$stmt = $pdo->prepare($sql7);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
//SQL8
|
||||||
|
$stmt = $pdo->prepare($sql8);
|
||||||
|
$stmt->execute([$user_name_old,$post_content['username'], $sql_like]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($command == 'insert' && isAllowed('user',$profile,$permission,'C') === 1){
|
||||||
|
|
||||||
|
//check if user exists
|
||||||
|
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = ?');
|
||||||
|
$stmt->execute([$post_content['username']]);
|
||||||
|
$user_exist = $stmt->fetch();
|
||||||
|
|
||||||
|
$exists = (isset($user_exist['username']))? 1 : 0;
|
||||||
|
if($user_exist == 0 ){
|
||||||
|
$sql = 'INSERT INTO users ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||||
|
$stmt = $pdo->prepare($sql);
|
||||||
|
$stmt->execute($execute_input);
|
||||||
|
|
||||||
|
//STEP 2- Send to user
|
||||||
|
include_once './assets/mail/email_template_new.php';
|
||||||
|
send_mail($post_content['email'],$subject,$message,'','');
|
||||||
|
} else {
|
||||||
|
//------------------------------------------
|
||||||
|
//JSON_ENCODE
|
||||||
|
//------------------------------------------
|
||||||
|
$messages = json_encode($exists, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
//Send results
|
||||||
|
echo $messages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($command == 'delete' && isAllowed('user',$profile,$permission,'D') === 1){
|
||||||
|
//delete equipment
|
||||||
|
$stmt = $pdo->prepare('DELETE FROM users WHERE id = ? '.$whereclause.'');
|
||||||
|
$stmt->execute([ $id ]);
|
||||||
|
|
||||||
|
//Add deletion to changelog
|
||||||
|
changelog($dbname,'users',$id,'Delete','Delete',$username);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1968,20 +1968,20 @@ function changeLogVisual($totals,$details){
|
|||||||
$totalcount += $total['total'];
|
$totalcount += $total['total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
//GET SERIALNUMBERS
|
$view = '<div style="margin-bottom: 30px;">
|
||||||
$url_input = ''; //used to collect serialnumber for onclick event
|
|
||||||
foreach ($details as $detail){
|
|
||||||
$url_input .= $detail['serialnumber'].',';
|
|
||||||
}
|
|
||||||
|
|
||||||
$view = '<div style="margin-bottom: 30px;" onclick="location.href=\'index.php?page=equipments&serialnumber='.substr($url_input,0,-1).'\'">
|
|
||||||
<ul style="width: 100%;max-width:100%" class="chart">
|
<ul style="width: 100%;max-width:100%" class="chart">
|
||||||
';
|
';
|
||||||
foreach ($totals as $total){
|
foreach ($totals as $total){
|
||||||
|
//GET SERIALNUMBERS
|
||||||
$height = ($total['total'] / $totalcount) * 100;
|
$url_input = ''; //used to collect serialnumber for onclick event
|
||||||
$title = $total['DoW'].'/'.$total['WoW'];
|
foreach ($details as $detail){
|
||||||
$view .='<li style="text-align:center;">' . $total['total'] . '<span style="height:' . $height . '%" title="' . $title . '"></span></li>';
|
if ($detail['WoW'] == $total['WoW'] && $detail['DoW'] == $total['DoW']){
|
||||||
|
$url_input .= $detail['serialnumber'].',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$height = ($total['total'] / $totalcount) * 100;
|
||||||
|
$title = $total['DoW'].'/'.$total['WoW'];
|
||||||
|
$view .='<li style="text-align:center;" onclick="location.href=\'index.php?page=equipments&serialnumber='.substr($url_input,0,-1).'\'">' . $total['total'] . '<span style="height:' . $height . '%" title="' . $title . '"></span></li>';
|
||||||
}
|
}
|
||||||
$view .='</ul></div>';
|
$view .='</ul></div>';
|
||||||
|
|
||||||
@@ -2229,3 +2229,115 @@ $messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
// ML data preparations
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
function traintotalMeasurement($messages){
|
||||||
|
|
||||||
|
//total measurement internal array
|
||||||
|
$total_measurement = [];
|
||||||
|
|
||||||
|
foreach ($messages as $message){
|
||||||
|
//Cleanup input array
|
||||||
|
$dataset = json_decode($message['description'],true);
|
||||||
|
$dataset = $dataset["doubletestvalues"];
|
||||||
|
foreach ($dataset as $measure){
|
||||||
|
//Filter out correct measurements
|
||||||
|
if ($measure['pass'] === true){
|
||||||
|
$measurementid = $message['equipmentid'].'-'.$message['rowID'];
|
||||||
|
$total_measurement[$measure['name']][$measurementid] = $measure['measure'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $total_measurement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function statisticalAnalyses($total_measurement){
|
||||||
|
|
||||||
|
//result array
|
||||||
|
$total_results = [];
|
||||||
|
|
||||||
|
//STATISTICAL ANALYSES INTERNAL ARRAY
|
||||||
|
foreach ($total_measurement as $key => $value){
|
||||||
|
$average = $total_results[$key]['average'] = average($value);
|
||||||
|
$median = $total_results[$key]['median'] = calculateMedian($value);
|
||||||
|
$stdev = $total_results[$key]['stdev'] = standDeviation($value);
|
||||||
|
$total_results[$key]['n'] = count($value);
|
||||||
|
|
||||||
|
//GET STDEV -/+
|
||||||
|
$total_results[$key]['stdev-1'] = $average - $stdev;
|
||||||
|
$total_results[$key]['stdev+1'] = $average + $stdev;
|
||||||
|
$total_results[$key]['stdev-2'] = $average - (2*$stdev);
|
||||||
|
$total_results[$key]['stdev+2'] = $average + (2*$stdev);
|
||||||
|
$total_results[$key]['stdev-3'] = $average - (3*$stdev);
|
||||||
|
$total_results[$key]['stdev+3'] = $average + (3*$stdev);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $total_results;
|
||||||
|
}
|
||||||
|
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
// Main statiscal functions for ML
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
function standDeviation($arr)
|
||||||
|
{
|
||||||
|
$num_of_elements = count($arr);
|
||||||
|
$variance = 0.0;
|
||||||
|
// Calculate mean using array_sum() method
|
||||||
|
$average = array_sum($arr) / $num_of_elements;
|
||||||
|
foreach($arr as $i)
|
||||||
|
{
|
||||||
|
// Sum of squares of differences between all numbers and means.
|
||||||
|
$variance += pow(($i - $average), 2);
|
||||||
|
}
|
||||||
|
return (float)sqrt($variance / $num_of_elements);
|
||||||
|
}
|
||||||
|
function average($arr)
|
||||||
|
{
|
||||||
|
$num_of_elements = count($arr);
|
||||||
|
$average = array_sum($arr) / $num_of_elements;
|
||||||
|
return $average;
|
||||||
|
}
|
||||||
|
function calculateMedian($array) {
|
||||||
|
if (empty($array)) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
sort($array);
|
||||||
|
$lowMiddle = $array[floor((count($array) - 1) / 2)];
|
||||||
|
$highMiddle = $array[ceil((count($array) - 1) / 2)];
|
||||||
|
return ($lowMiddle + $highMiddle) / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
// visual forecast for service and warranty+++++++++++++++
|
||||||
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
function usageView($messages){
|
||||||
|
|
||||||
|
//GET TOTAL SERVICE COUNT
|
||||||
|
$totalcount = 0;
|
||||||
|
foreach ($messages as $message){
|
||||||
|
$totalcount += $message['count'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$view = '
|
||||||
|
<smaller>Service = '.$totalcount.' </smaller>
|
||||||
|
<div style="margin-bottom: 30px;">
|
||||||
|
<ul style="width: 100%;max-width:100%" class="chart">
|
||||||
|
';
|
||||||
|
foreach ($messages as $message){
|
||||||
|
$height = ($message['count'] / $totalcount) * 100;
|
||||||
|
$fc_year = $message['year'];
|
||||||
|
|
||||||
|
$dateObj = DateTime::createFromFormat('!m', $message['month']);
|
||||||
|
$title = $dateObj->format('F').' '.$fc_year;
|
||||||
|
$view .='<li style="text-align:center;">' . $message['count'] . '<span style="height:' . $height . '%" title="' . $title . '"></span></li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .='</ul>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
399
contract.php
399
contract.php
@@ -1,223 +1,258 @@
|
|||||||
<?php
|
<?php
|
||||||
defined(page_security_key) or exit;
|
defined(page_security_key) or exit;
|
||||||
|
|
||||||
|
if (debug && debug_id == $_SESSION['id']){
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('display_startup_errors', '1');
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
}
|
||||||
|
include_once './assets/functions.php';
|
||||||
|
include_once './settings/settings.php';
|
||||||
|
|
||||||
|
//SET ORIGIN FOR NAVIGATION
|
||||||
|
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||||
$page = 'contract';
|
$page = 'contract';
|
||||||
|
|
||||||
|
//create backbutton to prev_origin
|
||||||
|
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
|
||||||
|
|
||||||
//Check if allowed
|
//Check if allowed
|
||||||
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
header('location: index.php');
|
header('location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//GET PARAMETERS && STORE in SESSION for FURTHER USE/NAVIGATION
|
||||||
|
$pagination_page = $_SESSION['p'] = isset($_GET['p']) ? $_GET['p'] : 1;
|
||||||
|
|
||||||
//PAGE Security
|
//PAGE Security
|
||||||
|
$page_manage = 'contract_manage';
|
||||||
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
$update_allowed_edit = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
$delete_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||||
|
$create_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||||
// Default input product values
|
|
||||||
$contract = [
|
|
||||||
'rowID' => '',
|
|
||||||
'type' => '',
|
|
||||||
'status' => '',
|
|
||||||
'accountID' => '',
|
|
||||||
'start_date' => '',
|
|
||||||
'duration' => '',
|
|
||||||
'service_count' => '',
|
|
||||||
'contract_details' => '',
|
|
||||||
'created' => '',
|
|
||||||
'createdby' => '',
|
|
||||||
'billing_plan' => '',
|
|
||||||
'pricing' => '',
|
|
||||||
'reference' => '',
|
|
||||||
'servicetool' => '',
|
|
||||||
'assigned_users' => []
|
|
||||||
];
|
|
||||||
|
|
||||||
|
//GET Details from URL
|
||||||
|
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||||
$contract_ID = $_GET['rowID'] ?? '';
|
$contract_ID = $_GET['rowID'] ?? '';
|
||||||
|
|
||||||
if ($contract_ID !=''){
|
//CALL TO API FOR General information
|
||||||
$url = 'index.php?page=contract&rowID='.$contract_ID.'';
|
$api_url = '/v1/contracts/rowID='.$contract_ID;;
|
||||||
} else {
|
$responses = ioServer($api_url,'');
|
||||||
$url = 'index.php?page=contracts';
|
//Decode Payload
|
||||||
}
|
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||||
|
$responses = $responses[0];
|
||||||
|
|
||||||
if (isset($_GET['rowID'])) {
|
//------------------------------
|
||||||
//CALL TO API
|
//Variables
|
||||||
$api_url = '/v1/contracts/rowID='.$contract_ID;
|
//------------------------------
|
||||||
$responses = ioServer($api_url,'');
|
$contract_status_text = 'contract_status'.$responses->status ?? '';
|
||||||
//Decode Payload
|
$contract_type_text = 'contract_type'.$responses->type ?? '';
|
||||||
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
$servicetools = json_decode($responses->servicetool,true) ?? '';
|
||||||
|
$assigned_users = json_decode($responses->assigned_users,true) ?? '';
|
||||||
|
|
||||||
$contract = json_decode(json_encode($responses[0]), true);
|
//Partnerdata
|
||||||
|
$partner_data = json_decode($responses->accounthierarchy);
|
||||||
|
$salesid = getPartnerName($partner_data->salesid) ?? $not_specified;
|
||||||
|
$soldto = getPartnerName($partner_data->soldto) ?? '-';
|
||||||
|
$shipto = getPartnerName($partner_data->shipto) ?? '-';
|
||||||
|
$location = getPartnerName($partner_data->location) ?? '-';
|
||||||
|
|
||||||
if ($update_allowed === 1){
|
// Handle success messages
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_GET['success_msg'])) {
|
||||||
//GET ALL POST DATA
|
if ($_GET['success_msg'] == 1) {
|
||||||
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
$success_msg = $message_contract_1;
|
||||||
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/contracts', $payload);
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
} else {
|
|
||||||
header('Location: index.php?page=contracts&success_msg=2');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($_GET['success_msg'] == 2) {
|
||||||
if ($delete_allowed === 1){
|
$success_msg = $message_contract_2;
|
||||||
if (isset($_POST['delete'])) {
|
|
||||||
//GET ALL POST DATA
|
|
||||||
$data = json_encode($_POST , JSON_UNESCAPED_UNICODE);
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/contracts', $payload);
|
|
||||||
// Redirect and delete product
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
} else {
|
|
||||||
header('Location: index.php?page=contracts&success_msg=3');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($_GET['success_msg'] == 3) {
|
||||||
} else {
|
$success_msg = $message_contract_3;
|
||||||
// Create a new product
|
|
||||||
if (isset($_POST['submit']) && $create_allowed === 1) {
|
|
||||||
//GET ALL POST DATA
|
|
||||||
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/contracts', $payload);
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
} else {
|
|
||||||
header('Location: index.php?page=contracts&success_msg=1');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template_header('Contract', 'contract', 'manage');
|
template_header('Contract', 'contract', 'view');
|
||||||
|
$view = '
|
||||||
$view ='
|
|
||||||
<form action="" method="post">
|
|
||||||
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
<h2 class="responsive-width-100">'.$contract_h2.'</h2>
|
<h2 class="responsive-width-100">'.$responses->rowID.'</h2>
|
||||||
<a href="index.php?page=contracts" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
<a href="index.php?page='.$_SESSION['origin'].'&p='.$_SESSION['p'].'" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
||||||
';
|
';
|
||||||
|
|
||||||
if ($delete_allowed === 1){
|
|
||||||
$view .= '<input type="submit" name="delete" value="Delete" class="btn red mar-right-2" onclick="return confirm(\'Are you sure you want to delete this contract?\')">';
|
//------------------------------------
|
||||||
}
|
//
|
||||||
if ($update_allowed === 1){
|
//------------------------------------
|
||||||
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
if ($update_allowed_edit === 1){
|
||||||
|
$view .= '<a href="index.php?page=contract_manage&rowID='.$_GET['rowID'].'" class="btn">Edit</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$view .= '</div>';
|
$view .= '</div>';
|
||||||
|
|
||||||
$view .= '<div class="tabs">
|
if (isset($success_msg)){
|
||||||
<a href="#" class="active">'.$tab1 .'</a>
|
$view .= ' <div class="msg success">
|
||||||
<a href="#">'.$tab2.'</a>
|
<i class="fas fa-check-circle"></i>
|
||||||
<a href="#">'.$tab3.'</a>
|
<p>'.$success_msg.'</p>
|
||||||
|
<i class="fas fa-times"></i>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .= '<div class="content-block-wrapper">';
|
||||||
|
|
||||||
|
$view .= ' <div class="content-block order-details">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-circle-info"></i></i>'.($product_data ?? '').'
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_id.'</h3>
|
||||||
|
<p>'.$responses->rowID.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_status.'</h3>
|
||||||
|
<p><span class="status id'.$responses->status.'">'.$$contract_status_text.'</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_type.'</h3>
|
||||||
|
<p><span class="status id'.$responses->type.'">'.$$contract_type_text.'</span></p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_start_date.'</h3>
|
||||||
|
<p>'.$responses->start_date.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_duration.'</h3>
|
||||||
|
<p>'.$responses->duration.'</p>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
if ($responses->duration !='' && $responses->start_date !=''){
|
||||||
|
$date = date('Y-m-d', strtotime('+'.$responses->duration.' months', strtotime($responses->start_date)));
|
||||||
|
|
||||||
|
$view .= '
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_end_date.'</h3>
|
||||||
|
<p>'.$date.'</p>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .='
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .='<div class="content-block order-details">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-user fa-sm"></i>'.$view_asset_partners.'
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$general_salesid.'</h3>
|
||||||
|
<p>'.$salesid.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$general_soldto.'</h3>
|
||||||
|
<p>'.$soldto.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$general_shipto.'</h3>
|
||||||
|
<p>'.$shipto.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$general_location.'</h3>
|
||||||
|
<p>'.$location.'</p>
|
||||||
|
</div>
|
||||||
|
<div class="order-detail">
|
||||||
|
<h3>'.$contract_reference.'</h3>
|
||||||
|
<p>'.$responses->reference.'</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>';
|
||||||
|
$view .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
//Usageview
|
||||||
|
|
||||||
|
//get all assigned serialnumbers
|
||||||
|
$url_input = '';
|
||||||
|
foreach($servicetools as $service_tool){
|
||||||
|
$url_input .= $service_tool.',';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return report_usage_servicereports
|
||||||
|
$api_url = '/v1/application/type=ServiceReport&serialnumber='.substr($url_input,0,-1).'/contract_usage_servicereports';
|
||||||
|
$contract_usage_servicereports = ioServer($api_url,'');
|
||||||
|
//Decode Payload
|
||||||
|
if (!empty($contract_usage_servicereports)){$contract_usage_servicereports = decode_payload($contract_usage_servicereports);}else{$contract_usage_servicereports = null;}
|
||||||
|
|
||||||
|
$service_events = usageView(json_decode(json_encode($contract_usage_servicereports),true));
|
||||||
|
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.$menu_service_reports.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
'.$service_events.'
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
$view .='<div class="content-block tab-content active">
|
|
||||||
<div class="form responsive-width-100">
|
$view .= '<div class="content-block">
|
||||||
<label for="">'.$contract_status.'</label>
|
<div class="block-header">
|
||||||
<select name="status">
|
<i class="fa-solid fa-bars fa-sm"></i>'.$contract_assigned_users.'
|
||||||
<option value="0" '.($contract['status']==0?' selected':'').'>'.$contract_status0.'</option>
|
|
||||||
<option value="1" '.($contract['status']==1?' selected':'').'>'.$contract_status1.'</option>
|
|
||||||
<option value="2" '.($contract['status']==2?' selected':'').'>'.$contract_status2.'</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form responsive-width-100">
|
<div class="table order-table">
|
||||||
<label for="">'.$contract_type.'</label>
|
<table class="sortable">
|
||||||
<select name="type">
|
<tbody>';
|
||||||
<option value="0" '.($contract['type']==0?' selected':'').'>'.$contract_type0.'</option>
|
//Check for assigned users
|
||||||
<option value="1" '.($contract['type']==1?' selected':'').'>'.$contract_type1.'</option>
|
foreach ($assigned_users as $user){
|
||||||
<option value="2" '.($contract['type']==2?' selected':'').'>'.$contract_type2.'</option>
|
$view .= '<tr><td>'.$user.'</td><tr>';
|
||||||
</select>
|
}
|
||||||
|
$view .= '
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_start_date.'</label>
|
|
||||||
<input type="date" name="start_date" value="'.$contract['start_date'].'" required>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
//Define end_date based on duration
|
|
||||||
if ($contract['duration'] !='' && $contract['start_date'] !=''){
|
|
||||||
$date = date('Y-m-d', strtotime('+'.$contract['duration'].' months', strtotime($contract['start_date'])));
|
|
||||||
|
|
||||||
$view .= '<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_end_date.'</label>
|
|
||||||
<input type="date" value="'.$date.'" readonly>
|
|
||||||
</div>';
|
|
||||||
}
|
|
||||||
$view .= '<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_duration.'</label>
|
|
||||||
<input type="number" name="duration" value="'.$contract['duration'].'" required>
|
|
||||||
</div>
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_reference.'</label>
|
|
||||||
<input type="text" name="reference" value="'.$contract['reference'].'" >
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//GET PARTNER DROPDOWN
|
|
||||||
$soldto_dropdown = listAccounts('accountID',$_SESSION['permission'],$contract['accountID']);
|
|
||||||
|
|
||||||
$view .= '<div class="content-block tab-content">
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_account.'</label>
|
|
||||||
'.$soldto_dropdown.'
|
|
||||||
</div>
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_servicetool.'</label>
|
|
||||||
<input id="name" type="text" name="servicetool" placeholder="'.$contract_servicetool.'" value="'.$contract['servicetool'].'">
|
|
||||||
</div>
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$contract_assigned_users.'</label>';
|
|
||||||
|
|
||||||
|
|
||||||
//Check for assigned users
|
|
||||||
$assigned_users = (is_string($contract['assigned_users']))? json_decode($contract['assigned_users']) : '';
|
|
||||||
|
|
||||||
if (is_array($assigned_users)) {
|
|
||||||
foreach ($assigned_users as $user){
|
|
||||||
$view .= '<input id="assigned_users" type="text" name="assigned_users" placeholder="'.$contract_assigned_users.'" value="'.$user.'">';
|
|
||||||
}
|
|
||||||
} else{
|
|
||||||
$view .= '<input id="assigned_users" type="text" name="assigned_users[]" placeholder="'.$contract_assigned_users.'" value="">';
|
|
||||||
}
|
|
||||||
|
|
||||||
$view .=' </div>
|
|
||||||
<button type="button" class="btn" onclick="addField(\'assigned_users\',\'assigned_users[]\');"> + </button> <small>'.$contract_assigned_users_add.'</small>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
$view .= '<div class="content-block tab-content">
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="">'.$general_created.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$contract['created'].'" readonly>
|
|
||||||
<label for="">'.$general_createdby.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$contract['createdby'].'" readonly>
|
|
||||||
<input id="name" type="hidden" name="rowID" value="'.$contract['rowID'].'" readonly>
|
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
';
|
||||||
|
|
||||||
|
|
||||||
$view .= '</form>';
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'. $contract_servicetool.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
<table class="sortable">
|
||||||
|
<tbody>';
|
||||||
|
//Check for assigned tools
|
||||||
|
foreach ($servicetools as $tools){
|
||||||
|
$view .= '<tr><td>'.$tools.'</td><tr>';
|
||||||
|
}
|
||||||
|
$view .= '
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.$tab3.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_created.'</td>
|
||||||
|
<td>'.$responses->created.'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_createdby.'</td>
|
||||||
|
<td>'.$responses->createdby.'</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .='</div>';
|
||||||
|
|
||||||
//Output
|
//OUTPUT
|
||||||
echo $view;
|
echo $view;
|
||||||
|
|
||||||
template_footer()?>
|
template_footer()
|
||||||
|
|
||||||
|
?>
|
||||||
250
contract_manage.php
Normal file
250
contract_manage.php
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
<?php
|
||||||
|
defined(page_security_key) or exit;
|
||||||
|
|
||||||
|
$page = 'contract_manage';
|
||||||
|
//Check if allowed
|
||||||
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
|
header('location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//PAGE Security
|
||||||
|
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
|
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||||
|
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||||
|
|
||||||
|
// Default input product values
|
||||||
|
$contract = [
|
||||||
|
'rowID' => '',
|
||||||
|
'type' => '',
|
||||||
|
'status' => '',
|
||||||
|
'accountID' => '',
|
||||||
|
'start_date' => '',
|
||||||
|
'duration' => '',
|
||||||
|
'service_count' => '',
|
||||||
|
'contract_details' => '',
|
||||||
|
'created' => '',
|
||||||
|
'createdby' => '',
|
||||||
|
'billing_plan' => '',
|
||||||
|
'pricing' => '',
|
||||||
|
'reference' => '',
|
||||||
|
'servicetool' => [],
|
||||||
|
'assigned_users' => [],
|
||||||
|
'accounthierarchy' => $_SESSION['partnerhierarchy']
|
||||||
|
];
|
||||||
|
|
||||||
|
$contract_ID = $_GET['rowID'] ?? '';
|
||||||
|
|
||||||
|
if ($contract_ID !=''){
|
||||||
|
$url = 'index.php?page=contract&rowID='.$contract_ID.'';
|
||||||
|
} else {
|
||||||
|
$url = 'index.php?page=contracts';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['rowID'])) {
|
||||||
|
//CALL TO API
|
||||||
|
$api_url = '/v1/contracts/rowID='.$contract_ID;
|
||||||
|
$responses = ioServer($api_url,'');
|
||||||
|
//Decode Payload
|
||||||
|
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||||
|
|
||||||
|
$contract = json_decode(json_encode($responses[0]), true);
|
||||||
|
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
if (isset($_POST['submit'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
var_dump($data);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/contracts', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
header('Location: index.php?page=contract&rowID='.$contract_ID.'&success_msg=2');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
if (isset($_POST['delete'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST , JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/contracts', $payload);
|
||||||
|
// Redirect and delete product
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
header('Location: index.php?page=contracts&success_msg=3');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Create a new product
|
||||||
|
if (isset($_POST['submit']) && $create_allowed === 1) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/contracts', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
header('Location: index.php?page=contracts&success_msg=1');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template_header('Contract', 'contract', 'manage');
|
||||||
|
|
||||||
|
$view ='
|
||||||
|
<form action="" method="post">
|
||||||
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
|
<h2 class="responsive-width-100">'.$contract_h2.'</h2>
|
||||||
|
<a href="'.$url.'" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
||||||
|
';
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="delete" value="Delete" class="btn red mar-right-2" onclick="return confirm(\'Are you sure you want to delete this contract?\')">';
|
||||||
|
}
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .= '</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="tabs">
|
||||||
|
<a href="#" class="active">'.$tab1 .'</a>
|
||||||
|
<a href="#">'.$tab2.'</a>
|
||||||
|
<a href="#">'.$tab3.'</a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .='<div class="content-block tab-content active">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_status.'</label>
|
||||||
|
<select name="status">
|
||||||
|
<option value="0" '.($contract['status']==0?' selected':'').'>'.$contract_status0.'</option>
|
||||||
|
<option value="1" '.($contract['status']==1?' selected':'').'>'.$contract_status1.'</option>
|
||||||
|
<option value="2" '.($contract['status']==2?' selected':'').'>'.$contract_status2.'</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_type.'</label>
|
||||||
|
<select name="type">
|
||||||
|
<option value="0" '.($contract['type']==0?' selected':'').'>'.$contract_type0.'</option>
|
||||||
|
<option value="1" '.($contract['type']==1?' selected':'').'>'.$contract_type1.'</option>
|
||||||
|
<option value="2" '.($contract['type']==2?' selected':'').'>'.$contract_type2.'</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_start_date.'</label>
|
||||||
|
<input type="date" name="start_date" value="'.$contract['start_date'].'" required>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
//Define end_date based on duration
|
||||||
|
if ($contract['duration'] !='' && $contract['start_date'] !=''){
|
||||||
|
$date = date('Y-m-d', strtotime('+'.$contract['duration'].' months', strtotime($contract['start_date'])));
|
||||||
|
|
||||||
|
$view .= '<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_end_date.'</label>
|
||||||
|
<input type="date" value="'.$date.'" readonly>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
$view .= '<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_duration.'</label>
|
||||||
|
<input type="number" name="duration" value="'.$contract['duration'].'" required>
|
||||||
|
</div>
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_reference.'</label>
|
||||||
|
<input type="text" name="reference" value="'.$contract['reference'].'" >
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_servicetool.' <button type="button" class="btn2" onclick="addField(\'assigned_servicetools\',\'servicetool[]\');" style="width:5%;background-color:#bed4ea;"> + </button></label>';
|
||||||
|
//Check for assigned servicetools
|
||||||
|
$assigned_servicetools = (empty($contract['servicetool']))? '' :json_decode($contract['servicetool'],true);
|
||||||
|
|
||||||
|
if (!empty($assigned_servicetools || $assigned_servicetools !='')){
|
||||||
|
foreach ($assigned_servicetools as $tool){
|
||||||
|
$view .= '<input id="assigned_servicetools" type="text" name="servicetool[]" placeholder="'.$contract_servicetool.'" value="'.$tool.'">';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$view .= '<input id="assigned_users" type="text" name="servicetool[]" placeholder="'.$contract_servicetool.'" value="">';
|
||||||
|
|
||||||
|
}
|
||||||
|
$view .=' </div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .=' <div class="form responsive-width-100">
|
||||||
|
<label for="">'.$contract_assigned_users.' <button type="button" class="btn2" onclick="addField(\'assigned_users\',\'assigned_users[]\');" style="width:5%;background-color:#bed4ea;"> + </button></label>';
|
||||||
|
|
||||||
|
//Check for assigned users
|
||||||
|
$assigned_users = (empty($contract['assigned_users']))? '' :json_decode($contract['assigned_users'],true);
|
||||||
|
|
||||||
|
if (!empty($assigned_users) || $assigned_users != ''){
|
||||||
|
foreach ($assigned_users as $user){
|
||||||
|
$view .= '<input id="assigned_users" type="text" name="assigned_users[]" placeholder="'.$contract_assigned_users.'" value="'.$user.'">';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$view .= '<input id="assigned_users" type="text" name="assigned_users[]" placeholder="'.$contract_assigned_users.'" value="">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .=' </div>
|
||||||
|
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
//GET PARTNERDATA
|
||||||
|
$partner_data = json_decode($contract['accounthierarchy']);
|
||||||
|
|
||||||
|
//BUID UP DROPDOWNS
|
||||||
|
$salesid_dropdown = listPartner('salesid',$_SESSION['permission'],$partner_data->salesid);
|
||||||
|
$soldto_dropdown = listPartner('soldto',$_SESSION['permission'],$partner_data->soldto);
|
||||||
|
$shipto_dropdown = listPartner('shipto',$_SESSION['permission'],$partner_data->shipto);
|
||||||
|
$location_dropdown = listPartner('location',$_SESSION['permission'],$partner_data->location);
|
||||||
|
|
||||||
|
//DISPLAY
|
||||||
|
$view .= '<div class="content-block tab-content">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
';
|
||||||
|
$view .= '<label for="status">'.$general_salesid.'</label>';
|
||||||
|
$view .= $salesid_dropdown;
|
||||||
|
$view .= '<label for="status">'.$general_soldto.'</label>';
|
||||||
|
$view .= $soldto_dropdown;
|
||||||
|
$view .= '<label for="status">'.$general_shipto.'</label>';
|
||||||
|
$view .= $shipto_dropdown;
|
||||||
|
$view .= '<label for="status">'.$general_location.'</label>';
|
||||||
|
$view .= $location_dropdown;
|
||||||
|
|
||||||
|
$view .= '
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="">'.$general_created.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$contract['created'].'" readonly>
|
||||||
|
<label for="">'.$general_createdby.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$contract['createdby'].'" readonly>
|
||||||
|
<input id="name" type="hidden" name="rowID" value="'.$contract['rowID'].'" readonly>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
|
$view .= '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
//Output
|
||||||
|
echo $view;
|
||||||
|
|
||||||
|
template_footer()?>
|
||||||
@@ -11,8 +11,8 @@ include_once './settings/settings.php';
|
|||||||
|
|
||||||
|
|
||||||
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
//SET PAGE ORIGIN FOR NAVIGATION AND SECURITY
|
||||||
|
$page = $_SESSION['origin'] = 'contracts';
|
||||||
$prev_page = ($_SESSION['origin'] == 'equipments') ? $_SESSION['prev_origin_equipment'] : (($_SESSION['origin'] == 'account')? $_SESSION['prev_origin'] :'');
|
$prev_page = ($_SESSION['origin'] == 'equipments') ? $_SESSION['prev_origin_equipment'] : (($_SESSION['origin'] == 'account')? $_SESSION['prev_origin'] :'');
|
||||||
$page = 'contracts';
|
|
||||||
|
|
||||||
//create backbutton to prev_origin
|
//create backbutton to prev_origin
|
||||||
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
|
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
|
||||||
@@ -78,7 +78,7 @@ $view .= ' <div class="msg success">
|
|||||||
}
|
}
|
||||||
$view .= '
|
$view .= '
|
||||||
<div class="content-header responsive-flex-column pad-top-5">
|
<div class="content-header responsive-flex-column pad-top-5">
|
||||||
<a href="index.php?page=contract" class="btn">'.$button_create_contract.'</a>
|
<a href="index.php?page=contract_manage" class="btn">'.$button_create_contract.'</a>
|
||||||
<form action="" method="get">
|
<form action="" method="get">
|
||||||
<input type="hidden" name="page" value="contracts">
|
<input type="hidden" name="page" value="contracts">
|
||||||
<div class="filters">
|
<div class="filters">
|
||||||
@@ -137,11 +137,14 @@ $view .= '
|
|||||||
//calculate enddate from duration
|
//calculate enddate from duration
|
||||||
$date = date('Y-m-d', strtotime('+'.$response->duration.' months', strtotime($response->start_date)));
|
$date = date('Y-m-d', strtotime('+'.$response->duration.' months', strtotime($response->start_date)));
|
||||||
|
|
||||||
|
//GetPartnerDetails
|
||||||
|
$partner_data = json_decode($response->accounthierarchy);
|
||||||
|
|
||||||
$view .= '
|
$view .= '
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.$response->rowID.'</td>
|
<td>'.$response->rowID.'</td>
|
||||||
<td>'.(($response->status == 1)? '<span class="status enabled">'.$$status:'<span class="status">'.$$status).'</td>
|
<td>'.(($response->status == 1)? '<span class="status enabled">'.$$status:'<span class="status">'.$$status).'</td>
|
||||||
<td>'.$response->accountID.'</td>
|
<td>'.$partner_data->soldto.'</td>
|
||||||
<td>'.$$type.'</td>
|
<td>'.$$type.'</td>
|
||||||
<td>'.$response->start_date.'</td>
|
<td>'.$response->start_date.'</td>
|
||||||
<td>'.$date.'</td>
|
<td>'.$date.'</td>
|
||||||
|
|||||||
94
dev.php
94
dev.php
@@ -7,42 +7,92 @@ include './assets/functions.php';
|
|||||||
include './settings/settings.php';
|
include './settings/settings.php';
|
||||||
include './settings/config.php';
|
include './settings/config.php';
|
||||||
|
|
||||||
|
|
||||||
|
$tes= '40';
|
||||||
|
|
||||||
|
$test_r = (isset($test))? $test : (isset($test2)? $test2 : 'none');
|
||||||
|
|
||||||
|
echo $test_r;
|
||||||
//Connect to DB
|
//Connect to DB
|
||||||
$pdo = dbConnect($dbname);
|
$pdo = dbConnect($dbname);
|
||||||
$sql = 'SELECT description FROM history where type="Maintenance_Test" and description like "%doubletestvalues%"';
|
|
||||||
|
|
||||||
|
//GET
|
||||||
|
$sql = 'SELECT rowID, description, equipmentid FROM history where type="Maintenance_Test" and description like "%doubletestvalues%"';
|
||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
//total measurement internal array
|
$watchlist_byproduct = [];
|
||||||
$total_measurement = [];
|
$watchlist_bytest = [];
|
||||||
foreach ($messages as $message){
|
$watchlist_totals = [];
|
||||||
//Cleanup input array
|
|
||||||
$message = json_decode($message['description'],true);
|
//train the model
|
||||||
$message = $message["doubletestvalues"];
|
$total_measurement = traintotalMeasurement($messages);
|
||||||
foreach ($message as $measure){
|
|
||||||
//Filter out correct measurements
|
//get statics on results
|
||||||
if ($measure['pass'] === true){
|
$total_results = statisticalAnalyses($total_measurement);
|
||||||
$total_measurement[$measure['name']][] = $measure['measure'];
|
|
||||||
|
//COMPARISON -- CHECK DEVIATIONS FROM STANDARD
|
||||||
|
foreach ($total_measurement as $measurement => $values){
|
||||||
|
foreach($total_results as $total_result => $measured_values){
|
||||||
|
if ($measurement == $total_result){
|
||||||
|
foreach ($values as $id => $measured_value){
|
||||||
|
if (($measured_value <= $total_results[$total_result]['stdev-3']) && ($measured_value >= $total_results[$total_result]['stdev+3'])){
|
||||||
|
$watchlist_byproduct[$id][] = array(
|
||||||
|
"measurement" => $measurement,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 3
|
||||||
|
);
|
||||||
|
$watchlist_bytest[$measurement][] = array(
|
||||||
|
"equipmentid" => $id,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 3
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ((($measured_value <= $total_results[$total_result]['stdev-2']) && ($measured_value >= $total_results[$total_result]['stdev-3'])) || (($measured_value >= $total_results[$total_result]['stdev+2']) && ($measured_value <= $total_results[$total_result]['stdev+3']))){
|
||||||
|
$watchlist_byproduct[$id][] = array(
|
||||||
|
"measurement" => $measurement,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 2
|
||||||
|
);
|
||||||
|
$watchlist_bytest[$measurement][] = array(
|
||||||
|
"equipmentid" => $id,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 2
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ((($measured_value <= $total_results[$total_result]['stdev-1']) && ($measured_value >= $total_results[$total_result]['stdev-2'])) || (($measured_value >= $total_results[$total_result]['stdev+1']) && ($measured_value <= $total_results[$total_result]['stdev+2']))){
|
||||||
|
/*$watchlist_byproduct[$id][] = array(
|
||||||
|
"measurement" => $measurement,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 1
|
||||||
|
);
|
||||||
|
$watchlist_bytest[$measurement][] = array(
|
||||||
|
"equipmentid" => $id,
|
||||||
|
"value" => $measured_value,
|
||||||
|
"deviation" => 1
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//result array
|
//GET WATCHLIST SUMMARY
|
||||||
$total_results = [];
|
foreach ($watchlist_bytest as $test => $value){
|
||||||
//print "<pre>";
|
$watchlist_totals[$test]['n_deviation'] = count($value);
|
||||||
//print_r($total_measurement);
|
//calculate percentage
|
||||||
//print "</pre>";
|
//$watchlist_totals[$test]['percentage'] = ($watchlist_totals[$test]['n_deviation'] / $watchlist_totals[$test]['n_total'])*100;
|
||||||
|
|
||||||
foreach ($total_measurement as $key => $value){
|
|
||||||
$total_results[$key]['average'] = average($value);
|
|
||||||
$total_results[$key]['median'] = calculateMedian($value);
|
|
||||||
$total_results[$key]['stdev'] = standDeviation($value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<pre>";
|
print "<pre>";
|
||||||
print_r($total_results);
|
print_r($total_results);
|
||||||
print "</pre>";
|
print "</pre>";
|
||||||
|
|
||||||
|
|
||||||
|
/*MAIN STATISCAL FUNCTION
|
||||||
function standDeviation($arr)
|
function standDeviation($arr)
|
||||||
{
|
{
|
||||||
$num_of_elements = count($arr);
|
$num_of_elements = count($arr);
|
||||||
@@ -72,6 +122,6 @@ function calculateMedian($array) {
|
|||||||
return ($lowMiddle + $highMiddle) / 2;
|
return ($lowMiddle + $highMiddle) / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -37,12 +37,13 @@ $servicedate = $_SESSION['servicedate'] = isset($_GET['servicedate']) ? '&servic
|
|||||||
$warrantydate = $_SESSION['warrantydate'] = isset($_GET['warrantydate']) ? '&warrantydate='.$_GET['warrantydate'] : '';
|
$warrantydate = $_SESSION['warrantydate'] = isset($_GET['warrantydate']) ? '&warrantydate='.$_GET['warrantydate'] : '';
|
||||||
$partnerid = $_SESSION['partnerid'] = isset($_GET['partnerid']) ? '&partnerid='.$_GET['partnerid'] : '';
|
$partnerid = $_SESSION['partnerid'] = isset($_GET['partnerid']) ? '&partnerid='.$_GET['partnerid'] : '';
|
||||||
$productselected = $_SESSION['productcode'] = isset($_GET['productcode']) ? '&productcode='.$_GET['productcode'] : '';
|
$productselected = $_SESSION['productcode'] = isset($_GET['productcode']) ? '&productcode='.$_GET['productcode'] : '';
|
||||||
|
$serialnumber_input = $_SESSION['serialnumber'] = isset($_GET['serialnumber']) ? '&serialnumber='.$_GET['serialnumber'] : '';
|
||||||
|
|
||||||
//GET PARAMETERS FOR FILTERS
|
//GET PARAMETERS FOR FILTERS
|
||||||
$filter = urlGETdetailsFilter($_GET) ?? '';
|
$filter = urlGETdetailsFilter($_GET) ?? '';
|
||||||
|
|
||||||
// Determine the URL
|
// Determine the URL
|
||||||
$url = 'index.php?page=equipments'.$status.$search.$software.$servicedate.$warrantydate.$partnerid.$sort.$productselected;
|
$url = 'index.php?page=equipments'.$status.$search.$software.$servicedate.$warrantydate.$partnerid.$sort.$productselected.$serialnumber_input;
|
||||||
//GET Details from URL
|
//GET Details from URL
|
||||||
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||||
//CALL TO API
|
//CALL TO API
|
||||||
|
|||||||
390
product.php
390
product.php
@@ -1,207 +1,249 @@
|
|||||||
<?php
|
<?php
|
||||||
defined(page_security_key) or exit;
|
defined(page_security_key) or exit;
|
||||||
|
|
||||||
|
if (debug && debug_id == $_SESSION['id']){
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('display_startup_errors', '1');
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
}
|
||||||
|
include_once './assets/functions.php';
|
||||||
|
include_once './settings/settings.php';
|
||||||
|
|
||||||
|
//SET ORIGIN FOR NAVIGATION
|
||||||
|
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||||
$page = 'product';
|
$page = 'product';
|
||||||
|
|
||||||
|
//create backbutton to prev_origin
|
||||||
|
$back_btn_orgin = ($prev_page != '')? '<a href="'.$prev_page.'" class="btn alt mar-right-2">'.$button_back.'</a>':'';
|
||||||
|
|
||||||
//Check if allowed
|
//Check if allowed
|
||||||
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
header('location: index.php');
|
header('location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//GET PARAMETERS && STORE in SESSION for FURTHER USE/NAVIGATION
|
||||||
|
$pagination_page = $_SESSION['p'] = isset($_GET['p']) ? $_GET['p'] : 1;
|
||||||
|
|
||||||
//PAGE Security
|
//PAGE Security
|
||||||
|
$page_manage = 'product_manage';
|
||||||
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
$update_allowed_edit = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
$delete_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||||
|
$create_allowed = isAllowed($page_manage ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||||
|
|
||||||
// Default input product values
|
//GET Details from URL
|
||||||
$product = [
|
$GET_VALUES = urlGETdetails($_GET) ?? '';
|
||||||
'rowID' => '',
|
|
||||||
'productcode' => '',
|
|
||||||
'productname' => '',
|
|
||||||
'productdescription' => '',
|
|
||||||
'softwareversion' => 'v1.0',
|
|
||||||
'created' => '',
|
|
||||||
'createdby' => $_SESSION['username'],
|
|
||||||
'parttype' => 1,
|
|
||||||
'price' => '0',
|
|
||||||
'salesflag' => 0,
|
|
||||||
'updated' => '',
|
|
||||||
'updatedby' => $_SESSION['username'],
|
|
||||||
'product_category' => '',
|
|
||||||
'status' => 1,
|
|
||||||
'build' => 1,
|
|
||||||
'partnerhierarchy' => '',
|
|
||||||
'sn' =>''
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isset($_GET['id'])) {
|
//CALL TO API FOR General information
|
||||||
// ID param exists, edit an existing product
|
$api_url = '/v1/products/'.$GET_VALUES;
|
||||||
//CALL TO API
|
$responses = ioServer($api_url,'');
|
||||||
$api_url = '/v1/products/rowID='.$_GET['id'];
|
//Decode Payload
|
||||||
$responses = ioServer($api_url,'');
|
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||||
//Decode Payload
|
$responses = $responses[0];
|
||||||
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
|
||||||
|
|
||||||
$product = json_decode(json_encode($responses[0]), true);
|
//CALL TO API FOR Product_versions
|
||||||
|
$api_url = '/v1/products_versions/productrowid='.$_GET['rowID'];
|
||||||
|
$product_versions = ioServer($api_url,'');
|
||||||
|
//Decode Payload
|
||||||
|
if (!empty($product_versions)){$product_versions = decode_payload($product_versions);}else{$product_versions = null;}
|
||||||
|
|
||||||
if ($update_allowed === 1){
|
//------------------------------
|
||||||
if (isset($_POST['file_upload'])){
|
//Variables
|
||||||
uploadProduct($_POST['productcode']);
|
//------------------------------
|
||||||
}
|
$status_text = 'prod_status_'.$responses->status ?? '';
|
||||||
if (isset($_POST['submit'])) {
|
$product_category_text = 'product_category'.$responses->product_category ?? '';
|
||||||
//GET ALL POST DATA
|
$parttype_text = 'part_type'.$responses->parttype ?? '';
|
||||||
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/products', $payload);
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
} else {
|
// Handle success messages
|
||||||
header('Location: index.php?page=products&status=1&success_msg=2');
|
if (isset($_GET['success_msg'])) {
|
||||||
exit;
|
if ($_GET['success_msg'] == 1) {
|
||||||
|
$success_msg = $message_pr_1;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($_GET['success_msg'] == 2) {
|
||||||
if ($delete_allowed === 1){
|
$success_msg = $message_pr_2;
|
||||||
if (isset($_POST['delete'])) {
|
|
||||||
//GET ALL POST DATA
|
|
||||||
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/products', $payload);
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// Redirect and delete product
|
|
||||||
header('Location: index.php?page=products&status=1&success_msg=3');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($_GET['success_msg'] == 3) {
|
||||||
} else {
|
$success_msg = $message_pr_3;
|
||||||
// Create a new product
|
|
||||||
if (isset($_POST['submit']) && $create_allowed === 1) {
|
|
||||||
//GET ALL POST DATA
|
|
||||||
$data = json_encode($_POST , JSON_UNESCAPED_UNICODE);
|
|
||||||
//Secure data
|
|
||||||
$payload = generate_payload($data);
|
|
||||||
//API call
|
|
||||||
$responses = ioServer('/v1/products', $payload);
|
|
||||||
if ($responses === 'NOK'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
header('Location: index.php?page=products&success_msg=1');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template_header('Product', 'product', 'manage');
|
template_header('Product', 'product', 'view');
|
||||||
|
$view = '
|
||||||
$view ='
|
|
||||||
<form action="" method="post">
|
|
||||||
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
<h2 class="responsive-width-100">'.$product_h2.'</h2>
|
<h2 class="responsive-width-100">'.$responses->productcode.' - '.$responses->productname.'</h2>
|
||||||
<a href="index.php?page=products" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
<a href="index.php?page='.$_SESSION['origin'].'&p='.$_SESSION['p'].'" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
||||||
';
|
';
|
||||||
|
|
||||||
if ($delete_allowed === 1){
|
|
||||||
$view .= '<input type="submit" name="delete" value="Delete" class="btn red mar-right-2" onclick="return confirm(\'Are you sure you want to delete this product?\')">';
|
//------------------------------------
|
||||||
}
|
//
|
||||||
if ($update_allowed === 1){
|
//------------------------------------
|
||||||
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
if ($update_allowed_edit === 1){
|
||||||
|
$view .= '<a href="index.php?page=product_manage&id='.$_GET['rowID'].'" class="btn">Edit</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$view .= '</div>';
|
$view .= '</div>';
|
||||||
|
|
||||||
$view .= '<div class="tabs">
|
if (isset($success_msg)){
|
||||||
<a href="#" class="active">'.$tab1.'</a>
|
$view .= ' <div class="msg success">
|
||||||
<a href="#">'.$tab4.'</a>
|
<i class="fas fa-check-circle"></i>
|
||||||
<a href="#">'.$tab3.'</a>
|
<p>'.$success_msg.'</p>
|
||||||
</div>
|
<i class="fas fa-times"></i>
|
||||||
';
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
$view .= '<div class="content-block tab-content active">
|
$view .= '<div class="content-block-wrapper">';
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="status">'.$product_status.'</label>
|
$view .= ' <div class="content-block order-details">
|
||||||
<select id="status" name="status">
|
<div class="block-header">
|
||||||
<option value="1" '.($product['status']==1?' selected':'').'>'.$prod_status_1 .'</option>
|
<i class="fa-solid fa-circle-info"></i></i>'.($product_data ?? '').'
|
||||||
<option value="0" '.($product['status']==0?' selected':'').'>'.$prod_status_0 .'</option>
|
</div>
|
||||||
</select>
|
<div class="order-detail">
|
||||||
<label for="parttype">'.$product_parttype.'</label>
|
<h3>'.$product_status.'</h3>
|
||||||
<select id="status" name="parttype">
|
<p><span class="status id'.$responses->status.'">'.$$status_text.'</span></p>
|
||||||
<option value="1" '.($product['parttype']==1?' selected':'').'>'.$part_type1.'</option>
|
</div>
|
||||||
<option value="2" '.($product['parttype']==2?' selected':'').'>'.$part_type2.'</option>
|
<div class="order-detail">
|
||||||
<option value="3" '.($product['parttype']==3?' selected':'').'>'.$part_type3.'</option>
|
<h3>'.$product_category.'</h3>
|
||||||
</select>
|
<p><span class="status id'.$responses->product_category.'">'.$$product_category_text.'</span></p>
|
||||||
<label for="parttype">'.$product_category.'</label>
|
</div>
|
||||||
<select id="status" name="product_category">
|
<div class="order-detail">
|
||||||
<option value="0" '.($product['product_category']==0?' selected':'').'>'.$product_category0.'</option>
|
<h3>'.$product_parttype.'</h3>
|
||||||
<option value="1" '.($product['product_category']==1?' selected':'').'>'.$product_category1.'</option>
|
<p><span class="status id'.$responses->parttype.'">'.$$parttype_text.'</span></p>
|
||||||
<option value="2" '.($product['product_category']==2?' selected':'').'>'.$product_category2.'</option>
|
</div>
|
||||||
<option value="3" '.($product['product_category']==3?' selected':'').'>'.$product_category3.'</option>
|
<div class="order-detail">
|
||||||
</select>
|
<h3>'.$product_code.'</h3>
|
||||||
<label for="productcode"><i class="required">*</i>'.$product_code.'</label>
|
<p>'.$responses->productcode.'</p>
|
||||||
<input id="name" type="text" name="productcode" placeholder="'.$product_code.'" value="'.$product['productcode'].'" required>
|
</div>
|
||||||
<label for="productname"><i class="required">*</i>'.$product_name.'</label>
|
<div class="order-detail">
|
||||||
<input id="name" type="text" name="productname" placeholder="'.$product_name.'" value="'.$product['productname'].'" required>
|
<h3>'.$product_name.'</h3>
|
||||||
<label for="productdescription">'.$product_description.'</label>
|
<p>'.$responses->productname.'</p>
|
||||||
<textarea id="description" name="productdescription" placeholder="'.$product_description.'">'.$product['productdescription'].'</textarea>
|
</div>';
|
||||||
<label for="softwareversion">'.$product_software.'</label>
|
|
||||||
<input id="name" type="text" name="softwareversion" placeholder="'.$product_software.'" value="'.$product['softwareversion'].'">
|
$view .='
|
||||||
<label for="price"><i class="required">*</i> '.$product_price.' </label>
|
|
||||||
<input id="price" type="number" name="price" placeholder="'.$product_price.'" min="0" step=".01" value="'.$product['price'].'" required>
|
|
||||||
<input type="hidden" name="rowID" value="'.$product['rowID'].'">
|
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
|
||||||
|
|
||||||
|
|
||||||
$view .= '<div class="content-block tab-content">
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="serialized">'.$product_serialized.'</label>
|
|
||||||
<select id="status" name="sn">
|
|
||||||
<option value="1" '.($product['sn']==1?' selected':'').'>'.$enabled.'</option>
|
|
||||||
<option value="0" '.($product['sn']==0?' selected':'').'>'.$disabled.'</option>
|
|
||||||
</select>
|
|
||||||
<label for="build">'.$product_build.'</label>
|
|
||||||
<select id="status" name="build">
|
|
||||||
<option value="1" '.($product['build']==1?' selected':'').'>'.$enabled.'</option>
|
|
||||||
<option value="0" '.($product['build']==0?' selected':'').'>'.$disabled.'</option>
|
|
||||||
</select>
|
|
||||||
<label for="sales">'.$product_sales.'</label>
|
|
||||||
<select id="status" name="salesflag">
|
|
||||||
<option value="1" '.($product['salesflag']==1?' selected':'').'>'.$enabled.'</option>
|
|
||||||
<option value="0" '.($product['salesflag']==0?' selected':'').'>'.$disabled.'</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
$view .= '<div class="content-block tab-content">
|
|
||||||
<div class="form responsive-width-100">
|
|
||||||
<label for="productcode">'.$general_created.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$product['created'].'" readonly>
|
|
||||||
<label for="productcode">'.$general_createdby.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$product['createdby'].'" readonly>
|
|
||||||
<label for="productcode">'.$general_updated.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_updated.'" value="'.$product['updated'].'" readonly>
|
|
||||||
<label for="productcode">'.$general_updatedby.'</label>
|
|
||||||
<input id="name" type="text" name="" placeholder="'.$general_updatedby.'" value="'.$product['updatedby'].'" readonly>
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
$view .= '</form>';
|
|
||||||
|
|
||||||
$view .= '<form action="" method="post" style="padding: 20px;" enctype="multipart/form-data">
|
|
||||||
<input type="hidden" value="'.$product['rowID'].'" name="file_upload" />
|
|
||||||
<input type="hidden" name="productcode" value="'.$product["productcode"].'"/>
|
|
||||||
<input type="file" name="fileToUpload" id="fileToUpload" onchange="this.form.submit()" accept=".jpg, .jpeg, .png">
|
|
||||||
</form>
|
|
||||||
';
|
';
|
||||||
|
|
||||||
//Output
|
$view .='<div class="content-block order-details">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-user fa-sm"></i>
|
||||||
|
</div>';
|
||||||
|
$picture = glob("./assets/images/products/".$responses->productcode.".{jpg,jpeg,png,gif}", GLOB_BRACE);
|
||||||
|
if (!empty($picture)){
|
||||||
|
$view .='
|
||||||
|
<div class="order-detail">
|
||||||
|
<img style="border-radius: 4px;height: 200px;margin: auto;" src="'.$picture[0].'" alt="">
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
$view .='
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$view .= '</div>';
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.$product_description.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
'.$responses->productdescription.'
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.($product_version ?? '').'
|
||||||
|
<a href="index.php?page=products_versions&productrowid='.$_GET['rowID'].'" class="btn2"> + </a>
|
||||||
|
</div>';
|
||||||
|
if (!empty($product_versions)){
|
||||||
|
$view .= '
|
||||||
|
<div class="table">
|
||||||
|
<table class="sortable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>'.$product_version_number.'</th>
|
||||||
|
<th>'.$product_version_version.'</th>
|
||||||
|
<th>'.$product_version_software .'</th>
|
||||||
|
<th>'.$general_actions.'</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>';
|
||||||
|
foreach ($product_versions as $version){
|
||||||
|
$view .= '<tr>
|
||||||
|
<td>'.$version->rowID.'</td>
|
||||||
|
<td>'.$version->version.'</td>
|
||||||
|
<td>'.$version->software.'</td>
|
||||||
|
<td><a href="index.php?page=products_versions&productrowid='.$_GET['rowID'].'&rowID='.$version->rowID.'" class="btn_link">'.$general_view.'</a></td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
|
$view .= '
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .= '
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.$tab4.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$product_serialized.'</td>
|
||||||
|
<td>'.(($responses->sn == 1)? $enabled : $disabled).'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$product_sales.'</td>
|
||||||
|
<td>'.(($responses->salesflag == 1)? $enabled : $disabled).'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$product_build.'</td>
|
||||||
|
<td>'.(($responses->build == 1)? $enabled : $disabled).'</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block">
|
||||||
|
<div class="block-header">
|
||||||
|
<i class="fa-solid fa-bars fa-sm"></i>'.$tab3.'
|
||||||
|
</div>
|
||||||
|
<div class="table order-table">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_created.'</td>
|
||||||
|
<td>'.$responses->created.'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_createdby.'</td>
|
||||||
|
<td>'.$responses->createdby.'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_updated.'</td>
|
||||||
|
<td>'.$responses->updated.'</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="width:25%;">'.$general_updatedby.'</td>
|
||||||
|
<td>'.$responses->updatedby.'</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .='</div>';
|
||||||
|
|
||||||
|
//OUTPUT
|
||||||
echo $view;
|
echo $view;
|
||||||
template_footer()?>
|
|
||||||
|
template_footer()
|
||||||
|
|
||||||
|
?>
|
||||||
214
product_manage.php
Normal file
214
product_manage.php
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
<?php
|
||||||
|
defined(page_security_key) or exit;
|
||||||
|
|
||||||
|
$page = 'product_manage';
|
||||||
|
//Check if allowed
|
||||||
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
|
header('location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//PAGE Security
|
||||||
|
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
|
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||||
|
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||||
|
|
||||||
|
//
|
||||||
|
if ($_GET['id'] !=''){
|
||||||
|
$url = 'index.php?page=product&rowID='.$_GET['id'];
|
||||||
|
} else {
|
||||||
|
$url = 'index.php?page=products';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default input product values
|
||||||
|
$product = [
|
||||||
|
'rowID' => '',
|
||||||
|
'productcode' => '',
|
||||||
|
'productname' => '',
|
||||||
|
'productdescription' => '',
|
||||||
|
'softwareversion' => 'v1.0',
|
||||||
|
'created' => '',
|
||||||
|
'createdby' => $_SESSION['username'],
|
||||||
|
'parttype' => 1,
|
||||||
|
'price' => '0',
|
||||||
|
'salesflag' => 0,
|
||||||
|
'updated' => '',
|
||||||
|
'updatedby' => $_SESSION['username'],
|
||||||
|
'product_category' => '',
|
||||||
|
'status' => 1,
|
||||||
|
'build' => 1,
|
||||||
|
'partnerhierarchy' => '',
|
||||||
|
'sn' =>''
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($_GET['id'])) {
|
||||||
|
// ID param exists, edit an existing product
|
||||||
|
//CALL TO API
|
||||||
|
$api_url = '/v1/products/rowID='.$_GET['id'];
|
||||||
|
$responses = ioServer($api_url,'');
|
||||||
|
//Decode Payload
|
||||||
|
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||||
|
|
||||||
|
$product = json_decode(json_encode($responses[0]), true);
|
||||||
|
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
if (isset($_POST['file_upload'])){
|
||||||
|
uploadProduct($_POST['productcode']);
|
||||||
|
}
|
||||||
|
if (isset($_POST['submit'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
header('Location: index.php?page=product&rowID='.$_GET['id'].'&success_msg=2');
|
||||||
|
exit;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
if (isset($_POST['delete'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Redirect and delete product
|
||||||
|
header('Location: index.php?page=products&success_msg=3');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Create a new product
|
||||||
|
if (isset($_POST['submit']) && $create_allowed === 1) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST , JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
header('Location: index.php?page=products&success_msg=1');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template_header('Product', 'product', 'manage');
|
||||||
|
|
||||||
|
$view ='
|
||||||
|
<form action="" method="post">
|
||||||
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
|
<h2 class="responsive-width-100">'.$product_h2.'</h2>
|
||||||
|
<a href="'.$url.'" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
||||||
|
';
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="delete" value="Delete" class="btn red mar-right-2" onclick="return confirm(\'Are you sure you want to delete this product?\')">';
|
||||||
|
}
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .= '</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="tabs">
|
||||||
|
<a href="#" class="active">'.$tab1.'</a>
|
||||||
|
<a href="#">'.$tab4.'</a>
|
||||||
|
<a href="#">'.$tab3.'</a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content active">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="status">'.$product_status.'</label>
|
||||||
|
<select id="status" name="status">
|
||||||
|
<option value="1" '.($product['status']==1?' selected':'').'>'.$prod_status_1 .'</option>
|
||||||
|
<option value="0" '.($product['status']==0?' selected':'').'>'.$prod_status_0 .'</option>
|
||||||
|
</select>
|
||||||
|
<label for="parttype">'.$product_parttype.'</label>
|
||||||
|
<select id="status" name="parttype">
|
||||||
|
<option value="1" '.($product['parttype']==1?' selected':'').'>'.$part_type1.'</option>
|
||||||
|
<option value="2" '.($product['parttype']==2?' selected':'').'>'.$part_type2.'</option>
|
||||||
|
<option value="3" '.($product['parttype']==3?' selected':'').'>'.$part_type3.'</option>
|
||||||
|
</select>
|
||||||
|
<label for="parttype">'.$product_category.'</label>
|
||||||
|
<select id="status" name="product_category">
|
||||||
|
<option value="0" '.($product['product_category']==0?' selected':'').'>'.$product_category0.'</option>
|
||||||
|
<option value="1" '.($product['product_category']==1?' selected':'').'>'.$product_category1.'</option>
|
||||||
|
<option value="2" '.($product['product_category']==2?' selected':'').'>'.$product_category2.'</option>
|
||||||
|
<option value="3" '.($product['product_category']==3?' selected':'').'>'.$product_category3.'</option>
|
||||||
|
</select>
|
||||||
|
<label for="productcode"><i class="required">*</i>'.$product_code.'</label>
|
||||||
|
<input id="name" type="text" name="productcode" placeholder="'.$product_code.'" value="'.$product['productcode'].'" required>
|
||||||
|
<label for="productname"><i class="required">*</i>'.$product_name.'</label>
|
||||||
|
<input id="name" type="text" name="productname" placeholder="'.$product_name.'" value="'.$product['productname'].'" required>
|
||||||
|
<label for="productdescription">'.$product_description.'</label>
|
||||||
|
<textarea id="description" name="productdescription" placeholder="'.$product_description.'">'.$product['productdescription'].'</textarea>
|
||||||
|
<label for="softwareversion">'.$product_software.'</label>
|
||||||
|
<input id="name" type="text" name="softwareversion" placeholder="'.$product_software.'" value="'.$product['softwareversion'].'">
|
||||||
|
<label for="price"><i class="required">*</i> '.$product_price.' </label>
|
||||||
|
<input id="price" type="number" name="price" placeholder="'.$product_price.'" min="0" step=".01" value="'.$product['price'].'" required>
|
||||||
|
<input type="hidden" name="rowID" value="'.$product['rowID'].'">
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="serialized">'.$product_serialized.'</label>
|
||||||
|
<select id="status" name="sn">
|
||||||
|
<option value="1" '.($product['sn']==1?' selected':'').'>'.$enabled.'</option>
|
||||||
|
<option value="0" '.($product['sn']==0?' selected':'').'>'.$disabled.'</option>
|
||||||
|
</select>
|
||||||
|
<label for="build">'.$product_build.'</label>
|
||||||
|
<select id="status" name="build">
|
||||||
|
<option value="1" '.($product['build']==1?' selected':'').'>'.$enabled.'</option>
|
||||||
|
<option value="0" '.($product['build']==0?' selected':'').'>'.$disabled.'</option>
|
||||||
|
</select>
|
||||||
|
<label for="sales">'.$product_sales.'</label>
|
||||||
|
<select id="status" name="salesflag">
|
||||||
|
<option value="1" '.($product['salesflag']==1?' selected':'').'>'.$enabled.'</option>
|
||||||
|
<option value="0" '.($product['salesflag']==0?' selected':'').'>'.$disabled.'</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="productcode">'.$general_created.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$product['created'].'" readonly>
|
||||||
|
<label for="productcode">'.$general_createdby.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$product['createdby'].'" readonly>
|
||||||
|
<label for="productcode">'.$general_updated.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_updated.'" value="'.$product['updated'].'" readonly>
|
||||||
|
<label for="productcode">'.$general_updatedby.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_updatedby.'" value="'.$product['updatedby'].'" readonly>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
$view .= '</form>';
|
||||||
|
|
||||||
|
$view .= '<form action="" method="post" style="padding: 20px;" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" value="'.$product['rowID'].'" name="file_upload" />
|
||||||
|
<input type="hidden" name="productcode" value="'.$product["productcode"].'"/>
|
||||||
|
<input type="file" name="fileToUpload" id="fileToUpload" onchange="this.form.submit()" accept=".jpg, .jpeg, .png">
|
||||||
|
</form>
|
||||||
|
';
|
||||||
|
|
||||||
|
//Output
|
||||||
|
echo $view;
|
||||||
|
template_footer()?>
|
||||||
10
products.php
10
products.php
@@ -8,8 +8,12 @@ defined(page_security_key) or exit;
|
|||||||
include_once './assets/functions.php';
|
include_once './assets/functions.php';
|
||||||
include_once './settings/settings.php';
|
include_once './settings/settings.php';
|
||||||
|
|
||||||
|
//SET ORIGIN FOR NAVIGATION
|
||||||
|
$prev_page = $_SESSION['prev_origin'] ?? '';
|
||||||
|
$page = $_SESSION['origin'] = 'products';
|
||||||
|
|
||||||
//Check if allowed
|
//Check if allowed
|
||||||
if (isAllowed('products',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
header('location: index.php');
|
header('location: index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@@ -69,7 +73,7 @@ $view .= ' <div class="msg success">
|
|||||||
}
|
}
|
||||||
$view .= '
|
$view .= '
|
||||||
<div class="content-header responsive-flex-column pad-top-5">
|
<div class="content-header responsive-flex-column pad-top-5">
|
||||||
<a href="index.php?page=product" class="btn">'.$button_create_product.'</a>
|
<a href="index.php?page=product_manage" class="btn">'.$button_create_product.'</a>
|
||||||
<form action="" method="get">
|
<form action="" method="get">
|
||||||
<input type="hidden" name="page" value="products">
|
<input type="hidden" name="page" value="products">
|
||||||
<div class="filters">
|
<div class="filters">
|
||||||
@@ -130,7 +134,7 @@ $view .= '
|
|||||||
'.(($picture)?'<img style="border-radius: 4px;height: 50px;" src="'.$picture[0].'" alt="">' : '').'
|
'.(($picture)?'<img style="border-radius: 4px;height: 50px;" src="'.$picture[0].'" alt="">' : '').'
|
||||||
</td>
|
</td>
|
||||||
<td>'.$response->productname.'</td>
|
<td>'.$response->productname.'</td>
|
||||||
<td><a href="index.php?page=product&id='.$response->rowID.'" class="btn_link">'.$general_view .'</a></td>
|
<td><a href="index.php?page=product&rowID='.$response->rowID.'" class="btn_link">'.$general_view .'</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|||||||
160
products_versions.php
Normal file
160
products_versions.php
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<?php
|
||||||
|
defined(page_security_key) or exit;
|
||||||
|
|
||||||
|
$page = 'products_versions';
|
||||||
|
//Check if allowed
|
||||||
|
if (isAllowed($page,$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
||||||
|
header('location: index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//PAGE Security
|
||||||
|
$update_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'U');
|
||||||
|
$delete_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'D');
|
||||||
|
$create_allowed = isAllowed($page ,$_SESSION['profile'],$_SESSION['permission'],'C');
|
||||||
|
|
||||||
|
// Default input product values
|
||||||
|
$products_versions = [
|
||||||
|
'rowID' => '',
|
||||||
|
'productrowid' => '',
|
||||||
|
'status' => '',
|
||||||
|
'version' => '',
|
||||||
|
'software' => '',
|
||||||
|
'created' => '',
|
||||||
|
'createdby' => $_SESSION['username'],
|
||||||
|
'measurement' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
//productrowid is required by api
|
||||||
|
$productrowid = $_GET['productrowid'] ?? '';
|
||||||
|
|
||||||
|
if (isset($_GET['rowID'])) {
|
||||||
|
// ID param exists, edit an existing product
|
||||||
|
//CALL TO API
|
||||||
|
$api_url = '/v1/products_versions/rowID='.$_GET['rowID'].'&productrowid='.$productrowid;
|
||||||
|
$responses = ioServer($api_url,'');
|
||||||
|
|
||||||
|
//Decode Payload
|
||||||
|
if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;}
|
||||||
|
|
||||||
|
$products_versions = json_decode(json_encode($responses[0]), true);
|
||||||
|
|
||||||
|
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
if (isset($_POST['submit'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products_versions', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
header('Location: index.php?page=product&rowID='.$productrowid.'&success_msg=2');
|
||||||
|
exit;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
if (isset($_POST['delete'])) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST, JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products_versions', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Redirect and delete product
|
||||||
|
header('Location: index.php?page=product&rowID='.$productrowid.'&success_msg=3');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Create a new product
|
||||||
|
if (isset($_POST['submit']) && $create_allowed === 1) {
|
||||||
|
//GET ALL POST DATA
|
||||||
|
$data = json_encode($_POST , JSON_UNESCAPED_UNICODE);
|
||||||
|
//Secure data
|
||||||
|
$payload = generate_payload($data);
|
||||||
|
//API call
|
||||||
|
$responses = ioServer('/v1/products_versions', $payload);
|
||||||
|
if ($responses === 'NOK'){
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
header('Location: index.php?page=product&rowID='.$productrowid.'&success_msg=1');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template_header('Products versions', 'products_versions', 'manage');
|
||||||
|
|
||||||
|
$view ='
|
||||||
|
<form action="" method="post">
|
||||||
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
|
<h2 class="responsive-width-100">'.$product_version_version.'</h2>
|
||||||
|
<a href="index.php?page=product&rowID='.$productrowid.'" class="btn alt mar-right-2">'.$button_cancel.'</a>
|
||||||
|
';
|
||||||
|
|
||||||
|
if ($delete_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="delete" value="Delete" class="btn red mar-right-2" onclick="return confirm(\'Are you sure you want to delete this product?\')">';
|
||||||
|
}
|
||||||
|
if ($update_allowed === 1){
|
||||||
|
$view .= '<input type="submit" name="submit" value="Save" class="btn">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view .= '</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="tabs">
|
||||||
|
<a href="#" class="active">'.$tab1.'</a>
|
||||||
|
<a href="#">'.$tab3.'</a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content active">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="status">'.$product_status.'</label>
|
||||||
|
<select id="status" name="status">
|
||||||
|
<option value="1" '.($products_versions['status']==1?' selected':'').'>'.$prod_status_1 .'</option>
|
||||||
|
<option value="0" '.($products_versions['status']==0?' selected':'').'>'.$prod_status_0 .'</option>
|
||||||
|
</select>
|
||||||
|
<label for=""><i class="required">*</i>'.$product_version_version.'</label>
|
||||||
|
<input id="name" type="text" name="version" placeholder="'.$product_version_version.'" value="'.$products_versions['version'].'" required>
|
||||||
|
|
||||||
|
<label for=""><i class="required">*</i>'.$product_version_software.'</label>
|
||||||
|
<input id="name" type="text" name="software" placeholder="'.$product_version_software.'" value="'.$products_versions['software'].'" required>
|
||||||
|
';
|
||||||
|
|
||||||
|
if (isset($_GET['rowID']) && $_GET['rowID'] !=''){
|
||||||
|
$view .= '
|
||||||
|
<label for="">'.$product_version_measurement.'</label>
|
||||||
|
<textarea><pre>'.$products_versions['measurement'].'</pre></textarea>
|
||||||
|
';
|
||||||
|
}
|
||||||
|
$view .= '
|
||||||
|
<input type="hidden" name="rowID" value="'.$products_versions['rowID'].'">
|
||||||
|
<input type="hidden" name="productrowid" value="'.$productrowid.'">
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
$view .= '<div class="content-block tab-content">
|
||||||
|
<div class="form responsive-width-100">
|
||||||
|
<label for="productcode">'.$general_created.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_created.'" value="'.$products_versions['created'].'" readonly>
|
||||||
|
<label for="productcode">'.$general_createdby.'</label>
|
||||||
|
<input id="name" type="text" name="" placeholder="'.$general_createdby.'" value="'.$products_versions['createdby'].'" readonly>
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
$view .= '</form>';
|
||||||
|
|
||||||
|
//Output
|
||||||
|
echo $view;
|
||||||
|
template_footer()
|
||||||
|
?>
|
||||||
@@ -34,9 +34,9 @@ if (!empty($query_total_sfg)){$query_total_sfg = decode_payload($query_total_sfg
|
|||||||
|
|
||||||
//Return FINISH GOODS from API
|
//Return FINISH GOODS from API
|
||||||
$api_url = '/v1/equipments/productrowid=0&status=2&totals=';
|
$api_url = '/v1/equipments/productrowid=0&status=2&totals=';
|
||||||
$query_total_sfg = ioServer($api_url,'');
|
$query_total_fg = ioServer($api_url,'');
|
||||||
//Decode Payload
|
//Decode Payload
|
||||||
if (!empty($query_total_sfg)){$query_total_sfg = decode_payload($query_total_sfg);}else{$query_total_sfg = null;}
|
if (!empty($query_total_fg)){$query_total_fg = decode_payload($query_total_fg);}else{$query_total_fg = null;}
|
||||||
|
|
||||||
//Return warranty from API
|
//Return warranty from API
|
||||||
$api_url = '/v1/equipments/status=2&totals=';
|
$api_url = '/v1/equipments/status=2&totals=';
|
||||||
@@ -46,7 +46,7 @@ if (!empty($query_total_onstock)){$query_total_onstock = decode_payload($query_t
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$startdate = date("Y-m-d", strtotime("-900 days"));
|
$startdate = date("Y-m-d", strtotime("-7 days"));
|
||||||
$enddate = date("Y-m-d");
|
$enddate = date("Y-m-d");
|
||||||
|
|
||||||
//Return SFG from API - total
|
//Return SFG from API - total
|
||||||
@@ -56,13 +56,13 @@ $query_SFG_total = ioServer($api_url,'');
|
|||||||
if (!empty($query_SFG_total)){$query_SFG_total = decode_payload($query_SFG_total);}else{$query_SFG_total = null;}
|
if (!empty($query_SFG_total)){$query_SFG_total = decode_payload($query_SFG_total);}else{$query_SFG_total = null;}
|
||||||
|
|
||||||
//Return SFG from API - details
|
//Return SFG from API - details
|
||||||
$api_url = '/v1/changelog/object_field=status&object_value=2&reporttype=2&between='.$startdate.'||'.$enddate;
|
$api_url = '/v1/changelog/object_field=status&object_value=1&reporttype=2&between='.$startdate.'||'.$enddate;
|
||||||
$query_SFG_details = ioServer($api_url,'');
|
$query_SFG_details = ioServer($api_url,'');
|
||||||
//Decode Payload
|
//Decode Payload
|
||||||
if (!empty($query_SFG_details)){$query_SFG_details = decode_payload($query_SFG_details);}else{$query_SFG_details = null;}
|
if (!empty($query_SFG_details)){$query_SFG_details = decode_payload($query_SFG_details);}else{$query_SFG_details = null;}
|
||||||
|
|
||||||
//Return FG from API - totals
|
//Return FG from API - totals
|
||||||
$api_url = '/v1/changelog/object_field=status&object_value=1&reporttype=1&between='.$startdate.'||'.$enddate;
|
$api_url = '/v1/changelog/object_field=status&object_value=2&reporttype=1&between='.$startdate.'||'.$enddate;
|
||||||
$query_FG_total = ioServer($api_url,'');
|
$query_FG_total = ioServer($api_url,'');
|
||||||
//Decode Payload
|
//Decode Payload
|
||||||
if (!empty($query_FG_total)){$query_FG_total = decode_payload($query_FG_total);}else{$query_FG_total = null;}
|
if (!empty($query_FG_total)){$query_FG_total = decode_payload($query_FG_total);}else{$query_FG_total = null;}
|
||||||
@@ -111,7 +111,7 @@ $view .= '
|
|||||||
<div class="content-block stat">
|
<div class="content-block stat">
|
||||||
<div class="data" onclick="location.href=\'index.php?page=equipments&productrowid=0&status=2\'">
|
<div class="data" onclick="location.href=\'index.php?page=equipments&productrowid=0&status=2\'">
|
||||||
<h3>'.$product_location_FG.'</h3>
|
<h3>'.$product_location_FG.'</h3>
|
||||||
<p>'.$query_total_sfg.'</p>
|
<p>'.$query_total_fg.'</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="fas fa-clipboard-check"></i>
|
<i class="fas fa-clipboard-check"></i>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|||||||
@@ -107,6 +107,11 @@ if (isset($_POST['geoupdate'])){
|
|||||||
geolocationUpdate($_SESSION['userkey']);
|
geolocationUpdate($_SESSION['userkey']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['updatecartest'])){
|
||||||
|
//GEOLOCATION UPDATE
|
||||||
|
convertCartest();
|
||||||
|
}
|
||||||
|
|
||||||
// Handle success messages
|
// Handle success messages
|
||||||
if (isset($_GET['success_msg'])) {
|
if (isset($_GET['success_msg'])) {
|
||||||
if ($_GET['success_msg'] == 1) {
|
if ($_GET['success_msg'] == 1) {
|
||||||
@@ -123,6 +128,7 @@ $view .= '
|
|||||||
|
|
||||||
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
||||||
<h2 class="responsive-width-100">Settings</h2>
|
<h2 class="responsive-width-100">Settings</h2>
|
||||||
|
<input type="submit" name="updatecartest" value="CarTestUpdate" class="btn">
|
||||||
<input type="submit" name="geoupdate" value="GeoUpdate" class="btn">
|
<input type="submit" name="geoupdate" value="GeoUpdate" class="btn">
|
||||||
<input type="submit" name="submit" value="Save" class="btn">
|
<input type="submit" name="submit" value="Save" class="btn">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
//MENÜEINTRÄGE:
|
//MENU ITEMS:
|
||||||
$menu_dashboard = 'Dashboard';
|
$menu_dashboard = 'Dashboard';
|
||||||
$menu_assets = 'Assets';
|
$menu_assets = 'Vermögenswerte';
|
||||||
$menu_service_reports = 'Serviceberichte';
|
$menu_service_reports = 'Serviceberichte';
|
||||||
$menu_history = 'Verlauf';
|
$menu_history = 'Verlauf';
|
||||||
$menu_firmwaretool = 'Firmwaretool';
|
$menu_firmwaretool = 'Firmware-Tool';
|
||||||
$menu_equipments_mass_update = 'Massenaktualisierungen';
|
$menu_equipments_mass_update = 'Massenupdates';
|
||||||
$menu_products = 'Produkte';
|
$menu_products = 'Produkte';
|
||||||
$menu_sales = 'Verkäufe';
|
$menu_sales = 'Verkäufe';
|
||||||
$menu_sales_accounts = "Konten";
|
$menu_sales_accounts = "Konten";
|
||||||
$menu_sales_contracts = 'Verträge';
|
$menu_sales_contracts = 'Verträge';
|
||||||
$menu_admin = 'Administrator';
|
$menu_admin = 'Admin';
|
||||||
$menu_admin_users = "Benutzer";
|
$menu_admin_users = "Benutzer";
|
||||||
$menu_admin_communications = 'Kommunikation';
|
$menu_admin_communications = 'Kommunikation';
|
||||||
$menu_admin_partners = 'Partner';
|
$menu_admin_partners = 'Partner';
|
||||||
@@ -19,11 +19,11 @@ $menu_config = 'Konfiguration';
|
|||||||
$menu_language = 'Sprache';
|
$menu_language = 'Sprache';
|
||||||
$menu_log = 'Protokoll';
|
$menu_log = 'Protokoll';
|
||||||
$menu_marketing = 'Marketing';
|
$menu_marketing = 'Marketing';
|
||||||
$menu_build = 'Erstellen';
|
$menu_build = 'Bau';
|
||||||
$menu_cartest = 'Fahrzeugdatenbank';
|
$menu_cartest = 'Fahrzeugdatenbank';
|
||||||
$menu_report_main = 'Reports';
|
$menu_report_main = 'Berichte';
|
||||||
$menu_report_build = 'Stock and Production';
|
$menu_report_build = 'Bestand und Produktion';
|
||||||
$menu_report_usage = 'System usage';
|
$menu_report_usage = 'Systemnutzung';
|
||||||
|
|
||||||
//TABS
|
//TABS
|
||||||
$tab1 = 'Allgemein';
|
$tab1 = 'Allgemein';
|
||||||
@@ -52,42 +52,42 @@ $general_page_of = ' von ';
|
|||||||
|
|
||||||
$general_sort_type_1 = 'Niedrig - Hoch';
|
$general_sort_type_1 = 'Niedrig - Hoch';
|
||||||
$general_sort_type_2 = 'Hoch - Niedrig';
|
$general_sort_type_2 = 'Hoch - Niedrig';
|
||||||
$general_sort_type_3 = 'Neuest';
|
$general_sort_type_3 = 'Neueste';
|
||||||
$general_sort_type_4 = 'Altest';
|
$general_sort_type_4 = 'Älteste';
|
||||||
|
|
||||||
$general_prev = '«';
|
$general_prev = '«';
|
||||||
$general_next = '»';
|
$general_next = '»';
|
||||||
$general_last = '↦'; // Letzte->
|
$general_last = '↦'; // Letzte
|
||||||
$general_first = '↤'; // <-Erste;
|
$general_first = '↤'; // Erste
|
||||||
|
|
||||||
$general_view = 'Anzeigen';
|
$general_view = 'Ansicht';
|
||||||
$general_actions = 'Aktionen';
|
$general_actions = 'Aktionen';
|
||||||
$general_actions_more = 'Mehr anzeigen';
|
$general_actions_more = 'Mehr anzeigen';
|
||||||
|
|
||||||
$general_profile = 'Profil';
|
$general_profile = 'Profil';
|
||||||
$general_logout = 'Abmelden';
|
$general_logout = 'Abmelden';
|
||||||
|
|
||||||
$button_apply = 'Übernehmen';
|
$button_apply = 'Anwenden';
|
||||||
$button_cancel = 'Abbrechen';
|
$button_cancel = 'Abbrechen';
|
||||||
$button_back = 'Zurück';
|
$button_back = 'Zurück';
|
||||||
$button_history = 'Verlauf';
|
$button_history = 'Verlauf';
|
||||||
$button_firmware = 'Firmware aktualisieren';
|
$button_firmware = 'Firmware aktualisieren';
|
||||||
$button_create_asset = 'Asset erstellen';
|
$button_create_asset = 'Vermögenswert erstellen';
|
||||||
$button_create_product = 'Produkt erstellen';
|
$button_create_product = 'Produkt erstellen';
|
||||||
$button_create_user = 'Benutzer erstellen';
|
$button_create_user = 'Benutzer erstellen';
|
||||||
$button_create_partner = 'Partner erstellen';
|
$button_create_partner = 'Partner erstellen';
|
||||||
$button_view = 'Anzeigen';
|
$button_view = 'Ansicht';
|
||||||
$button_create_communication = 'Kommunikation erstellen';
|
$button_create_communication = 'Kommunikation erstellen';
|
||||||
$button_create_account = 'Konto erstellen';
|
$button_create_account = 'Konto erstellen';
|
||||||
$button_partner_assigned_equipment = 'Zugehörige Assets';
|
$button_partner_assigned_equipment = 'Zuordnungen von Vermögenswerten';
|
||||||
$button_partner_assigned_contracts = 'Zugehörige Verträge';
|
$button_partner_assigned_contracts = 'Zuordnungen von Verträgen';
|
||||||
$button_partner_assigned_communication = 'Zugehörige Kommunikation';
|
$button_partner_assigned_communication = 'Zuordnungen von Kommunikation';
|
||||||
$button_partner_assigned_users = 'Zugehörige Benutzer';
|
$button_partner_assigned_users = 'Zuordnungen von Benutzern';
|
||||||
$button_create_contract = 'Vertrag erstellen';
|
$button_create_contract = 'Vertrag erstellen';
|
||||||
$button_create_communication_send = 'Firmware-Kommunikation';
|
$button_create_communication_send = 'Firmware-Kommunikation';
|
||||||
$button_create_cartest = 'Cartest erstellen';
|
$button_create_cartest = 'Fahrzeugdatenbank erstellen';
|
||||||
|
|
||||||
//Konto / Benutzer
|
//Account / Users
|
||||||
$account_h2 = 'Konto';
|
$account_h2 = 'Konto';
|
||||||
$account_status = 'Status';
|
$account_status = 'Status';
|
||||||
$account_username = 'Benutzername';
|
$account_username = 'Benutzername';
|
||||||
@@ -95,7 +95,7 @@ $account_permission = 'Berechtigung';
|
|||||||
$account_profile = 'Profil';
|
$account_profile = 'Profil';
|
||||||
$account_service = 'Dienst';
|
$account_service = 'Dienst';
|
||||||
$account_pw_reset = 'Passwort zurücksetzen';
|
$account_pw_reset = 'Passwort zurücksetzen';
|
||||||
$account_lastlogin = 'letzte Anmeldung';
|
$account_lastlogin = 'Letzte Anmeldung';
|
||||||
$account_language = 'Sprache';
|
$account_language = 'Sprache';
|
||||||
|
|
||||||
//Dashboard
|
//Dashboard
|
||||||
@@ -103,20 +103,21 @@ $dashboard_h2 = 'Dashboard';
|
|||||||
$dashboard_p = 'Statistiken';
|
$dashboard_p = 'Statistiken';
|
||||||
$dashboard_news = 'Neuigkeiten';
|
$dashboard_news = 'Neuigkeiten';
|
||||||
$data_assets_h3 = 'Vermögenswerte';
|
$data_assets_h3 = 'Vermögenswerte';
|
||||||
$data_assets_text = 'Gesamtzahl der verfügbaren Vermögenswerte';
|
$data_assets_text = 'Gesamtanzahl der verfügbaren Vermögenswerte';
|
||||||
$data_service_h3 = 'Service fällig';
|
$data_service_h3 = 'Service fällig';
|
||||||
$data_service_text = 'Vermögenswerte mit Service';
|
$data_service_text = 'Vermögenswerte mit Servicebedarf';
|
||||||
$data_warranty_h3 = 'Garantie';
|
$data_warranty_h3 = 'Garantie';
|
||||||
$data_warranty_text = 'Geräte mit Garantie';
|
$data_warranty_text = 'Vermögenswerte unter Garantie';
|
||||||
$data_software_h3 = 'Firmware';
|
$data_software_h3 = 'Firmware';
|
||||||
$data_software_text = 'Geräte, für die ein Firmware-Upgrade erforderlich ist';
|
$data_software_text = 'Vermögenswerte, die ein Firmware-Update benötigen';
|
||||||
$data_service_text_forecast = 'Geräte, deren Wartung innerhalb des angegebenen Zeitraums fällig ist';
|
$data_service_text_forecast = 'Vermögenswerte mit Servicebedarf innerhalb des angegebenen Zeitraums';
|
||||||
$data_warranty_text_forecast = 'Geräte mit Garantieabdeckung bis zum angegebenen Zeitraum';
|
$data_warranty_text_forecast = 'Vermögenswerte mit Garantieabdeckung bis zum angegebenen Zeitraum';
|
||||||
//Zurücksetzen
|
|
||||||
|
//Reset
|
||||||
$button1 = 'Anmelden';
|
$button1 = 'Anmelden';
|
||||||
$button2 = 'Zurücksetzen anfordern';
|
$button2 = 'Zurücksetzen anfordern';
|
||||||
|
|
||||||
//Geräte
|
//Equipments
|
||||||
$equipment_label1 = 'Indikatoren';
|
$equipment_label1 = 'Indikatoren';
|
||||||
$equipment_label2 = 'Seriennummer';
|
$equipment_label2 = 'Seriennummer';
|
||||||
$equipment_label3 = 'Status';
|
$equipment_label3 = 'Status';
|
||||||
@@ -124,22 +125,22 @@ $equipment_label4 = 'Produkt';
|
|||||||
$equipment_label5 = 'Hardware';
|
$equipment_label5 = 'Hardware';
|
||||||
$equipment_label6 = 'Software';
|
$equipment_label6 = 'Software';
|
||||||
$equipment_label7 = 'Garantiebeginn';
|
$equipment_label7 = 'Garantiebeginn';
|
||||||
$equipment_label8 = 'Wartungsdatum';
|
$equipment_label8 = 'Servicedatum';
|
||||||
$equipment_label9 = 'Serviceerneuerung';
|
$equipment_label9 = 'Serviceverlängerung';
|
||||||
$equipment_label10 = 'Asset-ID';
|
$equipment_label10 = 'Vermögens-ID';
|
||||||
$equipment_label11 = 'Bestellreferenz';
|
$equipment_label11 = 'Bestellreferenz';
|
||||||
$equipment_label12 = 'Geolokalisierung (Breiten- und Längengrad)';
|
$equipment_label12 = 'Geolokalisierung (Breite und Länge)';
|
||||||
|
|
||||||
$equiment_search = 'Seriennummer suchen...';
|
$equiment_search = 'Seriennummer suchen...';
|
||||||
|
|
||||||
$assets_h2 = "Assets";
|
$assets_h2 = "Vermögenswerte";
|
||||||
$assets_p = 'Assets anzeigen, verwalten und suchen.';
|
$assets_p = 'Vermögenswerte anzeigen, verwalten und suchen.';
|
||||||
$view_asset_h2 = 'Asset';
|
$view_asset_h2 = 'Vermögenswert';
|
||||||
$view_asset_information = 'Asset - Informationen';
|
$view_asset_information = 'Vermögenswert - Informationen';
|
||||||
$view_asset_partners = 'Asset - Partner';
|
$view_asset_partners = 'Vermögenswert - Partner';
|
||||||
$view_asset_details = 'Details';
|
$view_asset_details = 'Details';
|
||||||
$view_asset_servicereport = 'Serviceberichte';
|
$view_asset_servicereport = 'Serviceberichte';
|
||||||
$view_asset_notes = 'Zusätzliche Hinweise';
|
$view_asset_notes = 'Zusätzliche Notizen';
|
||||||
$view_asset_actions = 'Aktionen';
|
$view_asset_actions = 'Aktionen';
|
||||||
|
|
||||||
$not_specified = 'Nicht angegeben';
|
$not_specified = 'Nicht angegeben';
|
||||||
@@ -148,80 +149,80 @@ $warranty_status = 'Garantiestatus';
|
|||||||
$service_status = 'Servicestatus';
|
$service_status = 'Servicestatus';
|
||||||
$software_status = 'Softwarestatus';
|
$software_status = 'Softwarestatus';
|
||||||
|
|
||||||
$service_report_item = 'Serviceartikel';
|
$service_report_item = 'Servicepunkt';
|
||||||
$service_report_no_comments = 'Keine Kommentare';
|
$service_report_no_comments = 'Keine Kommentare';
|
||||||
$service_report_maintenance_test = 'Wartungstest';
|
$service_report_maintenance_test = 'Wartungstest';
|
||||||
$service_report_maintenance_test_status = 'Status';
|
$service_report_maintenance_test_status = 'Status';
|
||||||
|
|
||||||
$service_report_outcome_good = 'Gut';
|
$service_report_outcome_good = 'Gut';
|
||||||
$service_report_outcome_attention = 'Achtung';
|
$service_report_outcome_attention = 'Achtung';
|
||||||
$service_report_no_text = 'Es sind keine Serviceberichte vorhanden';
|
$service_report_no_text = 'Es gibt keine Serviceberichte ';
|
||||||
|
|
||||||
$service_maintenance_test_fail = 'fehlgeschlagen';
|
$service_maintenance_test_fail = 'Fehlgeschlagen';
|
||||||
$service_maintenance_test_pass = 'gut';
|
$service_maintenance_test_pass = 'Gut';
|
||||||
|
|
||||||
$status0 = 0; $status0_text = 'Neu';
|
$status0 = 0; $status0_text = 'Neu';
|
||||||
$status1 = 1; $status1_text = 'Erstellt';
|
$status1 = 1; $status1_text = 'Erstellt';
|
||||||
$status2 = 2; $status2_text = 'Auf Lager';
|
$status2 = 2; $status2_text = 'Auf Lager';
|
||||||
$status3 = 3; $status3_text = 'Senden';
|
$status3 = 3; $status3_text = 'Versendet';
|
||||||
$status4 = 4; $status4_text = 'In Verwendung';
|
$status4 = 4; $status4_text = 'In Benutzung';
|
||||||
$status5 = 5; $status5_text = 'Verschrottet';
|
$status5 = 5; $status5_text = 'Verschrottet';
|
||||||
|
|
||||||
$product_location_raw = 'PCB';
|
$product_location_raw = 'Roh-PCB';
|
||||||
$product_location_SFG = 'Halbfertigware';
|
$product_location_SFG = 'Halbfertiger Artikel';
|
||||||
$product_location_FG = 'Fertigware';
|
$product_location_FG = 'Fertiger Artikel';
|
||||||
|
|
||||||
$warranty_outdated_text = 'Garantie abgelaufen';
|
$warranty_outdated_text = 'Garantie abgelaufen';
|
||||||
$warranty_recent = 'Unter Garantie';
|
$warranty_recent ='Unter Garantie';
|
||||||
|
|
||||||
$service_renewal_text = 'Service fällig';
|
$service_renewal_text = 'Service fällig';
|
||||||
$service_recent = 'Service auf dem neuesten Stand';
|
$service_recent = 'Service aktuell';
|
||||||
|
|
||||||
$firmware_update_text = 'Firmware-Upgrade verfügbar';
|
$firmware_update_text = 'Firmware-Update verfügbar';
|
||||||
$firmware_recent_text = 'Firmware auf dem neuesten Stand';
|
$firmware_recent_text = 'Firmware aktuell';
|
||||||
$firmware_update_confirm = 'Ich bestätige, dass SN und HW vom Gerät gelesen wurden';
|
$firmware_update_confirm = ' Ich bestätige, dass SN und HW vom Gerät gelesen wurden';
|
||||||
|
|
||||||
$message_eq_1 = 'Gerät erfolgreich erstellt!';
|
$message_eq_1 = 'Ausrüstung erfolgreich erstellt!';
|
||||||
$message_eq_2 = 'Gerät erfolgreich aktualisiert!';
|
$message_eq_2 = 'Ausrüstung erfolgreich aktualisiert!';
|
||||||
$message_eq_3 = 'Gerät erfolgreich gelöscht!';
|
$message_eq_3 = 'Ausrüstung erfolgreich gelöscht!';
|
||||||
$message_no_assets = 'Es sind keine Assets vorhanden';
|
$message_no_assets = 'Es gibt keine Vermögenswerte';
|
||||||
|
|
||||||
//Assets verwalten
|
//Manage assets
|
||||||
$manage_asset_h2 = 'Asset verwalten';
|
$manage_asset_h2 = 'Vermögenswert verwalten';
|
||||||
|
|
||||||
//ServiceReports
|
//ServiceReports
|
||||||
$servicereports_h2 = 'Serviceberichte';
|
$servicereports_h2 = 'Serviceberichte';
|
||||||
$servicereports_p = 'Serviceberichte anzeigen, verwalten und durchsuchen.';
|
$servicereports_p = 'Serviceberichte anzeigen, verwalten und suchen.';
|
||||||
$servicereports_Search = 'Serviceberichte durchsuchen...';
|
$servicereports_Search = 'Serviceberichte suchen...';
|
||||||
$servicereports_no_history = 'Es sind keine Berichte vorhanden.';
|
$servicereports_no_history = 'Es gibt keine Berichte';
|
||||||
$servicereports_details = 'Serviceberichte';
|
$servicereports_details = 'Serviceberichte';
|
||||||
|
|
||||||
$servicereport_h2 = 'Servicebericht';
|
$servicereport_h2 = 'Servicebericht';
|
||||||
$servicereport_p = 'Serviceberichtdetails anzeigen.';
|
$servicereport_p = 'Serviceberichtdetails anzeigen.';
|
||||||
$servicereport_no_history = 'Es ist kein Bericht vorhanden.';
|
$servicereport_no_history = 'Es gibt keinen Bericht';
|
||||||
$servicereport_details = 'Servicebericht';
|
$servicereport_details = 'Servicebericht';
|
||||||
|
|
||||||
//Verlauf
|
//History
|
||||||
$history_h2 = 'Verlauf';
|
$history_h2 = 'Verlauf';
|
||||||
$history_p = 'Verlauf anzeigen, verwalten und durchsuchen.';
|
$history_p = 'Verlauf anzeigen, verwalten und suchen.';
|
||||||
$history_Search = 'Verlauf durchsuchen...';
|
$history_Search = 'Verlauf suchen...';
|
||||||
$history_no_history = 'Es ist kein Verlauf vorhanden.';
|
$history_no_history = 'Es gibt keinen Verlauf';
|
||||||
|
|
||||||
$history_label1 = 'HistoryID';
|
$history_label1 = 'Verlauf-ID';
|
||||||
$history_label2 = 'Typ';
|
$history_label2 = 'Typ';
|
||||||
$history_label3 = 'Erstellt';
|
$history_label3 = 'Erstellt';
|
||||||
$history_label4 = 'Erstellt von';
|
$history_label4 = 'Erstellt von';
|
||||||
$history_label5 = 'Beschreibung';
|
$history_label5 = 'Beschreibung';
|
||||||
$history_label6 = 'Seriennummer';
|
$history_label6 = 'Seriennummer';
|
||||||
|
|
||||||
//Massenaktualisierung
|
//Mass update
|
||||||
$mass_update_h2 = 'Massenaktualisierung von Assets';
|
$mass_update_h2 = 'Massenaktualisierung von Vermögenswerten';
|
||||||
$mass_update_partners = 'Partner zuweisen';
|
$mass_update_partners = 'Partner zuweisen';
|
||||||
$mass_update_input = 'Zuweisen und eingeben';
|
$mass_update_input = 'Zuweisen und Eingeben';
|
||||||
$mass_update_confirm_message = 'Aktualisierung verarbeiten?';
|
$mass_update_confirm_message = 'Aktualisierung durchführen?';
|
||||||
|
|
||||||
$mass_update_correct = 'Aktualisierung abgeschlossen';
|
$mass_update_correct = 'Update abgeschlossen';
|
||||||
$mass_update_not_found = 'nicht gefunden';
|
$mass_update_not_found = 'Nicht gefunden';
|
||||||
|
|
||||||
$mass_update_order_ref = 'Bestellreferenz';
|
$mass_update_order_ref = 'Bestellreferenz';
|
||||||
$mass_update_order_total = 'Bestellsumme';
|
$mass_update_order_total = 'Bestellsumme';
|
||||||
@@ -231,29 +232,32 @@ $paste_excel_h3 = 'Seriennummern einfügen';
|
|||||||
$paste_excel_1 = 'Seriennummer hinzufügen oder aus Excel einfügen';
|
$paste_excel_1 = 'Seriennummer hinzufügen oder aus Excel einfügen';
|
||||||
$paste_excel_2 = '1 Nummer pro Zeile';
|
$paste_excel_2 = '1 Nummer pro Zeile';
|
||||||
|
|
||||||
//Produkte
|
//Products
|
||||||
$products_h2 = 'Produkte';
|
$products_h2 = 'Produkte';
|
||||||
$product_h2 = 'Produkt';
|
$product_h2 = 'Produkt';
|
||||||
$products_p = 'Produkte anzeigen, verwalten und suchen.';
|
$products_p = 'Produkte anzeigen, verwalten und suchen.';
|
||||||
|
$product_data = 'Produktinformationen';
|
||||||
|
$product_version = 'Produktversionen';
|
||||||
|
|
||||||
$product_code = 'Produktcode';
|
$product_code = 'Produktcode';
|
||||||
$product_status = 'Status';
|
$product_status = 'Status';
|
||||||
$product_category = 'Kategorie';
|
$product_category = 'Kategorie';
|
||||||
$product_name = 'Name';
|
$product_name = 'Name';
|
||||||
$product_description = 'Beschreibung';
|
$product_description = 'Beschreibung';
|
||||||
$product_parttype = 'Typ';
|
$product_parttype = 'Typ';
|
||||||
$product_search = 'Produktnamen suchen...';
|
$product_search = 'Produktname suchen...';
|
||||||
$product_software = 'Softwareversion';
|
$product_software = 'Softwareversion';
|
||||||
$product_price = 'Preis';
|
$product_price = 'Preis';
|
||||||
$product_serialized = 'Serialisiert';
|
$product_serialized = 'Seriennummer';
|
||||||
$product_build = 'Build';
|
$product_build = 'Bau';
|
||||||
$product_sales = 'Verkäufe';
|
$product_sales = 'Verkäufe';
|
||||||
|
|
||||||
$part_type1 = 'Produkt';
|
$part_type1 = 'Produkt';
|
||||||
$part_type2 = 'Ersatzteil';
|
$part_type2 = 'Ersatzteil';
|
||||||
$part_type3 = 'Loose_item';
|
$part_type3 = 'Lose Ware';
|
||||||
|
|
||||||
$product_category0 = 'Notstecker';
|
$product_category0 = 'Notfall-Stecker';
|
||||||
$product_category1 = 'Werkstattstecker';
|
$product_category1 = 'Garage-Stecker';
|
||||||
$product_category2 = 'Service';
|
$product_category2 = 'Service';
|
||||||
$product_category3 = 'Sonstiges';
|
$product_category3 = 'Sonstiges';
|
||||||
|
|
||||||
@@ -264,14 +268,19 @@ $prod_status_1 = "Aktiv"; //1
|
|||||||
$message_pr_1 = 'Produkt erfolgreich erstellt!';
|
$message_pr_1 = 'Produkt erfolgreich erstellt!';
|
||||||
$message_pr_2 = 'Produkt erfolgreich aktualisiert!';
|
$message_pr_2 = 'Produkt erfolgreich aktualisiert!';
|
||||||
$message_pr_3 = 'Produkt erfolgreich gelöscht!';
|
$message_pr_3 = 'Produkt erfolgreich gelöscht!';
|
||||||
$message_no_products = 'Es sind keine Produkte vorhanden';
|
$message_no_products = 'Es gibt keine Produkte';
|
||||||
|
|
||||||
//Benutzer
|
$product_version_number = 'Versionsnummer';
|
||||||
|
$product_version_version = 'Version';
|
||||||
|
$product_version_software = 'Software';
|
||||||
|
$product_version_measurement = 'Daten';
|
||||||
|
|
||||||
|
//Users
|
||||||
$users_h2 = 'Benutzer';
|
$users_h2 = 'Benutzer';
|
||||||
$user_h2 = 'Benutzer';
|
$user_h2 = 'Benutzer';
|
||||||
$users_p = 'Benutzer anzeigen, verwalten und suchen.';
|
$users_p = 'Benutzer anzeigen, verwalten und suchen.';
|
||||||
$users_search = 'Benutzer suchen';
|
$users_search = 'Benutzer suchen';
|
||||||
$User_service = 'Dienst';
|
$User_service = 'Service';
|
||||||
$User_update = 'Aktiv';
|
$User_update = 'Aktiv';
|
||||||
$User_username = 'Benutzername';
|
$User_username = 'Benutzername';
|
||||||
$User_email = 'E-Mail';
|
$User_email = 'E-Mail';
|
||||||
@@ -285,101 +294,89 @@ $User_pw_login_count = 'Fehlgeschlagene Anmeldeversuche';
|
|||||||
$User_block = 'Gesperrt';
|
$User_block = 'Gesperrt';
|
||||||
$User_unblock = 'Entsperren';
|
$User_unblock = 'Entsperren';
|
||||||
|
|
||||||
$reset_message = 'Passwort zurücksetzen gestartet => Weitere Anweisungen finden Sie in Ihrem E-Mail-Posteingang. Sie werden zur Anmeldeseite weitergeleitet.';
|
$reset_message = 'Passwort-Reset gestartet => Weitere Anweisungen finden Sie in Ihrem E-Mail-Posteingang. Sie werden zur Anmeldeseite weitergeleitet.';
|
||||||
$reset_message2 = 'Resettoken ungültig, Sie werden weitergeleitet';
|
$reset_message2 = 'Zurücksetzungstoken nicht gültig, Sie werden weitergeleitet';
|
||||||
$reset_message3 = 'Passwort muss mindestens 6 Zeichen lang sein';
|
$reset_message3 = 'Passwort muss mindestens 6 Zeichen lang sein';
|
||||||
|
|
||||||
$enabled = 'Aktiv';
|
$enabled = 'Aktiv';
|
||||||
|
|
||||||
$disabled = 'Inaktiv';
|
$disabled = 'Inaktiv';
|
||||||
|
|
||||||
$message_us_1 = 'Benutzer erfolgreich erstellt!';
|
$message_us_1 = 'Benutzer erfolgreich erstellt!';
|
||||||
|
|
||||||
$message_us_2 = 'Benutzer erfolgreich aktualisiert!';
|
$message_us_2 = 'Benutzer erfolgreich aktualisiert!';
|
||||||
|
|
||||||
$message_us_3 = 'Benutzer erfolgreich gelöscht!';
|
$message_us_3 = 'Benutzer erfolgreich gelöscht!';
|
||||||
|
$message_no_users = 'Es gibt keine Benutzer';
|
||||||
$message_no_users = 'Es sind keine Benutzer vorhanden';
|
|
||||||
|
|
||||||
$error_msg_0 = 'Benutzer existiert bereits.';
|
$error_msg_0 = 'Benutzer existiert bereits.';
|
||||||
|
|
||||||
//Partner
|
//Partners
|
||||||
$partners_h2 = 'Partner';
|
$partners_h2 = 'Partner';
|
||||||
|
|
||||||
$partners_p = 'Partner anzeigen, verwalten und suchen.';
|
$partners_p = 'Partner anzeigen, verwalten und suchen.';
|
||||||
|
|
||||||
$partner_h2 = 'Partner';
|
$partner_h2 = 'Partner';
|
||||||
|
|
||||||
$partner_status = 'Status';
|
$partner_status = 'Status';
|
||||||
|
|
||||||
$partner_partnerID = 'ID';
|
$partner_partnerID = 'Id';
|
||||||
|
$partner_partnertype= 'Typ';
|
||||||
$partner_partnertype = 'Typ';
|
|
||||||
|
|
||||||
$partner_partnername = 'Name';
|
$partner_partnername = 'Name';
|
||||||
|
|
||||||
$partner_salesID = 'Partnerhierarchie';
|
$partner_salesID = 'Partnerhierarchie';
|
||||||
|
|
||||||
$partner_note = 'Notizen';
|
$partner_note = 'Notizen';
|
||||||
|
|
||||||
$partnertype1 = 'SalesID';
|
$partnertype1 = 'SalesID';
|
||||||
$partnertype2 = 'Verkauft an';
|
$partnertype2 = 'SoldTo';
|
||||||
$partnertype3 = 'Lieferadresse';
|
$partnertype3 = 'ShipTo';
|
||||||
$partnertype4 = 'Standort';
|
$partnertype4 = 'Standort';
|
||||||
$partnertype5 = 'Abschnitt';
|
$partnertype5 = 'Abschnitt';
|
||||||
|
|
||||||
$partner_search = 'Partner suchen...';
|
$partner_search = 'Partner suchen...';
|
||||||
$partner_view_assigned_assets = 'Zugewiesene Assets anzeigen';
|
$partner_view_assigned_assets = 'Zugewiesene Vermögenswerte anzeigen';
|
||||||
|
|
||||||
$message_pa_1 = 'Partner erfolgreich erstellt!';
|
$message_pa_1 = 'Partner erfolgreich erstellt!';
|
||||||
$message_pa_2 = 'Partner erfolgreich aktualisiert!';
|
$message_pa_2 = 'Partner erfolgreich aktualisiert!';
|
||||||
$message_pa_3 = 'Partner erfolgreich gelöscht!';
|
$message_pa_3 = 'Partner erfolgreich gelöscht!';
|
||||||
$message_no_partners = 'Es sind keine Partner vorhanden';
|
$message_no_partners = 'Es gibt keine Partner';
|
||||||
|
|
||||||
//Build
|
//Build
|
||||||
$buildtool_h2 = 'Buildtool';
|
$buildtool_h2 = 'Build-Tool';
|
||||||
$buildtool_p = 'Produkt zusammenbauen';
|
$buildtool_p = 'Produkt zusammenbauen';
|
||||||
|
|
||||||
//Firmware
|
//Firmware
|
||||||
$firmwaretool_h2 = 'Firmwaretool';
|
$firmwaretool_h2 = 'Firmware-Tool';
|
||||||
$firmwaretool_p = 'Firmware aktualisieren.';
|
$firmwaretool_p = 'Firmware aktualisieren.';
|
||||||
|
|
||||||
$firmwaretool_step = 'Anleitung';
|
$firmwaretool_step = 'Anleitungen';
|
||||||
$firmwaretool_step_1 = 'Verbinde dasVerbinden Sie das Gerät per USB mit dem Computer (unter der Batterieabdeckung zu finden).';
|
$firmwaretool_step_1 = 'Verbinden Sie das Gerät über USB mit dem Computer (zu finden unter der Batteriedeckel)';
|
||||||
$firmwaretool_step_2 = 'Drücken Sie die Schaltfläche "<i>Verbinden</i>"';
|
$firmwaretool_step_2 = 'Drücken Sie die "<i>Verbinden</i>"-Schaltfläche';
|
||||||
$firmwaretool_step_3 = 'Ein Popup wird angezeigt, in dem Sie aufgefordert werden, ein Gerät auszuwählen. Wählen Sie das Gerät aus, indem Sie darauf klicken, und drücken Sie die Schaltfläche "Verbinden".';
|
$firmwaretool_step_3 = 'Ein Popup-Fenster erscheint, in dem Sie ein Gerät auswählen müssen. Wählen Sie das Gerät aus, indem Sie darauf klicken, und drücken Sie die Schaltfläche Verbinden.';
|
||||||
$firmwaretool_step_4 = 'Nachdem das Popup verschwindet, wird das Gerät gelesen. In der Statusleiste wird der Fortschritt angezeigt.';
|
$firmwaretool_step_4 = 'Nachdem das Popup-Fenster verschwindet, wird das Gerät gelesen, die Statusleiste zeigt den Fortschritt an';
|
||||||
$firmwaretool_step_5 = 'Wenn Firmware verfügbar ist: In der Statusleiste wird "<i>Firmware verfügbar</i>" angezeigt.';
|
$firmwaretool_step_5 = 'Wenn Firmware verfügbar ist: Die Statusleiste zeigt "<i>Firmware verfügbar</i>"';
|
||||||
$firmwaretool_step_6 = 'Wenn Firmware verfügbar ist: Stellen Sie sicher, dass SN und HW vom Gerät gelesen werden, und bestätigen Sie dies, indem Sie das Kontrollkästchen "Ich bestätige, dass SN und HW vom Gerät gelesen werden" aktivieren.';
|
$firmwaretool_step_6 = 'Wenn Firmware verfügbar ist: Stellen Sie sicher, dass SN und HW vom Gerät gelesen werden und bestätigen Sie dies, indem Sie das Kontrollkästchen "Ich bestätige, dass SN und HW vom Gerät gelesen wurden" auswählen';
|
||||||
$firmwaretool_step_7 = 'Drücken Sie die Schaltfläche <i>"Firmware aktualisieren</i>", um den Dialog zur Firmwareaktualisierung zu starten, und folgen Sie den Anweisungen auf dem Bildschirm.';
|
$firmwaretool_step_7 = 'Drücken Sie die <i>"Firmware aktualisieren"</i>-Schaltfläche, um den Firmware-Aktualisierungsdialog zu starten und folgen Sie den Anweisungen auf dem Bildschirm';
|
||||||
$firmwaretool_step_8 = '<b>Beachten Sie: Dieser Vorgang kann nicht gestoppt werden und muss abgeschlossen werden.</b>';
|
$firmwaretool_step_8 = '<b>Hinweis: Dieser Prozess kann nicht gestoppt werden und muss abgeschlossen werden.</b>';
|
||||||
|
|
||||||
//EMAIL
|
//EMAIL
|
||||||
$newuser_subject = 'CustomerPortal-Benutzer erstellt';
|
$newuser_subject = 'CustomerPortal-Benutzer erstellt';
|
||||||
$newuser_header = 'Sehr geehrter CustomerPortal-Benutzer';
|
$newuser_header = 'Lieber CustomerPortal-Benutzer';
|
||||||
$newuser_text = 'Ihr CustomerPortal-Administrator hat Ihnen Zugriff auf das CustomerPortal gewährt. Um Ihr Konto zu vervollständigen, müssen Sie Ihr Passwort über den untenstehenden Link aktualisieren.';
|
$newuser_text = 'Ihr CustomerPortal-Administrator hat Ihnen Zugriff auf das CustomerPortal gewährt. Um Ihr Konto abzuschließen, müssen Sie Ihr Passwort über den folgenden Link aktualisieren.';
|
||||||
$newuser_credential_label = 'Link zum Portal:';
|
$newuser_credential_label = 'Link zum Portal:';
|
||||||
$newuser_closure = 'Aus Sicherheitsgründen ist dieser Link nur 10 Minuten lang aktiv.';
|
$newuser_closure = 'Aus Sicherheitsgründen ist dieser Link nur 10 Minuten lang aktiv.';
|
||||||
|
|
||||||
$changeuser_subject = 'CustomerPortal - Passwortzurücksetzung angefordert';
|
$changeuser_subject = 'CustomerPortal - Passwort zurücksetzen angefordert';
|
||||||
$changeuser_header = 'Sehr geehrter CustomerPortal-Benutzer';
|
$changeuser_header = 'Lieber CustomerPortal-Benutzer';
|
||||||
$changeuser_text = 'Für Ihr Konto wurde eine Passwortzurücksetzung angefordert. Um Ihr Konto zurückzusetzen, verwenden Sie den untenstehenden Link.';
|
$changeuser_text = 'Ein Passwort-Reset wurde für Ihr Konto angefordert. Um Ihr Konto zurückzusetzen, verwenden Sie den folgenden Link.';
|
||||||
$changeuser_credential_label = 'Link zum Portal:';
|
$changeuser_credential_label = 'Link zum Portal:';
|
||||||
$changeuser_closure = 'Aus Sicherheitsgründen ist dieser Link nur 10 Minuten lang aktiv.';
|
$changeuser_closure = 'Aus Sicherheitsgründen ist dieser Link nur 10 Minuten lang aktiv.';
|
||||||
|
|
||||||
$register_user_subject = 'Kundenportal - Firmware - Benutzer erstellt';
|
$register_user_subject = 'CustomerPortal - Firmware - Benutzer erstellt';
|
||||||
$register_user_header = 'Sehr geehrter Kunde';
|
$register_user_header = 'Lieber Kunde';
|
||||||
$register_user_text = 'Vielen Dank für Ihre Registrierung. Basierend auf Ihrer Produktregistrierung gewähren wir Ihnen hiermit Zugriff auf unsere Online-Firmware-Update-Funktion.';
|
$register_user_text = 'Danke für Ihre Registrierung. Basierend auf Ihrer Produktregistrierung gewähren wir Ihnen hiermit Zugriff auf unsere Online-Firmware-Update-Möglichkeit.';
|
||||||
$register_user_credential_label = 'Link zum Portal:';
|
$register_user_credential_label = 'Link zum Portal:';
|
||||||
$register_user_closure = 'Dies ist ein allgemeines Konto und kann nicht geändert werden.';
|
$register_user_closure = 'Dies ist ein allgemeines Konto und kann nicht geändert werden.';
|
||||||
|
|
||||||
//Registrieren
|
//Register
|
||||||
$register_message_1 = 'Seriennummer nicht erkannt, bitte wenden Sie sich an Ihren Lieferanten';
|
$register_message_1 = 'Seriennummer nicht erkannt, bitte wenden Sie sich an Ihren Anbieter';
|
||||||
$register_message_2 = 'Produkt unter Garantie oder Garantie abgelaufen. Falls nicht korrekt, wenden Sie sich bitte an Ihren Lieferanten';
|
$register_message_2 = 'Produkt unter Garantie oder Garantie abgelaufen. Wenn dies nicht zutrifft, wenden Sie sich bitte an Ihren Anbieter';
|
||||||
$register_message_3 = 'Garantie wird um 1 weiteres Jahr verlängert';
|
$register_message_3 = 'Garantie wurde um 1 zusätzliches Jahr verlängert';
|
||||||
$register_message_4 = 'Vielen Dank für Ihre Registrierung. Sie erhalten den Link zu unserem Software-Update-Tool über die bei der Registrierung angegebene E-Mail-Adresse.';
|
$register_message_4 = 'Vielen Dank für Ihre Registrierung. Sie erhalten den Link zu unserem Software-Update-Tool per E-Mail, die bei der Registrierung angegeben wurde.';
|
||||||
|
|
||||||
//Kommunikation
|
//Communication
|
||||||
$communication_h2 = 'Kommunikation';
|
$communication_h2 = 'Kommunikation';
|
||||||
$communication_p = 'Kommunikation anzeigen, verwalten und suchen.';
|
$communication_p = 'Kommunikation anzeigen, verwalten und suchen.';
|
||||||
$communication_status = 'Status';
|
$communication_status = 'Status';
|
||||||
@@ -392,32 +389,32 @@ $message_comm_1 = 'Kommunikation erfolgreich erstellt!';
|
|||||||
$message_comm_2 = 'Kommunikation erfolgreich aktualisiert!';
|
$message_comm_2 = 'Kommunikation erfolgreich aktualisiert!';
|
||||||
$message_comm_3 = 'Kommunikation erfolgreich gelöscht!';
|
$message_comm_3 = 'Kommunikation erfolgreich gelöscht!';
|
||||||
$message_comm_4 = 'Firmware-Kommunikation aktiviert!';
|
$message_comm_4 = 'Firmware-Kommunikation aktiviert!';
|
||||||
$message_no_communication = 'Es gibt keine Kommunikationsdatensätze';
|
$message_no_communication = 'Es gibt keine Kommunikationsaufzeichnungen';
|
||||||
|
|
||||||
$communication_partner = 'PartnerID';
|
$communication_partner = 'PartnerID';
|
||||||
$communication_email = 'E-Mail';
|
$communication_email = 'E-Mail';
|
||||||
$communication_firmware = 'Firmware';
|
$communication_firmware = 'Firmware';
|
||||||
$communication_service = 'Dienst';
|
$communication_service = 'Service';
|
||||||
$communication_marketing = 'Marketing';
|
$communication_marketing = 'Marketing';
|
||||||
$communication_type = 'Typ';
|
$communication_type = 'Typ';
|
||||||
$communication_send = 'Senden';
|
$communication_send = 'Senden';
|
||||||
|
|
||||||
$coms_types = 'Kommunikation';
|
$coms_types = 'Kommunikation';
|
||||||
$coms_status_0 = "Inaktiv"; //0
|
$coms_status_0 = "Inaktiv"; //0
|
||||||
$coms_status_1 = "Aktiv"; // 1
|
$coms_status_1 = "Aktiv"; //1
|
||||||
|
|
||||||
$coms_type_0 = 'Prognose';
|
$coms_type_0 = 'Prognose';
|
||||||
$coms_type_1 = 'Ereignisbasiert';
|
$coms_type_1 = 'Ereignisbasiert';
|
||||||
|
|
||||||
$communication_send_firmware_h2 = 'Firmware-Nachricht erstellen';
|
$communication_send_firmware_h2 = 'Firmware-Nachricht erstellen';
|
||||||
$communication_target = 'Ziel';
|
$communication_target = 'Ziel';
|
||||||
$communication_target_both = 'Beides';
|
$communication_target_both = 'Beide';
|
||||||
$communication_hw_scope = 'Hardware-Umfang';
|
$communication_hw_scope = 'Hardware-Bereich';
|
||||||
|
|
||||||
//Konto
|
//Account
|
||||||
$accountstatus_0 = 'Lead';
|
$accountstatus_0 = 'Lead';
|
||||||
$accountstatus_1 = 'Kunde';
|
$accountstatus_1 = 'Kunde';
|
||||||
$accountstatus_2 = 'Abbrechen';
|
$accountstatus_2 = 'Stornieren';
|
||||||
|
|
||||||
$account_h2 = 'Konto';
|
$account_h2 = 'Konto';
|
||||||
$account_p = 'Konto anzeigen, verwalten und suchen.';
|
$account_p = 'Konto anzeigen, verwalten und suchen.';
|
||||||
@@ -425,101 +422,80 @@ $account_status = 'Status';
|
|||||||
$account_search = 'Kontonamen suchen';
|
$account_search = 'Kontonamen suchen';
|
||||||
|
|
||||||
$message_account_1 = 'Konto erfolgreich erstellt!';
|
$message_account_1 = 'Konto erfolgreich erstellt!';
|
||||||
|
|
||||||
$message_account_2 = 'Konto erfolgreich aktualisiert!';
|
$message_account_2 = 'Konto erfolgreich aktualisiert!';
|
||||||
|
|
||||||
$message_account_3 = 'Konto erfolgreich gelöscht!';
|
$message_account_3 = 'Konto erfolgreich gelöscht!';
|
||||||
|
$message_no_account = 'Es gibt keine Konten';
|
||||||
$message_no_account = 'Es sind keine Konten vorhanden';
|
|
||||||
|
|
||||||
$account_id = 'Konto-ID';
|
$account_id = 'Konto-ID';
|
||||||
|
|
||||||
$account_name = 'Name';
|
$account_name = 'Name';
|
||||||
|
|
||||||
$account_firstname = 'Vorname';
|
$account_firstname = 'Vorname';
|
||||||
|
|
||||||
$account_lastname = 'Nachname';
|
$account_lastname = 'Nachname';
|
||||||
|
|
||||||
$account_email = 'E-Mail';
|
$account_email = 'E-Mail';
|
||||||
|
|
||||||
$account_phone = 'Telefon';
|
$account_phone = 'Telefon';
|
||||||
|
|
||||||
$view_account_information = 'Kontoinformationen';
|
$view_account_information = 'Kontoinformationen';
|
||||||
|
|
||||||
$view_account_contact = 'Kontaktinformationen';
|
$view_account_contact = 'Kontaktinformationen';
|
||||||
|
$account_contactfirstname = 'Vorname des Ansprechpartners';
|
||||||
$account_contactfirstname = 'Vorname der Kontaktperson';
|
$account_contactlastname = 'Nachname des Ansprechpartners';
|
||||||
|
|
||||||
$account_contactlastname = 'Nachname der Kontaktperson';
|
|
||||||
|
|
||||||
$account_contactemail = 'E-Mail';
|
$account_contactemail = 'E-Mail';
|
||||||
|
|
||||||
$account_contactphonenumber = 'Telefon';
|
$account_contactphonenumber = 'Telefon';
|
||||||
$account_billing = 'Rechnungsstellung';
|
$account_billing = 'Rechnung';
|
||||||
$account_billstreetadress ='Straßenadresse';
|
$account_billstreetadress = 'Straßenadresse';
|
||||||
$account_billpostalcode ='Postleitzahl';
|
$account_billpostalcode = 'Postleitzahl';
|
||||||
$account_billdistrict ='Bezirk';
|
$account_billdistrict = 'Bezirk';
|
||||||
$account_billcity ='Stadt';
|
$account_billcity = 'Stadt';
|
||||||
$account_billstate ='Bundesland';
|
$account_billstate = 'Bundesland';
|
||||||
$account_billcountry ='Land';
|
$account_billcountry = 'Land';
|
||||||
$account_shipping ='Versand';
|
$account_shipping = 'Versand';
|
||||||
$account_company ='Firmenname';
|
$account_company = 'Firmenname';
|
||||||
$account_firstname ='Vorname';
|
$account_firstname = 'Vorname';
|
||||||
$account_lastname ='Nachname';
|
$account_lastname = 'Nachname';
|
||||||
$account_streetadress ='Straßenadresse';
|
$account_streetadress = 'Straßenadresse';
|
||||||
$account_postalcode ='Postleitzahl';
|
$account_postalcode = 'Postleitzahl';
|
||||||
$account_district ='Distreng';
|
$account_district = 'Bezirk';
|
||||||
$account_city ='Stadt';
|
$account_city = 'Stadt';
|
||||||
$account_state ='Staat';
|
$account_state = 'Bundesland';
|
||||||
$account_country ='Land';
|
$account_country = 'Land';
|
||||||
$account_vatnumber ='Umsatzsteuer-Identifikationsnummer';
|
$account_vatnumber = 'USt-IdNr';
|
||||||
$account_loghandlername ='Logistik-Handler';
|
$account_loghandlername = 'Logistikleiter';
|
||||||
$account_loghandleraccount ='Logistikkonto';
|
$account_loghandleraccount = 'Logistik-Konto';
|
||||||
|
|
||||||
//Verträge
|
//Contracts
|
||||||
$message_contract_1 = 'Vertrag erfolgreich erstellt!';
|
$message_contract_1 = 'Vertrag erfolgreich erstellt!';
|
||||||
$message_contract_2 = 'Vertrag erfolgreich aktualisiert!';
|
$message_contract_2 = 'Vertrag erfolgreich aktualisiert!';
|
||||||
$message_contract_3 = 'Vertrag erfolgreich gelöscht!';
|
$message_contract_3 = 'Vertrag erfolgreich gelöscht!';
|
||||||
$message_no_contract = 'Es sind keine Verträge vorhanden';
|
$message_no_contract = 'Es gibt keine Verträge';
|
||||||
|
|
||||||
$contract_h2 = 'Verträge';
|
$contract_h2 = 'Verträge';
|
||||||
$contract_p = 'Verträge anzeigen, verwalten und suchen.';
|
$contract_p = 'Verträge anzeigen, verwalten und suchen.';
|
||||||
$contract_status = 'Status';
|
$contract_status = 'Status';
|
||||||
$contract_search = 'Suchreferenz';
|
$contract_search = 'Referenz suchen';
|
||||||
|
|
||||||
$contract_status0 = 'Entwurf';
|
$contract_status0 = 'Entwurf';
|
||||||
$contract_status1 = 'Aktiv';
|
$contract_status1 = 'Aktiv';
|
||||||
$contract_status2 = 'Geschlossen';
|
$contract_status2 = 'Abgeschlossen';
|
||||||
|
|
||||||
$contract_type0 = 'Fest';
|
$contract_type0 = 'Fest';
|
||||||
|
|
||||||
$contract_type1 = 'Abonnement';
|
$contract_type1 = 'Abonnement';
|
||||||
|
$contract_type2 = 'Pay-per-Use';
|
||||||
$contract_type2 = 'Zahlung pro Nutzung';
|
|
||||||
|
|
||||||
$contract_id = 'Vertrags-ID';
|
$contract_id = 'Vertrags-ID';
|
||||||
|
|
||||||
$contract_account = 'Konto';
|
$contract_account = 'Konto';
|
||||||
|
|
||||||
$contract_type = 'Typ';
|
$contract_type = 'Typ';
|
||||||
|
|
||||||
$contract_start_date = 'Startdatum';
|
$contract_start_date = 'Startdatum';
|
||||||
|
|
||||||
$contract_end_date = 'Enddatum';
|
$contract_end_date = 'Enddatum';
|
||||||
|
|
||||||
$contract_reference = 'Referenz';
|
$contract_reference = 'Referenz';
|
||||||
|
|
||||||
$contract_duration = 'Dauer (in Monaten)';
|
$contract_duration = 'Dauer (in Monaten)';
|
||||||
|
|
||||||
$contract_servicetool = 'Servicetool';
|
$contract_servicetool = 'Servicetool';
|
||||||
|
|
||||||
$contract_assigned_users = 'Zugewiesene Benutzer';
|
$contract_assigned_users = 'Zugewiesene Benutzer';
|
||||||
|
|
||||||
$contract_assigned_users_add = 'Benutzer hinzufügen';
|
$contract_assigned_users_add = 'Benutzer hinzufügen';
|
||||||
|
|
||||||
//=================================================================
|
//Service Tool Question variables
|
||||||
//Service Tool-Fragevariablen ===========================================
|
|
||||||
//= ...
|
//Groupheaders
|
||||||
|
$group_header_1 = 'Allgemein';
|
||||||
|
$group_header_2 = 'Kopf - Typ 1';
|
||||||
|
$group_header_3 = 'Kopf - Typ 2';
|
||||||
|
$group_header_4 = 'Batterieeinheit';
|
||||||
$group_header_5 = 'Gehäuse';
|
$group_header_5 = 'Gehäuse';
|
||||||
$group_header_6 = 'Aktionen';
|
$group_header_6 = 'Aktionen';
|
||||||
$group_header_7 = 'Notizen';
|
$group_header_7 = 'Notizen';
|
||||||
@@ -527,70 +503,67 @@ $group_header_8 = 'Repariert/Ersetzt';
|
|||||||
$group_header_9 = 'Abschließen';
|
$group_header_9 = 'Abschließen';
|
||||||
|
|
||||||
//ServiceReport_labels
|
//ServiceReport_labels
|
||||||
$service_report_id = 'ServicereportID';
|
$service_report_id = 'Servicebericht-ID';
|
||||||
$service_serialnumber = 'Seriennummer';
|
$service_serialnumber = 'Seriennummer';
|
||||||
$service_date = 'Servicedatum';
|
$service_date = 'Servicedatum';
|
||||||
$service_renewal = 'Verlängerungsdatum';
|
$service_renewal = 'Erneuerungsdatum';
|
||||||
$service_performed_by = 'Durchgeführt von';
|
$service_performed_by = 'Durchgeführt von';
|
||||||
|
|
||||||
//Summarylabels für Bericht
|
//Summarylabels for report
|
||||||
$summary_label1 = 'Durchgeführte Serviceaktionen';
|
$summary_label1 = 'Durchgeführte Serviceaktionen';
|
||||||
$summary_label2 = 'Beobachtungen';
|
$summary_label2 = 'Beobachtungen';
|
||||||
$summary_label3 = 'Korrosion';
|
$summary_label3 = 'Korrosion';
|
||||||
$summary_label4 = 'Status';
|
$summary_label4 = 'Zustand';
|
||||||
|
|
||||||
$message1 = 'Keine Serviceaktionen durchgeführt/erforderlich';
|
$message1 = 'Keine Serviceaktionen durchgeführt/erforderlich';
|
||||||
$message2 = 'Keine Reparaturmaßnahmen durchgeführt/erforderlich';
|
$message2 = 'Keine Reparaturaktionen durchgeführt/erforderlich';
|
||||||
|
|
||||||
//---------------------------------
|
//Service Tool visual questions
|
||||||
//Visuelle Fragen zum Servicetool
|
|
||||||
//---------------------------------
|
|
||||||
$service_visual_1 = 'Produktgehäuse enthalten?';
|
$service_visual_1 = 'Produktgehäuse enthalten?';
|
||||||
$service_visual_2 = 'Ersatzbatterien enthalten?';
|
$service_visual_2 = 'Ersatzbatterien enthalten?';
|
||||||
$service_visual_3 = 'Spudger enthalten?';
|
$service_visual_3 = 'Pray bar (Spudger) enthalten?';
|
||||||
$service_visual_4 = 'Adapter (NA) enthalten?';
|
$service_visual_4 = 'Adapter (NA) enthalten?';
|
||||||
|
|
||||||
$service_visual_5 = 'Kopf und Pins sauber?';
|
$service_visual_5 = 'Kopf und Pins sauber?';
|
||||||
$service_visual_6 = 'Alle Pins vorhanden (3x)?';
|
$service_visual_6 = 'Alle Pins vorhanden (3x)?';
|
||||||
$service_visual_7 = 'Korrosion an den Pins sichtbar?';
|
$service_visual_7 = 'Korrosion an Pins sichtbar?';
|
||||||
$service_visual_8 = 'Zustand des Kunststoffgehäuses';
|
$service_visual_8 = 'Zustand des Kunststoffgehäuses';
|
||||||
|
|
||||||
$service_visual_9 = 'Kopf und Pins sauber?';
|
$service_visual_9 = 'Kopf und Pins sauber?';
|
||||||
$service_visual_10 = 'Alle Pins vorhanden (3x)?';
|
$service_visual_10 = 'Alle Pins vorhanden (3x)?';
|
||||||
$service_visual_11 = 'Korrosion an den Pins sichtbar?';
|
$service_visual_11 = 'Korrosion an Pins sichtbar?';
|
||||||
$service_visual_12 = 'Zustand des Kunststoffgehäuses';
|
$service_visual_12 = 'Zustand des Kunststoffgehäuses';
|
||||||
|
|
||||||
$service_visual_13 = 'Batterieabdeckung vorhanden?';
|
$service_visual_13 = 'Batteriefach vorhanden?';
|
||||||
$service_visual_14 = 'Korrosion an Batteriekontakten?';
|
$service_visual_14 = 'Korrosion an Batterieanschlüssen?';
|
||||||
$service_visual_15 = 'Batteriekontakte vorhanden?';
|
$service_visual_15 = 'Batterieanschlüsse vorhanden?';
|
||||||
$service_visual_15 = 'Seriennummer lesbar?';
|
$service_visual_16 = 'Seriennummer lesbar?';
|
||||||
$service_visual_16 = 'USB-Anschluss sauber?';
|
$service_visual_17 = 'USB-Anschluss sauber?';
|
||||||
$service_visual_17 = 'Spiel am USB-Anschluss?';
|
$service_visual_18 = 'Bewegung am USB-Anschluss?';
|
||||||
$service_visual_18 = 'Schrauben fest (5x)?';
|
$service_visual_19 = 'Schrauben fest (5x)?';
|
||||||
|
|
||||||
$service_visual_19 = 'Knopf lässt sich drücken?';
|
$service_visual_20 = 'Taste drückbar?';
|
||||||
$service_visual_20 = 'Zustand des Gehäuses?';
|
$service_visual_21 = 'Zustand des Gehäuses?';
|
||||||
$service_visual_21 = 'Zustand des Diffusors?';
|
$service_visual_22 = 'Zustand des Diffusors?';
|
||||||
$service_visual_22 = 'Zustand der LED-Abdeckung?';
|
$service_visual_23 = 'Zustand des LED-Abdeckers?';
|
||||||
|
|
||||||
//---------------------------------
|
//Service Tool finalize
|
||||||
//Servicetool abschließen
|
|
||||||
//---------------------------------
|
|
||||||
$service_action_clean = "Gerät gereinigt";
|
$service_action_clean = "Gerät gereinigt";
|
||||||
$service_action_battery = "Batterien ersetzt";
|
$service_action_battery = "Batterien ersetzt";
|
||||||
|
|
||||||
$service_notes = 'Notizen';
|
$service_notes = 'Notizen';
|
||||||
$service_action_serial = 'Seriennummer';
|
$service_action_serial = 'Seriennummer';
|
||||||
$service_action_cover = 'Batterieabdeckung';
|
$service_action_cover = 'Batteriefach';
|
||||||
$service_action_spudger = 'Betstange (Spudger)';
|
$service_action_spudger = 'Pray bar (Spudger)';
|
||||||
$service_action_case = 'Koffer';
|
$service_action_case = 'Gehäuse';
|
||||||
$service_action_instructions = 'Anleitung im Koffer';
|
$service_action_instructions = 'Anleitungen im Fall';
|
||||||
//PFLICHTIGE Frage
|
|
||||||
$service_mandatory_question = 'Ich erkläre, dass ich die Fragen wahrheitsgemäß beantwortet habe';
|
$service_mandatory_question = 'Ich erkläre, dass ich die Fragen wahrheitsgemäß beantwortet habe';
|
||||||
|
|
||||||
//=================================================================
|
//SERVICE Tool allowed responses
|
||||||
//SERVICE Tool erlaubte Antworten============================================
|
$service_allowed_label1 = 'Ja';
|
||||||
//= ...
|
$service_allowed_label2 = 'Nein';
|
||||||
|
$service_allowed_label3 = 'Schlecht';
|
||||||
|
$service_allowed_label4 = 'Durchschnittlich';
|
||||||
$service_allowed_label5 = 'Gut';
|
$service_allowed_label5 = 'Gut';
|
||||||
$service_allowed_label6 = 'Ja';
|
$service_allowed_label6 = 'Ja';
|
||||||
$service_allowed_label7 = 'Nein';
|
$service_allowed_label7 = 'Nein';
|
||||||
@@ -598,37 +571,35 @@ $service_allowed_label8 = 'Kommentar';
|
|||||||
$service_allowed_label9 = 'n/a';
|
$service_allowed_label9 = 'n/a';
|
||||||
$service_allowed_label10 = 'Überprüfen';
|
$service_allowed_label10 = 'Überprüfen';
|
||||||
|
|
||||||
//=================================================================
|
//SERVICE Question - Legacy
|
||||||
//SERVICE-Frage - Legacy ==========================================
|
$group_header_legacy_1 = 'Produkt';
|
||||||
//= ... $group_header_legacy_5 = 'Status';
|
$group_header_legacy_2 = 'Etikett';
|
||||||
|
$group_header_legacy_3 = 'Reinigung';
|
||||||
|
$group_header_legacy_4 = 'Korrosion';
|
||||||
|
$group_header_legacy_5 = 'Zustand';
|
||||||
$group_header_legacy_6 = 'Bewegung';
|
$group_header_legacy_6 = 'Bewegung';
|
||||||
$group_header_legacy_7 = 'Sonstiges';
|
$group_header_legacy_7 = 'Sonstiges';
|
||||||
|
|
||||||
$question1 = 'Produkthülle enthalten?';
|
$question1 = 'Produktgehäuse enthalten?';
|
||||||
$question2 = 'Spudger in der Hülle?';
|
$question2 = 'Spudger im Gehäuse?';
|
||||||
$question3 = 'Batterien enthalten?';
|
$question3 = 'Batterien enthalten?';
|
||||||
$question4 = 'Batterieabdeckung inenthalten?';
|
$question4 = 'Batteriefach enthalten?';
|
||||||
$question5 = 'Seriennummer auf Etikett lesbar?';
|
$question5 = 'Seriennummer auf Etikett lesbar?';
|
||||||
$question6 = 'Typ 1 Kopf und Pins sauber?';
|
$question6 = 'Kopf Typ 1 und Pins sauber?';
|
||||||
$question7 = 'Typ 2 Kopf und Pins sauber?';
|
$question7 = 'Kopf Typ 2 und Pins sauber?';
|
||||||
$question8 = 'USB-Anschluss sauber?';
|
$question8 = 'USB-Anschluss sauber?';
|
||||||
$question9 = 'PCB sauber?';
|
$question9 = 'PCB sauber?';
|
||||||
$question10 = 'Gehäuse';
|
$question10 = 'Gehäuse';
|
||||||
$question11 = 'Kopf-Typ1';
|
$question11 = 'Kopf-Typ1';
|
||||||
$question12 = 'Kopf-Typ2';
|
$question12 = 'Kopf-Typ2';
|
||||||
$question13 = 'Batterien';
|
$question13 = 'Batterien';
|
||||||
$question14 = 'Batteriekontakte';
|
$question14 = 'Batterieanschlüsse';
|
||||||
$question11a = 'Kopf-Typ1 nicht korrodiert';
|
$question15 = 'Batteriefach';
|
||||||
$question12a = 'Kopf-Typ2 nicht korrodiert';
|
|
||||||
$question13a = 'Batterien nicht korrodiert';
|
|
||||||
$question14a = 'Batteriekontakte nicht korrodiert';
|
|
||||||
$question18a = 'PCB nicht korrodiert';
|
|
||||||
$question15 = 'Batterieabdeckung';
|
|
||||||
$question16 = 'Abdeckung';
|
$question16 = 'Abdeckung';
|
||||||
$question17 = 'Diffusor';
|
$question17 = 'Diffusor';
|
||||||
$question18 = 'PCB';
|
$question18 = 'PCB';
|
||||||
$question19 = 'Alle Schrauben vorhanden?';
|
$question19 = 'Alle Schrauben vorhanden?';
|
||||||
$question20 = 'Keine Bewegung an den Pins?';
|
$question20 = 'Keine Bewegung an Pins?';
|
||||||
$question21 = 'Alle Pins vorhanden?';
|
$question21 = 'Alle Pins vorhanden?';
|
||||||
$question22 = 'Keine Bewegung am USB-Anschluss?';
|
$question22 = 'Keine Bewegung am USB-Anschluss?';
|
||||||
$question23 = 'Taste funktioniert?';
|
$question23 = 'Taste funktioniert?';
|
||||||
@@ -642,119 +613,103 @@ $action_firmware = "action_firmware";
|
|||||||
$action_firmware_description = "Firmware des Geräts aktualisiert";
|
$action_firmware_description = "Firmware des Geräts aktualisiert";
|
||||||
$action_firmware_update_description = "Ich bestätige, dass SN und HW vom Gerät gelesen wurden";
|
$action_firmware_update_description = "Ich bestätige, dass SN und HW vom Gerät gelesen wurden";
|
||||||
$action_maintenance = "action_maintenance";
|
$action_maintenance = "action_maintenance";
|
||||||
$action_maintenance_description = "Gerätefunktionalität getestet";
|
$action_maintenance_description = "Gerät getestet";
|
||||||
$action_serial = "action_serial";
|
$action_serial = "action_serial";
|
||||||
$action_serial_description = "Geräteseriennummernetikett regeneriert";
|
$action_serial_description = "Seriennummer des Geräts neu erstellt";
|
||||||
$action_replacement_body = "action_replacement_body";
|
$action_replacement_body = "action_replacement_body";
|
||||||
$action_replacement_body_description = "Gerätegehäuse ersetzt";
|
$action_replacement_body_description = "Gehäuse des Geräts ersetzt";
|
||||||
$action_replacement_pcb = "action_replacement_pcb";
|
$action_replacement_pcb = "action_replacement_pcb";
|
||||||
$action_replacement_pcb_description = "Geräte-PCB ersetzt";
|
$action_replacement_pcb_description = "PCB des Geräts ersetzt";
|
||||||
$action_replacement_battery = "action_replacement_body";
|
$action_replacement_battery = "action_replacement_battery";
|
||||||
$action_replacement_battery_description = "Batterien ersetzt";
|
$action_replacement_battery_description = "Batterien ersetzt";
|
||||||
$action_repaired_body = "action_repaired_body";
|
$action_repaired_body = "action_repaired_body";
|
||||||
$action_repaired_body_description = "Gerätegehäuse repariert";
|
$action_repaired_body_description = "Gehäuse des Geräts repariert";
|
||||||
$action_repaired_pcb = "action_repaired_pcb";
|
$action_repaired_pcb = "action_repaired_pcb";
|
||||||
$action_repaired_pcb_description = "Geräte-PCB repariert";
|
$action_repaired_pcb_description = "PCB des Geräts repariert";
|
||||||
$action_repaired_LED = "action_repaired_LED";
|
$action_repaired_LED = "action_repaired_LED";
|
||||||
$action_repaired_LED_description = "Geräte-LED repariert";
|
$action_repaired_LED_description = "LED des Geräts repariert";
|
||||||
$action_repaired_button = "action_repaired_button";
|
$action_repaired_button = "action_repaired_button";
|
||||||
$action_repaired_button_description = "Gerätetaste repariert";
|
$action_repaired_button_description = "Taste des Geräts repariert";
|
||||||
|
|
||||||
//Marketing
|
//Marketing
|
||||||
$marketing_h2 = "Marketing";
|
$marketing_h2 = 'Marketing';
|
||||||
$marketing_p = "Marketingkatalog";
|
$marketing_p = 'Marketing-Katalog';
|
||||||
|
|
||||||
//Abmelden
|
//Unsubscribe
|
||||||
$unscribe_msg1 = "E-Mail abgemeldet";
|
$unscribe_msg1 = 'E-Mail abgemeldet';
|
||||||
$unscribe_msg_error = "Etwas ist schiefgelaufen. Bitte wenden Sie sich für Hilfe an Ihren Lieferanten";
|
$unscribe_msg_error = 'Etwas ist schiefgelaufen, bitte wenden Sie sich an Ihren Anbieter zur Unterstützung';
|
||||||
|
|
||||||
//Cartest
|
//CarTest
|
||||||
$cartests_h2 = "Fahrzeugdatenbank";
|
$cartests_h2 = 'Auto-Datenbank';
|
||||||
$cartests_p = "Fahrzeugdetails anzeigen, verwalten und suchen.";
|
$cartests_p = 'Fahrzeugdetails anzeigen, verwalten und suchen.';
|
||||||
$cartest_h2 = 'Cartest';
|
$cartest_h2 = 'Cartest';
|
||||||
|
|
||||||
$cartest_charts = 'Testgraphen';
|
$cartest_charts = 'Testdiagramme';
|
||||||
|
|
||||||
$message_ct_1 = 'Cartest erfolgreich erstellt!';
|
$message_ct_1 = 'Cartest erfolgreich erstellt!';
|
||||||
|
|
||||||
$message_ct_2 = 'Cartest erfolgreich aktualisiert!';
|
$message_ct_2 = 'Cartest erfolgreich aktualisiert!';
|
||||||
|
|
||||||
$message_ct_3 = 'Cartest erfolgreich gelöscht!';
|
$message_ct_3 = 'Cartest erfolgreich gelöscht!';
|
||||||
|
$message_no_ct = 'Es gibt keine Cartests';
|
||||||
|
|
||||||
$message_no_ct = 'Es sind keine Cartests vorhanden';
|
$cartest_search = 'Fahrzeugmarke suchen...';
|
||||||
|
|
||||||
$cartest_search = 'Automarke suchen...';
|
|
||||||
|
|
||||||
$cartest_information = 'Cartest-Informationen';
|
$cartest_information = 'Cartest-Informationen';
|
||||||
|
|
||||||
$cartest_rowID = 'Test-ID';
|
$cartest_rowID = 'Test-ID';
|
||||||
|
$cartest_carbrand = 'Fahrzeugmarke';
|
||||||
$cartest_carbrand = 'Automarke';
|
$cartest_cartype = 'Fahrzeugtyp';
|
||||||
|
|
||||||
$cartest_cartype = 'Autotyp';
|
|
||||||
|
|
||||||
$cartest_carvin = 'VIN';
|
$cartest_carvin = 'VIN';
|
||||||
|
|
||||||
$cartest_details_text = 'Testdetails';
|
$cartest_details_text = 'Testdetails';
|
||||||
|
|
||||||
$cartest_created = 'Zeitstempel';
|
$cartest_created = 'Zeitstempel';
|
||||||
|
|
||||||
$cartest_tester = 'Tester';
|
$cartest_tester = 'Tester';
|
||||||
|
$cartest_device = 'Verwendetes Asset';
|
||||||
$cartest_device = 'Gebrauchtes Asset';
|
|
||||||
$cartest_device_hw = 'Verwendete Hardware';
|
$cartest_device_hw = 'Verwendete Hardware';
|
||||||
$cartest_device_sw = 'Verwendete Software';
|
$cartest_device_sw = 'Verwendete Software';
|
||||||
$cartest_questions_text = 'Frage & Antwort';
|
$cartest_questions_text = 'Frage & Antwort';
|
||||||
|
|
||||||
//---------------------------------
|
//CarTest headers
|
||||||
//CarTest-Header
|
|
||||||
//---------------------------------
|
|
||||||
$cartest_header_0 = 'Fahrzeugdaten';
|
$cartest_header_0 = 'Fahrzeugdaten';
|
||||||
$cartest_header_1 = 'Testergebnisse';
|
$cartest_header_1 = 'Testergebnisse';
|
||||||
$cartest_header_2 = 'PHEV oder EV';
|
$cartest_header_2 = 'PHEV oder EV';
|
||||||
$cartest_header_3 = 'Farbe der LED';
|
$cartest_header_3 = 'Farbe der LED';
|
||||||
$cartest_header_4 = 'Armaturenbrett-Anzeigen';
|
$cartest_header_4 = 'Dashboard-Anzeigen';
|
||||||
$cartest_header_5 = 'Allgemein';
|
$cartest_header_5 = 'Allgemein';
|
||||||
$cartest_header_6 = 'Ergebnisse nach dem Test';
|
$cartest_header_6 = 'Ergebnisse nach Test';
|
||||||
$cartest_header_7 = 'Hinweise';
|
$cartest_header_7 = 'Notizen';
|
||||||
|
|
||||||
//---------------------------------
|
//CarTest questions
|
||||||
//CarTest-Fragen
|
$cartest_1 = 'Auf P gehen';
|
||||||
//---------------------------------
|
|
||||||
$cartest_1 = 'Gehe zu P';
|
|
||||||
$cartest_2 = 'Aus D';
|
$cartest_2 = 'Aus D';
|
||||||
$cartest_3 = 'Möglicher Gangwechsel';
|
$cartest_3 = 'Möglicher Gangwechsel';
|
||||||
$cartest_4 = 'Beschleuniger abschalten';
|
$cartest_4 = 'Gaspedal schneidet ab';
|
||||||
$cartest_5 = 'Auf N gehen';
|
$cartest_5 = 'Auf N gehen';
|
||||||
$cartest_6 = 'Handbremse angezogen';
|
$cartest_6 = 'Handbremse an';
|
||||||
$cartest_7 = 'Antrieb durch Beschleuniger';
|
$cartest_7 = 'Antrieb durch Gaspedal';
|
||||||
$cartest_8 = 'EV oder PHEV';
|
$cartest_8 = 'EV oder PHEV';
|
||||||
$cartest_9 = 'ICE-Abschaltung';
|
$cartest_9 = 'ICE-Abschaltung';
|
||||||
$cartest_10 = 'ICE durch Beschleuniger einschalten';
|
$cartest_10 = 'ICE durch Gaspedal aktiviert';
|
||||||
$cartest_11 = 'Vor dem Einfügen';
|
$cartest_11 = 'Vor dem Einstecken';
|
||||||
$cartest_12 = 'Nach dem Einfügen 1 Sekunde';
|
$cartest_12 = 'Nach dem Einstecken 1 Sekunde';
|
||||||
$cartest_13 = 'Nach dem Einfügen 2 Sekunden';
|
$cartest_13 = 'Nach dem Einstecken 2 Sekunden';
|
||||||
$cartest_14 = 'Ladezeichen';
|
$cartest_14 = 'Zeichen des Ladens';
|
||||||
$cartest_15 = 'Keine Zeichen';
|
$cartest_15 = 'Keine Zeichen';
|
||||||
$cartest_16 = 'Ladefehler';
|
$cartest_16 = 'Ladefehler';
|
||||||
$cartest_17 = 'Alle anderen';
|
$cartest_17 = 'Sonstige';
|
||||||
$cartest_18 = 'Bewegt sich im Leerlauf';
|
$cartest_18 = 'Bewegt sich im Leerlauf';
|
||||||
$cartest_19 = 'Foto der Fahrgestellnummer aufgenommen';
|
$cartest_19 = 'Foto der VIN gemacht';
|
||||||
$cartest_20 = 'Foto der Fahrzeugübersicht';
|
$cartest_20 = 'Foto des Fahrzeugs aufgenommen';
|
||||||
$cartest_21 = 'In 5 Minuten wieder anschließen';
|
$cartest_21 = 'In 5 Minuten wieder verbinden';
|
||||||
$cartest_22 = 'Foto des Typenschilds';
|
$cartest_22 = 'Foto des Identifikationsschildes';
|
||||||
$cartest_23 = 'Möglicher Gangwechsel nach Ausbau EP';
|
$cartest_23 = 'Möglicher Gangwechsel nach Entfernung EP';
|
||||||
$cartest_24 = 'Motor direkt an nach Ausbau EP';
|
$cartest_24 = 'Motor direkt nach Entfernung EP an';
|
||||||
$cartest_25 = 'PHEV, ICE an nach Ausbau EP';
|
$cartest_25 = 'PHEV, ICE nach Entfernung EP an';
|
||||||
$cartest_26 = 'Erster Kontakt zum Neustart';
|
$cartest_26 = 'Erster Kontakt zum Neustart';
|
||||||
$cartest_27 = 'Verriegelung nach Ausbau geöffnet';
|
$cartest_27 = 'Schloss nach Entfernung offen';
|
||||||
$cartest_28 = 'Testergebnisse bestanden/nicht bestanden';
|
$cartest_28 = 'Testresultate Bestanden/Nicht bestanden';
|
||||||
|
|
||||||
$cartest_notes = 'Notizen';
|
$cartest_notes = 'Notizen';
|
||||||
|
|
||||||
//---------------------------------
|
//CarTest response
|
||||||
//CarTest-Antwort
|
|
||||||
//---------------------------------
|
|
||||||
$cartest_allowed_label0 = 'Antwort einfügen';
|
$cartest_allowed_label0 = 'Antwort einfügen';
|
||||||
$cartest_allowed_label1 = 'Ja';
|
$cartest_allowed_label1 = 'Ja';
|
||||||
$cartest_allowed_label2 = 'Nein';
|
$cartest_allowed_label2 = 'Nein';
|
||||||
@@ -767,15 +722,13 @@ $cartest_allowed_label8 = 'Rot';
|
|||||||
$cartest_allowed_label9 = 'Bestanden';
|
$cartest_allowed_label9 = 'Bestanden';
|
||||||
$cartest_allowed_label10 = 'Nicht bestanden';
|
$cartest_allowed_label10 = 'Nicht bestanden';
|
||||||
|
|
||||||
//---------------------------------
|
|
||||||
//BUILD REPORT
|
//BUILD REPORT
|
||||||
//---------------------------------
|
$buildreport_h2 = 'Bestand und Produktion';
|
||||||
$buildreport_h2 = 'Stock and Production';
|
$buildreport_p = 'Berichterstattung';
|
||||||
$buildreport_p = 'Reporting';
|
|
||||||
|
|
||||||
$buildreport_raw_text = 'Total number '.$product_location_raw;
|
$buildreport_raw_text = 'Gesamtanzahl '.$product_location_raw;
|
||||||
$buildreport_SFG_text = 'Total number '.$product_location_SFG;
|
$buildreport_SFG_text = 'Gesamtanzahl '.$product_location_SFG;
|
||||||
$buildreport_FG_text = 'Total number '.$product_location_FG;
|
$buildreport_FG_text = 'Gesamtanzahl '.$product_location_FG;
|
||||||
$buildreport_onstock_text = 'Total number '.$status2_text;
|
$buildreport_onstock_text = 'Gesamtanzahl '.$status2_text;
|
||||||
$data_build_sfg_view = $product_location_SFG.' produced in the last 7 days';
|
$data_build_sfg_view = $product_location_SFG.' in den letzten 7 Tagen produziert';
|
||||||
$data_build_fg_view = $product_location_FG.' produced in the last 7 days';
|
$data_build_fg_view = $product_location_FG.' in den letzten 7 Tagen produziert';
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ $paste_excel_2 = '1 nummer per regel';
|
|||||||
$products_h2 = 'Produkten';
|
$products_h2 = 'Produkten';
|
||||||
$product_h2 = 'Produkt';
|
$product_h2 = 'Produkt';
|
||||||
$products_p = 'Bekijk, update, en zoek produkten.';
|
$products_p = 'Bekijk, update, en zoek produkten.';
|
||||||
|
$product_data = 'Produkt informatie';
|
||||||
|
$product_version = 'Produkt versies';
|
||||||
|
|
||||||
$product_code = 'Produktcode';
|
$product_code = 'Produktcode';
|
||||||
$product_status = 'Status';
|
$product_status = 'Status';
|
||||||
$product_category = 'Categorie';
|
$product_category = 'Categorie';
|
||||||
@@ -267,6 +270,11 @@ $message_pr_2 = 'Produkt aangepast!';
|
|||||||
$message_pr_3 = 'Produkt verwijderd!';
|
$message_pr_3 = 'Produkt verwijderd!';
|
||||||
$message_no_products = 'Er zijn geen produkten';
|
$message_no_products = 'Er zijn geen produkten';
|
||||||
|
|
||||||
|
$product_version_number = 'Versie nummer';
|
||||||
|
$product_version_version = 'Versie';
|
||||||
|
$product_version_software = 'Software';
|
||||||
|
$product_version_measurement = 'Data';
|
||||||
|
|
||||||
//Users
|
//Users
|
||||||
$users_h2 = 'Gebruikers';
|
$users_h2 = 'Gebruikers';
|
||||||
$user_h2 = 'Gebruiker';
|
$user_h2 = 'Gebruiker';
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ $paste_excel_2 = '1 number per line';
|
|||||||
$products_h2 = 'Products';
|
$products_h2 = 'Products';
|
||||||
$product_h2 = 'Product';
|
$product_h2 = 'Product';
|
||||||
$products_p = 'View, manage, and search products.';
|
$products_p = 'View, manage, and search products.';
|
||||||
|
$product_data = 'Product information';
|
||||||
|
$product_version = 'Product versions';
|
||||||
|
|
||||||
$product_code = 'Productcode';
|
$product_code = 'Productcode';
|
||||||
$product_status = 'Status';
|
$product_status = 'Status';
|
||||||
$product_category = 'Category';
|
$product_category = 'Category';
|
||||||
@@ -266,6 +269,11 @@ $message_pr_2 = 'Product updated successfully!';
|
|||||||
$message_pr_3 = 'Product deleted successfully!';
|
$message_pr_3 = 'Product deleted successfully!';
|
||||||
$message_no_products = 'There are no products';
|
$message_no_products = 'There are no products';
|
||||||
|
|
||||||
|
$product_version_number = 'Versionnumber';
|
||||||
|
$product_version_version = 'Version';
|
||||||
|
$product_version_software = 'Software';
|
||||||
|
$product_version_measurement = 'Data';
|
||||||
|
|
||||||
//Users
|
//Users
|
||||||
$users_h2 = 'Users';
|
$users_h2 = 'Users';
|
||||||
$user_h2 = 'User';
|
$user_h2 = 'User';
|
||||||
|
|||||||
@@ -1252,6 +1252,25 @@ background-color: #13b368;
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn2 {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-decoration: none;
|
||||||
|
appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 0;
|
||||||
|
background: #bed4ea;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 0px 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 4px;
|
||||||
|
height: 20px;
|
||||||
|
margin: 2px;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
a.btn:after{
|
a.btn:after{
|
||||||
content: ' ';
|
content: ' ';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
Reference in New Issue
Block a user