0

I'm kinda new here, just need help with small code.

I need to print specific area with a Print Payment Record that I've already added, I've added a new button, tried with another tutorial but I couldn't do it, with my other code print the entire page.

I know I can highlight the table and hit print but having a button is easier mostly when the record is like 50 payments.

Start in Deposit Fee in Details.

Help with these please!

This is my code:

@extends('branch.layout.main')
@section('title') Manage Fee @endsection

@section('content')
<div class="container">
    <div class="section">

        @section('button')
        <a href="#AddNew" class="btn cyan waves-effect waves-light right modal-trigger" style="margin-top:25px">Deposit Fee</a>
        @endsection
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="card-panel">
                    <div class="row">
                        <h4 class="header2" style="color:#00bcd4"><i class="mdi-social-person" style="font-size:20px"></i> Fee Detail of {{ $student->first_name." ".$student->last_name }}</h4>

                        <table class="striped" >
                            <thead>
                                <tr>
                                    <th>Current Course</th>
                                    <th>Course Fee</th>
                                    <th>Discount</th>
                                    <th>Any Extra</th>
                                    <th>Total Payable</th>
                                    <th>Deposited Fee</th>
                                    <th>Balance</th>
                                </tr>
                                <tr>
                                    <td width="20%">{{ $course->courseName }}</td>
                                    <td width="13%">{{ IMS::currency().$course->course_fee }}</td>
                                    <td width="13%">{{ IMS::currency().$course->discount }}</td>
                                    <td width="13%">{{ IMS::currency().$extra }}</td>
                                    <td width="13%">{{ IMS::currency().$payable }}</td>
                                    <td width="13%">{{ IMS::currency().$deposited }}</td>
                                    <td width="13%"><span style="color:red">{{ IMS::currency().$balance }}</span></td>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--Deposited Fee in Detail-->
    @if(count($fees) > 0)
    <div class="row">
        <div class="col s12 m12 l12">
            <div class="card-panel">
                <div class="row">
                    <h4 class="header2" style="color:#00bcd4"><i class="mdi-content-add" style="font-size:20px"></i> Deposited Fee of {{ $student->first_name." ".$student->last_name }}</h4>

      <button onclick="printContent('row')">Print Payment Record </button>


  <table class="striped" >
                        <thead>
                            <tr>
                                <th>Date Added</th>
                                <th>Amount</th>
                                <th>Course</th>
                                <th>Due Date</th>
                                <th>Option</th>
                            </tr>
                            @foreach($fees as $fee)
                            <tr>
                                <td width="20%">{{ date('d-M-Y',strtotime($fee->date_added)) }}</td>
                                <td width="20%">{{ IMS::currency().$fee->amount }}</td>
                                <td width="20%">{{ $fee->courseName }}</td>
                                <td width="20%">@if($fee->due_date) {{ date('d-M-Y',strtotime($fee->due_date)) }} @else --- @endif</td>
                                <td width="20%">
                                    <a href="{{ Asset('fee/print/'.$fee->id) }}" class="btn cyan tooltipped " data-position="top" data-delay="50" data-tooltip="Print Invoice" style="padding:0px 10px" target="_blank"><i class="mdi-maps-local-print-shop"></i></a>
                                    <a href="{{ Asset('fee/printDownload/'.$fee->id) }}" class="btn cyan tooltipped " data-position="top" data-delay="50" data-tooltip="Download Invoice" style="padding:0px 10px" target="_blank"><i class="mdi-maps-local-print-shop"></i></a>
                                    @if($delete)
                                        <a href="javascript::void()" class="btn red tooltipped " data-position="top" data-delay="50" data-tooltip="Delete This Entry" style="padding:0px 10px" onclick="confirmAlert('{{ Asset('fee/delete/'.$fee->id) }}')"><i class="mdi-content-clear"></i></a>
                                    @endif
                                </td>
                            </tr>
                            @endforeach
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
@endif
<!--End Deposited Fee in Detail-->

<!--Add New Fee-->
<div id="AddNew" class="modal modal-fixed-footer">
    <div class="modal-content">
        <h4 class="header2">Deposit Fee For {{ $student->first_name }} {{ $student->last_name }}</h4>
        <form action="{{ Asset('fee/'.$student->id) }}" method="post">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div class="row">
                <div class="input-field col s6">
                    <i class="mdi-editor-insert-invitation prefix"></i>
                    {!! Form::date('date_added',date('Y-m-d'),['id' => 'date_added','class' => 'datepicker']) !!}
                    <label for="date_added">Date Added *</label>
                </div>
                <div class="input-field col s6">
                    <i class="mdi-editor-attach-money prefix"></i>
                    {!! Form::number('amount',null,['id' => 'amount','required' => 'required','pattern' => '[0-9]{10}']) !!}
                    <label for="amount">Amount *</label>
                </div>
            </div>
            <div class="row">
                <div class="input-field col s6">
                    <select name="payment_mode">
                        <option>Please select Payment Type</option>
                        <option>Cash</option>
                        <option>Cheque</option>
                        <option>Card</option>
                        <option>Credit or Discount</option>
                    </select>
                </div>
                <div class="input-field col s6">
                    {!! Form::text('cheque_Card_Number', null, ['id' => 'cheque_Card_Number']) !!}
                </div>
            </div>
            <p style="color:red"><i class="fa fa-bell"></i> If you want fee due reminder then select fee due date,if not then leave empty</p>
            <div class="row">
                <div class="input-field col s12">
                    <i class="mdi-editor-insert-invitation prefix"></i>
                    {!! Form::date('due_date',null,['id' => 'due_date','class' => 'datepicker']) !!}
                    <label for="due_date">Due Date</label>
                </div>
            </div>
            <div class="modal-footer">
                <a href="#" class="waves-effect waves-red btn-flat modal-action modal-close">Close</a>
                <button type="submit" class="btn blue modal-action modal-close">Save</button>
            </div>
        </form>
    </div>
</div>
<!--End Add New Fee-->
@endsection
  • Are we talking "printing" content in the browser or physical to paper printing? `onclick="printContent('row')"` is not clear to me what the outcome actually is. – Scuzzy Jan 18 '18 at 00:00
  • https://stackoverflow.com/questions/2255291/print-the-contents-of-a-div – Scuzzy Jan 18 '18 at 00:17
  • Possible duplicate of [Print the contents of a DIV](https://stackoverflow.com/questions/2255291/print-the-contents-of-a-div) – Rasclatt Jan 18 '18 at 05:13

0 Answers0