/var/www/enzatesting.onesolution.hk/inv_stocktake_index.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php 
$formid 
"Inventory";
require_once 
"inc/configure.php";

$companyid setDefaultReqVar("companyid"$system_var['COMAPNY_FACTORY']);

if(
havePermission("STr")==false){
    
myerror(INVALID.WS.PERMISSION);    
}

search_orderField($_REQUEST['act'], $_REQUEST['customer'], $_REQUEST['launchdate_start'], $_REQUEST['launchdate_end'], $_REQUEST['deliverydate_start'], $_REQUEST['deliverydate_end'], $_REQUEST['finished'], $_REQUEST['status'] );    


 
?><!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><?=$system_var['COMPANY_NAME']?></title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<?php require_once "inc/jsheader.php"?>

<script>
$(document).ready(function() {
    $( "#launchdate_start" ).datepicker({
        dateFormat: "yy-mm-dd",
        showOn: "both",
/*        buttonImage: "images/calendar.gif",
        buttonImageOnly: true,*/
        defaultDate: "<?=$_REQUEST['launchdate_start']?>"
    });
    
    $( "#launchdate_end" ).datepicker({
        dateFormat: "yy-mm-dd",
        showOn: "both",
/*        buttonImage: "images/calendar.gif",
        buttonImageOnly: true,*/
        defaultDate: "<?=$_REQUEST['launchdate_end']?>"
    });

    $( "#deliverydate_start" ).datepicker({
        dateFormat: "yy-mm-dd",
        showOn: "both",
/*        buttonImage: "images/calendar.gif",
        buttonImageOnly: true,*/
        defaultDate: "<?=$_REQUEST['deliverydate_start']?>"
    });
    
    $( "#deliverydate_end" ).datepicker({
        dateFormat: "yy-mm-dd",
        showOn: "both",
/*        buttonImage: "images/calendar.gif",
        buttonImageOnly: true,*/
        defaultDate: "<?=$_REQUEST['deliverydate_end']?>"
    });                    
    
    $(".newStocktake").on("click", function(e){
        var c = confirm("<?=DO_YOU_WANT_TO_START_STOCK_TAKE?>? \n(<?=NO_INVENTORY_MOVEMENT_ALLOWED_DURING_STOCK_TAKE?>)");
        if(c){
            //start stock take
        }else{
            e.preventDefault();    
        }
    });
    
    $(".endStocktake").on("click", function(e){
        var c = confirm("<?=DO_YOU_WANT_TO_FINISH_STOCK_TAKE?>?");
        if(c){
            //finish stock take
        }else{
            e.preventDefault();    
        }
    });

    $(".slowReport").on('click', function(e){
        var c = confirm("<?=DO_YOU_WANT_TO_DOWNLOAD_THE_REPORT?>? \n(<?=IT_WILL_SLOW_DOWN_THE_SYSTEM?>)");
        if(c){
          //generate report
        }else{
          e.preventDefault(); 
        }   
    });
});    
</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="100%" 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">
            <form action="<?=realbasename($_SERVER['REQUEST_URI'])?>" method="post">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="search">
              <tr>
                <td width="120" valign="top" ><?=INVENTORY?>:<br />
                  <span class="stext1"><?=$companyid?> <?=STOCKTAKE?>:</span></td>
                <td valign="top">                
                
</td>
                <td align="right" valign="top">
                <?php 
                
if(havePermission("SIu")){
                    if(
inv_underStocktake($companyid)){ ?>
                        <span class="mod_menu"><a href="inv_stocktake_finish.php?action=stocktake_finish&companyid=<?=$companyid?>" class="endStocktake uibutton"><?=FINISH?><?=WS?><?=STOCKTAKE?></a></span>
                    <?php }else{ ?>
                        <span class="mod_menu"><a href="inv_stocktake_start.php?action=stocktake_start&companyid=<?=$companyid?>" class="newStocktake uibutton"><?=START?><?=WS?><?=STOCKTAKE?></a></span>
                    <?php }
                }
?>    
                </td>
              </tr>
            </table></form>
            </td>
          </tr>
          <tr>
            <td valign="top" class="c2_bg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td valign="top">
                <table width="100%" id="product_table" border="0" cellpadding="0" cellspacing="0" class="tablelist floathead">
                  <thead><tr>
                        <th><?=START?><?=WS?><?=DATE?></th>
                        <th><?=FINISH?><?=WS?><?=DATE?></th>
                        <th><?=USER?></th>
                        <th><?=REPORT?></th>
                    </tr></thead>
                                                        
<?php
    $sql 
"SELECT * FROM inv_stocktake WHERE companyid=:companyid ORDER BY startdate ASC";
    
    
$sth $dbh->prepare($sql);
    
$q $sth->execute( array(':companyid'=>$companyid) );
    
//echo $sth->getSQL( array(':companyid'=>$companyid) ) . HTML_EOL;
    
pdo_showerror($sth$q);
                            
    while(
$row $sth->fetch()) {    ?>
                  <tr>
                          <!--<td><a href="inv_stocktake_modifyform.php?refid=<?=$row['refid']?>" ><?=$row['ivc_nbr']?></a></td>-->
                        <td class="tdalignmid"><?=datef($row['startdate'])?></td>
                        <td class="tdalignmid"><?=datef($row['finishdate'])?></td>
                        <td class="tdalignmid"><?=$row['createby']?></td>
                        <td class="tdalignmid">
                            <?php if($row['finishdate']){ ?>
                                <a href="xls_inv_stocktake_report.php?companyid=<?=$companyid?>&refid=<?=$row['refid']?>&bomcategy=stone" target="_blank" title="<?=SLOW_REPORT?>" class="slowReport"><?=STONE?>*</a> |
                                <a href="xls_inv_stocktake_report.php?companyid=<?=$companyid?>&refid=<?=$row['refid']?>&bomcategy=diamond" target="_blank" title="<?=SLOW_REPORT?>" class="slowReport"><?=DIAMOND?>*</a> |
                                <a href="xls_inv_stocktake_report.php?companyid=<?=$companyid?>&refid=<?=$row['refid']?>&bomcategy=accessory" target="_blank" title="<?=SLOW_REPORT?>" class="slowReport"><?=ACCESSORY?>*</a>
                            <?php ?>
                        </td>

                  </tr>
<?php ?>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table>
        </td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>