Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.46 KB | None | 0 0
  1. <select id="invoice_status_all">
  2. <option value="1"><?php echo display('shipped') ?></option>
  3. <option value="2"><?php echo display('cancel') ?></option>
  4. <option value="3"><?php echo display('pending') ?></option>
  5. <option value="4"><?php echo display('complete') ?></option>
  6. <option value="5"><?php echo display('processing') ?></option>
  7. <option value="6"><?php echo display('return') ?></option>
  8. </select>
  9. <input type="submit" class="btn btn-primary allUpdate" value="&#x21bb; <?php echo display('update'); ?> <?php echo display('all'); ?>" />
  10.  
  11.  
  12. <?php
  13. if ($invoices_list) {
  14. $i = 1;
  15. foreach ($invoices_list as $invoice) {
  16. ?>
  17. <tr>
  18.  
  19. <td><input type="checkbox" value="" class="cElement"> <?php echo $invoice['sl']; ?> </td>
  20. <td><a href="<?php echo base_url() . 'Cinvoice/invoice_inserted_data/' . $invoice['invoice_id']; ?>"> <?php echo $invoice['invoice']; ?> </a></td>
  21. <td><a href="<?php echo base_url() . 'Cinvoice/invoice_inserted_data/' . $invoice['invoice_id']; ?>">
  22. <?php
  23. $saxeligvari = $this->Invoices->get_username_by_id($invoice['user_id']);
  24. echo $saxeligvari[0]['last_name'];
  25. echo ' ';
  26. echo $saxeligvari[0]['first_name'];
  27. ?>
  28. </a></td>
  29. <td><a href="<?php echo base_url() . 'Ccustomer/customerledger/' . $invoice['customer_id']; ?>"><?php echo $invoice['customer_name']; ?></a></td>
  30. <td><?php echo $invoice['final_date'] ?></td>
  31. <td><?php echo $invoice['varchar'] ?></td>
  32. <td style="text-align: right;"><?php echo (($position == 0) ? $currency . ' ' . $invoice['total_amount'] : $invoice['total_amount'] . ' ' . $currency) ?></td>
  33. <td><form action="<?php echo base_url('Cinvoice/update_status/' . $invoice['invoice_id']) ?>" method="post" id="validate">
  34. <select class="form-control" id="invoice_status" name="invoice_status" required="">
  35. <option value=""></option>
  36. <option value="1" <?php
  37. if ($invoice['invoice_status'] == '1') {
  38. echo "selected";
  39. }
  40. ?>><?php echo display('shipped') ?></option>
  41. <option value="2" <?php
  42. if ($invoice['invoice_status'] == '2') {
  43. echo "selected";
  44. }
  45. ?>><?php echo display('cancel') ?></option>
  46. <option value="3" <?php
  47. if ($invoice['invoice_status'] == '3') {
  48. echo "selected";
  49. }
  50. ?>><?php echo display('pending') ?></option>
  51. <option value="4" <?php
  52. if ($invoice['invoice_status'] == '4') {
  53. echo "selected";
  54. }
  55. ?>><?php echo display('complete') ?></option>
  56. <option value="5" <?php
  57. if ($invoice['invoice_status'] == '5') {
  58. echo "selected";
  59. }
  60. ?>><?php echo display('processing') ?></option>
  61. <option value="6" <?php
  62. if ($invoice['invoice_status'] == '6') {
  63. echo "selected";
  64. }
  65. ?>><?php echo display('return') ?></option>
  66. </select><br>
  67. <button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal_<?php echo $i ?>" title="<?php echo display('add_note') ?>" />
  68. <i class="fa fa-plus" aria-hidden="true"></i>
  69. </button>
  70. <input type="hidden" value="<?php echo $invoice['customer_email'] ?>" name="customer_email"/>
  71. <div class="modal fade" id="myModal_<?php echo $i ?>" role="dialog">
  72. <div class="modal-dialog" role="document">
  73. <div class="modal-content">
  74. <div class="modal-header">
  75. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  76. <h1 class="modal-title"><?php echo display('add_note') ?></h1>
  77. </div>
  78. <div class="modal-body">
  79. <div class="form-group row">
  80. <label for="" class="col-sm-4 col-form-label">მანქანის ნომერი</label>
  81. <div class="col-sm-8">
  82. <input type="text" name="add_note" class="form-control" id="add_note" placeholder="მანქანის ნომერი" >
  83. </div>
  84. </div>
  85. </div>
  86. <div class="modal-footer">
  87. <button type="button" class="btn btn-success" data-dismiss="modal"><?php echo display('submit') ?></button>
  88. </div>
  89. </div>
  90. <!-- /.modal-content -->
  91.  
  92. </div>
  93. <!-- /.modal-dialog -->
  94.  
  95. </div>
  96. <!-- /.modal -->
  97.  
  98. <?php if ($this->session->userdata('user_type') != 2) { ?>
  99. <input type="submit" class="btn btn-primary" value="&#x21bb; <?php echo display('update') ?>" />
  100. <?php } ?>
  101. <script type="text/javascript">
  102. function noteCheck() {
  103. var add_note = $('#add_note').val();
  104. if (add_note) {
  105. return true;
  106. } else {
  107. alert('<?php echo display('please_add_note') ?>');
  108. return false;
  109. }
  110. }
  111. </script>
  112. </form></td>
  113. <td><center>
  114. <?php if ($this->session->userdata('user_type') != 2) { ?>
  115. <a href="<?php echo base_url() . 'Cinvoice/invoice_inserted_data/' . $invoice['invoice_id']; ?>" class="btn btn-success btn-sm" data-toggle="tooltip" data-placement="left" title="<?php echo display('invoice') ?>"><i class="fa fa-window-restore" aria-hidden="true"></i></a> <a href="<?php echo base_url() . 'Cinvoice/pos_invoice_inserted_data/' . $invoice['invoice_id']; ?>" class="btn btn-warning btn-sm" data-toggle="tooltip" data-placement="left" title="<?php echo display('pos_invoice') ?>"><i class="fa fa-fax" aria-hidden="true"></i></a> <a href="<?php echo base_url() . 'Cinvoice/invoice_update_form/' . $invoice['invoice_id']; ?>" class="btn btn-info btn-sm" data-toggle="tooltip" data-placement="left" title="<?php echo display('update') ?>"><i class="fa fa-pencil" aria-hidden="true"></i></a> <a href="<?php echo base_url('Cinvoice/invoice_delete/' . $invoice['invoice_id']) ?>" class="btn btn-danger btn-sm" onclick="return confirm('<?php echo display('are_you_sure_want_to_delete') ?>');" data-toggle="tooltip" data-placement="right" title="" data-original-title="<?php echo display('delete') ?> "><i class="fa fa-trash-o" aria-hidden="true"></i></a>
  116. <?php } ?>
  117. </center></td>
  118. </tr>
  119. <?php
  120. $i++;
  121. }
  122. }
  123. ?>
  124. </tbody>
  125. </table>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </section>
  132. </div>
  133.  
  134. <!-- Manage Invoice End -->
  135.  
  136.  
  137. <script>
  138. $(document).ready(function () {
  139. $('.allUpdate').hide('');
  140. $('#checkall').change(function () {
  141. $('.cElement').prop('checked', this.checked);
  142. $('.allUpdate').show('fast');
  143. });
  144. $('.cElement').change(function () {
  145. if ($('.cElement:checked').length == $('.cElement').length) {
  146. $('#checkall').prop('checked', true);
  147. } else {
  148. $('#checkall').prop('checked', false);
  149. }
  150. });
  151.  
  152. $("#invoice_status_all").change(function () {
  153. var invoice_status_all = $(this);
  154. var invoice_status_id = $(this).find("option:selected").val();
  155. // console.log(invoice_status_id);
  156. $("form#validate").each(function () {
  157. var formV = $(this);
  158. formV.find("select[name='invoice_status']").find("option[value='" + invoice_status_id + "']").attr('selected', 'selected');
  159. });
  160. });
  161. });
  162.  
  163. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement