/var/www/enzatesting.onesolution.hk/master_mat_pricelist_addformEUR.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php 
$formid 
"MaterialPriceList";
require_once 
"inc/configure.php";

if(
havePermission("GNr")==false){
    
myerror("Invalid Permission");    
}

$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : "";

$sql "SELECT *, date(createdate) as lastrecord from master_mat_pricelist order by createdate DESC limit 1";        
if (
defined("MSSQL")) {
    
$sql "SELECT TOP(1) *, CONVERT(date, createdate) as lastrecord from master_mat_pricelist order by createdate DESC ";        
}
//echo $sql;    
$sth $dbh->prepare($sql);
$sth->execute();
$row $sth->fetch(); 

$lastupdate = new DateTime($row['lastrecord']);
$today = new DateTime(date("Y-m-d"));

unset(
$sth);?>
<!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>ENZA</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<?php require_once "inc/jsheader.php"?>


<script>
function ConfirmNewPricelist(verify)
{
    if(verify==1){
        return confirm("Are you sure you want to update the material price list?");
    }
    return true;
}
</script>

</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" class="top"><?php require"mod_webhead.php"?></td>
  </tr>
  <tr>
    <td><table width="1000" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="200" valign="top" class="menu_bg"><?php require"mod_menu.php"?></td>
        <td valign="top" class="padding1"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr></tr>
          <tr>
            <td class="c1_bg"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="search">
              <tr>
                <td width="90" valign="top" ><span class="stext1"><?=MATERIAL?> <?=PRICE_LIST?></span></td></tr>
            </table></td>
          </tr>
          <tr>

            <td valign="top" class="c2_bg">
            
<!-- content-->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablelist">
<!--                  <tr>
                    <th align="left">ModifyForm</th>
                    <th align="left">Table</th>
                    </tr>-->
                  <tr>
                    <td valign="top"><!--master add form-->
<?php if(havePermission("GNu")){ //GN-----------------------------------?>   

<form action="master_mat_pricelist_add.php" method="post" onsubmit="return ConfirmNewPricelist(<?=($today==$lastupdate)?1:0?>)">
<input type="hidden" name="id" value="<?=$row['refid']?>" />
<table width="100%">
<tr>
    <th colspan="5"><?=MATERIAL?> <?=PRICE_LIST?></th>
</tr>
<tr>
    <td><?=DATE?></td>
    <td><?=date("Y-m-d")?></td>
</tr>
<tr>
    <td><?=GOLD?></td>
    <td><input name="gold" type="text" class="positive" value="<?=numf($row['gold'])?>" /></td>
    <td><?=SILVER?></td>
    <td><input name="silver" type="text" class="positive" value="<?=numf($row['silver'])?>" /></td>
    <td>&nbsp;</td>
</tr>

<tr>
    <td><?=PLATINUM?></td>
    <td><input name="platinum" type="text" class="positive" value="<?=numf($row['platinum'])?>" /></td>
    <td><?=COPPER?></td>
    <td><input name="copper" type="text" class="positive" value="<?=numf($row['copper'])?>" /></td>
    <td>&nbsp;</td>
</tr>
<tr>
    <td><?=ALUMINUM?></td>
    <td><input name="aluminum" type="text" class="positive" value="<?=numf($row['aluminum'])?>" /></td>
    <td>USD/CNY</td>
  <td><input name="usd-cny" type="text" class="positive" value="<?=numf($row['usd-cny'],4)?>" /></td>
  <td>USD/EUR</td>
  <td><input name="usd-eur" type="text" class="positive" value="<?=numf($row['usd-eur'],4)?>" /></td>
  <td>&nbsp;</td>
</tr>
<tr>
  <td>USD/EURO</td>
  <td><input name="usd-eur" type="text" class="positive" value="<?=numf($row['usd-eur'],4)?>" /></td>
    <td class="tdalignright"><input name="<?=SUBMIT?>" value="<?=SUBMIT?>" type="submit" class="pressnhide2" />&nbsp;<input name="Cancel" value="<?=CANCEL?>" type="button" onclick="location.href='master_mat_pricelist_addform.php'"/><input type="hidden" name="action" value="master_mat_pricelist_add"/></td>
</tr>
</table>
</form>
<?php //END of GN--------------------------------------------------?>
<!-- end of addform--></td>
                    </tr>
<?php if(havePermission("GNr")){ //GN---------------------------------?>                    
                    <tr>
                    <td valign="top" align="right"><?=master_materialpricelist_table(20$from$to);?></td>
                    </tr>
<?php //END of GN--------------------------------------------------?> 
                </table></td>
              </tr>
            </table>
<!-- end of content-->            
            </td>

          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>