Advertisement
cdsatrian

search 20170309

Mar 8th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.58 KB | None | 0 0
  1. <?php
  2. include("../inc/koneksi.php");
  3. session_start();
  4. if(isset($_SESSION['username'])){
  5. ?>
  6. <!doctype html>
  7. <html>
  8.     <head>
  9.     <meta charset="utf-8">
  10.     <meta name="viewport" content="width=device-width, initial-scale=1">
  11.   <title>CA - Kalimantan Tengah</title>
  12.     <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  13.   <link href="assets/plugin/datepicker/css/datepicker.css" rel="stylesheet">
  14.     <link href="assets/css/style.css" rel="stylesheet">
  15. </head>
  16. <body>
  17.       <!--HEADER-->
  18.       <div class="container">
  19.         <a class="logo">Website<br/>
  20.         <span>CA - Kalimantan Tengah</span></a>
  21.       </div>
  22.     <div class="container">
  23.       <nav class="navbar navbar-default">
  24.         <div class="container-fluid">
  25.           <div class="navbar-header">
  26.             <ul class="nav navbar-nav navbar-right">
  27.               <li><a href="cabang.php">Beranda</a></li>
  28.               <li><a href="profil_cabang.php">Cabang</a></li>
  29.               <li class="dropdown">
  30.                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Input Data <span class="caret"></span></a>
  31.                 <ul class="dropdown-menu">
  32.                   <li><a href="input_rektel.php">Input Rekening Telpon</a></li>
  33.                   <li role="separator" class="divider"></li>
  34.                   <li><a href="input_rekpln.php">Input Rekening PLN</a></li>
  35.                   <li role="separator" class="divider"></li>
  36.                   <li><a href="input_rekpdam.php">Input Rekening PDAM</a></li>
  37.                 </ul>
  38.               </li>
  39.               <li class="dropdown">
  40.                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Lihat Data <span class="caret"></span></a>
  41.                 <ul class="dropdown-menu">
  42.                   <li class="active"><a href="data_rektel.php">Data Rekening Telpon</a></li>
  43.                   <li role="separator" class="divider"></li>
  44.                   <li><a href="data_rekpln.php">Data Rekening PLN</a></li>
  45.                   <li role="separator" class="divider"></li>
  46.                   <li><a href="data_rekpdam.php">Data Rekening PDAM</a></li>
  47.                 </ul>
  48.               </li>
  49.             </ul>
  50.           </div><!--/.nav-collapse -->
  51.         </div>
  52.       </nav>
  53.     </div>
  54.     <!--HEADER-->
  55.  
  56.   <div class="container">
  57.     <div class="row">
  58.         <div class="col-md-12 content">
  59.         <!--ISI-->
  60.               <div class="panel panel-default">
  61.           <div class="panel-heading">Tabel Rekening Telpon</div>
  62.           <div class="panel-heading">
  63.             <a href="input_rektel.php" class="btn btn-primary" title="Input Data">Input Data</a>
  64.             <a href="data_rektel.php" class="btn btn-default">Refresh</a>
  65.           </div>
  66.           <div class="panel-body">
  67.           <form role="form" action="" method="post" enctype="multipart/form-data" name="form">
  68.             <input name="tanggal_awal" type="date"> - <input name="tanggal_akhir" type="date">
  69.             <input name="cari" type="submit" class="btn btn-primary" value="Cari">
  70.             <table data-toggle="table" data-url="tables/data1.json"  
  71.                     data-show-refresh="true" data-show-columns="true"
  72.                     data-select-item-name="toolbar1" data-sort-name="name" data-sort-order="desc" border="1">
  73.                 <thead>
  74.                 <tr>
  75.                   <th width="200" scope="col"><div align="center">Tanggal</div></th>
  76.                   <th width="100" scope="col"><div align="center">T-Vis</div></th>
  77.                   <th width="100" scope="col"><div align="center">T-Kom</div></th>
  78.                   <th width="100" scope="col"><div align="center">Hallo</div></th>
  79.                   <th width="100" scope="col"><div align="center">Pulsa @10</div></th>
  80.                   <th width="100" scope="col"><div align="center">Pulsa @20</div></th>
  81.                   <th width="100" scope="col"><div align="center">Pulsa @25</div></th>
  82.                   <th width="100" scope="col"><div align="center">Pulsa @50</div></th>
  83.                   <th width="100" scope="col"><div align="center">Pulsa @100</div></th>
  84.                   <th width="100" scope="col"><div align="center">Jumlah Lembar</div></th>
  85.                   <th width="100" scope="col"><div align="center">Total</div></th>
  86.                     <?php
  87.                       if ($_SESSION['id_cabang']=='002PKY')
  88.                       {
  89.                         ?>
  90.                         <th width="100" scope="col"><div align="center">Fee Hallo & Tsel</div></th>
  91.                         <?php
  92.                       }
  93.                       else
  94.                       {
  95.                        
  96.                       }
  97.                     ?>
  98.                   <th width="100" scope="col"><div align="center">Fee ICC Telpon</div></th>
  99.                   <th width="100" scope="col"><div align="center">Finnet</div></th>
  100.                   <th width="100" scope="col"><div align="center">ICC Setor</div></th>
  101.                   <th width="200" scope="col"><div align="center">Tanggal Transfer</div></th>
  102.                   <th width="50" scope="col"><div align="center">Perintah</div></th>
  103.                 </tr>
  104.                 </thead>
  105.  
  106. <?php
  107. if(isset($_POST['cari'])){
  108.     $where=" AND tanggal BETWEEN '{$_POST['tanggal_awal']}' AND '{$_POST['tanggal_akhir']}' ";
  109. }
  110. $a="SELECT * FROM rekening_telpon WHERE id_cabang='$_SESSION[id_cabang]'".$where;
  111. $b=mysqli_query($koneksi,$a);
  112. while($data=mysqli_fetch_array($b)){
  113. ?>
  114.      <tr>
  115.         <td><div align="center"><?PHP echo $data['tanggal']?></div></td>
  116.         <td><div align="center"><?PHP echo $data['t_vis']?></div></td>
  117.         <td><div align="center"><?PHP echo $data['t_kom']?></div></td>
  118.         <td><div align="center"><?PHP echo $data['hallo']?></div></td>
  119.         <td><div align="center"><?PHP echo $data['pulsa_10']?></div></td>
  120.         <td><div align="center"><?PHP echo $data['pulsa_20']?></div></td>
  121.         <td><div align="center"><?PHP echo $data['pulsa_25']?></div></td>
  122.         <td><div align="center"><?PHP echo $data['pulsa_50']?></div></td>
  123.         <td><div align="center"><?PHP echo $data['pulsa_100']?></div></td>
  124.         <td><div align="center"><?PHP echo $data['jumlah_lembar']?></div></td>
  125.         <td><div align="center"><?PHP echo $data['total']?></div></td>
  126.         <?php
  127.           if ($_SESSION['id_cabang']=='002PKY')
  128.           {
  129.             ?>
  130.             <td><div align="center">
  131.             <?PHP echo $data['fee_hallo_tsel']?>
  132.             </div></td>
  133.             <?php
  134.           }
  135.           else
  136.           {
  137.             echo "";
  138.           }
  139.         ?>  
  140.         <td><div align="center"><?PHP echo $data['fee_icc_telpon']?></div></td>
  141.         <td><div align="center"><?PHP echo $data['finnet']?></div></td>
  142.         <td><div align="center"><?PHP echo $data['icc_setor']?></div></td>
  143.         <td><div align="center"><?PHP echo $data['tanggal_tf']?></div></td>
  144.         <td><div align="center"><a href="edit_rektel.php?id_rektel=<?php echo $data['id_rektel']?>">Edit</a></div></td>
  145.     </tr>
  146. <?PHP
  147.  }
  148. ?>
  149.     <tr>
  150.         <td><div align="center"><strong>TOTAL</strong></div></td>
  151. <?php
  152.   $pilihtotal="
  153.     SELECT
  154.         SUM(t_vis) as total_t_vis,
  155.         SUM(t_kom) as total_t_kom,
  156.         SUM(hallo) as total_hallo,
  157.         SUM(pulsa_10) as total_pulsa_10,
  158.         SUM(pulsa_20) as total_pulsa_20,
  159.         SUM(pulsa_25) as total_pulsa_25,
  160.         SUM(pulsa_50) as total_pulsa_50,
  161.         SUM(pulsa_100) as total_pulsa_100,
  162.         SUM(jumlah_lembar) as total_jumlah_lembar,
  163.         SUM(total) as total_uang,
  164.         SUM(fee_hallo_tsel) as total_hallo_tsel,
  165.         SUM(fee_icc_telpon) as total_fee_telpon,
  166.         SUM(finnet) as total_finnet,
  167.         SUM(icc_setor) as total_icc_setor
  168.     FROM rekening_telpon
  169.     WHERE id_cabang='$_SESSION[id_cabang]'".$where;
  170.     $query=mysqli_query($koneksi,$pilihtotal);
  171.     $total=mysqli_fetch_array($query);
  172. ?>
  173.                   <td><div align="center"><strong><?php echo $total['total_t_vis'] ?></strong></div></td>
  174.                   <td><div align="center"><strong><?php echo $total['total_t_kom'] ?></strong></div></td>
  175.                   <td><div align="center"><strong><?php echo $total['total_hallo'] ?></strong></div></td>
  176.                   <td><div align="center"><strong><?php echo $total['total_pulsa_10'] ?></strong></div></td>
  177.                   <td><div align="center"><strong><?php echo $total['total_pulsa_20'] ?></strong></div></td>
  178.                   <td><div align="center"><strong><?php echo $total['total_pulsa_25'] ?></strong></div></td>
  179.                   <td><div align="center"><strong><?php echo $total['total_pulsa_50'] ?></strong></div></td>
  180.                   <td><div align="center"><strong><?php echo $total['total_pulsa_100'] ?></strong></div></td>
  181.                   <td><div align="center"><strong><?php echo $total['total_jumlah_lembar'] ?></strong></div></td>
  182.                   <td><div align="center"><strong><?php echo $total['total_uang'] ?></strong></div></td>
  183.                   <?php
  184.                    if ($_SESSION['id_cabang']=='002PKY')
  185.                    {
  186.                      ?>
  187.                      <td><div align="center"><strong>
  188.                      <?PHP echo $total['total_hallo_tsel']?>
  189.                      </strong></div></td>
  190.                      <?php
  191.                    }
  192.                    else
  193.                    {
  194.                      echo "";
  195.                    }
  196.                   ?>
  197.                   <td><div align="center"><strong><?php echo $total['total_fee_telpon'] ?></strong></div></td>
  198.                   <td><div align="center"><strong><?php echo $total['total_finnet'] ?></strong></div></td>
  199.                   <td><div align="center"><strong><?php echo $total['total_icc_setor'] ?></strong></div></td>
  200.                   <td><div align="center"><strong>-</strong></div></td>
  201.                   <td><div align="center"><strong>-</strong></div></td>
  202.                 </tr>
  203.             </table>
  204.             </form>
  205.           </div>
  206.         </div>
  207.               <!--ISI-->
  208.         </div>
  209.     </div>
  210.     <!--FOOTER-->
  211.     <div class="footer">Copyright© 2017 CA - Kalimantan Tengah, Palangka Raya<br/></div>
  212.     <!--FOOTER-->
  213.   </div>
  214.   <script src="assets/js/jquery.min.js"></script>
  215.     <script src="assets/bootstrap/js/bootstrap.min.js"></script>
  216.   <script src="assets/plugin/datepicker/js/bootstrap-datepicker.js"></script>
  217.     <script src="assets/plugin/jquery.maskedinput/jquery.maskedinput.min.js"></script>
  218.   <script src="assets/js/main.js"></script>
  219. </body>
  220. </html>
  221. <?php
  222. }
  223. else
  224. {
  225.   echo "<script>alert('Anda tidak bisa mengakses halaman ini, karena belum login');document.location='index.php'</script>";
  226. }
  227. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement