/
six_man.php
773 lines (546 loc) · 22.7 KB
/
six_man.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
<?php
session_start();
$l_klient=$_SESSION['l_klient'];
//echo $l_klient;
$id_user=$_SESSION['id_user'];
include 'header.php';
$serwer = "localhost";
$login = "root";
$haslo = "krasnal";
$baza = "dbs3";
$tabela = "Sub_cat";
include 'menu_header.php';
include 'header_mysql.php';
include 'config_six.php';
include 'functions_ebay.php';
//flag fro clear barcode
$CLEAR_SALES=1;
$read=0;
$read=$_SESSION['read'];
$site_id;
if(isset($_SESSION['meter']))
unset($_SESSION['meter']);
function swap_hash($in)
{
for($i=0;$i<=45;$i++)
{
if($in[$i]=='#')
{
$in[$i]='\\';
}
};
return $in;
}
function swap_back($in)
{
for($i=0;$i<=45;$i++)
{
if($in[$i]=='\\')
{
$in[$i]='#';
}
};
return $in;
}
?>
<?php
/* Specify the server and connection string attributes. */
//$serverName = "(local)";
//$serverName="TEST-PC\SIXBITDBSERVER";
//$connectionInfo = array( "Database"=>"SixBit_BT_001");
if($SIX_WORK==1)
{
//$serverName="GRRSERVER\TEMPSERVER";
//change dne on 02 June
//$serverName="MRLCPWORK\MRLCPSQLSERVER";
$serverName="MRLCPWORK\SQLTRIALSERVER";
$serverName="SQLSERVER\GRR";
$connectionInfo = array("UID" => "lukas", "PWD" => "lukas", "Database"=>"SixBitServer");
}
else {
$serverName="TEST-PC\SIXBITDBSERVER";
$connectionInfo = array( "Database"=>"SixBit_BT_001");
}
/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
/* Query SQL Server for the login of the user accessing the
database. */
$tsql = "SELECT CONVERT(varchar(32), SUSER_SNAME())";
$stmt = sqlsrv_query( $conn, $tsql);
if( $stmt === false )
{
echo "Error in executing query.</br>";
die( print_r( sqlsrv_errors(), true));
}
/* Retrieve and display the results of the query. */
$row = sqlsrv_fetch_array($stmt);
echo "User login: ".$row[0]."</br>";
$result = sqlsrv_query($conn,"select distinct Items.ItemID, Items.Title, Inventory.SKU, Orders.BuyerID,
Sales.SaleDate, Orders.StatusID, Shipments.TrackingNumber, Addresses.FirstName, Addresses.LastName,
Addresses.AddressLine1,Addresses.AddressLine2,Addresses.AddressLine3,Addresses.City,
Addresses.State,Addresses.PostalCode, Addresses.Country
from Orders
left join Shipments on Shipments.OrderID=Orders.OrderID
left join Sales on Sales.ShipmentID = Shipments.ShipmentID
INNER JOIN SalesPurchases ON SalesPurchases.SaleID=Sales.SaleID
INNER JOIN Purchases ON Purchases.PurchaseID = SalesPurchases.PurchaseID
Inner Join Inventory ON Inventory.InventoryID = Purchases.InventoryID
INNER Join Addresses ON Addresses.AddressID=Shipments.ShippingAddressID
INNER JOIN Items ON Items.ItemID = Inventory.ItemID where Orders.StatusID='100000' AND Orders.ExternalOrderID>270000");
//Sales.SaleDate > '2013-11-29' AND
//Shipments.TrackingNumber='' AND
if (!$result) {
die('Query failed.');
}
$i=0;
echo "<table border='2'>";
/* Free statement and connection resources. */
?>
<?php
if(isset($_POST['small_bar']))
{
//here we need to provide an interface to detect barcode number in set so what is not empty is reall one processed
$small_bar=$_POST['dbs0'];
print("ADDING a cross reference to ");
print $small_bar;
$barcode=$small_bar;
$item_id=$_POST['item_id'];
$buyer_id=$_POST['buyer_id'];
echo $item_id;
echo $buyer_id;
$added=insert_six_barcode_sells($item_id, $buyer_id,$barcode, $conn);
//here we pick up the error messages
$id_barcode=get_barcode_id($barcode); //This means if barcode is actually tested or not
$TESTED=check_barcode_test($id_barcode);
if($TESTED==1)
echo "tested";
else
echo "Not tested";
if($added==1)
{
echo $added;
$MESG="Item ".$barcode." Sold.";
}
else if($added==0)
$MESG="Item failed to be sold.";
if(empty($id_barcode))
{
// $MESG="This is not valid barcode format";
$MESG=" This item needs further attention. Please contact supervisor.";
//if not there than check if used valid barcode format
if($val=validate_barcode($small_bar))
$MESG=" This item is not valid barcode format ";
}
else
if($TESTED==1)
;
else
$MESG .= " This item needs further attention. Please contact supervisor.";
if(check_barcode_ebay($barcode)==0 AND $added==0)
$MESG.=" Item already sold on ebay";
}
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
//if confirm posted than do this. Maybe here we fill put the query for adding to six barcode
if(isset($_POST['Confirm']))
{
$connect=mysql_connect('localhost','root','krasnal')
or die(mysql_error());
mysql_select_db('dbs3');
$sales_num=$_POST['sales_number'];
if(isset($_GET['ebay']))
$sales_num=$_GET['ebay'];
echo $sales_number;
$select="UPDATE six_barcode SET conf='1' Where ebaysales='$sales_num'";
$result=mysql_query($select) or die(mysql_error());
//$rek=mysql_fetch_array($result);
echo "Sales Confirmed";
}
?>
<HTML>
<HEAD>
<?php
/*
echo '<script type="text/javascript">';
echo "document.getElementByClassName('au_sub')[0].click();";
//echo "document.getElementById('dateForm').submit();"; // SUBMIT FORM
echo "</script>";
*/
?>
<!--<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="dist/css/bootstrap.min.css" rel="stylesheet" media="screen">
<!--
<link rel="stylesheet" href="layout.css " type="text/css">
<link rel="stylesheet" href="form_cat.css " type="text/css">
<link href="design.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="design.css" type="text/css" />
-->
<link rel="stylesheet" href="layout.css " type="text/css">
<link rel="stylesheet" href="form_cat.css " type="text/css">
<link rel="stylesheet" type="text/css" href="csshorizontalmenu.css" />
<!-- <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> -->
<script type="text/javascript" src="csshorizontalmenu.js" >
</script>
<script type="text/javascript" src="jquery-1.10.2.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="dist/js/bootstrap.min.js"></script>
</HEAD>
<BODY >
<table border=1 width=100% height=800 bgcolor="F8F8F8" >
<tr>
<td colspan=2 width=100% height=5% align=right>
<table border="0" cellpadding="1" cellspacing="3" bgcolor="#F8F8F8">
<?php
//F8F8F8 F0F0F0 #E0E0E0
if(empty($l_klient))
{
$log='<form action="log_pro.php" method="post">
<td>Login</td><td><input type="text" name="login"></td>
<td>Password</td><td><input type="password" name="pass"></td>
<tr>
<td></td><td></td><td></td><td><input type="submit" name="Submit" value="Log In" align="right"> </td>
</tr>
</form>';
echo $log;
}
else
echo "You are Logged In as ".$l_klient;
?>
</table>
</td></tr>
<tr bgcolor="#E0E0E0">
<td colspan=2 width=100% height=15% align=center valign=center> GRR Database System 2
</td>
</tr>
<tr>
<td colspan=2 width=100% height=25px align=right bgcolor="#E0E0E0">
<?php show_menu(); ?>
</td>
</tr>
<tr>
<td colspan=2 width=100% height=90% align=left valign=top>
<?php // <p>Welcome in the System: echo $_SESSION['name1']; </p>
$autofocus="autofocus=''";
$AUTO_FOCUS=1; //0 no 1 ebay reference 2 dbs
$AUTO_FOCUS=$_SESSION['AUTO_FOCUS'];
//LETS ADD PROCESSING FUNCTION HERE
connect_db();
$query="SELECT * From Origin ";
//this can be twofold, both distinct inner join or every site place distinctivel from origin tabel
//INNER JOIN Site ON Origin.origin_id=Site.Origin_origin_id
$result=query_select($query);
$users=array();
$names=array();
$batch_date=array();
$i=0;
while($rek = mysql_fetch_array($result,1))
{
$i++;
$users[$i]=$rek["post_code"];
$names[$i]=$rek["town"];
$origin[$i]=$rek["origin_id"];
//$batch_date[$i]=$rek["batch_date"];
// echo $users[$i].$names[$i];
}
?>
<?php if(isset($_GET['test'])) {
echo "Item with Barcode <B>".$_GET['test']."</B> added to the System ";} ?>
<center><h4>E-bay Sells </h4></center>
</BR>
</BR>
</BR>
<div style="margin: 10px;">
<form name="dataForm" id="dataForm" <?php if(isset($_POST['small_bar'])) echo 'id="dateForm"';?> action="six_man.php" method="POST" >
<table>
<tr>
<td>
<input type="text" name="sales_number" value="<?php if(empty($_POST['sales_number'])) echo $_POST['sales_ref'];
//else echo $_POST['sales_number']; ?>" placeholder="Ebay ref. numb." <?php if($AUTO_FOCUS==0)echo $autofocus; ?> style=" margin:15px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
box-shadow: rgba(0,0,0, 0.1) 0px 0px 2px;
-moz-box-shadow: rgba(0,0,0, 0.01) 0px 0px 2px;
-webkit-box-shadow: rgba(0,0,0, 0.01) 0px 0px 2px;
border-collapse:collapse;" ><label for="date">E-bay Reference Sales Number</date>
</td>
<!-- <td>
<input type="text" name="barcode" value="<?php echo $_POST['barcode']; ?>" placeholder="DBS Barcode." <?php if($AUTO_FOCUS==2)echo $autofocus; ?> ><label for="date">Uniqu item</date>
</td>-->
</tr><tr><td>
<!-- <input type="text" name="sales_number" value="<?php //echo $_POST['sales_number']; ?>"> -->
<input type="submit" name="Generate" value="Sell" style=" margin:15px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
box-shadow: rgba(0,0,0, 0.1) 0px 0px 2px;
-moz-box-shadow: rgba(0,0,0, 0.01) 0px 0px 2px;
-webkit-box-shadow: rgba(0,0,0, 0.01) 0px 0px 2px;
border-collapse:collapse;
">
<script type="text/javascript">
//document.dataForm.Generate.click();
</script>
<!-- <input type="checkbox" name="print_out" value="yes" <?php //if(isset($_POST['print_out'])) echo 'checked=""'; ?> >Individual customer<br> -->
</form>
</td></tr> </table>
<style>
label{
margin-left: 10px;
color: #999999;
font: normal 13px/100% Verdana, Tahoma, sans-serif;
}
</style>
</div>
<?php
if(isset($_POST['Generate'])OR isset($_GET['ebay']))
{
echo '<p style="margin-left: 10px;">';
// echo "</BR><b>Transaction inventory: </b></BR></BR>";
// Searching ond output results module
if(empty($_POST['date'])AND empty($_POST['site']))
{
$select_list="select distinct Items.ItemID, Items.Title, Inventory.SKU, Orders.BuyerID,
Sales.SaleDate, Orders.StatusID, Shipments.TrackingNumber, Addresses.FirstName, Addresses.LastName,
Addresses.AddressLine1,Addresses.AddressLine2,Addresses.AddressLine3,Addresses.City,
Addresses.State,Addresses.PostalCode, Addresses.Country
from Orders
left join Shipments on Shipments.OrderID=Orders.OrderID
left join Sales on Sales.ShipmentID = Shipments.ShipmentID
INNER JOIN SalesPurchases ON SalesPurchases.SaleID=Sales.SaleID
INNER JOIN Purchases ON Purchases.PurchaseID = SalesPurchases.PurchaseID
Inner Join Inventory ON Inventory.InventoryID = Purchases.InventoryID
INNER Join Addresses ON Addresses.AddressID=Shipments.ShippingAddressID
INNER JOIN Items ON Items.ItemID = Inventory.ItemID where Orders.StatusID='100000' AND Orders.ExternalOrderID>270000";
//Shipments.TrackingNumber='' AND
//Sales.SaleDate > '2013-11-29' AND
}
else if(!empty($_POST['date']))
{
$dd_s=$_POST['date'];
$select_list="SELECT DISTINCT town,batch_date,site_ref_number,site_id,source_id, SUM(sum_weight) as sum FROM site
INNER JOIN Origin ON site.Origin_origin_id=origin.origin_id
INNER JOIN site_has_cat ON site_has_cat.Site_site_id=site.site_id
INNER JOIN source ON source.source_id=origin.Source_source_id WHERE batch_date='$dd_s'
GROUP BY town;
";
}
else if(!empty($_POST['site']))
{
$dd_t=$_POST['site'];
$select_list="SELECT DISTINCT town,batch_date,site_ref_number,site_id,source_id, SUM(sum_weight) as sum FROM site
INNER JOIN Origin ON site.Origin_origin_id=origin.origin_id
INNER JOIN site_has_cat ON site_has_cat.Site_site_id=site.site_id
INNER JOIN source ON source.source_id=origin.Source_source_id WHERE origin_id='$dd_t'
GROUP BY town;
";
}
if(!empty($_POST['date'])AND !empty($_POST['site']))
{
$dd_t=$_POST['site'];
$dd_s=$_POST['date'];
$select_list="SELECT DISTINCT town,batch_date,site_ref_number,site_id,source_id, SUM(sum_weight) as sum FROM site
INNER JOIN Origin ON site.Origin_origin_id=origin.origin_id
INNER JOIN site_has_cat ON site_has_cat.Site_site_id=site.site_id
INNER JOIN source ON source.source_id=origin.Source_source_id WHERE origin_id='$dd_t' AND batch_date='$dd_s'
GROUP BY town;
";
}
//$serverName="TEST-PC\SIXBITDBSERVER";
//$connectionInfo = array( "Database"=>"SixBit_BT_001");
if($SIX_WORK==1)
{
//$serverName="GRRSERVER\TEMPSERVER";
// 2 June
//$serverName="MRLCPWORK\MRLCPSQLSERVER";
$serverName="MRLCPWORK\SQLTRIALSERVER";
$serverName="SQLSERVER\GRR";
$connectionInfo = array("UID" => "lukas", "PWD" => "lukas", "Database"=>"SixBitServer");
}
else {
$serverName="TEST-PC\SIXBITDBSERVER";
$connectionInfo = array( "Database"=>"SixBit_BT_001");
}
/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
/* Retrieve and display the results of the query. */
$sales=$_POST['sales_number'];
if(isset($_GET['ebay']))
$sales=$_GET['ebay'];
$select_list="select distinct Items.ItemID, Items.Title, Inventory.SKU, Orders.BuyerID,
Sales.SaleDate, Orders.StatusID, Shipments.TrackingNumber, Addresses.FirstName, Addresses.LastName,
Addresses.AddressLine1,Addresses.AddressLine2,Addresses.AddressLine3,Addresses.City,
Addresses.State,Addresses.PostalCode, Addresses.Country, Shipments.IsShipped, Sales.QtySold, Orders.ExternalOrderID
from Orders
left join Shipments on Shipments.OrderID=Orders.OrderID
left join Sales on Sales.ShipmentID = Shipments.ShipmentID
INNER JOIN SalesPurchases ON SalesPurchases.SaleID=Sales.SaleID
INNER JOIN Purchases ON Purchases.PurchaseID = SalesPurchases.PurchaseID
Inner Join Inventory ON Inventory.InventoryID = Purchases.InventoryID
INNER Join Addresses ON Addresses.AddressID=Shipments.ShippingAddressID
INNER JOIN Items ON Items.ItemID = Inventory.ItemID where Orders.StatusID='100000' AND Orders.ExternalOrderID='$sales' AND Orders.ExternalOrderID>270000";
// Shipments.TrackingNumber='' AND
//Sales.SaleDate > '2013-11-29' AND
$result = sqlsrv_query($conn,$select_list,array());
if (!$result) {
die('Query failed.');
}
//while($rek_list=sqlsrv_fetch_array($result,SQLSRV_FETCH_BOTH))
// echo $rek_list[0];
//$result_list=mysql_query($select_list)or die(mysql_error());
// $num_list_row= sqlsrv_num_rows($result);
// echo $num_list_row;
$i=-1;
$state=0;
// for($i=0;$i<$num_list_row;$i++)
while($rek_list=sqlsrv_fetch_array($result))
{
if($AUTO_FOCUS==0)
$_SESSION['AUTO_FOCUS']+=1;
//echo "</br>";
//echo $i;
$i++;
// echo $rek_list[0];
//echo "<form action='manifest_rep_print.php' method='POST'";
$stock_nr=swap_back($rek_list[2]);
//not stock number but u_barcode stock_nr
//HERE we come to a problem while the main reason is stock number comparison, while shall be ebaysales
//Beg
$check_sql="SELECT * FROM six_barcode WHERE stock_number='$stock_nr'";
//aleternative comparisobn
//asign $rek_list[18] that is ebay ref number
$ebay_ref=$rek_list[18];
$check_sql="SELECT * FROM six_barcode WHere ebaysales='$ebay_ref'";
//END
$result_my = mysql_query($check_sql);
$rek_ch=mysql_fetch_array($result_my);
$num_ro=mysql_num_rows($result_my);
if($rek_list[17]==$num_ro)
{
$read=1;
$_SESSION['read']=1;
if($rek_ch[19]==1)
unset($_SESSION['read']);
}
if($rek_ch[6]==$stock_nr)
{
$state=12;
}
// echo $rek_ch[6].$stock_nr;
echo "<table><tr><td>".($i+1).".</td><td> Shipped to: <b>";
echo $rek_list[7]." ".$rek_list[8];
echo "</b></td><td>item: <b>";
echo $rek_list[1];
echo "</b> ";
if($state==1)
echo "Sold on Ebay";
echo " </td><td> specified by barcode : <b>";
echo $rek_list[2];
echo "</b></td><td> <b>QTy: ";
//print(intval($rek_list['sum']));
echo $rek_list[17];
echo "</td><td>";
echo $track=$rek_list[6];
echo "</td><td>";
echo $rek_list[18];
echo "</td><td>";
echo $num_ro;
echo "</td><td>";
echo $rek_list[16];
echo "</b></td><td> Date sold: <b>";
echo $rek_list[4]->format('Y-m-d');
// echo date('d-M-Y', strtotime($rek_list[4]));
echo "</b></td></tr>";
echo "<tr></tr><tr></tr><tr></BR><td colspan='4'></td><td style='font-size:11px'></BR>";
//10 cat 1.
echo "<form action='six_man.php' method='POST'>";
// $source= str_replace("H", "", $rek_list['source_id']);
// $date_r=$rek_list['batch_date'];
// $site_ref_num=$rek_list['site_ref_number'];
$item_id=$rek_list[0];
$buyer_id=$rek_list[3];
//echo "ssd";
echo "<input type='hidden' name='item_id' value='".$item_id."'>";
echo "<input type='hidden' name='buyer_id' value='".$buyer_id."'>";
echo "<input type='hidden' name='date_r' value='".$date_r."'>";
echo "<input type='hidden' name='source' value='".$source."'>";
$sales_ref=$_POST['sales_number'];
echo "<input type='hidden' name='sales_ref' value='".$sales_ref."'>";
// echo "<input type='Submit' name='ten_cat' value='Generate 10 categories Sheet'>";
//echo $rek_list[17];
//echo $num_ro;
//this statement block the selling button
if($rek_list[17]==$num_ro)
{
echo "<input type='Submit' name='sold' value='Sold' disabled>";
// echo "Debug".$rek_list[17];
}
else
{
$items=$rek_list[17];
//echo "Debug".$rek_list[17];
$sold=check_sold_transaction($barcode, $item_id);
//IS A BUG SOME RECORD DOESNT SHOW
for($i=0;$i<$items-$sold;$i++)
{
if($AUTO_FOCUS==1)
{
//here we check if one sold by un barcode and stock number if yes than decrement showing list by one and show list sold intead
echo "<input type='text' name='dbs".$i."' value='' placeholder='Item sold..".$rek_list[2]."' autofocus=''>";
echo "<input type='Submit' name='small_bar' value='Sell'></BR>";
}
}
}
//echo $track;
echo "</form>";
echo "</td></tr>";
//end 10 cat here second
echo "<tr><td colspan='4'></td><td style='font-size:11px'>";
//10 cat 1.
echo "<form action='six_man.php' method='POST'>";
// $source= str_replace("H", "", $rek_list['source_id']);
// $date_r=$rek_list['batch_date'];
// $site_ref_num=$rek_list['site_ref_number'];
// $site_id=$rek_list['site_id'];
//echo "ssd";
//$item_id=$rek_list[0];
//$item_id=$rek_list[0];
//$buyer_id=$rek_list[3];
echo "<input type='hidden' name='item_id' value='".$item_id."'>";
echo "<input type='hidden' name='buyer_id' value='".$buyer_id."'>";
echo "<input type='hidden' name='date_r' value='".$date_r."'>";
echo "<input type='hidden' name='source' value='".$source."'>";
// echo "<input type='Submit' name='ten_cat' value='Generate 10 categories Sheet'>";
//if($rek_list[17]==$num_ro)
echo "</form></td></tr>";
$state=0;
echo "</table>";
}
echo " </p>";
}
?>
<?php
if(!empty($MESG))
show_message($MESG);
?>
</td>
</table>
<?php
/*
echo '<script type="text/javascript">';
echo "document.getElementById('dateForm').submit();"; // SUBMIT FORM
echo "</script>";
*/
?>
</BODY>
</HTML>