-
Notifications
You must be signed in to change notification settings - Fork 3
/
each_sku_sold_unit_uk_main_page.php
88 lines (72 loc) · 2.94 KB
/
each_sku_sold_unit_uk_main_page.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
<?php
//include auth.php file on all secure pages
include("auth.php");
//sql database
include ('sql/mainSql.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'nav/meta.php'; ?>
<?php include 'nav/css.php'; ?>
</head>
<body id="page-top">
<?php include 'nav/nav.php'; ?>
<?php include 'nav/header.php'; ?>
<!--Each Settlement goes there -->
<div class="container">
<br>
<br>
<?php
//sku unit model
function fill_settlement($conn) {
$outputData = '';
$sqlDropDownSettlementID = "SELECT * FROM `settlements` GROUP BY settlement_id DESC ORDER BY settlement_start_date ASC;";
$DropDownSettlementID = mysqli_query($conn, $sqlDropDownSettlementID);
while ($row = mysqli_fetch_array($DropDownSettlementID)) {
$outputData .= '<option value="' . $row["settlement_id"] . ' ' . $row["settlement_start_date"] . ' ' . $row["settlement_end_date"] . '">' . $row["settlement_id"] . '   ' . $row["settlement_start_date"] . ' - ' . $row["settlement_end_date"] . '</option>';
}
return $outputData;
}
?>
<div class="container">
<label class="col-sm-3 control-label">SKU Settlement ID & Date</label>
<div class="col-sm-9">
<select id="selproduct">
<option value=""> Settlement ID & Date</option>
<?php echo fill_settlement($conn); ?>
</select>
<button class="btn btn-primary left-space-button each-settlement-button-margin-left" id="getSettlementbutton">Settlement details</button>
</div>
<br>
<div id="presentprod">
</div>
<br><br>
<div class="form-group">
<button onclick="Export()" class="btn btn-success">Export to CSV File</button>
</div>
</div>
</div>
<?php include 'nav/footer.php'; ?>
<?php include 'nav/script.php'; ?>
<script>
//dropdown list
$(document).ready(function () {
$("#getSettlementbutton").click(function () {
var prodname = $('#selproduct :selected').text();
$.get("views/sku/uk/getsinglesku.php", {SettlementID: prodname}, function (getresult) {
$("#presentprod").html(getresult);
});
});
});
function Export()
{
var conf = confirm("Export users to CSV?");
if (conf == true)
{
window.open("export/each_settlement_uk_export_csv.php", '_blank');
}
}
</script>
</body>
</html>