SHARE
TWEET

Untitled

a guest May 7th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.   session_start();
  3.   include '../config/config.php'
  4. ?>
  5. <!DOCTYPE html>
  6. <html lang="en">
  7. <head>
  8. <title></title>
  9. <meta charset="utf-8">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <!-- Jquery-UI CSS -->
  12. <link rel="stylesheet" href="../assets/css/lib/jquery-ui.min.css">
  13. <!-- Boostrap CSS -->
  14. <link rel="stylesheet" href="../assets/css/lib/bootstrap.min.css">
  15. <!-- Bootstrap DatePicker CSS -->  
  16. <link rel="stylesheet" href="../assets/css/lib/bootstrap-datepicker.min.css">
  17. <!-- Bootstrap TimePicker CSS -->
  18. <link rel="stylesheet/less" href="../assets/css/lib/bootstrap-timepicker.min.css">
  19. <!-- SELECT 2 CSS
  20. <link href="assets/css/select2.min.css" rel="stylesheet">-->
  21. <!-- Clockpicker CSS -->
  22. <link href="../assets/css/clockpicker.css" rel="stylesheet">
  23. <!-- Main CSS -->
  24. <link rel="stylesheet" href="../assets/css/main.css">
  25. <!-- JQuery -->
  26. <script src="../assets/js/lib/jquery.min.js"></script>
  27. <!-- JQuery-UI JS-->
  28. <script src="../assets/js/lib/jquery-ui.min.js"></script>
  29. <!-- Bootstrap JS -->
  30. <script src="../assets/js/lib/bootstrap.min.js"></script>
  31. <!-- Bootstrap DatePicker JS -->
  32. <script src="../assets/js/lib/bootstrap-datepicker.min.js"></script>
  33. <!-- Bootstrap TimePicker JS -->
  34. <script src="../assets/js/lib/bootstrap-timepicker.min.js"></script>
  35. <!--Autocomplete JS -->
  36. <script src="../assets/js/autocomplete.js"></script>
  37. <!--Alert JS -->
  38. <script src="../assets/js/alert.js"></script>
  39. <!--ComboBox JS -->
  40. <script src="../assets/js/comboboxppic.js"></script>
  41. <!--Browse JS -->
  42. <script src="../assets/js/browseppic.js"></script>
  43. <!--Dashboard JS -->
  44. <script src="../assets/js/dashboardppic.js"></script>
  45. <!--Select2 JS
  46. <script src="assets/js/select2.full.min.js"></script>-->
  47. <!--Clockpicker JS -->
  48. <script src="../assets/js/clockpicker.js"></script>
  49. <!--Format Number JS
  50. <script src="../assets/js/jquery.maskMoney.js"></script>-->
  51. <link rel="stylesheet" href="../assets/datatables/dataTables.bootstrap.css"/>
  52.  
  53.  
  54. </head>
  55. <body>
  56. <?php if($_SESSION['login'] == true){ ?>
  57. <!-- Navbar -->
  58. <div class="container" >
  59.     <!-- Alert -->
  60.     <div id="alert"></div>
  61.      
  62.     <!-- Menu -->
  63.     <div id="menu-input">
  64.         <li>
  65.         <a id="newTransaction" href="#" class="btn" onclick="newTransaction()"><span class="glyphicon glyphicon-plus"></span>New</a>
  66.         </li>
  67.         <li>
  68.         <a id="editTransaction" href="#" class="btn" onclick="editTransaction()"><span class="glyphicon glyphicon-edit"></span>Edit</a>
  69.         </li>
  70.         <li>
  71.         <a id="copyTransaction" href="#" class="btn" onclick="copyTransaction()"><span class="glyphicon glyphicon-copy"></span>Copy</a>
  72.         </li>
  73.         <li>
  74.         <a id="revisiTransaction" href="#" class="btn" onclick="revisiTransaction()"><span class="glyphicon glyphicon-console"></span>Revisi</a>
  75.         </li>
  76.         <li>
  77.         <a id="saveTransaction" href="#" class="btn disabled" onclick="saveTransaction()"><span class="glyphicon glyphicon-floppy-saved"></span>Save</a>
  78.         </li>
  79.         <a id="cancelTransaction" href="#" class="btn" onclick="cancelTransaction()"><span class="glyphicon glyphicon-remove"></span>Cancel</a>
  80.         </li>
  81.         <li>
  82.         <a id="deleteTransaction" href="#" class="btn disabled" onclick=""><span class="glyphicon glyphicon-trash"></span>Delete</a>
  83.         </li>
  84.     </div>
  85. </div>
  86. <!-- A BIG FORM -->
  87. <form id="form" role="form" class="form-horizontal" method="POST" action="">
  88.    
  89.     <div class="container" style="margin-top:10px">
  90.         <!-- Nav tabs -->
  91.         <ul class="nav nav-tabs" role="tablist">
  92.         </ul>
  93.         <!-- Tab panes -->
  94.         <div class="tab-content">
  95.             <!-- Table Monthly Plan -->
  96.             <div role="tabpanel" class="tab-pane active" id="monthlyplan">
  97.                 <table id="tableMonthlyPlan" class="table table-striped">
  98.                 <thead>
  99.                 <tr>
  100.                     <th></th>
  101.                     <th>Part ID</th>
  102.                     <th>Line</th>
  103.                     <th>Mesin & Mold</th>
  104.                     <th style='width:100px'>QtyPlan</th>
  105.                     <th>Total Hour</th>
  106.                     <th>Keterangan</th>
  107.                     <th>Hapus</th>
  108.                 </tr>
  109.                 </thead>
  110.                 <tbody id="tableRowMonthlyPlanBody"></tbody>
  111.                 </table>
  112.             </div>
  113.         </div>
  114.         <!-- end Tab panes -->
  115.     </div>
  116.     <!-- end Container FormDetail -->
  117.     <input id="tableRowMonthlyPlan" type="hidden" name="tableRowMonthlyPlan" value="1"/>
  118. <!--    <input id="tableRowDailyPlan" type="hidden" name="tableRowDailyPlan" value="1"/>
  119.  -->    <input id="formAction" type="hidden" name="formAction" value=""/>
  120. </form>
  121.  
  122. <!--Modal tabel Part Monthly Plan-->
  123. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  124.            <div class="modal-dialog" style="width:70%">
  125.                 <div class="modal-content">
  126.                     <div class="modal-header">
  127.                         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  128.                         <h4 class="modal-title" id="myModalLabel">Cari Part</h4>
  129.                     </div>
  130.                     <div class="modal-body">
  131.                         <table id="lookup" class="table table-bordered table-hover table-striped">
  132.                             <thead>
  133.                                 <tr>
  134.                                     <th>PartID</th>
  135.                                     <th>Other ID</th>
  136.                                     <th>PartName</th>
  137.                                 </tr>
  138.                             </thead>
  139.                             <tbody>
  140.                                  <?php
  141.                                 //Data mentah yang ditampilkan ke tabel    
  142.                                 include '../config/db.php';
  143.                                
  144.                                 $sql = "SELECT a.PartID, a.PartName,a.OtherID FROM ms_partcategory a ";
  145.                                
  146.                                 $s      = mysqli_query($conn, $sql);
  147.                                 while ($data = mysqli_fetch_assoc($s)) {
  148.                                     ?>
  149.                                     <tr class="pilih" data-partid="<?php echo $data['PartID']; ?>">
  150.                                         <td><?php echo $data['PartID']; ?></td>
  151.                                         <td><?php echo $data['OtherID']; ?></td>
  152.                                         <td><?php echo $data['PartName']; ?></td>
  153.                                        
  154.                                     </tr>
  155.                                     <?php
  156.                                 }
  157.                                 ?>
  158.                             </tbody>
  159.                         </table>  
  160.                     </div>
  161.                 </div>
  162.             </div>
  163. </div>
  164.  
  165. <?php } else {
  166.       header('location: index.php');
  167.     }?>
  168.     <script src="../assets/datatables/jquery.dataTables.js"></script>
  169.     <script src="../assets/datatables/dataTables.bootstrap.js"></script>
  170.     <script type="text/javascript">  
  171.  
  172. //inputan detail           
  173. function addTableRowMonthlyPlan() {
  174.     row = parseInt($('#tableRowMonthlyPlan').val()) + 1;
  175.     $('#plusButtonMonthlyPlan').remove();
  176.     var html = ' \
  177.     <tr id="rowTableMonthlyPlan_' + row + '"> \
  178.     <td><button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal"><b>Cari</b> <span class="glyphicon glyphicon-search"></span></button></td> \
  179.       <td> \
  180.        <input type="text" class="form-control" name="typepartid_' + row + '" id="typepartid_' + row + '" style="text-transform: uppercase" placeholder="Masukkan Part" />\
  181.       </td> \
  182.      <td>\
  183.          <select id="line_' + row + '" class="form-control" name="line_' + row + '"> \
  184.         ' + htmlLine + ' \
  185.         </select> \
  186.       </td> \
  187.       <td>\
  188.       <div class="input-group"><input id="mesinmold_'+row+'" class="form-control" type="text" name="mesinmold_'+row+'"><span class="input-group-btn"><button type="button" class="btn btn-default glyphicon glyphicon-folder-open" data-toggle="modal" data-target="#mesinModal" ></button></span></div> \
  189.       </td> \
  190.       <td><input id="qtyplan_' + row + '" type="text" class="form-control"  onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" name="qtyplan_' + row + '" /> \
  191.       </td> \
  192.       <td><input id="tothour_' + row + '" type="text" class="form-control" name="tothour_' + row + '" /> \
  193.       </td> \
  194.       <td><input id="keterangan_' + row + '" type="text" class="form-control" name="keterangan_' + row + '"/></td> \
  195.       <td><button type="button" class="btn btn-sm btn-default" onclick="deleteRowMonthlyPlan(' + row + ')">x</button></td> \
  196.     </tr> \
  197.     <tr id="plusButtonMonthlyPlan"> \
  198.       <td colspan="5"><button type="button" class="btn btn-sm btn-success" style="width:100%" onclick="addTableRowMonthlyPlan();copyLastRowValue();">COPY</button></td> \
  199.       <td colspan="5"><button type="button" class="btn btn-sm btn-default" style="width:100%" onclick="addTableRowMonthlyPlan();">Tambah</button></td> \
  200.     </tr>';
  201.     $('#tableMonthlyPlan > tbody').append(html);
  202.     $('#tableRowMonthlyPlan').val(row);
  203. }
  204. $(document).on('click', '.pilih', function (e) {
  205.     document.getElementById('typepartid_' + row).value = $(this).attr('data-partid');
  206.     $('#myModal').modal('hide');
  207. });
  208.  
  209. $(function () {
  210.     $("#lookup").dataTable();
  211. });
  212.  
  213. function copyLastRowValue() {
  214.     var totalRow = $('#tableRowMonthlyPlanBody').find('tr').length - 1;
  215.     var valueAboveLastRow = $('#typepartid_' + (totalRow - 1)).val();
  216.     $('#typepartid_' + totalRow).val(valueAboveLastRow);
  217. }
  218.  
  219. </script>
  220.  
  221.     </body>
  222. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top