CMXX - Upgrade products_software
This commit is contained in:
@@ -53,6 +53,7 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
|
||||
$input_insert = '';
|
||||
|
||||
if ($command == 'insert'){
|
||||
$post_content['latest'] = 1; //New software is always latest
|
||||
$post_content['created'] = $date;
|
||||
$post_content['createdby'] = $username;
|
||||
}
|
||||
@@ -86,6 +87,13 @@ if (isset($post_content['productrowid']) && $post_content['productrowid'] != '')
|
||||
$stmt->execute($execute_input);
|
||||
}
|
||||
elseif ($command == 'insert' && isAllowed('products_software',$profile,$permission,'C') === 1){
|
||||
|
||||
//REMOVE LATEST FLAG FROM OTHER
|
||||
$sql = 'UPDATE products_software SET latest = 0 WHERE productrowid = ?';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$post_content['productrowid']]);
|
||||
|
||||
//INSERT NEW ITEM
|
||||
$sql = 'INSERT INTO products_software ('.$clause_insert.') VALUES ('.$input_insert.')';
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($execute_input);
|
||||
|
||||
Reference in New Issue
Block a user