employee_edit.blade.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. @extends('layouts.master')
  2. @section('content')
  3. <div class="content">
  4. <div class="row">
  5. <form action="{{ url('admin/employee/update/'.$employee->id) }}" enctype="multipart/form-data" method="POST" role="form">
  6. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  7. <header class="panel-heading" style="height:50px;">
  8. <div class="pull-left">
  9. {{$title}}
  10. </div>
  11. <div>
  12. @if(\Auth::user()->utype==1)
  13. <a style="margin-right:3px" href="{{ url('admin/employee') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-list"></i> Employee List</a>
  14. <a style="margin-right:3px" href="{{ url('admin/employee/add') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-plus"></i> Employee Add</a> <br><br>
  15. @endif
  16. </div>
  17. </header>
  18. </div>
  19. <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
  20. <div class="panel panel-default">
  21. <div class="panel-heading" style="height:50px;">
  22. <h3 class="panel-title">Employee Information</h3>
  23. </div>
  24. <div class="panel-body">
  25. {{ csrf_field() }}
  26. <div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
  27. <label for="name">Full Name <i class="text-danger">*</i></label>
  28. <input type='text' name="name" id="name" class="form-control" placeholder="Full Name" value="{{$employee->name }}" required="">
  29. <lebel class="text-danger"> {{ $errors->first('name') }}</lebel>
  30. </div>
  31. <div class="form-group {{ $errors->has('personal_email') ? 'has-error' : '' }}">
  32. <label for="personal_email">personal Email <i class="text-danger">*</i></label>
  33. <input type='email' name="personal_email" id="personal_email" class="form-control" value="{{ $employee->personal_email }}" required="" placeholder="Personal Email">
  34. <lebel class="text-danger"> {{ $errors->first('personal_email') }}</lebel>
  35. </div>
  36. <div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
  37. <label for="phone">Phone <i class="text-danger">*</i></label>
  38. <input type='text' name="phone" id="phone" class="form-control" required="" placeholder="Phone Number" value="{{ $employee->phone }}">
  39. <lebel class="text-danger"> {{ $errors->first('phone') }}</lebel>
  40. </div>
  41. <div class="form-group">
  42. <label for="phonetwo">Phone2</label>
  43. <input type='text' name="phonetwo" value="{{ $employee->phonetwo }}" id="phonetwo" class="form-control" placeholder="Phone Number">
  44. </div>
  45. <div class="form-group {{ $errors->has('birth_day') ? 'has-error' : '' }}">
  46. <label for="birth_day">Date of birth <i class="text-danger">*</i></label>
  47. <input type='text' name="birth_day" id="birth_day" class="form-control date" placeholder="Date of birth" value="{{ $employee->birth_day }}" required="" >
  48. <lebel class="text-danger"> {{ $errors->first('birth_day') }}</lebel>
  49. </div>
  50. <div class="form-group {{ $errors->has('present_address') ? 'has-error' : '' }}">
  51. <label for="present_address">Present Address <i class="text-danger">*</i></label>
  52. <input type='text' name="present_address" id="present_address" class="form-control" placeholder="Present Address" value="{{ $employee->present_address }}" required="">
  53. <lebel class="text-danger"> {{ $errors->first('present_address') }}</lebel>
  54. </div>
  55. <div class="form-group">
  56. <label for="per_address">Permanent Address</label>
  57. <input type='text' name="per_address" id="per_address" class="form-control" placeholder="Permanent Address" value="{{ $employee->per_address }}">
  58. </div>
  59. <div class="form-group">
  60. <label for="note">Note</label>
  61. <textarea name="note" id="note" class="form-control" placeholder="Note">{{ $employee->note }}</textarea>
  62. </div>
  63. <div class="form-group">
  64. <label for="facebook">Facebook</label>
  65. <input type='text' name="facebook" id="facebook" class="form-control" placeholder="Facebook" value="{{ $employee->facebook }}">
  66. </div>
  67. <div class="form-group">
  68. <label for="skype">Skype</label>
  69. <input type='text' name="skype" id="skype" class="form-control" placeholder="Skype" value="{{ $employee->skype }}">
  70. </div>
  71. <div class="form-group">
  72. <label for="linkedin">Linkedin</label>
  73. <input type='text' name="linkedin" id="linkedin" class="form-control" placeholder="Linkedin" value="{{ $employee->linkedin }}">
  74. </div>
  75. <div class="form-group">
  76. <label for="linkedin">Picture</label>
  77. <input type='file' name="image" class='form-control'>
  78. </div>
  79. <div>
  80. <img src="{{ asset('/assets/document/employee/'.$employee->image) }}" alt="Pic" height="95" width="120">
  81. </div>
  82. <div class="clearfix"></div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="col-xs-7 col-sm-7 col-md-7 col-lg-7">
  87. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  88. <div class="panel panel-default">
  89. <div class="panel-heading" style="height:50px;">
  90. <div class="pull-left">
  91. <h3 class="panel-title">Employment History: <small>Please Add Recent First</small></h3>
  92. </div>
  93. </div>
  94. <div class="panel-body">
  95. <table class="table table-bordered tbl-items">
  96. <thead>
  97. <tr>
  98. <th>#</th>
  99. <th>date</th>
  100. <th>Designation</th>
  101. <th>Salary Grade</th>
  102. <th>Action</th>
  103. </tr>
  104. </thead>
  105. <tbody class="ehbody">
  106. <?php $i=1;?>
  107. @foreach($emp_details as $emp_history)
  108. <tr>
  109. <input type='text' name="emp_we_id[]" class="hidden" value="{{ $emp_history->id }}">
  110. <td>{{ $i++ }}</td>
  111. <td><input type='text' name="joining_date[]" class="form-control date" placeholder="Date" value="{{ $emp_history->joining_date }}" required="" ></td>
  112. <td width="30%">
  113. <select name="current_designation[]" class='form-control' id="current_designation" required="" >
  114. <option disabled selected value>Choose One..</option>
  115. @foreach($all_designation as $info)
  116. <option value="{{ $info->id }}" @if($emp_history->designation_id==$info->id) {{'selected'}} @endif>{{ $info->name }}</option>
  117. @endforeach
  118. </select>
  119. </td>
  120. <td width="30%">
  121. <select name="salary_grade[]" class='form-control' id="salary_grade" required="" >
  122. <option disabled selected value>Choose One..</option>
  123. @foreach($all_grade as $row)
  124. <option value="{{ $row->id }}" @if($emp_history->grade_id==$row->id) {{'selected'}} @endif >{{ $row->name }}</option>
  125. @endforeach
  126. </select>
  127. </td>
  128. <td></td>
  129. </tr>
  130. @endforeach
  131. </tbody>
  132. </table>
  133. <button type='button' id='add_exp_history' class='btn btn-sm' title='Add New Item'><i class="fa fa-plus"></i> Add Promotion</button>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  138. <div class="panel panel-default">
  139. <div class="panel-heading">
  140. <h3 class="panel-title">File Upload</h3>
  141. </div>
  142. <div class="panel-body">
  143. <table class="table table-bordered tbl-items">
  144. <thead>
  145. <tr>
  146. <th>#</th>
  147. <th width="35%">Document Type</th>
  148. <th>File</th>
  149. <th>Action</th>
  150. </tr>
  151. </thead>
  152. <tbody class="filebody">
  153. <?php $i=1;?>
  154. @foreach($employee_document as $emp_doc)
  155. <tr>
  156. <input type='text' name="emp_doc_id[]" class="hidden" value="{{ $emp_doc->id }}">
  157. <td>{{ $i++ }}</td>
  158. <td>
  159. <select name="document_id[]" class='form-control'>
  160. <option disabled selected value>Choose One..</option>
  161. @foreach($all_document as $info)
  162. <option value="{{$info->id}}" @if($info->id == $emp_doc->document_id){{ 'selected' }}@endif>{{$info->document_name}}</option>
  163. @endforeach
  164. </select>
  165. </td>
  166. <td>
  167. <input type='file' name="file[]" class='form-control'>
  168. <small style="margin-top:3px;font-size: 10px;"> {{ @$emp_doc->file}}</small>
  169. </td>
  170. <td></td>
  171. </tr>
  172. @endforeach
  173. </tbody>
  174. </table>
  175. <button type='button' id='add_file' class='btn btn-sm' title='Add New Item'><i class="fa fa-plus"></i> Add more item</button>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  181. <div class="panel panel-default">
  182. <div class="panel-heading">
  183. <h3 class="panel-title">Academic Information</h3>
  184. </div>
  185. <div class="panel-body">
  186. <table class="table table-bordered tbl-items">
  187. <thead>
  188. <tr>
  189. <th>#</th>
  190. <th width="17%">Education Level</th>
  191. <th width="23%">Institute</th>
  192. <th>Major/Group</th>
  193. <th>Marks/CGPA</th>
  194. <th>Passing Year</th>
  195. <th>Duration</th>
  196. <th>Action</th>
  197. </tr>
  198. </thead>
  199. <tbody class="resultbody">
  200. <?php $i=1;?>
  201. @foreach($employee_education as $emp_edu)
  202. <tr>
  203. <input type='text' name="emp_edu_id[]" class="hidden" value="{{ $emp_edu->id }}">
  204. <td>{{ $i++ }}</td>
  205. <td>
  206. <select name="edu_level[]" id="edu_level" class='form-control' >
  207. <option disabled selected value>Choose One..</option>
  208. @foreach($all_level as $info)
  209. <option value="{{$info->id}}" @if($info->id == $emp_edu->edu_level_id){{ 'selected' }}@endif>{{$info->level_name}}</option>
  210. @endforeach
  211. </select>
  212. </td>
  213. <td>
  214. <input type='text' name="institute[]" class='form-control' placeholder="Institute" value="{{ $emp_edu->institute_name }}">
  215. </td>
  216. <td>
  217. <input type='text' name="major[]" class='form-control' placeholder="Major" value="{{ $emp_edu->major }}">
  218. </td>
  219. <td>
  220. <input type='text' name="marks[]" class='form-control' placeholder="Marks" value="{{ $emp_edu->marks }}">
  221. </td>
  222. <td>
  223. <input type='text' name="passing_year[]" class='form-control' placeholder="Passing Year" value="{{ $emp_edu->passing_year }}">
  224. </td>
  225. <td>
  226. <input type='text' name="duration[]" class='form-control' placeholder="Duration" value="{{ $emp_edu->duration }}">
  227. </td>
  228. <td> </td>
  229. </tr>
  230. @endforeach
  231. </tbody>
  232. </table>
  233. <button type='button' id='add_item' class='btn btn-sm' title='Add New Item'><i class="fa fa-plus"></i> Add more item</button>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  238. <div class="panel panel-default">
  239. <div class="panel-heading">
  240. <h3 class="panel-title">Work Experience</h3>
  241. </div>
  242. <div class="panel-body">
  243. <table class="table table-bordered tbl-items">
  244. <thead>
  245. <tr>
  246. <th>#</th>
  247. <th>Org Name</th>
  248. <th>Org Contact</th>
  249. <th>Designation</th>
  250. <th>Start Date</th>
  251. <th>End Date</th>
  252. <th>Action</th>
  253. </tr>
  254. </thead>
  255. <tbody class="expbody">
  256. <?php $i=1;?>
  257. @foreach($employee_ewe as $all_des)
  258. <tr>
  259. <input type='text' name="emp_exp_id[]" class="hidden" value="{{ $all_des->id }}">
  260. <td>{{ $i++ }}</td>
  261. <td>
  262. <input type='text' name="org_name[]" class='form-control' value="{{ $all_des->org_name }}" placeholder="Name">
  263. </td>
  264. <td>
  265. <input type='text' name="org_contact[]" class='form-control' value="{{ $all_des->org_contact }}" placeholder="Contact">
  266. </td>
  267. <td>
  268. <select name="designation[]" class='form-control' >
  269. <option disabled selected value>Choose One..</option>
  270. @foreach($all_designation as $data)
  271. <option value="{{ $data->id }}" @if($all_des->designation_id == $data->id) {{"selected"}} @endif>{{ $data->name }}</option>
  272. @endforeach
  273. </select>
  274. </td>
  275. <td>
  276. <input type='text' name="start_date[]" class='form-control date' value="{{ $all_des->start_date }}" placeholder=" Date">
  277. </td>
  278. <td>
  279. <input type='text' name="end_date[]" class='form-control date' value="{{ $all_des->end_date }}" placeholder=" date">
  280. </td>
  281. <td> </td>
  282. </tr>
  283. @endforeach
  284. </tbody>
  285. </table>
  286. <button type='button' id='add_exp' class='btn btn-sm' title='Add New Item'><i class="fa fa-plus"></i> Add more item</button>
  287. </div>
  288. </div>
  289. </div>
  290. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  291. <div class="panel panel-default">
  292. <div class="panel-heading">
  293. <h3 class="panel-title">Reference / Emergence Contact</h3>
  294. </div>
  295. <div class="panel-body">
  296. <table class="table table-bordered tbl-items">
  297. <thead>
  298. <tr>
  299. <th>#</th>
  300. <th>Person Name</th>
  301. <th>Relation</th>
  302. <th>Phone 1</th>
  303. <th>Phone 2</th>
  304. <th>Email</th>
  305. <th width="17%">Address</th>
  306. <th>Action</th>
  307. </tr>
  308. </thead>
  309. <tbody class="refbody">
  310. <?php $i=1;?>
  311. @if(!empty($employee_ref))
  312. @foreach($employee_ref as $emp_ref)
  313. <tr>
  314. <input type='text' name="emp_ref_id[]" class="hidden" value="{{ $emp_ref->id }}">
  315. <td>{{ $i++ }}</td>
  316. <td>
  317. <input type='text' name="person_name[]" class='form-control' placeholder="Name" value="{{ $emp_ref->person_name }}">
  318. </td>
  319. <td>
  320. <input type='text' name="relation[]" class='form-control' placeholder="Relation" value="{{ $emp_ref->relation }}">
  321. </td>
  322. <td>
  323. <input type='text' name="phone1[]" class='form-control' placeholder="Phone 1" value="{{ $emp_ref->phone1 }}">
  324. </td>
  325. <td>
  326. <input type='text' name="phone2[]" class='form-control' placeholder="Phone 2" value="{{ $emp_ref->phone2 }}">
  327. </td>
  328. <td>
  329. <input type='text' name="email[]" class='form-control' placeholder="Email" value="{{ $emp_ref->email }}">
  330. </td>
  331. <td>
  332. <input type='text' name="address[]" class='form-control' placeholder="Address" value="{{ $emp_ref->address }}">
  333. </td>
  334. <td> </td>
  335. </tr>
  336. @endforeach
  337. @endif
  338. </tbody>
  339. </table>
  340. <button type='button' id='add_ref_item' class='btn btn-sm' title='Add New Item'><i class="fa fa-plus"></i> Add more item</button>
  341. </div>
  342. <div class="panel-footer pull-right">
  343. <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Update data</button>
  344. <a href="{{ url('admin/employee') }}" class="btn btn-default">
  345. <i class="fa fa-times"></i> Cancel</a>
  346. </div>
  347. </div>
  348. </div>
  349. </form>
  350. </div>
  351. </div>
  352. @stop
  353. @section('script')
  354. <script type="text/javascript">
  355. $(function () {
  356. $('#add_item').click(function () {
  357. var n = ($('.resultbody tr').length - 0) + 1;
  358. var tr = '<tr><td class="no">' + n + '</td>' +
  359. '<td class=hidden><input type="text" name="new_edu_id" value="use_for_new_item"></td>'+
  360. '<td><select name="edu_level_new[]" class="form-control" required=""><option disabled selected value>Choose One..</option>@foreach($all_level as $info)<option value="{{ $info->id}}">{{ $info->level_name }}</option>@endforeach</select></td>'+
  361. '<td><input type="text" class="institute form-control" required="" name="institute_new[]" placeholder="Institute" ></td>'+
  362. '<td><input type="text" class="major form-control" required="" name="major_new[]" placeholder="Major" ></td>'+
  363. '<td><input type="text" class="marks form-control" required="" name="marks_new[]" placeholder="Marks"></td>'+
  364. '<td><input type="text" class="passing_year form-control" required="" name="passing_year_new[]" placeholder="Passing Year"></td>'+
  365. '<td><input type="text" class="duration form-control" name="duration_new[]" placeholder="Duration"></td>'+
  366. '<td><input id="delete_item" type="button" class="btn btn-danger" value="x"></td>';
  367. $('.resultbody').append(tr);
  368. });
  369. $('.resultbody').delegate('#delete_item', 'click', function () {
  370. $(this).parent().parent().remove();
  371. });
  372. });
  373. </script>
  374. <script type="text/javascript">
  375. $(function () {
  376. $('#add_exp').click(function () {
  377. var n = ($('.expbody tr').length - 0) + 1;
  378. var tr = '<tr><td class="no">' + n + '</td>' +
  379. '<td class=hidden><input type="hidden" name="new_exp_id" value="use_for_new_item"></td>'+
  380. '<td><input type="text" class="org_name form-control" required="" name="org_name_new[]" placeholder="Name" ></td>'+
  381. '<td><input type="text" class="org_contact form-control" required="" name="org_contact_new[]" placeholder="Contact" ></td>'+
  382. '<td><select name="designation_new[]" class="form-control" required="" ><option disabled selected value>Choose One..</option>@foreach($all_designation as $info)<option value="{{ $info->id}}">{{ $info->name }}</option>@endforeach</select></td>'+
  383. '<td><input type="date" class="start_date form-control date" required="" name="start_date_new[]" placeholder="Start Date"></td>'+
  384. '<td><input type="date" class="end_date form-control date" required="" name="end_date_new[]" placeholder="End Date"></td>'+
  385. '<td><input id="delete_exp" type="button" class="btn btn-danger" value="x"></td>';
  386. $('.expbody').append(tr);
  387. });
  388. $('.expbody').delegate('#delete_exp', 'click', function () {
  389. $(this).parent().parent().remove();
  390. });
  391. });
  392. </script>
  393. <script type="text/javascript">
  394. $(function () {
  395. $('#add_ref_item').click(function () {
  396. var n = ($('.refbody tr').length - 0) + 1;
  397. var tr = '<tr><td class="no">' + n + '</td>' +
  398. '<td class=hidden><input type="text" name="new_ref_id" value="use_for_new_item"></td>'+
  399. '<td><input type="text" class="person_name form-control" required="" name="person_name_new[]" placeholder="Name" ></td>'+
  400. '<td><input type="text" class="relation form-control" required="" name="relation_new[]" placeholder="Relation" ></td>'+
  401. '<td><input type="text" class="phone1 form-control" required="" name="phone1_new[]" placeholder="Phone 1" ></td>'+
  402. '<td><input type="text" class="phone2 form-control" required="" name="phone2_new[]" placeholder="Phone 2"></td>'+
  403. '<td><input type="email" class="email form-control" required="" name="email_new[]" placeholder="Email Address"></td>'+
  404. '<td><input type="text" class="address form-control" name="address_new[]" placeholder="Address"></td>'+
  405. '<td><input id="delete_ref" type="button" class="btn btn-danger" value="x"></td>';
  406. $('.refbody').append(tr);
  407. });
  408. $('.refbody').delegate('#delete_ref', 'click', function () {
  409. $(this).parent().parent().remove();
  410. });
  411. });
  412. </script>
  413. <script type="text/javascript">
  414. $(function () {
  415. $('#add_exp_history').click(function () {
  416. var n = ($('.ehbody tr').length - 0) + 1;
  417. var tr = '<tr><td class="no">' + n + '</td>' +
  418. '<td class=hidden><input type="hidden" name="new_emp_we_id" value="use_for_new_item"></td>'+
  419. '<td><input type="date" name="joining_date_new[]" id="joining_date" class="form-control date" placeholder="Date" required="" ></td>'+
  420. '<td><select name="current_designation_new[]" class="form-control" required=""><option disabled selected value> Choose One..</option>@foreach($all_designation as $info)<option value="{{ $info->id}}">{{ $info->name }}</option>@endforeach</select></td>'+
  421. '<td><select name="salary_grade_new[]" class="form-control" required=""><option disabled selected value> Choose One..</option>@foreach($all_grade as $info)<option value="{{ $info->id}}">{{ $info->name }}</option>@endforeach</select></td>'+
  422. '<td><input id="delete_item" type="button" class="btn btn-danger" value="x"></td>';
  423. $('.ehbody').append(tr);
  424. $('#add_exp_history').hide();
  425. });
  426. $('.ehbody').delegate('#delete_item', 'click', function () {
  427. $(this).parent().parent().remove();
  428. $('#add_exp_history').show();
  429. });
  430. });
  431. </script>
  432. <script type="text/javascript">
  433. $(function () {
  434. $('#add_file').click(function () {
  435. var n = ($('.filebody tr').length - 0) + 1;
  436. var tr = '<tr><td class="no">' + n + '</td>' +
  437. '<td class=hidden><input type="text" name="new_doc_id" value="use_for_new_item"></td>'+
  438. '<td><select name="document_id_new[]" class="form-control" required=""><option disabled selected value> Choose One..</option>@foreach($all_document as $info)<option value="{{ $info->id}}">{{ $info->document_name }}</option>@endforeach</select></td>'+
  439. '<td><input type="file" name="file_new[]" class="form-control" required=""></td>'+
  440. '<td><input id="delete_item" type="button" class="btn btn-danger" value="x"></td>';
  441. $('.filebody').append(tr);
  442. });
  443. $('.filebody').delegate('#delete_item', 'click', function () {
  444. $(this).parent().parent().remove();
  445. });
  446. });
  447. </script>
  448. <script type="text/javascript">
  449. $(document).ready(function() {
  450. $( ".date" ).datepicker({
  451. changeMonth: true,
  452. changeYear: true,
  453. yearRange: "c-100:c+10",
  454. dateFormat:"yy-mm-dd"
  455. });
  456. });
  457. </script>
  458. @stop