-
Notifications
You must be signed in to change notification settings - Fork 0
/
seller.php
executable file
路146 lines (140 loc) 路 7.48 KB
/
seller.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
<?php
require_once dirname(__FILE__).'/include/header.php';
require_once dirname(__FILE__).'/include/api.php';
require_once dirname(__FILE__).'/include/navbar.php';
if (isset($_GET['sid']))
{
$sellerId = $_GET['sid'];
}
else
header('LOCATION:invoices.php');
$api = new API;
$sellerResponse = $api->getSellerById($sellerId);
$invoiceResponse = $api->getInvoicesBySellerId($sellerId);
$allInvoiceAmount = 0;
$allPaidAmount = 0;
$allRemainingAmount = 0;
?>
<?php if(!$sellerResponse->error)
{
$seller = $sellerResponse->seller;
?>
<div class="socialcodia" >
<div class="row">
<div class="col s12 l6 m6">
<div class="card lighten-2 dark-text z-depth-0 light-white darken-1" style="min-height: 518px; border: 10px ridge #0288d1;" >
<img src="src/img/d_cover.jpg" alt="" class="responsive-img">
<div class="card-content center">
<img src="<?php echo $seller->sellerImage; ?>" alt="" class="responsive-img circle z-depth-2" style="width: 140px; border: 3px solid white; margin-top: -108px; max-height: 140px; max-width: 140px;">
<h5 class="center"><?php echo $seller->sellerName; ?></h5>
<div class="divider"></div>
<table>
<thead>
<tr>
<th>Contact</th>
<td class="dark-text"><?php echo $seller->sellerContactNumber; ?></td>
</tr>
<tr>
<th>Contact 1</th>
<td class="dark-text"><?php echo $seller->sellerContactNumber1; ?></td>
</tr>
<tr>
<th>Address</th>
<td class="dark-text"><?php echo $seller->sellerAddress; ?></td>
</tr>
</thead>
</table>
</div>
</div>
</div>
<div class="col s12 l6 m6 card z-depth-0" >
<canvas id="chartSellerIncome" width="400" height="400"></canvas>
</div>
<div class="col l12 s12 m12" style="padding: 30px 10px 30px 10px;">
<div id="productList">
<div class="card z-depth-0">
<table id="mstrTable" class="highlight responsive-table ">
<thead>
<tr>
<th>Sr No</th>
<th>Invoice Number</th>
<th>Status</th>
<th>Total Amount</th>
<th>Paid Amount</th>
<th>Remaining Amount</th>
<th>Invoice Date</th>
<th>Action</th>
</tr>
</thead>
<tbody id="tableBody">
<tr>
<?php
if (!$invoiceResponse->error)
{
$invoices = $invoiceResponse->invoices;
$count = 1;
foreach ($invoices as $invoice)
{
$allInvoiceAmount += $invoice->invoiceAmount;
$allPaidAmount += $invoice->invoicePaidAmount;
$allRemainingAmount += $invoice->invoiceRemainingAmount;
$color = 'blue';
$invoicePaidAmount = (int) $invoice->invoicePaidAmount;
$invoiceRemainingAmount = (int) $invoice->invoiceRemainingAmount;
if (empty($invoicePaidAmount))
$invoicePaidAmount = 0;
if (empty($invoiceRemainingAmount))
$invoiceRemainingAmount = 0;
if ($invoice->invoiceStatus=='UNPAID')
$color = 'red';
echo "<tr>";
echo "<td>$count</td>";
echo "<td style='font-weight:bold'>$invoice->invoiceNumber</td>";
echo "<td class='blue-text darken-4 chip $color white-text' style='margin-top:25px;'>$invoice->invoiceStatus</td>";
echo "<td>$invoice->invoiceAmount</td>";
echo "<td>$invoicePaidAmount</td>";
echo "<td>$invoiceRemainingAmount</td>";
echo "<td class='blue-text darken-4'>$invoice->invoiceDate</td>";
echo '<td><a href="invoice?inum='.$invoice->invoiceNumber.'" style="border: 1px solid white;border-radius: 50%;" class="btn blue" data-position="top" data-tooltip="View Invoice"><i class="material-icons white-text">remove_red_eye
</i></a>';
echo '<a href="payment?inum='.$invoice->invoiceNumber.'" style="border: 1px solid white;border-radius: 50%;" class="btn red" data-position="top" data-tooltip="Pay Amount"><i class="material-icons white-text">attach_money
</i></a></td>';
$count++;
echo "</tr>";
}
}
?>
</tr>
</tbody>
</table>
</div>
<div class="card z-depth-0 red">
<div class="row center">
<div class="col s4 l4 m4">
<h5>Total Amount <b><?php echo $allInvoiceAmount; ?> </b></h5>
</div>
<div class="col s4 l4 m4">
<h5>Paid Amount <b><?php echo $allPaidAmount; ?> </b></h5>
</div>
<div class="col s4 l4 m4">
<h5>Remainig Amount <b><?php echo $allRemainingAmount; ?> </b></h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php }
else
{
?>
<div class="socialcodia center">
<h4>No Seller Found</h4>
<img class="verticalCenter socialcodia" src="src/img/empty_cart.svg">
</div>
<?php
}
?>
<?php require_once dirname(__FILE__).'/include/sidenav.php'; ?>
<?php require_once dirname(__FILE__).'/include/footer.php'; ?>