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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
var hide_empty_list=true;
addListGroup("vehicles", "maj-category"); <? $majcatid = $_GET['majcatid']; $subcatid = $_GET['subcatid']; /* $dbh = mysql_connect("localhost", "man", "we11d0ne");
if (!$dbh) { die('Could not connect: ' . mysql_error()); } $selected = mysql_select_db("oneERP",$dbh) or die("Error"); */ require("inc/configure.php");
?> <? $sql = "select * from INV_CATEGORY_MAJ where status = 1 order by majcatid";
$result = mysql_query($sql); while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { if ($row{'majcatid'} == $majcatid) { ?> addList("maj-category", "<?=$row{'majcatname'}?>", "<?=$row{'majcatid'}?>", "<?=$row{'majcatid'}?>", 1); <? } else { ?> addList("maj-category", "<?=$row{'majcatname'}?>", "<?=$row{'majcatid'}?>", "<?=$row{'majcatid'}?>"); <? } } ?>
<? $sql = "select * from INV_CATEGORY_MAJ where status = 1";
$result = mysql_query($sql); while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { ?> addList("<?=$row{'majcatid'}?>", "Select sub category", "", "dummy-<?=$row{'majcatname'}?>"); <? $sqls = "select * from INV_CATEGORY_SUB where status = 1 and majcatid = ". $row{'majcatid'}." order by subcatid"; $results = mysql_query($sqls); while ($rows = mysql_fetch_array($results,MYSQL_ASSOC)) { if ($rows{'subcatid'} == $subcatid) { ?> addList("<?=$rows{'majcatid'}?>", "<?=$rows{'subcatname'}?>", "<?=$rows{'subcatid'}?>", "<?=$rows{'subcatname'}?>",1); <? } else { ?> addList("<?=$rows{'majcatid'}?>", "<?=$rows{'subcatname'}?>", "<?=$rows{'subcatid'}?>", "<?=$rows{'subcatname'}?>"); <? } } } ?>
|