123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- @extends('layouts.master')
- @section('content')
- <!-- Main content -->
- <section class="content">
- <!-- Main row -->
- <div class="row">
- <div class="col-md-12">
- <section class="panel tasks-widget">
- <header class="panel-heading" style="height:40px;">
- <div class="pull-left">
- {{$title}}
- </div>
- <div>
- <button class="btn btn-success btn-xs pull-right" data-toggle="modal" data-target=".add-modal">Add Address Book Info</button>
- </div>
- </header>
- <div class="table-responsive project-list">
- @if(Session::has('msg'))
- {{Session::get('msg')}}
- {{"sdjflsdfjls"}}
- @endif
- <table class="table table-striped">
- <thead>
- <tr>
- <th>
- Name
- </th>
- <th>
- Company name
- </th>
- <th>
- Designation
- </th>
- <th>
- Mobile
- </th>
- <th>
- Email
- </th>
- <th>
- Action
- </th>
- </tr>
- </thead>
- <tbody>
- @if (session('data'))
- <div class="alert alert-success">
- {{ session('data') }}
- </div>
- @endif
- @if($all)
- @foreach($all as $info)
- <tr>
- <td>{{$info->name}}</td>
- <td>
- {{$info->company->name or ''}}
- </td>
- <td>
- {{$info->designation}}
- </td>
- <td>
- Mobile 01 # {{$info->mob1}} <br>
- Mobile 02 # {{$info->mob2}}
- </td>
- <td>
- Email 01 # {{$info->email1}} <br>
- Email 02 # {{$info->email2}}
- </td>
- <td>
- <input type="hidden" id="proj_id" value="{{$info->id}}">
- <button class="btn btn-xs edit-btn" data-toggle="modal" data-target=".edit-company" style="color: #7dcc93;">
- <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
- </button>
-
-
- <a onclick="return confirm ('want to delete?')" href="{{url("admin/address_book/$info->id")}}">
- <button class="btn btn-xs" style="color:#FD4B39;">
- <i class="fa fa-times" aria-hidden="true"></i>
- </button>
- </a>
-
- </td>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- <hr>
- </hr>
- </div>
- <div class="panel-body">
- <div class=" add-task-row">
- </div>
- <div class="table-foot">
- <ul class="pagination pagination-sm no-margin ">
- <li>
- <a href="#">
- «
- </a>
- </li>
- <li>
- <a href="#">
- 1
- </a>
- </li>
- <li>
- <a href="#">
- 2
- </a>
- </li>
- <li>
- <a href="#">
- 3
- </a>
- </li>
- <li>
- <a href="#">
- »
- </a>
- </li>
- </ul>
- </div>
- </div>
- </section>
- </div>
- </div>
- </section>
- <!-- row end -->
- <!-- /.content -->
- <!-- Modal Add Contract person -->
- <div class="modal fade add-modal" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="gridSystemModalLabel">Add Address Book Info</h4>
- </div>
- <div class="modal-body">
- <form action="{{url('admin/address_book')}}" method="POST">
- {{ csrf_field() }}
- <div class="form-group in-group">
- <label for="">Name<span class="field_mendatory">*</span></label>
- <input type="text" name="name" required="" class="form-control" id="" placeholder="Contact Person Name" >
- </div>
- <div class="form-group in-group">
- <label for="">Company Name</label>
- <select class="form-control" name="company_name" id="company_name">
- <option value="0">Select Company Name</option>
- @if(count($company)>0)
- @foreach($company as $info)
- <option value="{{$info->id}}">{{$info->name}}</option>
- @endforeach
- @endif
- </select>
- </div>
- <div class="form-group in-group">
- <label for="">Designation</label>
- <input type="text" name="designation" class="form-control" id="" placeholder="Designation" >
- </div>
- <div class="form-group in-group">
- <label for="">Mobile no #01<span class="field_mendatory">*</span></label>
- <input type="text" name="mob1" required="" class="form-control" id="" placeholder="Mobile number" >
- </div>
- <div class="form-group in-group">
- <label for="">Mobile no #02</label>
- <input type="text" name="mob2" class="form-control" id="" placeholder="Optional mobile number" >
- </div>
- <div class="form-group in-group">
- <label for="">Email #01</label>
- <input type="email" name="email1" required="" class="form-control" id="" placeholder="Email address" >
- </div>
- <div class="form-group in-group">
- <label for="">Email #02</label>
- <input type="email" name="email2" class="form-control" id="" placeholder="Optional email address" >
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- <button type="submit" class="btn btn-primary">Submit</button>
- </div>
- </form>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
- <!-- Modal Edit Company -->
- <div class="modal fade edit-company" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="gridSystemModalLabel">Edit Address Book Info</h4>
- </div>
- <div class="modal-body">
- <form action="{{url('admin/update_address_book')}}" method="POST">
- {{ csrf_field() }}
- <input type="hidden" name="edit_id" value="" id="edit_id">
- <div class="form-group in-group">
- <label for="">Name<span class="field_mendatory">*</span></label>
- <input type="text" name="edit_name" required="" class="form-control" id="edit_name" placeholder="User name" >
- </div>
- <div class="form-group in-group">
- <label for="">Company Name</label>
- <select class="form-control" name="edit_company_name" id="edit_company_name">
- <option value="0">Select Company Name</option>
- @if(count($company)>0)
- @foreach($company as $info)
- <option value="{{$info->id}}">{{$info->name}}</option>
- @endforeach
- @endif
- </select>
- </div>
- <div class="form-group in-group">
- <label for="">Designation</label>
- <input type="text" name="edit_designation" class="form-control" id="edit_designation" placeholder="Designation" >
- </div>
- <div class="form-group in-group">
- <label for="">Mobile no #01<span class="field_mendatory">*</span></label>
- <input type="text" name="edit_mob1" required="" class="form-control" id="edit_mob1" placeholder="Mobile number" >
- </div>
- <div class="form-group in-group">
- <label for="">Mobile no #02</label>
- <input type="text" name="edit_mob2" class="form-control" id="edit_mob2" placeholder="Optional mobile number" >
- </div>
- <div class="form-group in-group">
- <label for="">Email #01<span class="field_mendatory">*</span></label>
- <input type="email" name="edit_email1" required="" class="form-control" id="edit_email1" placeholder="Email address" >
- </div>
- <div class="form-group in-group">
- <label for="">Email #02</label>
- <input type="email" name="edit_email2" class="form-control" id="edit_email2" placeholder="Optional email address" >
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- <button type="submit" class="btn btn-primary">Submit</button>
- </div>
- </form>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
- @endsection
- @section('script')
- <script type="text/javascript">
- $('.edit-btn').click(function(event) {
-
- var id = $(this).prev('input').val();
-
- $.ajax({
- url: "{{url("admin/address_book")}}/"+id+"/edit",
- type: 'GET',
- })
- .done(function(data){
- $('#edit_id').val(data['id']);
- $('#edit_name').val(data['name']);
- $('#edit_designation').val(data['designation']);
-
- var company_name = data['company_name'];
- $("#edit_company_name option[value='"+company_name+"']").prop('selected', true);
- $('#edit_mob1').val(data['mob1']);
- $('#edit_mob2').val(data['mob2']);
- $('#edit_email1').val(data['email1']);
- $('#edit_email2').val(data['email2']);
- });
- });
- </script>
- @endsection
|