/home/bjcompany/domains/benjabhorn.com/public_html/benjabhorn_group/control/UserGrant.php


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
69
70
71
72
73
74
75
<?php

        
//------------------------------------------------------------------------------------------------------    
            
$rowPerPage =200;
            
$thisFile=basename($PHP_SELF);
                if((!
$page)||($page==1)){
                            
$page=1;
                            
$startRow=0;
                    }else{
                            
$startRow=($page-1)*$rowPerPage;
                  }    
    
//------------------------------------------------------------------
    
$query ="DELETE IGNORE FROM tbl_admin_user WHERE id = '".$_POST['key']."' ";
    
mysql_query($query);
    
//-----------------------------------------------------------------
    
if($_POST['action']=='add'){
        if((
$_POST['admin_name'])&&($_POST['username'])&&($_POST['password'])){
                
$query " INSERT IGNORE INTO `tbl_admin_user` "
                
."(`id` ,`admin_name` ,`username` ,`password` ,`adminType` ) "
                
." VALUES ('' , '".$_POST['admin_name']."', '".$_POST['username']."', '".$_POST['password']."', '2') ";
                
mysql_query($query);
            }
    }
    
$query "SELECT * FROM  `tbl_admin_user` ORDER BY adminType  DESC ";
    
$result =mysql_query($query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>  <form action="<?php $PHP_SELF?>" method="post" name="form1">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
  <tr>
    <td colspan="2" class="txt10-black"><span class="kbank"><img src="images/black_icon/32x32/users.png" alt="" width="32" height="32" hspace="5" vspace="5" align="absmiddle" />User List</span></td>
  </tr>
  <tr>
    <td width="3%">&nbsp;</td>
    <td width="97%">
      <table width="550" border="0" cellpadding="3" cellspacing="0"  class="tableborder_full">
        <tbody>
          <tr>
            <td 
          height="15" colspan="3"  valign="top" nowrap="nowrap" class="txt10-brown"><img src="images/black_icon/16x16/users.png" width="16" height="16" hspace="10" vspace="5" align="absmiddle" />รายชื่อ admin </td>
            </tr>
          <?php $n=1; while($data=mysql_fetch_assoc($result)){ ?>
          <tr>
            <td width="19" align="center" bgcolor="#F7F7F7"><img src="images/black_icon/16x16/user.png" width="16" height="16" /></td>
            <td width="360" height="25" bgcolor="#F7F7F7" class="txt10-black">&nbsp;<?php echo $data['admin_name']?></td>
            <td bgcolor="#F7F7F7" class="txt10-black">
                    <input type="button" name="button" id="button" value="รายละเอียด" onclick="window.location.href='main.php?work=userToMenu&userID=<?php echo $data['id']?>' " /></td>
            </tr>
          <tr>
            <td colspan="3" align="center" bgcolor="#E6E6E6" height="1"></td>
            </tr>
          <!-- <tr>
      <td align="center" bgcolor="#CCCCCC">&nbsp;</td>
      <td width="307" bgcolor="#CCCCCC"><input name="udesc[<?php echo $data['id']?>]" type="text" id="udesc" size="50" maxlength="50" value="<?php echo $data['descrip']?>" /></td>
      <td width="112" align="center" bgcolor="#CCCCCC">&nbsp;</td>
    </tr> -->
          <?php $n++; } ?>
          </tbody>
        </table>
      <br />
      <input name="loop" type="hidden" value="<?php echo $n;?>" /></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table> </form>
</body>
</html>