Hello!
I have two templates, viz.:
1. students.php
2. fees.php
The students.php template is a DBF to create a student. The fees.php template is a DBF to create a month and the fees of the month.
I have also created a third template named fees-payment.php. I intend to use this template to generate a receipt of fees payment, i.e. if student X pays fees for January a receipt stating the same should be generated. And once the student X has paid the fees for January, when she returns for paying the fees, the month of January should not appear on the fees-payment.php.
How can this be done?
My codes for the templates are:
students.php
fees.php
fees-payment.php:
Any help would be more than appreciated.
Regards,
GenXCoders
I have two templates, viz.:
1. students.php
2. fees.php
The students.php template is a DBF to create a student. The fees.php template is a DBF to create a month and the fees of the month.
I have also created a third template named fees-payment.php. I intend to use this template to generate a receipt of fees payment, i.e. if student X pays fees for January a receipt stating the same should be generated. And once the student X has paid the fees for January, when she returns for paying the fees, the month of January should not appear on the fees-payment.php.
How can this be done?
My codes for the templates are:
students.php
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Students' clonable='1'>
<!-- k_page_title == Student Name -->
<cms:editable name='smobile' label='Student Mobile Number' type='text' required='1' validator='exact_len=10 | non_negative_integer' order='1' />
<cms:editable name='semail' label='Student Email Id' type='text' required='1' validator='email' order='2' />
<cms:editable name='student_feesmonth' label='Paid Months' desc='will appear selected' type='relation' masterpage='fees.php' reverse_has='many' order='3' />
</cms:template>
<html>
<head>
<title>Students</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<style>
body {
margin: 0;
padding: 0;
}
table > thead > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > thead > tr > th {
background-color: rgba(0,0,0,0.8);
color: white;
}
.gxcpl-ptop-10 {
padding-top: 10px;
}
input {
padding: 5px 10px;
border: 1px solid #ccc;
width: 100%;
}
button.gxcpl-btn-text {
text-transform: uppercase;
font-weight: bold;
letter-spacing: 1px;
}
a {
cursor: pointer;
color: #212121;
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #2980b9;
}
/* Paginator */
div.pagination {
padding: 5px;
margin: 5px;
}
div.pagination a {
padding: 5px 10px;
margin: 2px;
border: 1px solid rgba(0,0,0,0.8);
zoom: 100%;
text-decoration: none; /* no underline */
color: rgba(0,0,0,0.8);
}
div.pagination a:hover, div.pagination a:active {
border: 1px solid rgba(0,0,0,0.8);
color: rgba(0,0,0,0.8);
}
div.pagination span.page_current {
padding: 5px 10px;
margin: 2px;
border: 1px solid rgba(0,0,0,0.8);
* zoom: 100%;
font-weight: bold;
background-color: rgba(0,0,0,0.8);
color: #FFF;
}
div.pagination span.page_disabled {
padding: 5px 10px;
margin: 2px;
border: 1px solid #ccc;
* zoom: 100%;
color: #ccc;
}
* span.elipsis {zoom:100%}
/* Paginator */
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>
Student
</h1>
</div>
</div>
</div>
<hr>
<!-- FORM -->
<div class="container">
<div class="row">
<div class="col-md-12">
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
<cms:if submit_success >
<h4>Success: Student data saved.</h4>
</cms:if>
<cms:form masterpage=k_template_name mode='create' enctype='multipart/form-data' method='post' anchor='0'>
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
k_page_title=frm_k_page_title
k_page_name=random_name
/>
<cms:if k_success>
<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<cms:if k_error >
<div class="error">
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
<div class="row">
<div class="col-md-2">
<label for='k_page_title'>Full Name</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<cms:input class="form-control" name='k_page_title' type='bound' />
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2">
<label for='smobile'>Mobile Number</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<cms:input class="form-control" name='smobile' type='bound' />
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2">
<label for='semail'>Email</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<cms:input class="form-control" name='semail' type='bound' />
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-12">
<center>
<button type='submit' class="btn btn-danger gxcpl-btn-text">
<i class="fa fa-save"></i> SAVE
</button>
</center>
</div>
</div>
</cms:form>
<!-- FORM -->
</div>
</div>
</div>
<hr>
<br>
<!-- Student List -->
<div class="container">
<div class="row">
<div class="col-md-12">
<table border='1' style="width: 90%; margin: auto;">
<thead>
<tr>
<th width='5%' style="text-align: center;">
Sr. No.
</th>
<th width='5%' style="text-align: center;">
Student Id
</th>
<th width='25%' style="text-align: center;">
Full Name
</th>
<th width='15%' style="text-align: center;">
Mobile Number
</th>
<th width='20%' style="text-align: center;">
Email Id
</th>
<th width='30%' style="text-align: center;">
Actions
</th>
</tr>
</thead>
<tbody>
<cms:pages masterpage=k_template_name order='asc' paginate='1' limit='10' show_future_entries='1'>
<cms:no_results>
<tr>
<td colspan="5" class="text-center">
- No Student Data Available -
</td>
</tr>
</cms:no_results>
<tr>
<td style="text-align: center;">
<cms:show k_current_record />
</td>
<td style="text-align: center;">
<cms:show k_page_id />
</td>
<td>
<cms:show k_page_title />
</td>
<td style="text-align: center;">
<cms:show smobile />
</td>
<td>
<cms:show semail />
</td>
<td style="text-align: center;">
<a data-toggle="modal" data-target="#myModal-<cms:show k_page_id />"><i class="fa fa-eye"></i> View</a> <a href="#!"><i class="fa fa-edit"></i> Edit</a> <a href="#!"><i class="fa fa-inr"></i> Fees</a> <a href="#!"><i class="fa fa-times"></i> Delete</a>
</td>
</tr>
</cms:pages>
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="gxcpl-ptop-10"></div>
<cms:pages masterpage=k_template_name show_future_entries='1' paginate='1' limit='10'>
<center>
<cms:paginator />
</center>
</cms:pages>
</div>
</div>
</div>
<!-- Student List -->
<div class="gxcpl-ptop-10"></div>
<!-- Scripts -->
<script type="text/javascript" src="<cms:show k_site_link />assets/js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="<cms:show k_site_link />assets/js/bootstrap.js"></script>
<!-- Scripts -->
<!-- View Student Details Modal -->
<cms:pages masterpage=k_template_name>
<div class="modal fade" id="myModal-<cms:show k_page_id />" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<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="myModalLabel">Student Details</h4>
</div>
<div class="modal-body">
<table border='1' style="width: 100%;">
<tr>
<th style="padding-left: 10px;">
Full Name
</th>
<td>
<cms:show k_page_title />
</td>
</tr>
<tr>
<th style="padding-left: 10px;">
Mobile
</th>
<td>
<cms:show smobile />
</td>
</tr>
<tr>
<th style="padding-left: 10px;">
Email Id
</th>
<td>
<cms:show semail />
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</cms:pages>
<!-- View Student Details Modal -->
</body>
</html>
<?php COUCH::invoke(); ?>
fees.php
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Fees' clonable='1' >
<cms:editable name='fees' label='Fees' type="text" required='1' validator='non_negative_integer' order='1' />
</cms:template>
<html>
<head>
<title>Fees</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<style>
body {
margin: 0;
padding: 0;
}
table > thead > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > thead > tr > th {
background-color: rgba(0,0,0,0.8);
color: white;
}
.gxcpl-ptop-10 {
padding-top: 10px;
}
input, select, option {
padding: 5px 10px;
border: 1px solid #ccc;
width: 100%;
}
button.gxcpl-btn-text {
text-transform: uppercase;
font-weight: bold;
letter-spacing: 1px;
}
a {
cursor: pointer;
color: #212121;
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #2980b9;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>
Fees
</h1>
</div>
</div>
</div>
<hr>
<!-- FORM -->
<div class="container">
<div class="row">
<div class="col-md-12">
<cms:set submit_success="<cms:get_flash 'submit_success' />" />
<cms:if submit_success >
<h4>Success: Month and fees saved.</h4>
</cms:if>
<cms:form masterpage=k_template_name mode='create' enctype='multipart/form-data' method='post' anchor='0' >
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
k_page_title=frm_k_page_title
k_page_name=random_name
/>
<cms:if k_success >
<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<cms:if k_error >
<div class="error">
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
<div class="row">
<div class="col-md-2">
<label for="month">Month</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<cms:hide>
<cms:input name='k_page_title' type='bound' class='form-control' />
</cms:hide>
<select class="form-control" name="f_k_page_title">
<option value="Select">
Select
</option>
<option value="January">
January
</option>
<option value="February">
February
</option>
<option value="March">
March
</option>
<option value="April">
April
</option>
<option value="May">
May
</option>
<option value="June">
June
</option>
<option value="July">
July
</option>
<option value="August">
August
</option>
<option value="September">
September
</option>
<option value="October">
October
</option>
<option value="November">
November
</option>
<option value="December">
December
</option>
</select>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2">
<label for="fees">Fees</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1"><i class="fa fa-inr"></i></span>
<cms:input name='fees' type="bound" class="form-control" placeholder="Monthly Fees Amount" aria-describedby="basic-addon1" />
</div>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2 col-md-offset-5">
<center>
<button type="submit" class="btn btn-danger gxcpl-btn-text">
<i class="fa fa-save"></i> Save
</button>
</center>
<div class="gxcpl-ptop-10"></div>
</div>
</div>
</cms:form>
</div>
</div>
</div>
<hr>
<br>
<!-- Fees List -->
<div class="container">
<div class="row">
<div class="col-md-12">
<table border='1' style="width: 90%; margin: auto;">
<thead>
<tr>
<th width='10%' style="text-align: center;">
Sr. No.
</th>
<th width='10%' style="text-align: center;">
Fees Id
</th>
<th width='25%' style="text-align: center;">
Month
</th>
<th width='15%' style="text-align: center;">
Amount
</th>
<th width='40%' style="text-align: center;">
Actions
</th>
</tr>
</thead>
<tbody>
<cms:pages masterpage=k_template_name order='asc' show_future_entries='1'>
<cms:no_results>
<tr>
<td colspan="5" class="text-center">
- No Fees Data Available -
</td>
</tr>
</cms:no_results>
<tr>
<td style="text-align: center;">
<cms:show k_current_record />
</td>
<td style="text-align: center;">
<cms:show k_page_id />
</td>
<td>
<cms:show k_page_title />
</td>
<td style="text-align: center;">
<i class="fa fa-inr"></i> <cms:show fees />
</td>
<td style="text-align: center;">
<a href="#!"><i class="fa fa-edit"></i> Edit</a> <a href="#!"><i class="fa fa-times"></i> Delete</a>
</td>
</tr>
</cms:pages>
</tbody>
</table>
</div>
</div>
</div>
<!-- Fees List -->
<div class="gxcpl-ptop-10"></div>
<div class="gxcpl-ptop-10"></div>
<div class="gxcpl-ptop-10"></div>
<!-- Scripts -->
<script type="text/javascript" src="<cms:show k_site_link />assets/js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="<cms:show k_site_link />assets/js/bootstrap.js"></script>
<!-- Scripts -->
</body>
</html>
<?php COUCH::invoke(); ?>
fees-payment.php:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Fees Payment' clonable='1'>
</cms:template>
<html>
<head>
<title>Fees Payment</title>
<link href="<cms:show k_site_link />assets/css/bootstrap.css" rel="stylesheet" />
<link href="<cms:show k_site_link />assets/css/bootstrap-select.min.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<style>
body {
margin: 0;
padding: 0;
}
table > thead > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > thead > tr > th {
background-color: rgba(0,0,0,0.8);
color: white;
}
.gxcpl-ptop-10 {
padding-top: 10px;
}
input, select {
padding: 5px 10px;
border: 1px solid #ccc;
width: 100%;
}
button.gxcpl-btn-text {
text-transform: uppercase;
font-weight: bold;
letter-spacing: 1px;
}
a {
cursor: pointer;
color: #212121;
font-weight: bold;
}
a:hover {
text-decoration: none;
color: #2980b9;
}
/* Paginator */
div.pagination {
padding: 5px;
margin: 5px;
}
div.pagination a {
padding: 5px 10px;
margin: 2px;
border: 1px solid rgba(0,0,0,0.8);
zoom: 100%;
text-decoration: none; /* no underline */
color: rgba(0,0,0,0.8);
}
div.pagination a:hover, div.pagination a:active {
border: 1px solid rgba(0,0,0,0.8);
color: rgba(0,0,0,0.8);
}
div.pagination span.page_current {
padding: 5px 10px;
margin: 2px;
border: 1px solid rgba(0,0,0,0.8);
* zoom: 100%;
font-weight: bold;
background-color: rgba(0,0,0,0.8);
color: #FFF;
}
div.pagination span.page_disabled {
padding: 5px 10px;
margin: 2px;
border: 1px solid #ccc;
* zoom: 100%;
color: #ccc;
}
* span.elipsis {zoom:100%}
/* Paginator */
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>
Fees Payment
</h1>
</div>
</div>
</div>
<hr>
<!-- FORM -->
<div class="container">
<div class="row">
<div class="col-md-12">
<form method="post">
<div class="row">
<div class="col-md-2">
<label for='student'>Student Name</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<select name="student" class="selectpicker" data-show-subtext="false" data-live-search="true">
<option data-subtext="">Select Student</option>
<option>
<!-- Student Name Dropdown -->
</option>
</select>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2">
<label for="month">Month</label>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-10">
<select name="month">
<option>
Select Month
</option>
<option>
<!-- Only months for which student has not paid the fees should appear here -->
</option>
</select>
<div class="gxcpl-ptop-10"></div>
</div>
<div class="col-md-2 col-md-offset-5">
<center>
<button type="submit" class="btn btn-danger gxcpl-btn-text">
<i class="fa fa-save"></i> Save
</button>
</center>
<div class="gxcpl-ptop-10"></div>
</div>
</div>
</form>
</div>
</div>
</div>
<hr>
<br>
<!-- Student List -->
<div class="container">
<div class="row">
<div class="col-md-12">
<table border='1' style="width: 90%; margin: auto;">
<thead>
<tr>
<th width='10%' style="text-align: center;">
Sr. No.
</th>
<th width='10%' style="text-align: center;">
Receipt Id
</th>
<th width='25%' style="text-align: center;">
Student Name
</th>
<th width='15%' style="text-align: center;">
Month
</th>
<th width='15%' style="text-align: center;">
Amount Paid
</th>
<th width='25%' style="text-align: center;">
Actions
</th>
</tr>
</thead>
<tbody>
<cms:pages masterpage=k_template_name order='asc' paginate='1' limit='10' show_future_entries='1'>
<cms:no_results>
<tr>
<td colspan="6" class="text-center">
- No Student Data Available -
</td>
</tr>
</cms:no_results>
<tr>
<td style="text-align: center;">
<cms:show k_current_record />
</td>
<td style="text-align: center;">
<cms:show k_page_id />
</td>
<td>
<cms:show k_page_title />
</td>
<td style="text-align: center;">
<cms:show smobile />
</td>
<td>
<cms:show semail />
</td>
<td style="text-align: center;">
<a data-toggle="modal" data-target="#myModal-<cms:show k_page_id />"><i class="fa fa-eye"></i> View</a> <a href="#!"><i class="fa fa-edit"></i> Edit</a> <a href="#!"><i class="fa fa-inr"></i> Fees</a> <a href="#!"><i class="fa fa-times"></i> Delete</a>
</td>
</tr>
</cms:pages>
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="gxcpl-ptop-10"></div>
<cms:pages masterpage=k_template_name show_future_entries='1' paginate='1' limit='10'>
<center>
<cms:paginator />
</center>
</cms:pages>
</div>
</div>
</div>
<!-- Student List -->
<div class="gxcpl-ptop-10"></div>
<!-- Scripts -->
<script type="text/javascript" src="<cms:show k_site_link />assets/js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="<cms:show k_site_link />assets/js/bootstrap.js"></script>
<script type="text/javascript"> src="<cms:show k_site_link />assets/js/bootstrap-select.min.js"></script>
<!-- Scripts -->
</body>
</html>
<?php COUCH::invoke(); ?>
Any help would be more than appreciated.
Regards,
GenXCoders