Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form action="api/insertreqmpro.php" method="POST">
- <div class="form-group row">
- <label class="col-sm-12 col-md-2 col-form-label">Request No</label>
- <div class="col-sm-12 col-md-12 input-group">
- <input class="form-control" type="text" name="requestnumber" placeholder="Nomor Request">
- <button type="button" class="btn btn-primary" name="button" onclick="window.location.href='javascript: buka_popup();'"><i class="icon-copy fa fa-folder-open" aria-hidden="true"></i></button>
- </div>
- </div>
- <div class="form-group row">
- <label class="col-sm-12 col-md-2 col-form-label">Request Date</label>
- <div class="col-sm-12 col-md-12">
- <input class="form-control date-picker" name="requestdate" placeholder="Select Date" type="text">
- </div>
- </div>
- <div class="table-responsive">
- <table class="table table-striped" id="crud_table">
- <thead>
- <tr>
- <th >#</th>
- <th >PartID </th>
- <th >PartName</th>
- <th >LocationID</th>
- <th >UnitID</th>
- <th >Qty </th>
- <th >Note </th>
- <th >Hapus</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- <button type="button" name="add" id="add" class="btn btn-success btn-xs">+</button>
- <button type="submit" class="btn btn-outline-primary" onclick="confirm('Are you sure you want to save this transaction?');">Simpan</button>
- </div>
- </form>
- <script>
- $(document).ready(function(){
- var count = 0;
- $('#add').click(function(){
- count = count + 1;
- var html_code = "<tr id='detailrequest"+count+"'>";
- html_code += "<td><button type='button' class='btn btn-primary' name='button' onclick='buka_popup();'><i class='icon-copy fa fa-search' aria-hidden='true'></i></button></td>";
- html_code += "<td><input type='text' id='PartID"+count+"'name='PartID[]' class='form-control'></input></td>";
- html_code += "<td></td>";
- html_code += "<td></td>";
- html_code += "<td></td>";
- html_code += "<td><input type='number' name='QtyReq[]' class='form-control'></input></td>";
- html_code += "<td><input type='text' class='form-control' name='Notes[]'></td>";
- html_code += "<td><button type='button' class='btn btn-sm btn-default' onclick='deleterow("+count+")'>x</button></td>";
- html_code += "</tr>";
- $('#crud_table').append(html_code);
- //$('#tabledata').val(count);
- });
- });
- function deleterow(count) {
- var x = confirm("Are you sure to delete?"+count);
- if (x == true ) {
- $('#detailrequest'+ count).remove();
- //$('#rowTableDowntime_' + row).remove();
- }
- }
- function buka_popup(){
- window.open('datapart.php', '', 'width=600, height=300, location=yes,scrollbars=yes, resizeable=yes, status=yes, copyhistory=no,toolbar=no');
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment