Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include"koneksi.php";
- $sebelum = $_GET['season']-1;
- $sql = "SELECT DISTINCT t_order.refbuyer,t_order.nama FROM `t_kirim`,`t_order` WHERE
- t_order.buyer LIKE '%$_GET[buyer]%'
- AND t_kirim.buyer LIKE '%$_GET[buyer]%'
- AND t_order.refbuyer = t_kirim.refbuyer
- AND t_order.season BETWEEN '$sebelum'
- AND '$_GET[season]' AND t_kirim.season BETWEEN '$sebelum'
- AND '$_GET[season]'
- ORDER BY t_order.refbuyer ASC ";
- $result = $conn->query($sql);
- ?>
- <center> Season <b><?php echo $sebelum; ?> - <?php echo $_GET['season']; ?></b> | Buyer <b><?php echo $_GET['buyer']; ?></b></center>
- <hr>
- <div class="scroll">
- <table style="font-size:12px;" class="table table-hover">
- <thead>
- <tr bgcolor="#00A3FF" style="color:#FFFFFF";>
- <th class="col-xs-2"> Ref Buyer </th>
- <th width="250px"> Item </th>
- <th> Order </th>
- <th> Kirim </th>
- <th> Balance </th>
- </tr>
- </thead>
- <tbody>
- <?php while($c = $result->fetch_assoc()) : extract($c);
- $data_qorder=0;
- $data_qkirim=0;
- $sql2 = "SELECT t_order.qorder,t_kirim.qkirim
- FROM t_order
- inner join t_kirim
- on t_order.refbuyer=t_kirim.refbuyer
- WHERE t_order.refbuyer='$refbuyer'
- ORDER BY t_order.refbuyer ASC"
- $result2 = $conn->query($sql2);
- while($c = $result->fetch_assoc()) : extract($c);
- $data_qorder += $qorder;
- $data_qkirim += $qkirim;
- endWhile;
- $balance = $data_qorder-$data_qkirim;
- ?>
- <tr>
- <td> <?php echo $refbuyer; ?> </td>
- <td> <?php echo $nama; ?> </td>
- <td> <?php echo $data_qorder; ?></td>
- <th> <?php echo $data_qkirim; ?> </th>
- <th> <?php echo $balance; ?> </th>
- </tr>
- <?php endWhile; ?>
- </tbody>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment