create.blade.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @extends('layouts.master')
  2. @section('content')
  3. <section class="content">
  4. <div class="row">
  5. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  6. <div class="panel panel-default">
  7. <div class="panel-heading">
  8. <h3 class="panel-title">New Journal</h3>
  9. </div>
  10. <div class="panel-body">
  11. @include('layouts.message')
  12. <form action="{{ url('account/journal/save') }}" method="POST" class="form-horizontal" role="form" enctype="multipart/form-data">
  13. {{ csrf_field() }}
  14. <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
  15. <div class="form-group">
  16. <label for="account_head" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Debit Head</label>
  17. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  18. <select name="account_head" id="account_head" class="form-control">
  19. <option value="">-Select Account Head-</option>
  20. @if($account_types)
  21. @foreach($account_types as $type)
  22. <optgroup label="{{ $type->name }}">
  23. @if($type->acc_head)
  24. @foreach($type->acc_head as $head)
  25. <option value="{{ $head->id }}">{{ $head->name }}</option>
  26. @if($head->children)
  27. @foreach($head->children as $child)
  28. <option value="{{ $child->id }}">&nbsp;&nbsp;&nbsp;{{ $child->name }}</option>
  29. @endforeach
  30. @endif
  31. @endforeach
  32. @endif
  33. </optgroup>
  34. @endforeach
  35. @endif
  36. </select>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label for="amount" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Amount</label>
  41. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  42. <input type="text" name="amount" id="amount" class="form-control" onkeypress="return checkNumber(event)" required placeholder="Amount">
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label for="description" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Description</label>
  47. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  48. <textarea name="description" id="description" class="form-control" placeholder="Description"></textarea>
  49. </div>
  50. </div>
  51. <!-- <div class="form-group">
  52. <label for="due_date" class="col-sm-12 col-xs-12 col-md-2 col-lg-2 control-label">Due Date</label>
  53. <div class="col-xs-12 col-sm-12 col-md-5 col-lg-5">
  54. <input type="text" name="due_date" id="due_date" class="form-control date" required placeholder="Due Date">
  55. </div>
  56. </div> -->
  57. <div class="form-group">
  58. <div class="col-sm-8 col-sm-offset-4">
  59. <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Save</button>
  60. <a href="{{ url('account/journal') }}" class="btn btn-default"><i class="fa fa-times"></i> Cancel</a>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
  65. <div class="form-group">
  66. <label for="credit_head" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Credit Head</label>
  67. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  68. <select name="credit_head" id="credit_head" class="form-control">
  69. <option value="">-Select Credit Head-</option>
  70. @if($account_types)
  71. @foreach($account_types as $type)
  72. <optgroup label="{{ $type->name }}">
  73. @if($type->acc_head)
  74. @foreach($type->acc_head as $head)
  75. <option value="{{ $head->id }}">{{ $head->name }}</option>
  76. @if($head->children)
  77. @foreach($head->children as $child)
  78. <option value="{{ $child->id }}">&nbsp;&nbsp;&nbsp;{{ $child->name }}</option>
  79. @endforeach
  80. @endif
  81. @endforeach
  82. @endif
  83. </optgroup>
  84. @endforeach
  85. @endif
  86. </select>
  87. </div>
  88. </div>
  89. <div class="form-group">
  90. <label for="date" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Date</label>
  91. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  92. <input type="text" name="date" id="date" class='form-control date' value="{{ date('Y-m-d') }}">
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label for="date" class="col-sm-12 col-xs-12 col-md-4 col-lg-4 control-label">Upload document</label>
  97. <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
  98. <input type="file" name="filedocument" id="">
  99. </div>
  100. </div>
  101. </div>
  102. </form>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </section>
  108. @stop
  109. @section('script')
  110. <script type="text/javascript">
  111. $(document).ready(function() {
  112. $( ".date" ).datepicker({
  113. changeMonth: true,
  114. changeYear: true,
  115. dateFormat:"yy-mm-dd"
  116. });
  117. /**
  118. * get account head by account type
  119. */
  120. // $('#account_type').change(function(){
  121. // var id=$(this).val();
  122. // $.ajax({
  123. // url: "{{ url('account/journal/get_head') }}/"+id,
  124. // type: 'GET'
  125. // })
  126. // .done(function(res) {
  127. // $('#account_head').html(res);
  128. // });
  129. // }); //end get account head by account type
  130. });
  131. function checkNumber(evt)
  132. {
  133. var charCode = (evt.which) ? evt.which : evt.keyCode;
  134. if (charCode != 46 && charCode > 31
  135. && (charCode < 48 || charCode > 57))
  136. {
  137. alert('Invalid amount !!');
  138. return false;
  139. }
  140. return true;
  141. }
  142. </script>
  143. @stop