CMXX - Product query updates

This commit is contained in:
“VeLiTi”
2025-02-25 11:10:00 +01:00
parent bc7e83efe9
commit 3a52632d61
19 changed files with 994 additions and 58 deletions

View File

@@ -57,7 +57,7 @@ if ($id != '' && $command == 'reset'){
$stmt->execute([$resetkey,$post_content['updatedby'],$id]);
//STEP 3 - Send DATA BACK TO FRONT_END
$messages = json_encode(array('consumer_email'=> $consumer_data['email'], "resetkey" => $resetkey), JSON_UNESCAPED_UNICODE);
$messages = json_encode(array('identity'=> $consumer_data['email'], "resetkey" => $resetkey), JSON_UNESCAPED_UNICODE);
//Send results
echo $messages;
exit;
@@ -69,7 +69,7 @@ if ($command == 'update'){
$stmt = $pdo->prepare('SELECT * FROM identity WHERE userkey = ?');
$stmt->execute([$id]);
$consumer_data = $stmt->fetch();
$post_content['updatedby'] = $consumer_data['email'];
if (isset($post_content['password'])){
@@ -82,6 +82,8 @@ elseif ($command == 'insert'){
$post_content['language'] = isset($post_content['language']) ? $post_content['language'] : 'US';
$post_content['profile'] = 0;
$post_content['isverified'] = 0;
$post_content['createdby'] = $username;
$post_content['updatedby'] = $username;
}
elseif ($command == 'login'){
@@ -103,7 +105,8 @@ elseif ($command == 'login'){
//CONSUMER LOGIN CORRECT RETURN DATA
$consumer = array(
'accountID' => $account['userkey'],
'profile' => $account['profile']
'profile' => $account['profile'],
'language' =>$account['language']
);
//Reset login count after succesfull attempt
@@ -173,6 +176,11 @@ if ($command == 'update' && (isAllowed('identity',$profile,$permission,'U') ===
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
//STEP 2- Send to user
$messages = json_encode(array('accountID' => $id,'status' => 'updated'), JSON_UNESCAPED_UNICODE);
//Send results
echo $messages;
exit;
}
elseif ($command == 'insert' && isAllowed('',$profile,$permission,'C') === 1){
@@ -188,7 +196,7 @@ elseif ($command == 'insert' && isAllowed('',$profile,$permission,'C') === 1){
$stmt->execute($execute_input);
//STEP 2- Send to user
$messages = json_encode(array('consumer_email'=> $post_content['email'],'accountID' => $account['userkey'],'profile' => $post_content['profile'], 'resetkey' => $resetkey), JSON_UNESCAPED_UNICODE);
$messages = json_encode(array('identity'=> $post_content['email'],'accountID' => $post_content['userkey'],'profile' => $post_content['profile'], 'resetkey' => $resetkey, 'language' =>$post_content['language']), JSON_UNESCAPED_UNICODE);
//Send results
echo $messages;
exit;

View File

@@ -70,7 +70,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
//QUERY AND VERIFY ALLOWED
if ($command == 'update' && isAllowed('products_configurations',$profile,$permission,'U') === 1){
$sql = 'UPDATE products_configurations SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
$sql = 'UPDATE products_configurations SET '.$clause.' WHERE rowID = ? ';
$execute_input[] = $id;
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
@@ -81,7 +81,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
$stmt->execute($execute_input);
}
elseif ($command == 'delete' && isAllowed('products_configurations',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM products_configurations WHERE rowID = ? '.$whereclause.'');
$stmt = $pdo->prepare('DELETE FROM products_configurations WHERE rowID = ? ');
$stmt->execute([ $id ]);
//Add deletion to changelog

View File

@@ -68,7 +68,7 @@ if (isset($post_content['product_id']) && $post_content['product_id'] != ''){
//QUERY AND VERIFY ALLOWED
if ($command == 'update' && isAllowed('products_media',$profile,$permission,'U') === 1){
$sql = 'UPDATE products_media SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
$sql = 'UPDATE products_media SET '.$clause.' WHERE rowID = ? ';
$execute_input[] = $id;
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
@@ -79,7 +79,7 @@ if (isset($post_content['product_id']) && $post_content['product_id'] != ''){
$stmt->execute($execute_input);
}
elseif ($command == 'delete' && isAllowed('products_media',$profile,$permission,'D') === 1){
$stmt = $pdo->prepare('DELETE FROM products_media WHERE rowID = ? '.$whereclause.'');
$stmt = $pdo->prepare('DELETE FROM products_media WHERE rowID = ? ');
$stmt->execute([ $id ]);
//Add deletion to changelog

View File

@@ -114,7 +114,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
$stmt->execute([$post_content['productrowid'], $hw_eq_version ]);
}
$sql = 'UPDATE products_software SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
$sql = 'UPDATE products_software SET '.$clause.' WHERE rowID = ? ';
$execute_input[] = $id;
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
@@ -134,7 +134,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
elseif ($command == 'delete' && isAllowed('products_software',$profile,$permission,'D') === 1){
//GET FILENAME AND REMOVE FROM SERVER
$sql = 'SELECT * FROM products_software WHERE rowID = ? '.$whereclause.'';
$sql = 'SELECT * FROM products_software WHERE rowID = ? ';
$stmt = $pdo->prepare($sql);
$stmt->execute([$id]);
//Get results
@@ -148,7 +148,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
}
}
$stmt = $pdo->prepare('DELETE FROM products_software WHERE rowID = ? '.$whereclause.'');
$stmt = $pdo->prepare('DELETE FROM products_software WHERE rowID = ? ');
$stmt->execute([ $id ]);
//Add deletion to changelog

View File

@@ -68,7 +68,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
//QUERY AND VERIFY ALLOWED
if ($command == 'update' && isAllowed('products_versions',$profile,$permission,'U') === 1){
$sql = 'UPDATE products_versions SET '.$clause.' WHERE rowID = ? '.$whereclause.'';
$sql = 'UPDATE products_versions SET '.$clause.' WHERE rowID = ? ';
$execute_input[] = $id;
$stmt = $pdo->prepare($sql);
$stmt->execute($execute_input);
@@ -79,7 +79,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
$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 = $pdo->prepare('DELETE FROM products_versions WHERE rowID = ? ');
$stmt->execute([ $id ]);
//Add deletion to changelog