Sealing against XSS atacks: purchasing,sales,install,admin,taxes
[fa-stable.git] / sales / includes / db / credit_status_db.inc
1 <?php
2
3 function add_credit_status($description, $disallow_invoicing)
4 {
5         $sql = "INSERT INTO ".TB_PREF."credit_status (reason_description, dissallow_invoices) 
6                 VALUES (".db_escape($description).",$disallow_invoicing)";
7                 
8         db_query($sql, "could not add credit status");          
9 }
10
11 function update_credit_status($status_id, $description, $disallow_invoicing)
12 {
13         $sql = "UPDATE ".TB_PREF."credit_status SET reason_description=".db_escape($description).",
14                 dissallow_invoices=$disallow_invoicing WHERE id=$status_id";
15         
16         db_query($sql, "could not update credit status");                       
17 }
18
19 function get_all_credit_status()
20 {
21         $sql = "SELECT * FROM ".TB_PREF."credit_status";
22         
23         return db_query($sql, "could not get all credit status");
24
25
26 function get_credit_status($status_id)
27 {
28         $sql = "SELECT * FROM ".TB_PREF."credit_status WHERE id=$status_id";
29         
30         $result = db_query($sql, "could not get credit status");
31         
32         return db_fetch($result);
33 }
34
35 function delete_credit_status($status_id)
36 {
37         $sql="DELETE FROM ".TB_PREF."credit_status WHERE id=$status_id";
38                 
39         db_query($sql, "could not delete credit status");       
40 }
41
42 ?>