-
Notifications
You must be signed in to change notification settings - Fork 0
/
marginSearch.php
198 lines (166 loc) · 7.43 KB
/
marginSearch.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
<!DOCTYPE html>
<html lang="en">
<head>
<?php
require_once('general.php');
require_once('marginquery.php');
putLinks();
?>
</head>
<body>
<div class="container">
<div id="distmodal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title">Estimate</h2>
</div>
<div class="modal-body">
<form method="post" action="marginSearch.php" enctype="multipart/form-data">
<!-- <input type="text" class="form-control" placeholder="example control..." id="example"><br/> -->
<input type="text" class="form-control" placeholder="" id="barcode" readonly="readonly"><br/>
<input type="text" class="form-control" placeholder="" id="itemdesc" readonly="readonly"><br/>
<input type="text" class="form-control" placeholder="" id="price" readonly="readonly"><br/>
<input type="text" class="form-control" placeholder="" id="qty" autofocus><br/>
<button type="submit" id="secretButton" style="float:left;" name="secretButton" />
</form>
</div>
<div class="modal-footer">
<!-- <input type="button" data-toggle="modal" data-target="#distmodal" class="btn btn-success" name="estSave" id="estSave" value="Save" > -->
<!-- <a href="estimate.php" id="estinsert" name="estinsert" class="btn btn-success" data-toggle="modal" data-target="#distmodal">Save</a> -->
<a href="estimate.php" id="estinsert" name="estinsert" class="btn btn-success">Save</a>
<a class="btn btn-danger" data-toggle="modal" data-target="#distmodal">Close</a>
</div>
</div>
</div>
</div>
</div>
<header class="site__header island">
<div class="wrap">
<span id="animationSandbox" style="display: block;" class="tada animated">
<h1 class="site__title mega text-center">Product Distribution</h1>
</span>
</div>
</header>
<form action="marginsearch.php" method="post" enctype="multipart/form-data">
<div class="row">
<div class="form-group">
<div class="col-lg-4">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" frame scrolling="yes" src="./estimate.php"></iframe>
</div>
</div>
<div class="col-lg-4 text-right">
<a class="glyphicon glyphicon-home" style="font-size:30px;color:orange" href="/chromisphp/"></a>
<div class="input-group">
<div class="input-group-addon">SEARCH</div>
<input type="text" class="form-control" name="barcode" id="inlineFormInputGroup" placeholder="BARCODE">
<input type="text" class="form-control" name="item" id="inlineFormInputGroup" placeholder="ITEM">
<input type="text" class="form-control" name="category" id="inlineFormInputGroup" placeholder="CATEGORY">
<input type="text" class="form-control" name="mrp" id="inlineFormInputGroup" placeholder="MRP">
</div>
<br />
<button type="submit" class="btn btn-success" id="btnSearch" name="Search">Search</button>
<button type="submit" class="btn btn-warning" id="btnClear" name="Clear">Clear</button>
<button type="submit" class="btn btn-info" id="btnReload" name="Reload">Reload</button>
</div>
<div class="col-lg-4"></div>
</div>
</div>
</form>
<br />
<div class="row">
<div class="col-lg-4"></div>
<div class="col-lg-12">
<?php
/* session_start();
if(strcasecmp($_SERVER['REQUEST_METHOD'],"POST") === 0) {
$_SESSION['postdata'] = $_POST;
header("Location: ".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']);
exit;
}
if( isset($_SESSION['postdata'])) {
$_POST = $_SESSION['postdata'];
unset($_SESSION['postdata']);
} */
if (isset($_POST['']))
{
//echo 'empty post';
refreshRecords();
//putEmptyRow();
}
/* if(isset($_POST['estinsert']))
{
$thisPrice = $_POST['price'];
$thisBarcode = $_POST['barcode'];
$thisQty = $_POST['qty'];
echo $thisPrice;
echo $thisBarcode;
echo $thisQty;
header("Location: estimateActions.php?insertRec=" . $thisPrice . "&code=" . $thisBarcode . "&qty=" . $thisQty);
} */
?>
</div>
<div class="col-lg-4"></div>
</div>
</div>
<?php
if (isset($_POST['Reload']))
{
refreshRecords();
}
if (isset($_POST['Search']))
{
filterRecords($_POST['barcode'],$_POST['item'],$_POST['category'],$_POST['mrp']);
//$_POST['barcode'] = $_POST['barcode'];
}
?>
<?php
putScripts();
?>
<script type="text/javascript">
$(document).ready(function() {
$("#addNew").on('click',function(){
$("#distmodal").modal('show');
})
$('#distmodal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); // Button that triggered the modal
var qty = button.data('quantity'); // Extract info from data-* attributes
var barcode = button.data('barcode');
var itemdesc = button.data('itemdesc');
var price = button.data('price');
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
//modal.find('.modal-title').text('New message to ' + recipient)
$(".modal-body #barcode").val(barcode)
$(".modal-body #itemdesc").val(itemdesc)
$(".modal-body #price").val(price)
$("a[href='estimate.php']").attr('href', './estimateActions.php?insertRec=' + price + '&code=' + barcode + '&qty=0') // + qty)
});
$('#qty').change(function() {
var newurl = $('#qty').val()
var newhref = $("#estinsert").attr("href")
newhref= newhref.replace("qty=0","qty="+newurl)
//alert(newhref)
$("#estinsert").attr("href",newhref)
});
$("#secretButton").hide()
$("#qty").keypress(function (e){
if(e.which == 13) {
var newurl = $('#qty').val();
var newhref = $("#estinsert").attr("href");
newhref= newhref.replace("qty=0","qty="+newurl);
$("#estinsert").attr("href",newhref)
//sleep(2);
//wait(10)
$('#estinsert')[0].click();
}
});
});
</script>
<?php
stickfooter();
?>
</body>
</html>