/var/www/(Del)pathways.org.hk/admin/custemailmodifyform.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?
//require 'db_connect.php';
require 'check_login.php';
if (
$logged_in <> 1) {
    echo(
"<script language=\"javascript\">"); 
    echo(
"top.location.href = \"login.php\";"); 
    echo(
"</script>");
    return;
}
else
{
?>
<?php 
require("configure.php");
mysql_query("SET NAMES UTF8"); ?>
<?
$custemailid    
$_GET['custemailid'];
?>
<html>
<head>
<link rel="stylesheet" href="main.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Page</title>
</head>
<body>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr>
<td class='pagetitle' align="left"><b>Modify</b></td>
<td class='pagetitle' align="right"><a href="custemailindex.php" class="pagetitle">Back</a></td>
</tr>
</table>
<?
$result 
mysql_query("SELECT * FROM custemail where custemailid="$custemailid ." ");
$row mysql_fetch_array($result,MYSQL_ASSOC)
?>
<form action="custemailmodify.php" method="post" name="addform">
    <input type="hidden" name="custemailid" value="<?=$custemailid?>">
    <table border="0" cellpadding="0" cellspacing="2" width="600">
        <tr>
          <td class='content' align="right" valign="top">Name</td>
          <td class='content' valign="top">:&nbsp;</td>
            <td class='content'><input type="text" class="content" name="custemailname" size="25" value="<?=$row{'custemailname'}?>"></td>
        </tr>
        <tr><td class='content' align="right" valign="top">Email Address</td><td class='content' valign="top">:&nbsp;</td>
            <td class='content'><input type="text" class="content" name="custemailaddress" size="25" value="<?=$row{'custemailaddress'}?>"></td>
        </tr>
        <tr><td width="100" align="right" valign="top" class='content'>Group</td>
        <td class='content' valign="top">:&nbsp;</td>
            <td class='content'><select name="emailgroupid" class="content">
            <option value=" ">--------------</option>
            <?php
            $result1 
mysql_query("SELECT * from emailgroup order by emailgroupname asc ");
            while (
$row1 mysql_fetch_array($result1,MYSQL_ASSOC))
            {
            
?>                
                <option value="<?=$row1{'emailgroupid'}?><?=getSelect($row{emailgroupid}, $row1{emailgroupid})?>>
                    <?=$row1{'emailgroupname'}?>
                </option>                
            <?
            
}
            
?>
            </select>
            </td></tr>
        <tr><td colspan="2"></td><td>
            <input type="submit" value="Modify" class='content'>
        </td></tr>
  </table>
</form>
</body>
</html>
<?
}
?>
<?
function getSelect($field1$field2)
{
    if (
$field1 == $field2)
    {
        return 
"selected";
    }
    else
    {
        return 
"";
    }
}
?>
<?
function checkoption($a,$b)
{
    if (
$a == $b)
        return 
"selected";
    else
        return 
"";
}

?>