forked from sitracker/sitracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete_product_skill.php
More file actions
41 lines (34 loc) · 1.38 KB
/
delete_product_skill.php
File metadata and controls
41 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// delete_product_skill.php
//
// SiT (Support Incident Tracker) - Support call tracking system
// Copyright (C) 2010-2014 The Support Incident Tracker Project
// Copyright (C) 2000-2009 Salford Software Ltd. and Contributors
//
// This software may be used and distributed according to the terms
// of the GNU General Public License, incorporated herein by reference.
//
// Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net>
// Removes link between a product and skill
require ('core.php');
$permission = PERM_UNLINK_SKILLS_PRODUCTS;
require (APPLICATION_LIBPATH . 'functions.inc.php');
$title = "{$strDisassociateSkillWithProduct}";
// This page requires authentication
require (APPLICATION_LIBPATH . 'auth.inc.php');
// External variables
$productid = clean_int($_REQUEST['productid']);
$softwareid = clean_int($_REQUEST['softwareid']);
if (!empty($productid) AND !empty($softwareid))
{
$sql = "DELETE FROM `{$dbSoftwareProducts}` WHERE productid='{$productid}' AND softwareid='{$softwareid}' LIMIT 1";
mysqli_query($db, $sql);
if (mysqli_error($db)) trigger_error("MySQL Query Error ".mysqli_error($db), E_USER_ERROR);
journal(CFG_LOGGING_NORMAL, 'Skill Unlinked', "Skill $softwareid was unlinked from Product $productid", CFG_JOURNAL_PRODUCTS, $productid);
html_redirect("products.php");
}
else
{
html_redirect("products.php", FALSE, "{$strRequiredDataMissing}");
}
?>