AbdulBazith

AbdulBazith

Member Since 1 Year Ago

India, Tamil Nadu, Tirunelveli

Experience Points
18,900
Total
Experience

1,100 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
7
Lessons
Completed
Best Reply Awards
2
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 4
18,900 XP
Jan
22
1 day ago
Activity icon

Started a new Conversation Having Many Roles, And Permissions How To Check Condition In Nav Bar And Blade Files

Guys iam working with a project School Management System

i have a doubt in checking condition in roles and permissions.

I used spatie-laravel-permission package for multiple authentication.

Everything works fine, i have added, user, role, permission, role->permission, user->role

But say for example

i have role Teacher, and i have total 10 permissions,

so if the teacher role have 7 permissions, then in my nav bar i have 10 items means, for each option i need to write the check condition like below

@role('teacher')
    item 1
@role('teacher')
    option 2
@role('teacher')
    option 3
@role('teacher')
    option 4
.
.
.
so on i need to check like this?

and if i need to check more than one role means how it possible?? for each item i need to check every condition like below?

@role('teacher') or @role('admin') or @role('accountant') ... . .. . . so on  // like this i need to write many condition 
    item 1
@role('teacher')
    option 2

for teacher role i can write @role('teacher') item 1 , but my doubt is teacher, prinicipal, vice principal, coordinator, adminstrator. like this 5 roles can have permission to access the nav item1.

i need to write 'or' conditions, or have a simple way.

and another thing,

do i need to check with permission?? or role?? that is

if (role) or if (permission to this role). which condition is good

and i have a table for user_to_permissions. what is the necessity for that?? why i need to give permission to users directly. i will make a user to a role, and assign permission to that role.

Kindly reply for this please...

This is my permission list: https://imgur.com/GYQ133S

This is my role list: https://imgur.com/JyseLLT

Kindly reply please and suggest ideas.

If i need to wirte condition for each role then for each nav item, i have to write many conditions how it possibe? is that a right way??

Activity icon

Replied to Return Back From One Method To Another Method With Given Date In Single Or Array Format

@snapey thank you for your response.

Kindly can you suggest any idea of keeping those values in session.

Because i need it in my current project also school management system. there also i need to keep the date in the session.

Please dont hesitate

Activity icon

Replied to Form Inside A Form With Post And Get Method Not Working (Nested Form)

@jlrdw @armancodes thank you so much guys for your responses

what i did is used ajax.

//my blade file

 <meta name="csrf-token" content="{{ csrf_token() }}">
 <button id="deleteRecord" data-id="{{ $supplierbalance->id }}" type="button" name="deleting">
 </button>

 //my ajax

 <script>
     $("#deleteRecord").click(function () {

         var x = confirm("Are you sure you want to delete?");
         if (x) {
             var id = $(this).data("id");
             var token = $("meta[name='csrf-token']").attr("content");

             $.ajax({
                 url: "SupplierPayment/" + id,
                 type: 'DELETE',
                 data: {
                     "id": id,
                     "_token": token,
                 },
                 success: function (data) {
                     alert(data['success']);
                     location.reload(true);
                 }
             });
         } else {
             return false;
         }

     });
 </script>


 // my controller

 public function destroy($id)
 {

 $pur_to_store = PurchaseToStore::find($id);

 PurchaseOrder::where('hotel_id', Auth::user()->hotel_id)->where('id', $pur_to_store->purchase_order_id)->
 update([
 "move_stock" => '0',
 ]);

 $pur_to_store->delete();

 Alert::success('Data Deleted successfully');

 return response()->json([
 'success' => 'Record deleted successfully!'
 ]);

 }

after deleting the page refreshes. everything worked fine thank you guys

Jan
21
2 days ago
Activity icon

Replied to Form Inside A Form With Post And Get Method Not Working (Nested Form)

@jove thank you so much for your response.

But is there any solution to to do this, i need both the button.

Jan
20
3 days ago
Activity icon

Started a new Conversation Form Inside A Form With Post And Get Method Not Working (Nested Form)

Guys i have a blade file, manage payment form

which has the following columns

 <form name="showallbalance_search_date_form1" id="showallbalance_search_date_form1" method="get"
     action="{{ route('pay_all_bills') }}" novalidate autocomplete="off" onsubmit="return validateForm()">
     {{ csrf_field() }}

<table>
<tr>
     <td><input type="checkbox" name="allbalance[]" class="checkboxes" value="{{ $supplierbalance->id }}" /></td>

    <td>Billno</td>

//this below is for paying a single bill. when clicking this it takes to a form there user can pay the bill amount
 <td>

<a href="{{ route('payform', $supplierbalance['id'])}}"> <button type="button"
             class="btn btn-info">Pay</button></a>
</td>



// this below is form deleting this
 <td>

     <form action="{{ route('SupplierPayment.destroy', $supplierbalance['id'])}}" method="post"
         onsubmit="return ConfirmDelete()">
         {{ csrf_field() }}
         <input name="_method" type="hidden" value="DELETE">

         <button type="submit" class="btn btn-info glyphicon glyphicon-trash" style="float:left; width:60%;background: #428BCA;
                                                            padding: 6px;
                                                            margin-right: 2px;">

         </button>
</form>
 </td>


 

</table>
 <div class="col-sm-7 col-sm-offset-5">
     <input type="submit" class="btn btn-primary mr5">Pay checked bills</button>
 </div>
 </form>

here the top form is used for when i check three bill and click Pay checked Bills the it moves to a controller where i can pay the checked bills.

The problem is now the delete button is not working.

i think i cant use nested forms. is there any solution??

Kindly suggest please

Activity icon

Replied to Sweet Alert Is Not Working In Laravel Framework 6.9.0

@snapey @frezno thank you so much guys, for your response.

I will try that package and inform you. thank you guys

Activity icon

Replied to Sweet Alert Is Not Working In Laravel Framework 6.9.0

@bugsysha thank you for your response

I will try and reply you, but i did everything its not working, i dont know why.

once again let me try

Activity icon

Replied to ReflectionException (-1) Class Clearance Does Not Exist After Login

@jove @nakov

i tried like this adding this line in my App\Http\Kernel.php class, in the $routeMiddleware array.

protected $routeMiddleware = [
        'auth' => \App\Http\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,

        // add your own here
        'isAdmin' => \App\Http\Middleware\IsAdmin::class     // This line i added
    ];


and when i used like below

public function __construct() {
        $this->middleware(['auth', 'isAdmin']); //isAdmin middleware lets only users with a //specific permission permission to access these resources
    }

it shows error Class App\Http\Middleware\IsAdmin does not exist

i googled it found a line when i added that it works. but i dont know wether that line is correct or not.

  public function __construct() {
        $this->middleware('auth', ['except' => ['getActivate', 'anotherMethod']]);
    }

The above line works fine. but i dont know those methods why present??

Activity icon

Started a new Conversation Return Back From One Method To Another Method With Given Date In Single Or Array Format

Guys iam working with a project Hotel Management System.

i have 3 functions in mycontroller PaymentController

//My routes

Route::resource('SupplierPayment', 'SupplierPaymentController');
Route::get('pay_form', '[email protected]_form')->name('pay_form');
Route::get('pay_bill', '[email protected]_bill')->name('pay_bill');
Route::get('payment_process', '[email protected]_process')->name('payment_process');

so when user selects the nav bar pay bills just it results an empty form where there will be two dates from and To. user will choose the payment date in the options and will click search Button. the it moves to pay_form method and fetches all the bills in the respective dates.

In each bill number i have a pay button, when i click the pay button it moves to pay_billmethod and brings the details of that bill and user will chose the date and mode of payment and the he will click submit button. then it goes to payment_process and the bill is paid.

Everything works fine. but my problem is after the user payment it redirects to pay_form method which shows an empty form. i didnt expect that, it should redirect to pay_bill method where it must shows the bills listed with the dates which is chosen before at the starting.

say for example i have chosen From :01-01-2020 To: 20-01-2020 means it fetches all bills, i will chose one specific bill and the i will pay the amount, but after that it should redirect to same page where 01-01-2020 to 20-01-2020 page only. so that user will choose another bill for payment.

now what hapens for me is after a bill payment the user need to choose the date once again to list the bills.

what i have tried is

public function index()
    {
    // first redirect to an empty form where it has only from to dates 
    }

 public function pay_form(Request $request)
    {
    //fetch all bills with given form to dates 
    }


public function pay_bill(Request $request)
    {
        redirect to a form with only selected bill 
    }



public function payment_process(Request $request)
    {
    save to the db as paid with that selected bill
    
here is my problem now it should to redirect to ```pay_form``` method with already chosen dates. what i did is just

 return redirect()->route('pay_form',$request);  // but this not worked . i need to pass those dates once again to the same ```pay_form``` function
    }

Kindly some one suggest your ideas please

Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov i have a small doubt in this kindly clear it.

i have role Teacher, and i have total 10 permissions,

so if the teacher role have 7 permissions, then in my nav bar i have 10 items means, for each option i need to write the check condition like below

@role('teacher')
    item 1
@role('teacher')
    option 2
@role('teacher')
    option 3
@role('teacher')
    option 4
.
.
.
so on i need to check like this?

and if i need to check more than one role means how it possible?? for each item i need to check every condition like below?

@role('teacher') or @role('admin') or @role('accountant') ... . .. . . so on  // like this i need to write many condition 
    item 1
@role('teacher')
    option 2

is my question is right?? or anything wrong?

Jan
10
1 week ago
Activity icon

Started a new Conversation Sweet Alert Is Not Working In Laravel Framework 6.9.0

Guys i have a project Hotel Management system, which was developed in laravel 5.4 version 1 year before. now it runs well in the live. i need to do some changes, so i downloaded it in local and update the composer

after composer updation all the above three packages has been automatically removed from composer

uxweb/sweet-alert 
barryvdh/laravel-dompdf
intervention/image   

Then i reinstalled these packages one by one. everything is ok but sweet alert is not working. i dont know whats the problem

i did like this

composer require uxweb/sweet-alert

'providers' => [
    UxWeb\SweetAlert\SweetAlertServiceProvider::class,
];

'aliases' => [
    'Alert' => UxWeb\SweetAlert\SweetAlert::class,
];

and in my blade i used

<head>
 <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</head>
<body>
 @include('sweet::alert')
</body>

But not working whats the problem. now i need to update the corrects in live, if i update it the sweet alert will be missing, the same thing i did in my old version it working fine, but after updation i dont know those packages removed and why now the sweet alert is not working

Activity icon

Replied to GroupBy In Controller Shows Error Trying To Get Property 'employee' Of Non-object Even Though It Has Record

@sti3bas @tisuchi thank you for your responses

but

@foreach($empatts as $empname => $results)
    <td width=10%>{{ $loop->iteration}} </td>
    <td width=10%>{{ $results->employee->emp_name  }} </td>
@foreach

this shows the same error Property [employee] does not exist on this collection instance.

and i cant put groupBy before get like this ->groupBy('emp_id')->get(); that too shows error

SQLSTATE[42000]: Syntax error or access violation: 1055 'newsrp_04_01_2020.emp_attendances.id' isn't in GROUP BY (SQL: select * from `emp_attendances` where `hotel_id` = 1 and (`att_date` between 2019-12-01 and 2019-12-31) group by `emp_id`)

so what can i doo??

you said use another forloop. but iam already using 2 forloops

 @foreach($empatts as $empname => $results) //first forloop
 @php
 //these for storing total preasent and total absent values
 $totalpresent = 0;
 $totalabsent = 0;
 $aa = 0;
 $bb = 0;
 @endphp

 <tr>
     <td width=10%>{{ $loop->iteration}} </td> // displays serial number
    
     <td width=10%>{{ $empname}} </td>// displays emp id but need emp name
     @foreach($results as $result)  // second forloop

     @php
     $totalpresent += $result->att_count;  // adds the total of numbers to store present days
     @endphp
     @if($result->att_count == 0 ) // this if for having a count of 0's that is absent
     @php
     $aa += 1;
     @endphp

     @endif
     @if($result->att_count == 0.5 ) // this if for adding the total of 0.5's that is half days
     @php
     $bb += $result->att_count;  // 
     @endphp

     @endif

     @endforeach
     <td><b>{{$totalpresent}}</b></td>  // this displays the total preasent days
     <td><b></b>{{$aa + $bb }}</td>  // this displays the total absent by adding the count of 0's and total of 0.5's
     <td><b>{{$totalpresent + $aa + $bb}}</b></td> displays total days

 </tr>

 @endforeach



 how i have my att_count in table is ```0= absent 0.5, half day, 1 = present```


Kindly suggest your ideass please

Activity icon

Replied to GroupBy In Controller Shows Error Trying To Get Property 'employee' Of Non-object Even Though It Has Record

@sti3bas thank you for your response,

But to display my employee name what should i do??

Jan
09
2 weeks ago
Activity icon

Started a new Conversation GroupBy In Controller Shows Error Trying To Get Property 'employee' Of Non-object Even Though It Has Record

Guys iam working with a project,

I have small a issue in groupBy function

my model is EmpAttendance in my controller i did a coding

$empatts = EmpAttendance::where('hotel_id', Auth::user()->hotel_id)->get()->groupBy('emp_id');

it fetched records correctly but when i use my model name in my blade it shows error.

in my bade file i used like this

 @foreach($empatts as $empname => $results)
<td width=10%>{{ $loop->iteration}} </td>
<td width=10%>{{ $empname->employee->emp_name  }} </td>
@foreach

but this shows error Trying to get property 'employee' of non-object

my EmpAttendance model

 public function employee()
    {
        return $this->belongsTo('App\Employee', 'emp_id');
    }

my Employee model

 public function empattendance()
    {
        return $this->hasMany('App\EmpAttendance', 'emp_id');
    }

whats the problem??? temporarily i did like this get()->groupBy('employee.emp_name') this worked for me correctly, but in same name there may be many employees so the data mixed. kindly someone help please

Jan
03
2 weeks ago
Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov yes , yes you are right,

now only my mind gets an idea of that, i understood, so that as a creator of the roles and permissions, i know where to wirte the conditions,

the school admin can just assign to a specific user, its their part.

But the roles, are decided by the school. accountant, teacher, parent, student, principal, correspondent, these are decided by the school,

so i need to get these roles from the school and i need to feed it in db???

Activity icon

Replied to ReflectionException (-1) Class Clearance Does Not Exist After Login

@jove thank you for your reply.

at my blade level, i started restricting by adding these lines like

@role('writer')
    I am a writer!
@else
    I am not a writer...
@endrole

but at my controller level i didnt do that?? so can you suggest you ideas?

whats the problem in that error ReflectionException (-1) Class clearance does not exist

Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov thank you thank you.

i understood, as you saying that, role can be handled by the user, but the permissions must be handled by the developer only.

so that we can easily make condition in nav bar am i right??

so permissions must be handled by myself only you are saying. but assigning user-> to this role can be done by the school admin, am i right??

so the role, and permission must be done by the developer,

is my understanding is right??? if wrong kindly guide me

Activity icon

Started a new Conversation ReflectionException (-1) Class Clearance Does Not Exist After Login

Guys iam working with a project School Management System

i processed my login authentication work with spatie-larevel-permission package.

everything is fine but iam getting an error when moving to add a student after login

ReflectionException (-1)
Class clearance does not exist

i have added this line in my StudentController

public function __construct() {
        $this->middleware(['auth', 'clearance']); //isAdmin middleware lets only users with a //specific permission permission to access these resources
    }

even i changed the line like below also


 public function __construct() {
        $this->middleware(['auth', 'isAdmin']); //isAdmin middleware lets only users with a //specific permission permission to access these resources
    }

whats the problem, after login it moves to home page, but when i click the nav bar add student it shows such an error. i dont know which line to add, when i referred in net they used with except('index','show'). but i no need that, everthing should be authenticated, as this was an application

i have users table, role table, role->permission table, user->role table.

and in my user model i added this line use HasRoles;

i used php php artisan make:auth

Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov ya you are right.

But now what should i do? then do i need to ask the school management about their roles, permissions and i need to fix that in the db, and need to write the condition??

so if any changes need they should contact the developer? is this a right format?

Jan
02
3 weeks ago
Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov ya you are right.

but how i can check?? is there any solution?? there are more that 7 modules, so for each module do i need to write manually?? but how?

in this package we should do like this only??


@role($user->role)   // this works fine am i right?? just if the role sets, or permission given show that else no need,


but for each nav bars, and each blade files in resource i need to do thiss??? is is correct way??

Activity icon

Replied to Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

@nakov thank you for your response.

but the link which u sent is also same as spatie nothing different. in that link also the checked like

@role('writer')
    I am a writer!
@else
    I am not a writer...
@endrole

here my problem is the role and permission is entered dynamically by the school management. so how can i check a condition like below

@role(how condition goes dynamically?? like if logged person is accountant, and he has permission to add salary)
   Add the salary nav bar should shown to that user
@else

here the condition maters, how to check it dynamically?

Activity icon

Started a new Conversation Role And Permission Need To Be Checked Dynamically Not Manually(this Works Fine) In Spatie Package

Guys iam working with a project School Management System.

I used spatie-laravel-permission package for multiple authentication.

Everything works fine, i have added, user, role, permission, role->permission, user->role

All i did and i checked the permission manually like

  @role('Accountant')
//Show Salary link in nav bar
  @endrole

This above code works fine. But my problem is

the role and permission are dynamic, it is left to the school they will enter the roles and permissions, and the admin of the school has the permission to assign role->user, and permission->to roles.

so think that

@role('Accountant')
//Show Salary link in nav bar
  @endrole


the same above code, i dont know the role name which entered by the school, so in the place of checking it is dynamic, how can i check it??

the same problem i will face in controllers, blades etc.

think that i have a nav bar like this

Role
        AddRole
        ManageRole
        
Permissions
        Add Permissions
        Manage Permissions

Students
        Add Student
        Manage student

Staff
        Add Staff
        ManageStadd

Student Attendance
        Add attendance
        Manage Attendance

Staff Attendance
        Add attendance
        manage attendance

Subjects
        Add
        manage

Exams
        Add
        Manage

Fee Structure
        add
        manage

FeePayment
        add
        manage

MarkDetails
        Add
        Manage

StaffSalary
        Add
        manage


Now the above all is my nav bar. here based on the user role the nav bar display will be changed. how can i check it dynamically.

say for example, a staff role have permission to use the nav bars like add mark, add subject, add exam. but dont have permission to add a student, only the office admin has the permission to add a student.

likewise a account has permission only to add fee structure, fee payment, add salary, the dont have permission to add mark, or exam, or subjects.

I have added the role and permission, everything, but checking the permission is dynamic how can i do that

how i added my role permission is like below

Staff Role->have permission to-> add_mark, add_exam, add_subject, edit_mark, edit_exam, edit_subject

Accountant Role->have permission to-> add_feepayment, edit_feepayment, add_salary, edit_salary, add_feestructure, edit_feestructure.

Just how i can check it??

Jan
01
3 weeks ago
Activity icon

Replied to Suggestion For Multiple Authentication Package In Laravel.

@alkut actually there are tables such as

Roles,
 Permission ,
 Role_Permission( to assign permission to role),
model_has_permission,
model_has_role

and iam referring this tutorial: https://www.youtube.com/watch?v=nx6eGEKnkwU&list=PLe30vg_FG4OQKaLJodH9E8htPvfj7jamt&index=2

Activity icon

Replied to Suggestion For Multiple Authentication Package In Laravel.

@alkut is there any problem with that one table?? because i never used spatie package.

just now i started with that, iam not clear about that, referring few tutorials for that..

can you suggest any easy tutorials for that??

Dec
30
3 weeks ago
Activity icon

Replied to Suggestion For Multiple Authentication Package In Laravel.

@alkut thank you for your reply.

actually the link which you send it predefined roles am i right?? admin and writer??

But my application the management decides the roles, involved. there may be 3 roles, 4 roles, or n number of roles with different permissions, so what can i do??

i decided to use spatie package, which has all i expected. whats your opinion???

Dec
20
1 month ago
Activity icon

Started a new Conversation Suggestion For Multiple Authentication Package In Laravel.

Guys Iam working with a project School Management System

i have completed Student,Staff, student-attendance, staff-attendance, class,section modules.

now i have to work with Authentication module.

I have googled about multiple authentication, many of them suggested spatie package.

here is what my user table looks

id  year_id     user_name   user_type   admin_no    user_phno   password
1      1        AAA          student      STU01     123         --
2      1        BBB          student      STU02     236         --
3      1        CCC          staff        STAF01    127         --
4      1        DDD          staff        STAF02    987         --

Almost more than 1000 students and 100 staff details are entered in the application. the application is in live.

Now i need to proceed with multiple authentication, so do i need to restrucutre the user table? is there may be any data loss??

How my authentication must be is,

All staff comes under the role STAFF they has permission to access only the student attendance, student mark module,

Few nonteaching staffs are there they come under COORDINATOR role. they can access only1 module in theapplication

Accountant and Sub-accountant fall under ACCOUNTANT role and they has permission to access Fee payment module, fe strucutre module.

the Roles are dynamic that the principal can create N number of roles and can add the user in any one role.

Parent also can access the application, they can only view theier student, details, attendance, fee payment, just only can view it,

i have another doubt also, eacher staff will be class teacher of 1 class (say for example staff CCC will be class teacher of V std), so that only that staff (CCC) has the permission to put attendance and add mark details of that class(V std) students, all other staff can just view that, but they dont have permission to edit or delete it,

so i think i need to map(tag) staff with respective classes am i right??

already i have a class and section table like below

id  year_id     class_name
1   1           V std
2   1           VI std

Section table

id  year_id     class_id        section_name
1   1           1                   A
2   1           1                   B

So after my reference i understood that, i need role table, permission table, role-permission table, module- permission table,role-module table.

is my understanding is correct? or else am i moving in wrong way? is these tables are necessary?? else i need more tables?

Kindly suggest any package and also video links for my multiple authentication.

else i can do this authentication manually. in my last project how i worked with athentication is,

my loginfunction

public function login(Request $request)
 {
  if (auth()->attempt(request(['user_name', 'password'])) == true  && Auth::user()->hotel_id == $request->hotel_id)

  {

   return redirect()->route('RegisterLogin.index');

  }
  else {
   return back()->withErrors([
    'message' => 'The email or password is incorrect, please try again',
   ]);

  }
 }

  public function index()
 {

  $user = Auth::user();
  return view('Home.index')->withUser($user);

 }

My logout function

public function logout()
 {
  auth()->logout();
  Alert::success('Successfully Logged out');
  return redirect()->route('login_form');
 }

the above function worked fine, i didnt use any athentication package or anything else.

just in my nav bar i would check like this and it worked.

 @if( auth()->check() && Auth::user()->user_type == "emp")
 {
     show these nav bars
 }

I dont know about middle ware etc. kindly suggest you ideas for this multiple authentication please.

Activity icon

Replied to Laravel Show Blank Page When Trying To Logout

@papia91 after logout you have redirect the page to login page or some other else.

if you didnt mention the redirection the it dont know what to do after logout.

public function logout() {
   session()->forget('name');

//redirect to some where else may be login page
 }

Dec
19
1 month ago
Activity icon

Replied to How To Display File In Laravel

@van-india have you checked in you console, whether it shows any error?

How you are saying the it fetched correcting but not displaying?

Activity icon

Replied to How To Display File In Laravel

@van-india

where you are storing your image. actually iam storing my image in public folder so my query would be,

 <img  src="{{ asset('StudentImages/'.$student->stud_image) }}" alt="user-img">

in my project i have a folder StudentImages in my public folder.

Dec
18
1 month ago
Activity icon

Replied to Display Records From Row Wise To Column Wise In Blade File Laravel

@sinnbeck once again thank you soo much. everything worked fine with one problem

what i did is,

in my controller

 $headers =StudentSubMark::distinct()->orderBy('subject_id')->get();     
        
$groups = StudentSubMark::orderBy('subject_id')->get()->groupBy('student_id');

actually distinct is not working. i dont know why.

In my blade file for my headers. unique() works fine for me for subject duplication problem if i remove this unique subjects are repeated.

<thead>
    <tr >
        <th>S.No</th>
        <th>Name</th>

        @foreach($headers->unique('subject_id') as $header)
        <th>{{  $header->subject->sub_name }}</th>
        @endforeach

        <th>Total</th>
    </tr>
</thead>

and for my body portion

<tbody>

    @foreach($groups as $student => $results)
    @php
    $total = 0;
    @endphp
    <tr>
        <td> {{ $loop->iteration }} </td>
        <td>{{$student }}</td>
//Here i face a problem, $student has id of that student. but i need the student name. i explained it below




        @foreach($results as $result)

        @if($result->mark==0)
        <td><b>A</b></td>
        @else
        <td>{{$result->mark ?? 0}}</td>
        @endif

        @php
        $total += $result->mark;
        @endphp

        @endforeach

        <td><b>{{$total}}</b></td>
    </tr>
    @endforeach

</tbody>

$student has id of that student. but i need the student name. i coded like below

{{$student->user->user_name ?? 'problem' }}

the problem is printed instead the name of the student. if i remove the problem and code like below

{{$student->user->user_name }} this shows error Trying to get property 'user' of non-object

whats the problem???

my models are

My User model

public function studentsubmark()
     {
         return $this->hasmany('App\StudentSubMark', 'student_id');
     }


My SubMark Model

 public function user()
    {
        return $this->belongsTo('App\User', 'student_id');
    }


when i dd($groups)

Collection {#552 ▼
  #items: array:8 [▼
    321 => Collection {#535 ▶}
    319 => Collection {#526 ▶}
    320 => Collection {#536 ▶}
    318 => Collection {#544 ▶}
    313 => Collection {#545 ▶}
    310 => Collection {#553 ▶}
    311 => Collection {#549 ▶}
    312 => Collection {#551 ▶}
  ]
}

all the numbers are student id

Kindly answer this please. and also suggest a table structure if possible.

i have to enter class, section, exam, subect, student, mark.

i have divied it onto two tables whether that is right or not that is in this thread

Link:

https://laracasts.com/discuss/channels/laravel/error-in-student-mark-db-structure-insert-and-view

if possible answer the link thread else kindly answer to this thread about the student name..

Dec
17
1 month ago
Activity icon

Replied to Display Records From Row Wise To Column Wise In Blade File Laravel

@sinnbeck thank yu sooo much for your response. it worked but having problem in table heading (headers ) as you said.

in header i need like these

StudentName     English     Maths       Science ....... (all these are in mark table as subject_id)

Kidnly help me for that tooo pleasee

Activity icon

Replied to Display Records From Row Wise To Column Wise In Blade File Laravel

I need to use groupBy for this. but i unable to understand where to use it,

i referred this link for it:

https://stackoverflow.com/questions/37993846/how-to-convert-rows-into-columns-in-laravel

but i cant understand.

@snapey please please suggest your idea

Activity icon

Replied to Display Records From Row Wise To Column Wise In Blade File Laravel

@van-india thank you for your response

i tried like this

$query= StudentSubMark::distinct()->get(['student_id','subject_id','mark']);

in my blade

<thead>
    <tr class="unread bggrn">
        <th>S.No</th>
        <th>Name</th>

        @foreach($query as $sub)

        <th>{{  $sub->subject->sub_name }}</th>

        @endforeach

    </tr>
</thead>
<tbody class="capital">

    @foreach($query as $sub)

    <tr class="profile-table">
        <td> {{ $loop->iteration }} </td>

        <td> <a href="">{{ $sub->user->user_name }} </a> </td>
        <td> {{  $sub->mark }} </td>
        <td>{{ $sub->student_remarks }}</td>
    </tr>

    @endforeach

</tbody>

but the output looks like this

S.No        Name        Tamil   English
1           Muthu       30  
2           Muthu       60  

but currently what i have in my db is

id  exam        class   student     subject     marks
1   monthly     V       muth         tamil      30
2   monthly     V       muthu       Engish      60

whats the problem??i have entered muthu's tamil and english mark. both tamil and english mark are displayed in tamil column. i need it to be displayed in english.

Activity icon

Replied to Selecting Two Values From The Same Table But Under Different Conditions?

@smeunus

for what reason you are trying to do like that?

or else just fetch $students = Student::get();

and in you view file use a if condition based on your requirement

like

@foreach($students as $student)

@if($student->promoted ==1)
//your code
@else
//your code
@endif
@endforeach

But what you expecting either only two records from table, or all records from table.

Activity icon

Started a new Conversation Display Records From Row Wise To Column Wise In Blade File Laravel

Guys iam working with a project.

i have a table Student_mark with columns the below is my table structure

id  exam        class   student     subject     marks
1   monthly     V       AAA         english     60
2   monthly     V       BBB         Engish      70
3   monthly     V       CCC         English     90
4   monthly     V       AAA         Maths       89
5   monthly     V       BBB         Maths       70
6   monthly     V       CCC         Maths       45

iam expecting the output like below in my blade file

Exam:Monthly        Class: V

Sno     Student     English     Maths
1       AAA         60          89      
2       BBB         70          70
3       CCC         90          45

How can i achieve this?

actually i asked this in my previous thread also. but i made this thread very simple. my problem is data are repeating. the names and subjects are repeating so what can i do?? Kindly someone suggest any idea

the brief details is here in this thread:

https://laracasts.com/discuss/channels/laravel/error-in-student-mark-db-structure-insert-and-view

But if you answer for this i can compare it with my tables and make it.

Activity icon

Replied to Error In Student Mark DB Structure Insert And View

@martinbean thank you for your response.

Kindly suggest your idea please

Dec
14
1 month ago
Activity icon

Replied to Error In Student Mark DB Structure Insert And View

I will explain what i have tried,

My tables are just two for the mark

MainMark with columns

id      class_id        section_id      exam_id
1       1           1               1
2       1           1               2

SubMark with columns

id  mainmark_id     student_id  subject_id  mark
1   1               1           1           80
2   1               2           1           90
3   1               3           1           50
4   1               4           1           60

in the above table for a single subject that is (subject: english) i have entered mark for 4 students, the exam name, class section are refered from the mainmark table. how to fetch this as my expected output below

class: V STD        Section: A      Exam: Quarterly Exam

StudentName     English     Maths       Science
Bazith              80          40          60
Abdul               60          70          80
Imran               69          75          85

Like above i need the output,

what i tried in coding is my controller

 $students = StudentMainMark::where(function ($query) use ($request) {

            if (!empty($request->class_id)) {

                $query->where('class_id', $request->class_id);
            }
            if (!empty($request->section_id)) {

                $query->where('section_id', $request->section_id);
            }
            if (!empty($request->exam_id)) {

                $query->where('exam_id', $request->exam_id);
            }

        })->with('studentsubmark')->get();

In the above code iam fetching records based from mainmark table with class and section and exam id. with its sub mark.

when i dd($students);

Collection {#546 ▼
  #items: array:1 [▼
    0 => StudentMainMark {#545 ▼
      #connection: "mysql"
      #table: "student_main_marks"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:10 [▼
        "id" => 34
        "acc_year_id" => 1
        "exam_date" => "2019-12-12"
        "class_id" => 6
        "section_id" => 16
        "exam_id" => 2
        "exam_remarks" => ""
        "exam_status" => "active"
        "created_at" => "2019-12-12 07:26:04"
        "updated_at" => "2019-12-12 07:26:04"
      ]
      #original: array:10 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: array:1 [▼
        "studentsubmark" => Collection {#576 ▼
          #items: array:4 [▼
            0 => StudentSubMark {#580 ▼
              #fillable: array:7 [▶]
              #connection: "mysql"
              #table: "student_sub_marks"
              #primaryKey: "id"
              #keyType: "int"
              +incrementing: true
              #with: []
              #withCount: []
              #perPage: 15
              +exists: true
              +wasRecentlyCreated: false
              #attributes: array:10 [▼
                "id" => 35
                "acc_year_id" => 1
                "main_mark_id" => 34
                "student_id" => 10
                "subject_id" => 12
                "mark" => 57.0
                "student_remarks" => null
                "status" => "active"
                "created_at" => "2019-12-12 07:26:04"
                "updated_at" => "2019-12-12 07:26:04"
              ]
              #original: array:10 [▶]
              #changes: []
              #casts: []
              #dates: []
              #dateFormat: null
              #appends: []
              #dispatchesEvents: []
              #observables: []
              #relations: []
              #touches: []
              +timestamps: true
              #hidden: []
              #visible: []
              #guarded: array:1 [▶]
            }
            1 => StudentSubMark {#581 ▶}
            2 => StudentSubMark {#582 ▶}
            3 => StudentSubMark {#583 ▶}
          ]
        }
      ]
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #fillable: []
      #guarded: array:1 [▶]
    }
  ]
}

in my view. blade file

<table class="table">
    <thead>
        <tr class="unread bggrn">
            <th>S.No</th>
            <th>Name</th>

            @foreach($students->studentsubmark as $sub)
            <th>{{  $sub->subject->sub_name }}</th>
            @endforeach

        </tr>
    </thead>
    <tbody class="capital">
        @foreach($students->studentsubmark as $sub)
        <tr class="profile-table">
            <td> {{ $loop->iteration }} </td>
            <td> <a href="">{{ $sub->user->user_name }} </a> </td>
            <td> {{  $sub->mark }} </td>
            <td>{{ $sub->student_remarks }}</td>
        </tr>
        @endforeach

    </tbody>
</table>

Expected Output:

StudentName     English     Maths       Science
Bazith              80          40          60
Abdul               60          70          80
Imran               69          75          85

in the above view iam trying to make a output like mentioned. but the subjects and name are repeated. why?

and this are my models

Main Mark Model
class StudentMainMark extends Model
{
    
    public function studentsubmark()
    {
        return $this->hasmany('App\StudentSubMark', 'main_mark_id');
    }
}



SubMark Model

public function studentmainmark()
    {
        return $this->belongsTo('App\StudentMainMark', 'main_mark_id');
    }

public function user()
    {
        return $this->belongsTo('App\User', 'student_id');
    }
    
    public function subject()
    {
        return $this->belongsTo('App\SubjectInfo', 'subject_id');
    }


But i face a problem is the names and subjects are repeated in the view. blade as for loop is mistake or something else i dont know

Dec
13
1 month ago
Activity icon

Replied to Error In Student Mark DB Structure Insert And View

My big Problem is intermeidate table. i cant get how to use intermediate table and whatever columns present in that table. Guys Sorry for tagging You all please.

@snapey @bobbybouwmann @tykus @martinbean @Nakov @jlrdw

You all guys answered me a lot of threads before. thats why iam tagging you. kindly suugest you opinion please,

i need to enter student mark How many tables i need to use.

i have the following tables AccademicYearTable, ClassTable, UserTable(studentdetails), SubjectTable, ExaminationTable Based on these tables i need to enter student mark.

Kindly suggest

Dec
12
1 month ago
Activity icon

Replied to Error In Student Mark DB Structure Insert And View

@snapey

I think after long gap iam tagging you. Kindly suggest your idea please.

just need to enter student mark.

the tables already have are ClassTable, UserTable,ExamTable,SubjectTable these are the tables i have. how to mingle this and to have a mark table. please suggest me an idea please.

Dec
11
1 month ago
Activity icon

Started a new Conversation Error In Student Mark DB Structure Insert And View

Guys iam working with a project School Management System

I have a small problem in entering marks of the student for specific class.

i have a form to add the student mark. first need to choose the class , section which subject(Eg: English), and which Exam (Eg: Quarterly exam). for that whole class english mark for quarterly exam is entered. now the problem is in db. how to frame the structure.

i have the following tables

SubjectDetails with columns (which has Subject details. just shown few columns only)

id      subjectcode     subjectName
1       SB01            English
2       SB02            Maths
.
.
.

ExamDetails with columns (which has Exam details. just shown few columns only)

id      Examcode        examName
1       Ex01            Quarterly Exam
2       Ex02            Halfyearly Exam

User with columns (which has student details. just shown few columns only)

id  user_name   class   section
1   Abdul       V       A
2   Bazith      V       A
3   Imran       V       A
4   Muthu       V       A

Now i need to mingle the above three tables and to have a new table to enter the student marks. how to do that, thats my question

what i did is had two tables

MainMark with columns

id  class_id    section_id  exam_id
1   V       A           1

SubMark with columns

id  mainmark_id     student_id  subject_id  Mark
1       1           1           1           80
2       1           2           1           90
3       1           3           1           75
4       1           4           1           60      

In the above table student_id and mark is changing. here for the same exam same class, same section i have entered the marks. so i given (exam, class, section) in mainmark table and for different student for different subject their mark changes so i given that in Submark table.

But fetching is the big issue for me. i think i done wrong some where. i cant predict it. kindly someone suggest your suggestion please.

The output i expect is when i choose a class and section and the exam, the student name with subject and marks must be displayed. this what i expect. Kindly some one help

Nov
28
1 month ago
Activity icon

Replied to Suggestion For Many To Many Relationship, And Data Repentance Laravel

@jeffreyvanrossum @bugsysha thank you guys thank you for your response.

Ya i know that post and tags where we can use pivot table.

ok let me ask a simple doubt?

i have two tables,

ClassDetails with columns

id      class_Name
1       V std
2       VI std

SubjectDetails with columns

id      subcode     subname
1       S001        English
2       S002        Maths
3       S004        Science

Now a single class can have many subjects and a single subject corresponds to many class.

for this iam doing a pivot table, ClassDetails_SubjectDetails

id      class_id        subject_id
1       1           1
2       1           2
3       2           1

here is my doubt i need a column status= active or inactive for both subject and class, because, i have a column acc_year in all tables. this year there may be english subject. but for next academic year they may remove the subject. i cant delete it, because old sudent marks are there. so i will inactive it, so for next year it wont come, so where i should use this status?? in class table or subject table or pivot table??

after using all these if i need to retrieve the subjects which belongs to a specific class the how i can do that???

Kindly suggest your ideas

Nov
26
1 month ago
Activity icon

Replied to Generate Serial Number With Current Year And Last Id Automatically Laravel

@alanholmes and @rodrigo.pedra thank you so much guys for your response. I will try it and it and inform .

Kindly if possible please suggest an idea for the below thread please. facing a huge problem in that. for past 3 months. still in confusion state.

Link: https://laracasts.com/discuss/channels/laravel/suggestion-for-many-to-many-relationship-and-data-repentance-laravel

Kindly suggest your opinion please please

Activity icon

Started a new Conversation Suggestion For Many To Many Relationship, And Data Repentance Laravel

Guys i have a big doubt in my project.

still now i worked with one to many relation only in my projects. iam not too familiar with many to many relationship.

iam working with a school project. got too confused with fee module. need a suggestion

i need to frame the fee structure of the school.

this is my table strucutre : https://imgur.com/KxLpQWI

I have drawn the table in my note: https://imgur.com/rmJWDSK

i have drawn the unstructured table also: https://imgur.com/DD1CHud

the requirement is, each class posses different fee structure and each fee structure has sub categories say for example,

Class: V std 

Term1 (main category)

        Tution fee  -   5000
        Van Fee     -   2000
        Extra Curicular-    4000
        Total           11000

Class: X std 

Term1 (main category)

        Tution fee  -   2000
        Van Fee     -   2000
        Extra Curicular-    4000
        Total           8000

In the above example for class V std term1 fee is 11000 with its sub categories and for class X std term1 fee is 8000 with its sub categories.

So already i have a table ClassDetails with columns

id      class_name      note
1       I std           this is 1st std
2       IIstd           this is 2nd standard
.
.
.so on

Now for fee structure how to frame the table? i know i need to have two tables feeMainCategory and FeeSubCategory.

but i need to link class with Feemainctegory and feemaincategory with feesubcategory

For this how many intermediate tables i need to have? how to frame a table. just i made the tables without intermediate. working fine, but the data are repeated.

my feemaincateogy table must possess the following columns

id  year        class_id        feemainName     note    status  amt
1   2019            1           Term1           ..      active  6000
2   2020            2           Term1           ..      active  9000

my feesubcateogy table must possess the following columns

id  feemaincat_id       subcatname      amt     note        status  
1   1                   busfee          3000        ...     active
2   1                   extrafee            3000        ...     active
3   2                   bus             8000        ...     active
4   2                   tutionfee       1000        ...     active

How i can mingle this tables. in this status is important because based on year those details changes. say for example, in 2019 term1 is active. but in 2021 they will stop term1 and have a different name with different amount. so i need that tooo. even sometimes the same term1 will for next year the amount will be increased. how to update this all?? kindly suugest me with ideas please. got so confused with relationship of many. please suggest with example table or any other links also please? can i have a extra column in my intermediate table?? like this status??

i have already asked this question many times. but still confused. i have shorten the question in this thread. if doubts you can refer the below threads for this question please.

Refer:

https://laracasts.com/discuss/channels/laravel/problem-any-to-many-relationship-with-class-and-fees

https://laracasts.com/discuss/channels/guides/problem-in-fetching-records-from-db-need-suggestion-for-columns-in-table

Nov
25
1 month ago
Activity icon

Replied to Comparison Of Two Tables With A Name In Where Condition In Laravel

@rodrigo.pedra thank you thank you so much. it worked fine. i made small changes with if condition in my view and thats it.

thank youuu..

if possible kindly suggest your answer for this please

Link: https://laracasts.com/discuss/channels/laravel/generate-serial-number-with-current-year-and-last-id-automatically-laravel

Activity icon

Started a new Conversation Generate Serial Number With Current Year And Last Id Automatically Laravel

Guys iam working with a project. i have a small doubt,

i have a fee payment form. the bill number must be automatically generated. how to do that?

year + serial Number in this order i need the bill number.

say for example,

Bill19-20-01
Bill19-20-02
Bill19-20-03

Here ```Bill``` is predefiend texr ```19-20``` is year and ```01,02, 03``` are comes from the next id of that payment table. how to get that??

FeePayment is my model name and feepayment is my table name

even i have a drop down in all form. for accademic year.

AccademicYear my model name and accademicyear table name with columns

id      accname
1       2018-2019
2       2019-2020

How to get this?

Nov
22
2 months ago
Activity icon

Replied to Comparison Of Two Tables With A Name In Where Condition In Laravel

@rodrigo.pedra thank you thank you so much for your response.

i tried your code just editing like this, in my controller.

  $records = FeePayment::query()
                ->with(['feeStructure'])
                ->selectRaw('student_id, feeStructure, SUM(paid_amt + disc_amt - fine_amt) as paid')->where('student_id',74)
                ->groupBy([ 'student_id', 'fee_main_cat_id'])
                ->get()
                ->groupBy('student_id');

Everthing worked fine. i added disc_amount with that, because i have a column in my payment table. and i need a where condition for specifically mention the student so i added that also.

but i have a small problem, if student_id: 5 didnt pay any fee means it should return all the terms fees from feeStrucutre table?? and if a student paid only term1 fee, then the remaining terms fee and its amount should be displayed. so that i will have a link and i will click and pay that in the same payment table.

this is what the output when student:5 doesnt pay any fee means,

Term1 Balance 6000
Term2 Balance 8000
Term3 Balance 10000

Actually this shows the whole,  term and fee from feestrucutre table because this student didnt pay any fee. so i have a link by click the amt and it will redirect to payment page.

if the student paid only term1 partially that is , term1 fee is 6000, but he paid only 4000 means the output should be,

Term1 Balance 2000
Term2 Balance 8000
Term3 Balance 10000

How this comes is for term1 he paid 4000 so its balance is shown and remaining term2 and term3 he not paid a single amount, so it shown fully.

as per your query everything works fine, but it shows only when student pays the fee. because the query projects from FeePayment Table.

can you guide me to achieve my output. thank you.

i think i didnt confuse you.

Activity icon

Started a new Conversation Comparison Of Two Tables With A Name In Where Condition In Laravel

Guys i have a small error in my project. i have two tables

Table 1: fees_structure its model is FeeStructure with columns

id      Name        Amount
1       Term1       6000
2       Term2       8000
3       Term3       10000

Table 2: fees_payment its model is FeePayment with columns

id      feestrcutre_id      student_id      Amount
1           1               5               1000
2           1               5               1000
3           1               5               2000
4           2               5               4000
5           2               5               1000
6           3               5               2000
7           3               5               2000

See i have above two tables in first table feestructure i have the name and amount. in the second table feepayment i have paid the amt for each student. let the student_id be 5

Now whats my doubt is when i choose student 5 means, it should compare, both the tables, compare the payment done by the student with fees_structure table and should return the balance amount.

From the above two tables the output will be like this, student may pay the fee in installment. in the above payment table student id 5 had paid the Term1 fee in 3 installment, 1000,1000,2000 (Total : 4000). original term1 fee amount is 6000(fees_structure table) so (6000 - 4000 = 2000)

The output looks like below. it should compare for each term for that student and return the balance amount to be paid.

Student Id: 5

Term1   Balance     2000

Term2   Balance     3000

Term3   Balance     6000    

How this comparison is done??? i know that i need to use loop in controller for checking the condition. Kindly give me a suggestion for this please. if you give a hint i will catch it up.

if student_id and feestructure both given say for example, student_id:5 fee:Term1 means the comparison would be easy. but only student_id will be given and it should compare all the fee strucutre like term1,term2,term3.......

Kindly suggest me a solution...