PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/sales-breakdown.php

https://bitbucket.org/OverSite/capstone-demo
PHP | 176 lines | 131 code | 16 blank | 29 comment | 0 complexity | 00e2609581de16f6b6fbec06fac3fe87 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, MIT, LGPL-2.1, Apache-2.0
  1. <?php
  2. session_start();
  3. require 'databaseConnection.php';
  4. $dbConn = getConnection();
  5. $sql = "SELECT * FROM commInfo";
  6. $stmt = $dbConn->prepare($sql);
  7. $stmt->execute();
  8. $result = $stmt->fetchAll();
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <meta charset="utf-8">
  14. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  15. <title>RE/MAX Salinas | Sales Breakdown</title>
  16. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  17. <!-- BEGIN TEMPLATE default-css.php INCLUDE -->
  18. <?php include "./templates-admin/default-css.php" ?>
  19. <!-- END TEMPLATE default-css.php INCLUDE -->
  20. <!-- PAGE-SPECIFIC CSS -->
  21. <link rel="stylesheet" href="dist/css/vendor/footable.bootstrap.min.css">
  22. </head>
  23. <body class="hold-transition skin-black sidebar-mini">
  24. <!-- Site Wrapper -->
  25. <div class="wrapper">
  26. <!-- BEGIN TEMPLATE header.php INCLUDE -->
  27. <?php include "./templates-admin/header.php" ?>
  28. <!-- END TEMPLATE header.php INCLUDE -->
  29. <!-- BEGIN TEMPLATE nav.php INCLUDE -->
  30. <?php include "./templates-admin/nav.php" ?>
  31. <!-- END TEMPLATE nav.php INCLUDE -->
  32. <!-- Content Wrapper -->
  33. <div class="content-wrapper">
  34. <!-- Content Header (Page header) -->
  35. <section class="content-header">
  36. <h1>
  37. Sales Breakdown
  38. </h1>
  39. <ol class="breadcrumb">
  40. <li>Transactions</li>
  41. <li class="active"><a href="#"><i class="fa fa-archive"></i> Sales Breakdown</a></li>
  42. </ol>
  43. </section>
  44. <!-- Main content -->
  45. <section class="content">
  46. <div class="row">
  47. <div class="col-xs-12">
  48. <div class="box">
  49. <div class="box-body">
  50. <table class="table table-bordered table-striped" data-filtering="true">
  51. <thead>
  52. <tr>
  53. <th>Date Settled</th>
  54. <th>Property Address</th>
  55. <th>Agent</th>
  56. <th>Total</th>
  57. <th data-breakpoints="all">Office</th>
  58. <th data-breakpoints="all">E&O <a href="#" data-toggle="tooltip"
  59. data-placement="top" title="Errors & Omissions"><i
  60. class="fa fa-question-circle"></i></a></th>
  61. <th data-breakpoints="all">Tech Fee</th>
  62. <th data-breakpoints="all">Processing</th>
  63. <th data-breakpoints="all">RE/MAX FF</th>
  64. <th data-breakpoints="all">Misc</th>
  65. <th>Commission</th>
  66. <th data-breakpoints="all">Client</th>
  67. <th>Price</th>
  68. <th>Listing/Buyer</th>
  69. <th data-breakpoints="all">Notes</th>
  70. <th data-breakpoints="all">Commission Sheet</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. <?php
  75. foreach ($result as $sales) {
  76. echo "<tr>";
  77. echo "<td>" . date("m-d-Y", strtotime($sales['settlementDate'])) . "</td>";
  78. echo "<td>" . $sales['address'] . "</td>";
  79. echo "<td>" . $sales['firstName'] . " " . $sales['lastName'] . "</td>";
  80. echo "<td>" . '$' . number_format($sales['InitialGross'], 0) . "</td>"; //Total
  81. echo "<td>" . '$' . number_format($sales['brokerFee'], 0) . "</td>"; //office
  82. echo "<td>" . '$99.00' . "</td>"; //eo
  83. echo "<td>" . '$50.00' . "</td>"; //tech
  84. echo "<td>" . '$200.00' . "</td>"; //processing
  85. echo "<td>" . '$' . number_format($sales['remaxFee'], 0) . "</td>"; //remax_ff
  86. echo "<td>" . '$' . number_format($sales['misc'], 0) . "</td>"; //misc
  87. echo "<td>" . '$' . number_format($sales['finalComm'], 0) . "</td>"; //commission
  88. echo "<td>" . $sales['clients'] . "</td>"; //client
  89. echo "<td>" . '$' . number_format($sales['finalHousePrice'], 0) . "</td>"; //price
  90. echo "<td>" . $sales['clients'] . "</td>"; //listing buyer
  91. echo "<td>" . $sales['notes'] . "</td>"; //notes
  92. echo '<td> <a href="viewCommissionSheet.php?comm=' . $sales['commId'] . '" target="_blank"> <button>View Commission Sheet</button> </a> </td>';
  93. echo "</tr>";
  94. }
  95. ?>
  96. <?php
  97. // $dbConn = getConnection();
  98. //
  99. // $sql = "SELECT status, houseId, date(dateTimes) as dateTimes, address, city, state, zip, bedrooms, bathrooms, price
  100. // FROM HouseInfo
  101. // WHERE userId = :userId
  102. // ORDER BY dateTimes ASC";
  103. //
  104. // //$namedParameters = array();
  105. // //$namedParameters[':userId'] = $_SESSION['userId'];
  106. // //$stmt = $dbConn -> prepare($sql);
  107. // /*$stmt->execute($namedParameters);
  108. // //$stmt->execute();
  109. // $results = $stmt->fetchAll();
  110. //
  111. // foreach($results as $result){
  112. // echo "<tr>";
  113. // echo "<td>" . $result['houseId'] . "</td>";
  114. // echo "<td>" . $result['address'] . "</td>";
  115. // echo "<td>King</td>";
  116. // echo "<td>Mali</td>";
  117. // echo "<td>4083488336</td>":
  118. // echo "<td>5/6/17</td>";
  119. // echo "<td>5/9/17</td>";
  120. // echo "<td>5/12/17</td>";
  121. // echo "<td>5/12/17</td>";
  122. // echo "<td>5/12/17</td>";
  123. // echo "<td>Notes</td>";
  124. // echo "</tr>";
  125. // } //closes foreach*/
  126. ?>
  127. </tbody>
  128. </table>
  129. </div>
  130. <!-- /.box-body -->
  131. </div>
  132. <!-- /.box -->
  133. </div>
  134. <!-- /.col -->
  135. </div>
  136. <!-- /.row -->
  137. </section>
  138. <!-- /.content -->
  139. </div>
  140. <!-- /.content-wrapper -->
  141. </div>
  142. <!-- /.wrapper -->
  143. <!-- BEGIN TEMPLATE default-footer.php INCLUDE -->
  144. <?php include "./templates-admin/default-footer.php" ?>
  145. <!-- END TEMPLATE default-footer.php INCLUDE -->
  146. <!-- Sidebar Background -->
  147. <div class="control-sidebar-bg">
  148. </div>
  149. <!-- BEGIN TEMPLATE default-js.php INCLUDE -->
  150. <?php include "./templates-admin/default-js.php" ?>
  151. <!-- END TEMPLATE default-js.php INCLUDE -->
  152. <!-- PAGE-SPECIFIC JS -->
  153. <script src="dist/js/vendor/footable.min.js"></script>
  154. <script>
  155. jQuery(function ($) {
  156. $('.table').footable();
  157. });
  158. </script>
  159. </body>
  160. </html>