Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/mmishra/erp19-7-2019/views/ |
<?php
//if (!class_exists($erpView)) {
// face detector class
require_once __DIR__."/erp_view.php";
//}
class aaaView extends erpView {
var $controller;
var $model;
public function __construct($controller, $model) {
$this->controller = $controller; // instantiate controller
$this->model = $model; // instantiate model
}
public function __destruct() {
// throw last executed sql statement
//if ($this->model->sqlStmt) print("<hr>" .$this->model->sqlStmt);
if (!in_array($this->controller->menu, ['insurence', 'upload', 'photoUpload', 'photuupload', 'nodeficit', 'payment', 'PGPayment', 'PGResponse', 'specimen', 'import', 'booking', 'photograph', 'photoshop']) && !in_array($this->controller->action, ['print', 'show', 'docUpload'])) {
print(":|:" .$this->erpMenus(). ":|:" .$this->erpXupdate(). ":|:" .$this->erpError(). ":|:" .$this->erpClock(). ":|:" .$this->erpLogin());
}
}
public function getCallingFunctionName($completeTrace=false) {
$trace=debug_backtrace();
if($completeTrace) {
$str = '';
foreach($trace as $caller) {
$str .= " -- Called by {$caller['function']}";
if (isset($caller['class']))
$str .= " From Class {$caller['class']}";
}
} else {
$caller=$trace[2];
$str = "Called by {$caller['function']}";
if (isset($caller['class']))
$str .= " From Class {$caller['class']}";
}
return $str;
}
function callee() {
echo sprintf("callee() called @ %s: %s from %s::%s",
xdebug_call_file(),
xdebug_call_line(),
xdebug_call_class(),
xdebug_call_function()
);
}
public function aaaDashboard($action, $batchYear) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$str = $this->pageHeader($findbar, $toolbar, 1);
foreach ($this->controller->degreeLevels as $degreeLevel => $desc) {
$programs = $this->model->selectProgram($degreeLevel);
foreach ($programs as $program) {
// loop through records
$programID = $program['programID'];
$minRank1 = 0;
$maxRank1 = 0;
// initialize variables
$aTotal = 0;
$eTotal = 0;
$sTotal = 0;
$wTotal = 0;
$genders = '';
$student4 = null;
foreach (array_keys($this->controller->genders) as $key) {
$applicant1[$key] = 0;
$enroll1[$key] = 0;
$student1[$key] = 0;
$withdrawal1[$key] = 0;
$genders .= "<th>$key</th>";
}
foreach (array_keys(array_merge($this->controller->categorys, $this->controller->dasaCategorys)) as $key1) {
if ($key1 == 'OBC-NCL') $key1 = 'OBC';
$applicant2[$key1] = '';
$student2[$key1] = '';
$withdrawal2[$key1] = '';
$minRank[$key1] = '';
$maxRank[$key1] = '';
foreach (array_keys($this->controller->genders) as $key2) {
$applicant3[$key1.'-'.$key2] = '';
$student3[$key1.'-'.$key2] = '';
$withdrawal3[$key1.'-'.$key2] = '';
}
}
$states = $this->model->listStates('IN');
foreach ($states as $row) {
$state[$programID.'-'.$row['stateID']] = 0;
}
$countrys = $this->model->listCountrys();
foreach ($countrys as $row) {
$country[$programID.'-'.$row['countryCode']] = 0;
}
// gender/category wise applicants breakup
$applicants = $this->model->selectApplicant1($programID);
foreach ($applicants as $applicant) {
if ($applicant['pwdStatus'] == 'Y') {
$acat = 'PWD';
} else {
$acat = trim($applicant['offerCategory']);
}
if (!$acat) $acat = trim($applicant['category']);
$acat = (strtoupper($acat) == 'OPEN' ? 'GEN' : $acat);
$acat = (strtoupper($acat) == 'OBC-NCL' ? 'OBC' : $acat);
$asex = trim($applicant['gender']);
$applicant1[substr($asex, 0, 1)]++;
if (!$applicant2[$acat]) $applicant2[$acat] = 0;
$applicant2[$acat]++;
$applicant3[$acat.'-'.$asex]++;
$aTotal++;
}
$aBreakup = "<div align='right'>";
foreach ($applicant1 as $key => $value) {
$aBreakup .= $this->controller->genders[$key]. " : " .str_pad($value, 3, '0', STR_PAD_LEFT). " <br>";
}
$aBreakup .= "<hr width='70%' align='right'><b>Total : " .str_pad($aTotal, 3, '0', STR_PAD_LEFT). " </b></div>";
// gender/category wise student breakup
$enrolments = $this->model->selectEnrolment($programID);
foreach ($enrolments as $enrolment) {
if ($enrolment['pwdStatus'] == 'Y') {
$ecat = 'PWD';
} else {
$ecat = trim($enrolment['enrolCategory']);
}
if (!$ecat) $ecat = trim($enrolment['category']);
$ecat = (strtoupper($ecat) == 'OPEN' ? 'GEN' : $ecat);
$ecat = (strtoupper($ecat) == 'OBC-NCL' ? 'OBC' : $ecat);
$esex = trim($enrolment['gender']);
$student1[$esex]++;
$enroll1[$esex]++;
$eTotal++;
if (!$student2[$ecat]) $student2[$ecat] = 0;
$student2[$ecat]++;
$student3[$ecat. '-' .$esex]++;
if (!$student4[trim($enrolment['loginID'])]) $student4[trim($enrolment['loginID'])] = 0;
$student4[trim($enrolment['loginID'])]++;
$state[$programID. '-' .$enrolment['homeState']]++;
$country[$programID. '-' .$enrolment['nationality']]++;
if (!$minRank1) {
if (!in_array($ecat, array_keys($this->controller->dasaCategorys))) {
$minRank1 = $enrolment['lastScore'];
$minRanker1 = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ') ' .$ecat;
}
}
if (!$minRank[$ecat]) {
$minRank[$ecat] = $enrolment['lastScore'];
$minRanker[$ecat] = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ')';
}
if ($enrolment['lastScore'] < $minRank1) {
if (!in_array($ecat, array_keys($this->controller->dasaCategorys))) {
$minRank1 = $enrolment['lastScore'];
$minRanker1 = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ') ' .$ecat;
}
} else if ($enrolment['lastScore'] > $maxRank1) {
$maxRank1 = $enrolment['lastScore'];
$maxRanker1 = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ') ' .$ecat;
}
if ($enrolment['lastScore'] < $minRank[$ecat]) {
if (!in_array($ecat, array_keys($this->controller->dasaCategorys))) {
$minRank[$ecat] = $enrolment['lastScore'];
$minRanker[$ecat] = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ')';
}
} else if ($enrolment['lastScore'] > $maxRank[$ecat]) {
$maxRank[$ecat] = $enrolment['lastScore'];
$maxRanker[$ecat] = $enrolment['enrolmentNo']. '-' .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ')';
}
$sTotal++;
}
$sBreakup = "<div align='right'>";
foreach ($student1 as $key => $value) {
$sBreakup .= $this->controller->genders[$key]. " : " .str_pad($value, 3, '0', STR_PAD_LEFT). " <br>";
}
$sBreakup .= "<hr width='70%' align='right'><b>Total : " .str_pad($sTotal, 3, '0', STR_PAD_LEFT). " </b>
</div>";
// gender/category wise withdrawal breakup
$withdrawals = $this->model->listWithdrawals($programID);
foreach ($withdrawals as $withdrawal) {
if ($withdrawal['pwdStatus'] == 'Y') {
$wcat = 'PWD';
} else {
$wcat = trim($withdrawal['enrolCategory']);
}
if (!$wcat) $wcat = trim($withdrawal['category']);
$wcat = (strtoupper($wcat) == 'OPEN' ? 'GEN' : $wcat);
$wcat = (strtoupper($wcat) == 'OBC-NCL' ? 'OBC' : $wcat);
$wsex = trim($withdrawal['gender']);
$withdrawal1[$wsex]++;
$enroll1[$wsex]++;
$eTotal++;
if (!$withdrawal2[$wcat]) $withdrawal2[$wcat] = 0;
$withdrawal2[$wcat]++;
$withdrawal3[$wcat.'-'.$wsex]++;
$wTotal++;
}
$wBreakup = "<div align='right'>";
foreach ($withdrawal1 as $key => $value) {
$wBreakup .= $this->controller->genders[$key]. " : " .str_pad($value, 3, '0', STR_PAD_LEFT). " <br>";
}
$wBreakup .= "<hr width='70%' align='right'><b>Total : " .str_pad($wTotal, 3, '0', STR_PAD_LEFT). " </b>
</div>";
$eBreakup = "<div align='right'>";
foreach ($enroll1 as $key => $value) {
$eBreakup .= $this->controller->genders[$key]. " : " .str_pad($value, 3, '0', STR_PAD_LEFT). " <br>";
}
$eBreakup .= "<hr width='70%' align='right'><b>Total : " .str_pad($eTotal, 3, '0', STR_PAD_LEFT). " </b>
</div>";
$str .= "<table border='1' class='report'>
<tr valign='top'><th width='10%'>Program</th><th width='8%'>Student In-roll</th><th width='8%'>Student Withdrawn</th><th width='8%'>Total Enrollment</th><th width='8%'>Candidates Reported</th><th>Category-wise Summary Table</th></tr>
<tr valign='top'><th><br>$desc<br><br>" .$program['programCode']. "<br><br>Duration: " .$program['timeDuration']. " Year<br>Enrollment: " .$program['rollnoPrefix']. " / " .$program['lastRollno']."<br><p>Min. " .($degreeLevel == 'UG' ? 'Rank' : 'Score'). ": <a title='$minRanker1'>" .($degreeLevel == 'UG' ? intval($minRank1) : $minRank1). "</a><br> Max. " .($degreeLevel == 'UG' ? 'Rank' : 'Score'). ": <a title='$maxRanker1'>" .($degreeLevel == 'UG' ? intval($maxRank1) : $maxRank1). "</a></p></th><td>$sBreakup</td><td>$wBreakup</td><td>$eBreakup</td><td>$aBreakup</td>
<td><table border='1' class='report'>
<tr valign='top'><th width='10%'>Category</th><th width='10%'>Fees</th><th width='10%'>Mess</th><th>Candidates</th>$genders<th>Admissions</th>$genders<th>Withdrawals</th>$genders<th>Min" .($degreeLevel == 'UG' ? 'Rank' : 'Score'). "</th><th>Max" .($degreeLevel == 'UG' ? 'Rank' : 'Score'). "</th></tr>";
$cats = array_keys(($degreeLevel == 'UG' ? array_merge($this->controller->categorys, $this->controller->dasaCategorys) : $this->controller->categorys));
foreach ($cats as $category) {
$no++;
if ($category == 'OBC-NCL') continue;//$category = 'OBC';
$fees = $this->model->getPayable($programID, $category, 1);
$mess = $this->model->getPayable($programID, $category, 2);
$aTotal1 = $applicant2[$category];
$sTotal1 = $student2[$category];
$wTotal1 = $withdrawal2[$category];
$sBreakup = '';
$wBreakup = '';
$aBreakup = '';
foreach (array_keys($this->controller->genders) as $key) {
$aBreakup .= "<td align='center'>" .$applicant3[$category. '-' .$key]. '</td>';
$sBreakup .= "<td align='center'>" .$student3[$category. '-' .$key]. '</td>';
$wBreakup .= "<td align='center'>" .$withdrawal3[$category. '-' .$key]. '</td>';
}
$str .= "<tr valign='top'><td width='15%' nowrap> $category</td>
<td width='15%' align='right' nowrap>" .($fees['curency'] == 'INR' ? $this->rs : $this->do). ' ' .$fees['amount']. " </td>
<td width='15%' align='right' nowrap>" .($mess['curency'] == 'INR' ? $this->rs : $this->do). ' ' .$mess['amount']. " </td>
<td align='center'>" .$aTotal1. "</td>" .$aBreakup. "
<td align='center'>" .$sTotal1. "</td>" .$sBreakup. "
<td align='center'>" .$wTotal1. "</td>" .$wBreakup;
if (in_array($category, array_keys($this->controller->dasaCategorys))) {
$str .= "<td align='center'>N/A</td><td align='center'>N/A</td></tr>";
} else {
$str .= "<td align='center'><a title='" .$minRanker[$category]. "'>" .($degreeLevel == 'UG' ? intval($minRank[$category]) : $minRank[$category]). "</a></td><td align='center'><a title='" .$maxRanker[$category]. "'>" .($degreeLevel == 'UG' ? intval($maxRank[$category]) : $maxRank[$category]). "</a></td></tr>";
}
}
$str .= "</table></td></tr>";
if ($sTotal) {
$str .= "<tr><th>State-wise Count</th><td colspan='5'>";
foreach ($states as $row) {
$str .= ($state[$programID.'-'.$row['stateID']] ? "[" .$row['stateName']. ": " .$state[$programID.'-'.$row['stateID']]. "] " : '');
}
$str .= "</td></tr>
<tr><th>Country-wise Count</th><td colspan='5'>";
foreach ($countrys as $row) {
$str .= ($country[$programID.'-'.$row['countryCode']] ? "[" .$row['countryName']. ": " .$country[$programID.'-'.$row['countryCode']]. "] " : '');
}
$str .= "</td></tr>
<tr><th>Staff-wise Count</th><td colspan='5'>";
foreach ($student4 as $key => $value) {
$str .= "[" .ucwords($key) .": $value] ";
}
$str .= "</td></tr>";
}
$str .= "</table><br>";
flush();
}
}
$str .= $this->aaaStatus();
return $str;
}
public function aaaNotice() {
$str = "<h3>Notice</h3>";
if ($this->model->getUserGroup() == "Applicant") {
$str .= "<table width='70%' align='center' boder='1' style='border: red 1px dotted; border-collapse: collapse;'>
<tr><th align='center'>
Dear Freshers!!!<br>
<a href='' onclick=\"inner('aaa/applicant/edit/0/" .$_SESSION['loginID']. "'); return false;\"><font size='+1'>Please start with your <span class='button'><i class='fas fa-registered'></i></span>egistration here.</font></a>
<br><br>
</td></tr>
<tr><td>
It is advised to read once carefully
</td></tr>
<tr><td align='center'>
<a href='https://erp.iiita.ac.in/about/ccmt/' title='About CCMT 2018' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CCMT2018 </span></a> |
<a href='https://erp.iiita.ac.in/about/csabA/' title='About CSAB 2018 (IIITA)' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CSAB2018 (IIITA) </span></a>
<a href='https://erp.iiita.ac.in/about/csabL/' title='About CSAB 2018 (IIITL)' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CSAB2018 (IIITL)</span></a>
</td></tr>
<tr><td>
to avoid any mistake in online sumbission of your information.<br><br>
You have to upload image files of good quality
<ol>
<li>Photograph (coloured, passport size - 30 mm x 50 mm) and </li>
<li>Signature (30 mm x 10 mm)</li>
</ol>
These files will be used in your digital records at the institute.
</td></tr>
<tr><td align='justify'><br>
<code>
Note: Please do not press back button of browser to go back to previous page.
Instead use this button <span class='button'><i class='fas fa-arrow-circle-left'></i></span> where ever provided.
</code>
</td></tr>
</table>\n";
// <a href='' onclick=\"inner('erp/helper/render/" .$this->model->getMenuID('applicant'). "'); return false;\" title='Helper Tips'><span class='button'><i class='far fa-question-circle'></i> Guidelines </span></a>
} else {
$str .= "<table width='70%' align='center' boder='1' style='border: red 1px dotted; border-collapse: collapse;'>
<tr><th align='center'>
Dear Freshers!!!<br><br>
Please login with your JEE Mains/GATE/CAT Roll No. as login ID and DoB (YYYY-MM-DD) as password to get into the system for online submission of your enrolment related details.
if DoB in YYYY-MM-DD format does not work please try with YYYY-DD-MM format specially where day value is in the range of 1-12.
After successful login, you can upload your photo, signature as image (.jpeg, .png) files and complete personal details as per format provided.
Also, online payment gateway of CANARA and HDFC banks are accessible to pay your FEES and MESS CHARGES as per fee structure of your targeted program.
<tr><td align='center'>
<a href='https://erp.iiita.ac.in/about/ccmt/' title='About CCMT 2018' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CCMT2018 </span></a> |
<a href='https://erp.iiita.ac.in/about/csabA/' title='About CSAB 2018 (IIITA)' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CSAB2018 (IIITA) </span></a>
<a href='https://erp.iiita.ac.in/about/csabL/' title='About CSAB 2018 (IIITL)' target='_new'><span class='button'><i class='far fa-question-circle'></i> Guidelines for CSAB2018 (IIITL)</span></a>
</td></tr>
<tr><td>
<b>Others</b> may please use their LDAP user credentials to get into this system.
Navigation links in the form of drop-down menus are provided as per Access Control List (ACL) of signed-in user.
It is advised to read once
</td></tr>
<tr><td align='center'>
<a href='https://erp.iiita.ac.in/about/design/' title='About ERP' target='_new'><span class='button'><i class='far fa-object-group'></i> About ERP </span></a>
</td></tr>
<tr><td>
for more information about this system. This will be of your help as you are here either<br>
<ul>
<li>To provide some INPUT to this system, OR</li>
<li>To get some OUTPUT from this system</li>
</ul>
Kindly note, your activities on this system are recorded in log files, so kindly avoid undesired clicks.
</td></tr>
<tr><td align='justify'><br>
<code>
Note: Please do not press back button of browser to go back to previous page.
Instead use this button <span class='button'><i class='fas fa-arrow-circle-left'></i></span> where ever provided.
</code>
</td></tr>
</table>\n";
}
return $str;
}
public function aaaAlerts($action, $alertID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$alertID = $this->controller->manageAlert($action, $alertID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$programs = $this->model->selectProgram(); // get record
$alerts = $this->model->listAlerts();
$data = $this->model->getAlert($alertID); // get record
$toolbar = $this->erpToolbar('', 2);
//<tr><td nowrap width='20%'>Subject</td><td><input type='text' name='subjectID' size='50' value='" .$data['subjectID']. "' placeholder='255 characters' $ro></td></tr>
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='80%'>Alert #{$alertID} Detail</th><th width='20%'>Alert List</th></tr>
<tr valign='top'><td>
<table class='interface' width='100%'>
<tr><td nowrap width='15%'>Subject</td><td><select name='subjectID' style='width: 250px' $ro>";
foreach ($this->controller->reminders as $id => $code) {
$str .= "<option value='$id'" .($id == $data['subjectID'] ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select></td></tr>
<tr valign='top'><td nowrap>Message</td><td><textarea name='message' rows='5' cols='50' placeholder='text message' $ro>" .$data['message']. "</textarea></td></tr>
<tr><td nowrap>To</td><td><input type='text' name='emailsTo' size='50' value='" .$data['emailsTo']. "' placeholder='separated by comma' $ro> If it is set, mail to student does not spool.</td></tr>
<tr><td nowrap>CC</td><td><input type='text' name='emailsCC' size='50' value='" .$data['emailsCC']. "' placeholder='separated by comma' $ro></td></tr>
<tr><td nowrap>BCC</td><td><input type='text' name='emailsBCC' size='50' value='" .$data['emailsBCC']. "' placeholder='separated by comma' $ro></td></tr>
<tr valign='top'><td nowrap>Schedule</td><td><select name='schedule' style='width: 250px' $ro>";
foreach ($this->controller->schedules as $id => $code) {
$str .= "<option value='$id'" .($id == $data['schedule'] ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select><span class='toolbar'>Daily: at 9:00 AM, Weekly: every Monday at 9:00 AM, Monthly: every 1st day at 9:00 AM, Yearly: every 1st Aug at 9:00 AM</span></td></tr>
</table>" .($alertID ? "<span class='toolbar'>" . ($data['status'] == 'Enabled' ? "<a href='' onclick=\"inner('$app/$menu/mail/". $data['alertID']."'); return false;\" title='Mail Alert'><i class='far fa-envelope'></i></a>" : ''). " Last Alert: " .$data['dateXalert']. " and Alert Counter: " .$data['alertCounter']. "</span>" : ''). "
</td><td>
<ul class='listbar'>";
foreach($alerts as $alert) {
$str .= "<li>" .($alert['alertID'] == $alertID ? "<b>" .$this->controller->reminders[$alert['subjectID']]. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$alert['alertID']."'); return false;\">" .$this->controller->reminders[$alert['subjectID']]. "</a>"). " (" .$alert['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>";
$targetGroups = explode(',', $data['targetGroups']);
foreach ($this->controller->degreeLevels as $code => $desc) {
$col++;
$degrees[$col] = $code;
$oprograms = $this->model->selectProgram($code);
foreach ($oprograms as $oprogram) {
$progs[$code] .= "<input type='checkbox' id='prg' name='targetGroups[]' value='" .$oprogram['programID']. "'" .(in_array($oprogram['programID'], $targetGroups) || $oprogram['programID'] == $programID ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
}
}
$str .= "<h3>Email To <span class='findbar'><input type='checkbox' onclick='toggle(this,\"prg\")'> Toggle All Programs</span></h3>
<table class='report'>
<tr><th>". implode('</th><th>', $degrees). "</th></tr>
<tr valign='top'><td>" .implode('</td><td>', $progs). "</td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaMassmails($action, $alertID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$alertID = $this->controller->manageAlert($action, $alertID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$programs = $this->model->selectProgram(); // get record
$alerts = $this->model->listAlerts();
$data = $this->model->getAlert($alertID); // get record
$toolbar = $this->erpToolbar();
//<tr><td nowrap width='20%'>Subject</td><td><input type='text' name='subjectID' size='50' value='" .$data['subjectID']. "' placeholder='255 characters' $ro></td></tr>
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='80%'>Alert #{$alertID} Detail</th><th width='20%'>Alert List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='15%'>Subject</td><td><select name='subjectID' style='width: 250px' $ro>";
foreach ($this->controller->reminders as $id => $code) {
$str .= "<option value='$id'" .($id == $data['subjectID'] ? ' selected' : ''). ">$code</option>";
}
$str .= "</select></td></tr>
<tr valign='top'><td nowrap>Message</td><td><textarea name='message' rows='5' cols='50' placeholder='text message' $ro>" .$data['message']. "</textarea></td></tr>
<tr><td nowrap>CC</td><td><input type='text' name='emailsCC' size='50' value='" .$data['emailsCC']. "' placeholder='separated by comma' $ro></td></tr>
<tr><td nowrap>BCC</td><td><input type='text' name='emailsBCC' size='50' value='" .$data['emailsBCC']. "' placeholder='separated by comma' $ro></td></tr>
<tr valign='top'><td nowrap>Attachments</td><td>
<ol>";
foreach(explode(',', $data['attachments']) as $attachment) {
$str .= $attachment ? "<li><a href='/uploads/attachments/$attachment' title='Open Attachment' target='_blank'>$attachment</a> [ <a href='' onclick=\"inner('$app/$menu/removeAttachment/$alertID/$attachment'); return false;\"><i class='far fa-times-circle'></i></a> ]</li>" : '';
}
$str .= "</ol></td></tr>
<tr valign='top'><td nowrap>Schedule</td><td><select name='schedule' style='width: 250px' $ro>";
foreach ($this->controller->schedules as $id => $code) {
$str .= "<option value='$id'" .($id == $data['schedule'] ? ' selected' : ''). ">$code</option>";
}
$str .= "</select><span class='toolbar'>Daily: at 9:00 AM, Weekly: every Monday at 9:00 AM, Monthly: every 1st day at 9:00 AM, Yearly: every 1st Aug at 9:00 AM</span></td></tr>
</table>" .($alertID ? "<span class='toolbar'><a href='' onclick=\"inner('$app/$menu/mail/". $data['alertID']."'); return false;\"><i class='far fa-envelope'></i></a> Last Alert: " .$data['dateXalert']. " and Alert Counter: " .$data['alertCounter']. "</span>" : ''). "
</td><td>
<ul class='listbar'>";
foreach($alerts as $alert) {
$str .= "<li>" .($alert['alertID'] == $alertID ? "<b>" .$this->controller->reminders[$alert['subjectID']]. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$alert['alertID']."'); return false;\">" .$this->controller->reminders[$alert['subjectID']]. "</a>"). " (" .$alert['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>";
$targetGroups = explode(',', $data['targetGroups']);
foreach ($this->controller->degreeLevels as $code => $desc) {
$col++;
$degrees[$col] = $code;
$oprograms = $this->model->selectProgram($code);
foreach ($oprograms as $oprogram) {
//if ($programID != $oprogram['programID']) $progs[$code] .= "<input type='checkbox' id='prg' name='programID[]' value='" .$oprogram['programID']. "'" .(in_array($oprogram['programID'], $programIDs) ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
$progs[$code] .= "<input type='checkbox' id='prg' name='targetGroups[]' value='" .$oprogram['programID']. "'" .(in_array($oprogram['programID'], $targetGroups) || $oprogram['programID'] == $programID ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
}
}
$str .= "<h3>Email Target Groups <span class='findbar'><input type='checkbox' onclick='toggle(this,\"prg\")'> Toggle All Programs</span></h3>
<table class='report'>
<tr><th>". implode('</th><th>', $degrees). "</th></tr>
<tr valign='top'><td>" .implode('</td><td>', $progs). "</td></tr>
</table>" .$this->pageFooter('', $toolbar);
//if ($alertID) $str .= "<iframe id='iframe' src='inner/$app/upload/attachmentUpload/$alertID' width='100%' frameborder='0' scrolling='no' onload='resizeIframe(this);'></iframe>";
return $str;
}
public function aaaAutomailer($action, $alertID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$alertID = $this->controller->manageAlert($action, $alertID);
$alerts = $this->model->listAlerts(); // get record
$toolbar = $this->erpPrintbar();
$str = $this->pageHeader($findbar, $toolbar);
foreach ($alerts as $alert) {
$i++;
$str .= "<table class='interface'>
<tr><th>[ #$i ] " .$alert['subjectID']. "<span class='toolbar'>Scheduled: " .$this->controller->schedules[$alert['schedule']]. ", Last Alert: " .$alert['dateXalert']. ", Alert Counter: " .$alert['alertCounter']. "
<a href='' onclick=\"inner('$app/$menu/mail/" .$alert['alertID']. "'); return false;\"><i class='far fa-envelope'></i>>>></a></span></th></tr>
<tr><td>" .$alert['message']. "<br><br><b>".
($alert['emailsTo'] ? "To: " .$alert['emailsTo']. "<br>" : '').
($alert['emailsCC'] ? "CC: " .$alert['emailsCC']. "<br>" : '').
($alert['emailsBCC'] ? "BCC: " .$alert['emailsBCC']. "<br>" : ''). "</b>";
if ($alert['targetGroups']) {
$programs = "<b>Target Groups:</b><ul>";
if ($alert['targetGroups'] == 999) {
$programs .= '<li>All Programs</li>';
} else {
$targetGroups = explode(',', $alert['targetGroups']);
foreach ($targetGroups as $programID) {
$program = $this->model->getProgram($programID);
$programs .= '<li>' .$program['programCode']. '</li>';
}
}
$programs .= '</ul>';
}
$str .= "$programs<br><br></td></tr></table>";
}
return $str;
}
public function aaaCourse($action, $courseID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$courseID = $this->controller->manageCourse($action, $courseID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$courses = $this->model->listCourses();
$data = $this->model->getCourse($courseID); // get record
$toolbar = $this->erpToolbar('', 2);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Course #{$courseID} Detail</th><th width='30%'>Course List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='20%'>Course Code</td><td><input type='text' name='courseCode' size='50' value='" .$data['courseCode']. "' placeholder='unique 25 characters' $ro></td></tr>
<tr><td nowrap>Course Name <span class='rightbar'>(in English)</span></td><td><input type='text' name='courseName' size='50' value='" .$data['courseName']. "' placeholder='max. 255 character' $ro></td></tr>
<tr><td nowrap><span class='rightbar'>(in Hindi)</span></td><td><input type='text' name='courseNameH' size='50' value='" .$data['courseNameH']. "' placeholder='max. 255 characters' $ro></td></tr>
</table>Course name will be printed on Degree/Certificate.
</td><td>
<ul class='listbar'>";
foreach($courses as $course) {
$str .= "<li>" .($course['courseID'] == $courseID ? "<b>" .$course['courseCode']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/". $course['courseID']."'); return false;\">" .$course['courseCode']. "</a>"). " (" .$course['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaBranch($action, $branchID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$branchID = $this->controller->manageBranch($action, $branchID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$branches = $this->model->listBranches();
$data = $this->model->getBranch($branchID); // get record
$toolbar = $this->erpToolbar('', 2);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Branch #{$branchID} Detail</th><th width='30%'>Branch List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='20%'>Branch Code</td><td><input type='text' name='branchCode' size='50' value='" .$data['branchCode']. "' placeholder='unique 25 characters' $ro></td></tr>
<tr><td nowrap>Branch Name <span class='rightbar'>(in English)</span></td><td><input type='text' name='branchName' size='50' value='" .$data['branchName']. "' placeholder='max. 255 character' $ro></td></tr>
<tr><td nowrap><span class='rightbar'>(in Hindi)</span></td><td><input type='text' name='branchNameH' size='50' value='" .$data['branchNameH']. "' placeholder='max. 255 characters' $ro></td></tr>
</table>Branch name will be printed on Degree/Certificate.
</td><td>
<ul class='listbar'>";
foreach($branches as $branch) {
$str .= "<li>" .($branch['branchID'] == $branchID ? "<b>" .$branch['branchCode']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$branch['branchID']."'); return false;\">" .$branch['branchCode']. "</a>"). " (" .$branch['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaSpecialization($action, $specializationID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$specializationID = $this->controller->manageSpecialization($action, $specializationID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$specializations = $this->model->listSpecializations();
$data = $this->model->getSpecialization($specializationID); // get record
$toolbar = $this->erpToolbar('', 2);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Specialization #{$specializationID} Detail</th><th width='30%'>Specialization List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='20%'>Specialization Code</td><td><input type='text' name='specializationCode' size='50' value='" .$data['specializationCode']. "' placeholder='unique 25 characters' $ro></td></tr>
<tr><td nowrap>Specialization Name <span class='rightbar'>(in English)</span></td><td><input type='text' name='specializationName' size='50' value='" .$data['specializationName']. "' placeholder='max. 255 character' $ro></td></tr>
<tr><td nowrap><span class='rightbar'>(in Hindi)</span></td><td><input type='text' name='specializationNameH' size='50' value='" .$data['specializationNameH']. "' placeholder='max. 255 characters' $ro></td></tr>
</table>Specialization will be printed on Degree/Certificate.
</td><td>
<ul class='listbar'>";
foreach($specializations as $specialization) {
$str .= "<li>" .($specialization['specializationID'] == $specializationID ? "<b>" .$specialization['specializationCode']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$specialization['specializationID']. "'); return false;\">" .$specialization['specializationCode']. "</a>"). " (" .$specialization['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaProgram($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->manageProgram($action, $programID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$courses = $this->model->listCourses();
$branches = $this->model->listBranches();
$specializations = $this->model->listSpecializations();
$programs = $this->model->listPrograms();
$data = $this->model->getProgram($programID); // get record
$toolbar = $this->erpToolbar('', 2);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Program #{$programID} Detail</th><th width='30%'>Program List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='20%'>Program Code</td><td><input type='text' name='programCode' size='45' value='" .$data['programCode']. "' placeholder='unique 25 characters' $ro></td></tr>
<tr><td nowrap>Program Title <span class='rightbar'>(in English)</span></td><td><input type='text' name='programTitle' size='100' value='" .$data['programTitle']. "' placeholder='max. 255 characters' $ro></td></tr>
<tr><td nowrap><span class='rightbar'>(in Hindi)</span></td><td><input type='text' name='programTitleH' size='100' value='" .$data['programTitleH']. "' placeholder='max. 255 characters' $ro></td></tr>
<tr><td nowrap>Course Name</td><td><select name='courseID' style='width: 250px'>";
foreach ($courses as $course) {
$str .= "<option value='" .$course['courseID']. "'" .($course['courseID'] == $data['courseID'] ? ' selected' : ''). ">" .$course['courseName']. ' ( ' .$course['courseNameH']. " )</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Branch Name</td><td><select name='branchID' style='width: 250px'>
<option value='0'>Select</option>";
foreach ($branches as $branch) {
$str .= "<option value='" .$branch['branchID']. "'" .($branch['branchID'] == $data['branchID'] ? ' selected' : ''). ">" .$branch['branchName']. ' ( ' .$branch['branchNameH']. " )</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Specialization</td><td><select name='specializationID' style='width: 250px'>
<option value='0'>Select</option>";
foreach ($specializations as $spec) {
$str .= "<option value='" .$spec['specializationID']. "'" .($spec['specializationID'] == $data['specializationID'] ? ' selected' : ''). ">" .$spec['specializationName']. ' ( ' .$spec['specializationNameH']. " )</option>";
}
$str .= "</select></td></tr>
<tr><td width='20%' nowrap>Degree Level</td><td><select name='degreeLevel' style='width: 250px'>";
foreach ($this->controller->degreeLevels as $code => $desc) {
$str .= "<option value='$code'" .($data['degreeLevel'] == $code ? ' selected' : ''). ">" .$desc. "</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Time Duration</td><td><input type='number' name='timeDuration' size='45' value='" .$data['timeDuration']. "' placeholder='Year of completion of program' $ro> Year</td></tr>
<tr><td nowrap>RollNo Prefix</td><td><input type='text' name='rollnoPrefix' size='45' value='" .$data['rollnoPrefix']. "' placeholder='3 aphabets code for roll number series' $ro></td></tr>
<tr><td nowrap>Entrance Board</td><td><input type='text' name='entranceBoard' size='45' value='" .$data['entranceBoard']. "' placeholder='Central body conducting entrance exam for this program' $ro></td></tr>
<tr><td nowrap>Entrance Exam</td><td><input type='text' name='entranceName' size='45' value='" .$data['entranceName']. "' placeholder='Entrance examination name' $ro></td></tr>
<tr><td nowrap>Intake Limit</td><td><input type='number' name='intakeLimit' size='45' value='" .$data['intakeLimit']. "' placeholder='Student count' $ro></td></tr>
<tr><td nowrap>Total Enroll</td><td><input type='number' name='lastRollno' size='45' value='" .$data['lastRollno']. "' placeholder='Enrollment count' $ro></td></tr>
</table><span class='rightbar'>Program Title will be printed on Degree/Certificate.</span>
</td><td>
<ul class='listbar'>";
foreach($programs as $program) {
if ($dl != $program['degreeLevel']) {
if ($dl != '') $str .= '</ol>';
$str .= "<li><b>" .$this->controller->degreeLevels[$program['degreeLevel']]. "</b></li><ol>";
$dl = $program['degreeLevel'];
}
$str .= "<li>" .($program['programID'] == $programID ? "<b>" .$program['programCode']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$program['programID']."'); return false;\">" .$program['programCode']. "</a>"). " (" .$program['status']. ")</li>";
}
$str .= "</ul></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaFeehead($action, $feeheadID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$feeheadID = $this->controller->manageFeehead($action, $feeheadID);// initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$feeheads = $this->model->listFeeheads();
$data = $this->model->getFeehead($feeheadID); // get record
$toolbar = $this->erpToolbar();
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Feehead #{$feeheadID} Detail</th><th width='30%'>Feehead List</th></tr>
<tr valign='top'><td>
<table class='interface'>
<tr><td nowrap width='20%'>Feehead Code</td><td><input type='text' name='feeheadCode' size='50' value='" .$data['feeheadCode']. "' placeholder='unique 3 characters' $ro></td></tr>
<tr><td nowrap>Feehead Name</td><td><input type='text' name='feeheadName' size='50' value='" .$data['feeheadName']. "' placeholder='max. 255 character' $ro></td></tr>
<tr><td nowrap>Account Type</td><td><select name='accountType' style='width: 280px'>";
foreach ($this->controller->accountTypes as $code => $desc) {
$str .= "<option value='$code'" .($data['accountType'] == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></td></tr>
<tr><td>Payment Term</td><td><select name='paymentTerm' style='width: 280px'>";
foreach ($this->controller->paymentTerms as $code => $desc) {
$str .= "<option value='$code'" .($data['paymentTerm'] == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></td></tr>
</table>
</td><td>
<ol class='listbar'>";
foreach($feeheads as $feehead) {
$str .= "<li>" .($feehead['feeheadID'] == $feeheadID ? "<b>" .$feehead['feeheadName']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$feehead['feeheadID']."'); return false;\">" .$feehead['feeheadName']. "</a>"). " (" .$feehead['status']. ")</li>";
}
$str .= "</ol></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaFeechart($action, $feechartID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$category = $this->controller->params[1];
$feechartID = $this->controller->manageFeechart($action, $feechartID); // initiate controller action
$ro = $this->controller->editLock;
$programs = $this->model->selectProgram();
$feeheads = $this->model->selectFeehead();
$feecharts = $this->model->selectFeechart($programID, $category);
$toolbar = ($programID && $category ? $this->erpToolbar() : '');
$findbar = "Program <select name='programID1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value+'/0'); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
if ($programID == $program['programID']) {
$dl = $program['degreeLevel'];
}
}
asort($this->controller->categorys);
asort($this->controller->dasaCategorys);
$cats = ($dl == 'UG' ? array_merge($this->controller->categorys, $this->controller->dasaCategorys) : $this->controller->categorys);
$findbar .= "</select>
Category <select name='category1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/$programID/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($cats as $code => $desc) {
$findbar .= "<option value='$code'" .($category == $code ? self::SL : ''). ">$code</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $category) {
$str .= "<table width='100%' class='interface'>
<tr><th width='40%'>Fee #{$feechartID} Detail</th><th>Other Category/Program Having Same Fee Structure</th></tr>
<tr valign='top'><td><table class='interface'>
<tr><th>#</th><th>Fee Head</th><th>Payment Term</th><th>Fee Amount</th></tr>";
foreach($feecharts as $feechart) {
$i++;
$heads[$i] = $feechart['feeheadID'];
if ($feechart['paymentTerm'] == 9) {
$total -= $feechart['feeAmount'];
} else {
$total += $feechart['feeAmount'];
}
$str .= "<tr valign='top'><td>$i</td>";
if ($feechart['feechartID'] == $feechartID) {
$categorys = explode(',', $feechart['category']);
$programIDs = explode(',', $feechart['programID']);
$str .= "<td><b>" .$feechart['feeheadName']. "</b><input type='hidden' name='feeheadID' value='" .$feechart['feeheadID']. "'></td>
<td>" .$this->controller->paymentTerms[$feechart['paymentTerm']]. "</td>
<td align='right' nowrap><select name='currency' style='width: 50px'>";
foreach ($this->controller->currencys as $code => $desc) {
$str .= "<option value='$code'" .($feechart['currency'] == $code ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select> <input type='number' name='feeAmount' style='width: 100px' value='" .$feechart['feeAmount']. "' placeholder='decimal format' $ro></td><td>";
} else {
$str .= "<td><a href='' onclick=\"inner('$app/$menu/open/" .$feechart['feechartID']. "/$programID/$category'); return false;\">" .$feechart['feeheadName']. "</a></td>
<td>" .$this->controller->paymentTerms[$feechart['paymentTerm']]. "</td>
<td align='right'>" .($feechart['currency'] == 'INR' ? $this->rs : $this->do). $feechart['feeAmount'] ."</td>";
}
$str .= "</tr>";
}
if ($action == 'new') {
$str .= "<tr valign='top'><td>New</td><td colspan='2'><select name='feeheadID' style='width: 90%'>
<option value=''>Select</option>";
foreach ($feeheads as $feehead) {
$str .= (in_array($feehead['feeheadID'], $heads) ? '' : "<option value='" .$feehead['feeheadID']. "' " .$this->dis. ">" .$feehead['feeheadCode']. ' - ' .$feehead['feeheadName']. ' (' .$this->controller->paymentTerms[$feehead['paymentTerm']]. ")</option>");
}
$str .= "</select></td><td align='right' nowrap><select name='currency' style='width: 50px'>";
foreach ($this->controller->currencys as $code => $desc) {
$str .= "<option value='$code' " .$this->dis. ">$code</option>";
}
$str .= "</select> <input type='number' name='feeAmount' style='width: 100px' value='" .$data['feeAmount']. "' placeholder='decimal format' $ro></td></tr>";
}
$str .= "<tr><th colspan='3'>Total Admission Fees</th><th>" .($feechart['currency'] == 'INR' ? $this->rs : $this->do). ' ' .number_format($total, 2). "</th></tr>
</table></td><td align='center'>";
foreach ($this->controller->degreeLevels as $code => $desc) {
$col++;
$degrees[$col] = $code;
$oprograms = $this->model->selectProgram($code);
foreach ($oprograms as $oprogram) {
//if ($programID != $oprogram['programID']) $progs[$code] .= "<input type='checkbox' id='prg' name='programID[]' value='" .$oprogram['programID']. "'" .(in_array($oprogram['programID'], $programIDs) ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
$progs[$code] .= "<input type='checkbox' id='prg' name='programID[]' value='" .$oprogram['programID']. "'" .((in_array($oprogram['programID'], $programIDs) || $oprogram['programID'] == $programID) ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
}
}
$str .= "<table class='report'>
<tr valign='top'><td>";
foreach ($this->controller->categorys as $code => $desc) {
//if ($code != $category) $str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .(in_array($code, $categorys) ? self::CK : $this->dis). ">$code - $desc<br>";
$str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .((in_array($code, $categorys) || $code == $category) ? self::CK : $this->dis). ">$code - $desc<br>";
}
if ($dl == 'UG') {
$str .= "</td><td>";
foreach ($this->controller->dasaCategorys as $code => $desc) {
//if ($code != $category) $str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .(in_array($code, $categorys) ? self::CK : $this->dis). ">$code - $desc<br>";
$str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .((in_array($code, $categorys) || $code == $category) ? self::CK : $this->dis). ">$code - $desc<br>";
}
}
$str .= "</td></tr></table>
<span class='findbar'><input type='checkbox' onclick='toggle(this,\"cat\")'> Toggle All Categorys</span>
<table class='report'>
<tr><th>". implode('</th><th>', $degrees). "</th></tr>
<tr valign='top'><td>" .implode('</td><td>', $progs). "</td></tr></table>
<span class='findbar'><input type='checkbox' onclick='toggle(this,\"prg\")'> Toggle All Programs</span>
</td></tr></table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program and category to proceed with.</h1>";
}
return $str;
}
public function aaaDochead($action, $docheadID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$docheadID = $this->controller->manageDochead($action, $docheadID);
$ro = $this->controller->editLock;
$dochead = $this->model->getDochead($docheadID);
$docheads = $this->model->selectDochead();
$toolbar = $this->erpToolbar();
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th width='70%'>Dochead #{$docheadID} Detail</th><th>Dochead List</th></tr>
<tr valign='top'><td><table class='interface'>
<tr><td>Dochead Code</td><td><input type='text' name='docheadCode' size='10' value='" .$dochead['docheadCode']. "' placeholder='3 characters unique code' $ro></td></tr>
<tr><td>Dochead Name</td><td><input type='text' name='docheadName' size='50' value='" .$dochead['docheadName']. "' placeholder='Name of document in 50 characters' $ro></td></tr>
<tr><td>Specification</td><td><input type='text' name='specification' size='50' value='" .$dochead['specification']. "' placeholder='Document resolution, size, color etc.' $ro></td></tr>
<tr><td>Original</td><td><select name='original' style='width: 200px'>";
foreach($this->controller->yesnoChoices as $key => $value) {
$str .= "<option value='$key'" .($key == $dochead['original'] ? ' selected' : $this->dis). ">$value</option>";
}
$str .= "</select></td></tr>
</table></td><td>
<ol class='listbar'>";
foreach($docheads as $dochead) {
$str .= "<li>" .($dochead['docheadID'] == $docheadID ? "<b>" .$dochead['docheadName']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$dochead['docheadID']."'); return false;\">" .$dochead['docheadName']. "</a>"). " (" .$dochead['status']. ")</li>";
}
$str .= "</ol></td></tr>
</table>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaDocchart($action, $docchartID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$category = $this->controller->params[1];
$docchartID = $this->controller->manageDocchart($action, $docchartID);
$ro = $this->controller->editLock;
$programs = $this->model->selectProgram();
$docheads = $this->model->selectDochead();
$doccharts = $this->model->selectDocchart($programID, $category);
$chartheads = $this->model->listChartheads($programID, $category);
$toolbar = ($programID && $category ? $this->erpToolbar() : '');
$findbar = "Program <select name='programID1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value+'/0'); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
if ($programID == $program['programID']) {
$dl = $program['degreeLevel'];
}
}
asort($this->controller->categorys);
asort($this->controller->dasaCategorys);
$cats = ($dl == 'UG' ? array_merge($this->controller->categorys, $this->controller->dasaCategorys) : $this->controller->categorys);
$findbar .= "</select>
Category <select name='category1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/$programID/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($cats as $code => $desc) {
$findbar .= "<option value='$code'" .($category == $code ? self::SL : ''). ">$code</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $category) {
$str .= "<table width='100%' class='interface'>
<tr><th width='40%'>Docchart #{$docchartID} Detail</th><th>Other Category and Programs with similar requirement</th></tr>
<tr valign='top'><td><table class='interface'>
<tr><th>#</th><th>Code</th><th>Dochead Name</th><th>Specification</th><th>Original</th></tr>";
$i = 0;
foreach($doccharts as $docchart) {
$i++;
$str .= "<tr valign='top'><td>$i</td><td>";
if ($docchart['docchartID'] == $docchartID) {
$categorys = explode(',', $docchart['category']);
$programIDs = explode(',', $docchart['programID']);
$str .= "<b>" .$docchart['docheadCode']. "</b><input type='hidden' name='docheadID' value='" .$docchart['docheadID']. "'>";
} else {
$str .= "<a href='' onclick=\"inner('$app/$menu/edit/" .$docchart['docchartID']. "/$programID/$category'); return false;\", false);'>" .$docchart['docheadCode']. "</a>";
}
$str .= "</td><td>" .$docchart['docheadName']. "</td><td>" .$docchart['specification']. "</td><td align='center'>" .$this->controller->yesnoChoices[$docchart['original']]. "</td></tr>";
}
if ($action == 'new') {
$str .= "<tr><td>New</td><td colspan='4'><select name='docheadID' style='width: 95%'>
<option value=''>Select</option>";
foreach($docheads as $dochead) {
$docheadCode = $dochead['docheadCode'];
foreach ($chartheads as $charthead) {
if ($docheadCode == $charthead['docheadCode']) {
$got = 1;
break;
} else $got = 0;
}
if (!$got) {
$j++;
$str .= "<option value='" .$dochead['docheadID']. "'>" .$docheadCode. ' - ' .$dochead['docheadName']. ' - ' .$dochead['specification']. "</option>";
}
}
$str .= "</select></td></tr>";
}
$str .= "<tr><th colspan='4'>Total Documents</th><th>$i</th></tr>
</table></td><td align='center'>";
foreach ($this->controller->degreeLevels as $code => $desc) {
$col++;
$degrees[$col] = $code;
$oprograms = $this->model->selectProgram($code);
foreach ($oprograms as $oprogram) {
//if ($programID != $oprogram['programID']) $progs[$code] .= "<input type='checkbox' id='prg' name='programID[]' value='" .$oprogram['programID']. "'" .(in_array($oprogram['programID'], $programIDs) ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
$progs[$code] .= "<input type='checkbox' id='prg' name='programID[]' value='" .$oprogram['programID']. "'" .((in_array($oprogram['programID'], $programIDs) || $oprogram['programID'] == $programID) ? self::CK : $this->dis). ">" .$oprogram['programCode']. '<br>';
}
}
$str .= "<table class='report'>
<tr valign='top'><td>";
foreach ($this->controller->categorys as $code => $desc) {
//if ($code != $category) $str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .(in_array($code, $categorys) ? self::CK : $this->dis). ">$code - $desc<br>";
$str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .((in_array($code, $categorys) || $code == $category) ? self::CK : $this->dis). ">$code - $desc<br>";
}
if ($dl == 'UG') {
$str .= "</td><td>";
foreach ($this->controller->dasaCategorys as $code => $desc) {
//if ($code != $category) $str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .(in_array($code, $categorys) ? self::CK : $this->dis). ">$code - $desc<br>";
$str .= "<input type='checkbox' id='cat' name='category[]' value='$code'" .((in_array($code, $categorys) || $code == $category) ? self::CK : $this->dis). ">$code - $desc<br>";
}
}
$str .= "</td></tr></table>
<span class='findbar'><input type='checkbox' onclick='toggle(this,\"cat\")'> Toggle All Categorys</span>
<table class='report'>
<tr><th>". implode('</th><th>', $degrees). "</th></tr>
<tr valign='top'><td>" .implode('</td><td>', $progs). "</td></tr></table>
<span class='findbar'><input type='checkbox' onclick='toggle(this,\"prg\")'> Toggle All Programs</span></td></tr>
</td></tr></table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program and category to proceed with.</h1>";
}
return $str;
}
public function aaaSeatMatrix($action, $matrixID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$matrixID = $this->controller->manageSeatmatrix($action, $matrixID); // initiate controller action
$ro = $this->controller->editLock;
$programs = $this->model->selectProgram();
$toolbar = ($programID ? $this->erpToolbar() : '');
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
if ($programID == $program['programID']) $dl = $program['degreeLevel'];
}
$findbar .= "</select>";
asort($this->controller->categorys);
asort($this->controller->dasaCategorys);
$categorys = ($dl == 'UG' ? array_merge($this->controller->categorys, ['DASA' => 'Direct Admission of Students Abroad']) : $this->controller->categorys);
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
$str .= "<table width='100%' class='interface'>
<tr><th rowspan='2' width='50%'>Category-wise Seat Matrix</th><th colspan='3'>Gender-wise Distribution</th><th rowspan='2'>Total<br>Count</th></tr>
<tr><th>" .implode('</th><th>', $this->controller->genders). "</th></tr>";
foreach ($categorys as $category => $desc) {
if ($category != 'OBC') {
$str .= "<tr><td>$desc ($category)</td>";
foreach($this->controller->genders as $gender => $desc) {
$data = $this->model->getSeatmatrix($programID, $category, $gender);
$matrixID= $data['matrixID'];
$seatNo = ($data['seatNo'] ? $data['seatNo'] : 0);
$str .= "<td align='center'><input type='number' name='seatNo[]' style='width: 50px' value='$seatNo' placeholder='Number only' $ro><input type='hidden' name='matrixID[]' value='$matrixID'><input type='hidden' name='category[]' value='$category'><input type='hidden' name='gender[]' value='$gender'></td>";
$cTotal += $seatNo;
}
$data = $this->model->getSeatmatrix($programID, $category, '-');
$matrixID = $data['matrixID'];
$str .= "<td align='center'><input type='number' name='seatNo[]' style='width: 50px' value='" . ($cTotal ? $cTotal : ($data['seatNo'] ? $data['seatNo']: 0)). "' placeholder='Total number' $ro><input type='hidden' name='matrixID[]' value='$matrixID'><input type='hidden' name='category[]' value='$category'><input type='hidden' name='gender[]' value='-'></td></tr>";
$pTotal += ($cTotal ? $cTotal : $data['seatNo']);
$cTotal = 0;
}
}
$str .= "<tr><th colspan='4'>Total Seats in this Program</th><th>$pTotal</th></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
function aaaImport($action, $roundNo) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$degreeLevel = $this->controller->params[0];
$roundNo = $this->controller->manageImport($action, $roundNo);
$roundNo++;
$institute = $this->model->getInstitute();
$degrees = $this->model->selectDegree(); // get record
$candidates = $this->model->listCandidates($degreeLevel);
if ($degreeLevel) $toolbar = $this->erpPrintbar();
$findbar = "Program <select name='degreeLevel' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value=''>Select</option>";
foreach ($degrees as $degree) {
$findbar .= "<option value='" .$degree['degreeLevel']. "'" .($degree['degreeLevel'] == $degreeLevel ? self::SL : ''). ">" .$degree['degreeLevel']. "</option>";
}
$findbar .= "</select>" .($roundNo ? ' Round No.: ' .$roundNo : '');
if ($action == 'dataUpload') {
$roundNo--; // two time roundNo++ on two calls, so keep just one roundNo++, here roundNo-- is required
$str = "<span style='font-size: 12px;'>CSV file should contain record of candidates in the format given below</span>
<table width='100%' border='1' style='border-collapse: collapse; font-size: 10px;'>
<tr><th>(1)<br>SrNo</th><th>(2)<br>RollNo</th><th>(3)<br>Name</th><th>(4)<br>Category</th><th>(5)<br>PwD</th><th>(6)<br>Gender</th><th>(7)<br>DoB</th><th>(8)<br>StateEligibility</th><th>(9)<br>Nationality</th><th>(10)<br>AllotedProgram</th><th>(11)<br>AllotedCategory</th><th>(12)<br>AllotedRank</th><th>(13)<br>ChoiceNo</th><th>(14)<br>Quota</th><th>(15)<br>Round</th><th>(16)<br>Status</th><th>(17)<br>RCName</th><th>(18)<br>RemarksByRC</th></tr>
<tr valign='top'><td>1</td><td>12345</td><td>aaaaa bbb</td><td>General</td><td>Yes</td><td>Male</td><td>25-12-2000</td><td>Uttar Pradesh</td><td>India</td><td>Information Technology (4 Years, Bachelor of Technology)</td><td>Open</td><td>1234</td><td>1</td><td>All India</td><td>Floating</td><td>Retained</td><td>School of Planning & Architecture: Vijayawada</td><td>(1) PwD certificate not in JoSAA format.</td></tr>
</table><br>
<div align='center' style='font-size: 12px;'>
<input type='hidden' name='degreeLevel' value='$degreeLevel'>
To upload list of round No. <b>$roundNo</b> candidates for <b>" .$institute['instituteCode']. "</b>,
Select CSV File <input type='file' name='fileToUpload' id='fileToUpload'>
<input type='submit' name='submit' value='IMPORT' title='Upload selected CSV file'>
<hr width='50%'>
<h1>". (stripos($this->controller->errorText, 'ERP @ IIITA') ? 'CSV file only' : $this->controller->errorText). "</h1>
<hr width='50%'>
Select CSV (Excel) file as received from CCMT/CSAB/DASA.
Only CSV format is supported for upload on server.
After upload refresh page to get uploaded records.<br>
</div>
</span>";
} else {
$str = $this->pageHeader($findbar, $toolbar, 1);
if ($degreeLevel) {
$str .= "<iframe src='inner/$app/$menu/dataUpload/$roundNo/$degreeLevel' width='100%' frameborder='0' scrolling='no' onload='resizeIframe(this);'></iframe>
" .$this->pageFooter('', $toolbar). "
<h3>Uploaded Records</h3>" .$this->printReport($candidates);
} else {
$str .= "<h1 align='center'>Select degree to proceed with.</h1>";
}
}
return $str;
}
public function aaaOffer($action, $roundNo) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$degreeLevel = $this->controller->params[0];
$roundNo = $this->controller->manageOffer($action, $roundNo); // initiate controller action
$degrees = $this->model->selectDegree(); // list enabled programs only
$programs = $this->model->selectProgram($degreeLevel);
$candidates = $this->model->listCandidates($degreeLevel);
if ($degreeLevel) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/open/0/$degreeLevel'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$roundNo/$degreeLevel'); return false;\" title='Make Offer'><span class='button'><i class='far fa-save'></i></span></a>";
}
$findbar = "Degree <select name='degreeLevel1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value=''>Select</option>";
foreach ($degrees as $degree) {
$findbar .= "<option value='" .$degree['degreeLevel']. "'" .($degree['degreeLevel'] == $degreeLevel ? self::SL : ''). ">" .$degree['degreeLevel']. "</option>";
}
$findbar .= "</select>" .($roundNo ? " Round No.: $roundNo" : '');
$str = $this->pageHeader($findbar, $toolbar);
if ($degreeLevel) {
// program mapping
$str .= "<table width='100%'>
<tr><th width='60%' nowrap>Alloted Program</th><th colspan='2'>Candidate</th><th width='40%'>Offered Program</th></tr>";
$oPrograms = $this->model->listOfferedPrograms($degreeLevel, $roundNo);
foreach ($oPrograms as $oProgram) {
if ($oProgram['aProgramID'] != $aProgramID) {
$aProgramID = $oProgram['aProgramID'];
$oProgramID = $oProgram['oProgramID'];
$no1 = $oProgram['no'];
$str .= "<tr><td><input type='hidden' name='aProgramIDs[]' value='$aProgramID'>$aProgramID</td>
<td align='right'>$no1</td><td>" .str_repeat(' ', 5). "</td>
<td align='center'><select name='oProgramIDs[]' style='width: 200px'>
<option value='0'>Select</option>";
foreach ($programs as $program) {
$i++;
$str .= "<option value='" .$program['programID']. "'" . ($program['programID'] == $oProgramID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$str .= "</select></td></tr>";
$total += $no1;
}
}
// category mapping
$str .= "<tr><th width='60%' nowrap>Alloted Category</th><th colspan='2'>Candidate</th><th width='40%'>Offered Category</th></tr>";
$oCategorys = $this->model->listOfferedCategorys($degreeLevel, $roundNo);
foreach ($oCategorys as $oCategory) {
if ($oCategory['aCategory'] != $aCategory) {
$aCategory = $oCategory['aCategory'];
$oCat = $oCategory['oCategory'];
$no2 = $oCategory['no'];
$str .= "<tr><td><input type='hidden' name='aCategorys[]' value='$aCategory'>$aCategory</td>
<td align='right'>$no2</td><td>" .str_repeat(' ', 5). "</td>
<td align='center'><select name='oCategorys[]' style='width: 200px'>
<option value=''>Select</option>";
foreach (array_merge($this->controller->categorys,$this->controller->dasaCategorys) as $key => $value) {
$i++;
$str .= "<option value='$key'" .($key == $oCat ? self::SL : ''). ">$key -$value</option>";
}
$str .= "</select></td></tr>";
}
}
$str .= "<tr><td align='right'><b>Total</b></td><td align='right'><b>$total</b></td></tr>
</table>" .$this->pageFooter('', $toolbar);
$str .= ($candidates ? "<h3>Candidates so far:</h3>" .$this->printReport($candidates) : '');
} else {
$str .= "<h1 align='center'>Select degree to proceed with.</h1>";
}
return $str;
}
public function aaaCandidate($action, $candidateID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$candidateID = $this->controller->manageCandidate($action, $candidateID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock;;
$programs = $this->model->selectProgram(); // to get program details
$candidates = $this->model->selectCandidate($programID);
$program = $this->model->getProgram($programID);
$degreeLevel = $program['degreeLevel'];
$candidate = $this->model->getCandidate($candidateID); // get record
$roundNo = ($candidate['roundNo'] ? $candidate['roundNo'] : $this->model->getRoundNoByInstituteID($degreeLevel));
if ($programID) $toolbar = $this->erpToolbar();
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value+'/0'); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
if (!$candidate['allotedRank']) $candidate['allotedRank'] = 0;
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
$str .= "<table width='99.9%'>
<tr><th>Candidate #{$candidateID} Detail</th><th>Candidate List</th></tr>
<tr valign='top'><td width='65%'><input type='hidden' name='studentID' value='$studentID'>
<table class='interface'>
<tr><td colspan='8'><b>Official detail</b></td></tr>
<tr><td nowrap>Batch Year</td><td><input type='text' name='batchYear' size='25' value='" .$_SESSION["batchYear"]. "' placeholder='YYYY' readonly></td>
<td nowrap>Admission Round</td><td><input type='number' name='roundNo' value='$roundNo' placeholder='Round no.' style='width: 148px' $ro></td>
<td nowrap>Round Name</td><td><input type='text' name='roundName' value='" .$candidate['roundName']. "' size='25' placeholder='Round name' $ro></td>
<td nowrap>Roll No.</td><td><input type='text' name='rollNo' size='25' value='" .$candidate['rollNo']. "' placeholder='Roll No.' $ro></td></tr>
<tr><td nowrap>Alloted Category</td><td><input type='text' name='allotedCategory' size='25' value='" .$candidate['allotedCategory']. "' placeholder='Category' $ro></td>";
/*
<select name='allotedCategory' style='width: 150px'>";
foreach (array_merge($this->controller->subCategorys, $this->controller->dasaCategorys) as $code => $desc) {
$str .= "<option value='$code'" .($candidate['allotedCategory'] == $code ? self::SL : ''). ">" .$desc. ' (' .$code. ")</option>";
}
</select></td>
*/
$str .= "
<td nowrap>Alloted Rank</td><td> <input type='text' name='allotedRank' value='" .$candidate['allotedRank']. "' size='25' placeholder='Rank No.' $ro></td>
<td nowrap>Choice No.</td><td><input type='text' name='choiceNo' value='" .$candidate['choiceNo']. "' size='25' placeholder='Choice No.' $ro></td>
<td>Quota</td><td><input type='text' name='quota' value='" .$candidate['quota']. "' size='25' placeholder='Quota' $ro></td></tr>
<tr><td>Willingness</td><td><input type='text' name='willingness' value='" .$candidate['willingness']. "' size='25' placeholder='WIllingness' $ro></td>
<td nowrap>PWD Status</td><td>";
foreach ($this->controller->pwdStatuss as $code => $desc) {
$i++;
$str .= "<input type='radio' name='pwdStatus' value='$code'" .($candidate['pwdStatus'] == $code ? self::CK : $this->dis). "> $desc ";
if ($i == 2) break;
}
$str .= "</td>
<td>Status</td><td><input type='text' name='status' value='" .$candidate['status']. "' size='25' placeholder='Status' $ro></td>
<td nowrap>RC Name</td><td><input type='text' name='rcName' value='" .$candidate['rcName']. "' size='25' placeholder='Reporting center name' $ro></td></tr>
<tr><td nowrap>State Eligibility</td><td><select name='stateEligibility' style='width: 155px' title='Select state'>";
$states = $this->model->selectState();
foreach ($states as $state) {
$str .= "<option value='" .$state['stateName']. "'" .(trim(strtolower($state['stateName'])) == trim(strtolower($candidate['stateEligibility'])) ? self::SL : $this->dis). ">" .$state['stateName']. "</option>";
}
$str .= "</select></td>
<td nowrap>Nationality</td><td colspan='3'><select name='nationality' style='width: 155px'>";
$countrys = $this->model->selectCountry();
if (!$candidate['nationality']) $candidate['nationality'] = 'IN';
foreach ($countrys as $country) {
$str .= "<option value='" .$country['countryCode']. "'" .(trim($candidate['nationality']) == trim($country['countryCode']) ? self::SL : $this->dis). ">" .$country['countryName']. "</option>";
}
$str .= "</select></td>
<td>New Program</td><td><select name='programIDn' style='width: 155px'>";
foreach ($programs as $program) {
if ($program['degreeLevel'] == $degreeLevel) { // && $program['programID'] <> $programID
$str .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : $this->dis). ">" .$program['programCode']."</option>";
}
}
$str .= "</select></td></tr>
<tr><td>Remark</td><td colspan='7'><input type='text' name='remark' size='76' value='" .$candidate['remark']. "' placeholder='Reporting center remark' $ro></td></tr>
<tr><td colspan='8'><br><b>Personal detail</b></td></tr>
<tr><td nowrap>Candidate Name</td><td colspan='5'><input type='text' name='nameEnglish' size='76' value='" .$candidate['nameEnglish']. "' placeholder='full name in english' $ro></td>
<td nowrap><span class='alert'>is an Alumni ?</span></td><td nowrap>";
$candidate['alumni'] = !$candidate['alumni'] ? 'N' : $candidate['alumni'];
foreach ($this->controller->pwdStatuss as $code => $desc) {
$str .= "<input type='radio' name='alumni' value='$code'" .($candidate['alumni'] == $code ? self::CK : $this->dis). "> $desc ";
if ($code == 'N') break;
}
$str .= "</td></tr>
<tr><td nowrap>Gender</td><td><select name='gender' style='width: 155px'>";
foreach ($this->controller->genders as $code => $desc) {
$str .= "<option value='$code'" .($candidate['gender'] == $code ? self::SL : $this->dis). ">" .$desc. "</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Date of Birth</td><td><input type='text' name='dateBirth' size='25' value='" .$candidate['dateBirth']. "' placeholder='YYYY-MM-DD' $ro></td></tr>
<tr><td nowrap>Social Category</td><td colspan='3'><select name='category' style='width: 155px'>";
foreach ($this->controller->subCategorys as $code => $desc) {
$str .= "<option value='$code'" .($candidate['category'] == $code ? self::SL : $this->dis). ">" .$desc. ' (' .$code. ")</option>";
}
$str .= "</select></td></tr>
</table>
</td><td>
<ul class='listbar'>";
foreach($candidates as $candidate) {
$str .= "<li>" .($candidate['candidateID'] == $candidateID ? "<b>" .$candidate['rollNo']. "</b>" : "<a href='' onclick=\"inner('$app/$menu/open/" .$candidate['candidateID']. "/$programID'); return false;\">" .$candidate['rollNo']. "</a>"). " (" .$candidate['nameEnglish']. ($candidate['alumni'] == 'Y' ? ") <i class='fas fa-check'></i>" : ')'). "</li>";
}
$str .= "</ul><span class='findbar'>* ticked candidates are alumni.</span></td></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
public function aaaApplicant($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$rollNo = $_SESSION["loginID"];
if ($this->controller->params[0]) $rollNo = $this->controller->params[0];
$applicantID = ($studentID ? $this->model->getApplicantIDByStudentID($studentID) : $this->model->getApplicantIDByRollNo($rollNo));
$applicantID = $this->controller->manageApplicant($action, $applicantID); // initiate controller action
$ro = $this->controller->editLock;
$data = $this->model->getApplicant($applicantID); // get record
$studentID = $data['studentID'];
$programID = $data['programID'];
$program = $this->model->getProgram($programID);
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
if ($studentID) {
$noAction = 0;
if ($enrolmentID) {
$toolbar .= "Enrollment already processed, record is locked for any change.";
$this->controller->editLock = 'readonly';
} else { // comes from applicant details
$toolbar .= "Please fill in the form completely and click SAVE icon.
<a href='' onclick=\"inner('$app/$menu/edit/$studentID/$rollNo'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$studentID/$rollNo'); return false;\" title='Save record'><span class='button'><i class='far fa-save'></i></span></a>
<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Form'><span class='button'><i class='fa fa-print'></i></span></a>";
}
}
$findbar = $program['entranceName']. " Roll No. <input type='text' id='rno' name='rollNo' size='20' value='$rollNo' placeholder='Fetch candidate detail' onkeypress=\"if (event.key === 'Enter') {inner('$app/$menu/edit/0/'+this.value); return false;}\">
<a href='' onclick=\"inner('$app/$menu/edit/0/'+$('#rno').val()); return false;\" title='Registration Detail'><span class='button'><i class='fas fa-search'></i></span></a>";
$str = $this->pageHeader($findbar, $toolbar);
if ($studentID) {
$str .= $this->candidateProfile($studentID);
$str .= $this->studentForm($action, $studentID). $this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Type Roll No. to proceed with.</h1>";
}
return $str;
}
function aaaUpload($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$studentID = $this->controller->manageUpload($action, $studentID); // initiate controller action
$program = $this->model->getProgram($programID);
if ($action == 'photoUpload') {
$str = "<input type='hidden' name='docheadCode[]' value='PHO'>
Photograph File <input type='file' name='fileToUpload' id='fileToUpload'>
<input type='submit' name='submit' value='UPLOAD' title='Upload File' style='background-color: orange'>
<span class='alert'>" .$this->controller->errorText. "</span>
<input type='hidden' name='studentID' value='$studentID'>";
} else if ($action == 'signUpload') {
$str = "<input type='hidden' name='docheadCode[]' value='SIG'>
Signature File <input type='file' name='fileToUpload' id='fileToUpload'>
<input type='submit' name='submit' value='UPLOAD' title='Upload File' style='background-color: orange'>
<span class='alert'>" .$this->controller->errorText. "</span>
<input type='hidden' name='studentID' value='$studentID'>";
} else if ($action == 'photosUpload' || $action == 'photosupload') { // graduand photo upload
if ($studentID) {
$graduand = $this->model->getGraduand($studentID);
$enrolmentNo = $graduand['enrolmentNo'];
$programID = $graduand['programID'];
$graduands = $this->model->selectGraduand($programID);
$program = $this->model->getProgram($programID);
}
$str = "<h3>Photo Upload</h3>
<table width='100%'>
<tr><th>Program: " .$program['courseName']. ' [ ' .$program['courseNameH']. ' ]<br>Branch Name: ' .$program['branchName']. ' [ ' .$program['branchNameH']. ' ]' .($program['specializationName'] ? '<br>Specialization: ' .$program['specializationName']. ' [ ' .$program['specializationNameH']. ' ]' : ''). "</th></tr>
<tr height='50'><td align='center'>";
if ($enrolmentNo) {
$str .= "Select Enrollment No. <select name='graduandID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach ($graduands as $graduand) {
$str .= "<option value='" .$graduand['graduandID']. "'" .($studentID == $graduand['graduandID'] ? self::SL : ''). ">" .$graduand['graduandID'].'-'.$graduand['enrolmentNo']. ' (' .$graduand['nameEnglish']. ")</option>";
}
$str .= "</select>";
} else {
$str .= "Select Multiple Photographs ";
}
$str .= "<input type='file' name='fileToUpload[]' id='fileToUpload' size='50' multiple>
<input type='submit' name='submit' value='UPLOAD' title='Upload selected image file' style='background-color: orange'></td></tr>
<tr><th><span class='alert'>" .$this->controller->errorText. "</span></th></tr>
</table>";
if ($studentID) {
$str .= "<input type='hidden' name='studentID' value='$studentID'>
<center><img src='/uploads/photos/" .strtolower($enrolmentNo). ".jpg' width='100' height='120' /></center>"; //<script language='JavaScript'>window.onunload=refreshParent();</script>
}
} else if ($action == 'attachmentUpload') {
$alertID = $studentID;
$this->controller->errorText = ($this->controller->errorText == "Welcome to ERP @ IIITA ! This bar displays status of ongoing database activities by you during this session..." ? "single or multiple": $this->controller->errorText);
$str .= "<input type='file' name='attachments[]' size='50' value='" .$data['attachments']. "' placeholder='select multiple attachment files' multiple $ro>
<input type='submit' name='submit' value='UPLOAD' title='Upload attachment file' style='background-color: orange'>
<font color='red'>" .$this->controller->errorText. "</font>
<input type='hidden' name='alertID' value='$alertID'>";
} else if ($action == 'docUpload') {
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$applicant = $this->model->getApplicant($applicantID);
$programID = $applicant['programID'];
// for DASA candidates
if (array_key_exists($applicant['offerCategory'], $this->controller->dasaCategorys)) {
$category = $this->controller->dasaCategorys[$applicant['offerCategory']];
} else {
$category = ($applicant['pwdStatus'] == 'Y' ? 'PWD' : $applicant['offerCategory']);
}
//echo $applicant['offerCategory'];
$j = 0;
$documents = $this->model->selectDocchart($programID, $category);
foreach ($documents as $document) {
$docheadCode = $document['docheadCode'];
if ($this->model->getMyExemption($studentID, $docheadCode)) {
$docs .= "<li>* $docheadCode - " .$document['docheadName']. ' (' .$document['specification']. ")</li>";
} else if ($this->model->getMyUpload($studentID, $docheadCode)) {
// do nothing
//} else if (in_array($category, explode(',', $document['category'])) && in_array($programID, explode(',', $document['programID']))) {
} else if (array_search($category, explode(',', ',' .$document['category'])) && array_search($programID, explode(',', ',' .$document['programID']))) {
$j++;
$docs .= "<li><input type='checkbox' id='doc' name='docheadCode[]' value='$docheadCode'>$docheadCode- " .$document['docheadName']. ' (' .$document['specification']. ") " .($document['original'] == 'Y' ? "<span class='alert'>Original</span>" : ''). "</li>";
}
}
if ($docs) {
$str .= "<table width='100%'>
<tr><th width='50%'>Pre-requisit List</th><th>Only PDF File</th></tr>
<tr valign='top'><td nowrap rowspan='2'>
<span class='toolbar'><input type='checkbox' onclick='toggle(this, \"doc\")'> Toggle All</span>
<ol>$docs</ol>
* marked are temporarily exempted.</td><th>";
if ($j) {
$str .= "<br><br>
Select File <input type='file' name='fileToUpload' id='fileToUpload' size='50'>
<input type='submit' name='submit' value='UPLOAD' title='Upload selected file'>
<h1 align='center' class='alert'>". $this->controller->errorText. "</h1>
<hr>
A combined PDF file for all documents is required to be uploaded.<br>
<hr>";
} else {
$str .= "<span class='alert'>Nothing to upload.</span>";
}
$str .= "</th></tr></table>";
} else {
$str .= "<h1 class='alert' align='center'>Nothing due.</h1>";
}
} else {
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$applicant = $this->model->getApplicant($applicantID);
$programID = $applicant['programID'];
$enrolmentNo = $this->model->getEnrolmentNoByStudentID($studentID);
// for DASA candidates
if (array_key_exists($applicant['offerCategory'], $this->controller->dasaCategorys)) {
$category = $this->controller->dasaCategorys[$applicant['offerCategory']];
} else {
$category = $this->controller->categorys[($applicant['pwdStatus'] == 'Y' ? 'PWD' : $applicant['offerCategory'])];
}
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<center><span class='plainbar'><b>"; //$this->candidateProfile($studentID).
if ($enrolmentNo) {
$str .= "Enrollment No.: " .$enrolmentNo. ", Name: " .$applicant['nameEnglish']. ", Contact: " .$applicant['phoneNo']. " & " .$applicant['email'];
} else {
$str .= $program['entranceName']. " Roll No.: " .$applicant['rollNo']. ", Name: " .$applicant['nameEnglish']. ", Category: " .$category;
}
$str .= "</b></span>
<iframe src='inner/$app/$menu/docUpload/$studentID/$programID' width='100%' height='100%' frameborder='0' scrolling='no' onload='resizeIframe(this);'></iframe>
</center>";
$uploads = $this->model->listUploads($studentID, $programID);
if ($uploads) {
foreach($uploads as $upload) {
$docheadCode = $upload['docheadCode'];
$docheadName = $upload['docheadName'];
if (!$this->model->getMyExemption($studentID, $docheadCode)) {
$i++;
$docs .= "($i) $docheadName ";
}
if ($fname != $upload['fileName']) {
$files .= "[ <a href='uploads/documents/" .$upload['fileName']. "'>" .$upload['fileName']. "</a> ]";
}
$fname = $upload['fileName'];
}
if ($docs) {
$str .= "<h3>Uploaded Documents</h3>
<table style=\"background: url('images/pdf-icon.png') no-repeat right bottom; background-size: 50px 50px;\" class='report'>
<tr><th>Uploaded PDF File: $files</th></tr>
<tr><td>$docs</td></tr>
<table>";
}
}
}
return $str;
}
public function aaaPayment($action, $studentID) {
$app = $this->controller->app; // required for toolbar and urls
$menu = $this->controller->menu; // required for toolbar and urls
$account = $this->controller->params[0];
$amount = $this->controller->params[1];
$currency = $this->controller->params[2];
$paymentID = $this->controller->managePayment($action, $studentID);
$ro = '';
$programID = $this->model->getProgramIDByStudentID($studentID);
if ($amount) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/refresh/$studentID/$account/$amount/$currency'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/enrolment/open/$studentID/$programID'); return false;\" title='Go Back'><span class='button'><i class='fas fa-arrow-circle-left'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$studentID/$account/$amount/$currency'); return false;\" title='Pay Offline'><span class='button'><i class='far fa-save'></i></span></a>";
}
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->studentDetail($studentID);
if ($amount) {
$str .= "<hr width='50%'><h1 class='alert' align='center'>Above information are required for ONLINE " .$this->controller->accountTypes[$account]. " payment.</h1><hr width='50%'>
<table class='interface'>
<tr><th colspan='10'>" .$this->controller->accountTypes[$account]. " Payment</th></tr>
<tr><td nowrap align='right'><b>Amount</b> ($currency)</td><td nowrap><input type='text' name='payAmount' size='10' value='$amount'></td>
<td nowrap align='right'>Payment Date</td><td><input type='text' name='datePayment' size='10' value='" . date("Y-m-d"). "' placeholder='YYYY-MM-DD format'></td>
<td nowrap align='right'>Payment Mode</td><td><select name='paymentMode' style='width: 100px' on change=\"form.no.text='UTR'; return false;\">";
foreach ($this->controller->paymentModes as $mode) {
$str .= "<option value='$mode'>$mode</option>";
}
$str .= "</select></td>
<td align='right' nowrap><label for='tno'>Invoice No.</lable></td><td><input type='text' name='paymentNo' size='10' value='' placeholder='Payment No.'></td>
<td align='right' nowrap><label for='bnk'>Bank Name</label></td><td><input type='text' name='bankName' size='20' value='' placeholder='Payee bank name'></td></tr>
</table>" .$this->pageFooter('', $toolbar). "
<ul>
<li><u>On approval of part payments, amount may be adjusted here.</u></li>
<li><i>Use Online Payment Gateway for credit/debit cards, net banking or Point of Sale (POS) terminal for credit/debit card swapping.</i></li>
</ul>
<script language='javascript'>
$('select[name=paymentMode]').change(function() {
var selected = $('option:selected', this).text().trim();
if(selected == 'NEFT') {
$('label[for=tno]').text('UTR No.');
$('label[for=bnk]').text('Bank Name');
} else if (selected == 'DD') {
$('label[for=tno]').text('DD No.');
$('label[for=bnk]').text('Bank Name');
} else if (selected == 'Alumni') {
$('label[for=tno]').text('Alumni RollNo.');
$('label[for=bnk]').text('Remark');
} else {
$('label[for=tno]').text('Invoice No');
$('label[for=bnk]').text('Bank Name');
}
});
</script>";
} else {
$str .= "<center><span class='plainbar'><b class='alert'>Nothing due</b></span></center>";
}
$str .= "</center><br><br>" .$this->aaaTransactions($studentID);
return $str;
}
public function aaaTransactions($studentID) {
$transactions = $this->model->listPayments($studentID);
$str = "<table width='100%'>
<tr><th colspan='7'>Payment #{$studentID} Transactions</th></tr>";
if ($transactions) {
$str .= "<tr><th>#</th><th>Account</th><th>Payment No.</th><th>Payment Date</th><th>Payment Mode</th><th>Bank Name</th><th align='right'>Amount</th></tr>";
foreach ($transactions as $transaction) {
$i++;
$str .= "<tr><td>$i</td><td>" .$this->controller->accountTypes[$transaction['accountType']]. "</td><td>" . $transaction['paymentNo']. "</td><td>" .$transaction['datePayment']. "</td><td>" .$transaction['paymentMode']. "</td><td>" .$transaction['bankName']. "</td><td align='right'>" .($transaction['currency'] == 'INR' ? $this->rs : $this->do). " " .$transaction['payAmount']. "</td></tr>";
}
} else {
$str .= "<tr><td colspan='7'><b class='alert'>None</b></td></tr>";
}
$str .= "</table>";
return $str;
}
public function aaaGateway($action, $studentID) {
$app = $this->controller->app; // required for toolbar and urls
$menu = $this->controller->menu; // required for toolbar and urls
$account = $this->controller->params[0];
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$data = $this->model->getApplicant($applicantID); // get record
$programID = $data['programID']; // to get program detail
$offerCategory = $data['offerCategory'];
$category = $data['category'] ? $data['category'] : $offerCategory; // for DASA candidates
$category = ($data['pwdStatus'] == 'Y' ? 'PWD' : $category);
$program = $this->model->getProgram($programID);
$dLevel = $program['degreeLevel'];
$amount = $_POST['amount'];
$currency = $_POST['currency'];
// save payments in database
$toolbar = "<a href='' onclick=\"inner('$app/$menu/new/$studentID/$account/$amount/$currency'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/payment/new/$studentID/$account/$amount/$currency'); return false;\" title='Go Back'><span class='button'><i class='fas fa-arrow-circle-left'></i></span></a>";
// ============================ HDFC Bank PG
$HASHING_METHOD = "sha512"; // md5,sha1
if (strtoupper($action) == 'FEES') {
// fees account
$hashData = "020bc4ca9304d76f471b03213f73d035";
$pg1['account_id'] = "25146";
$accountType = 1;
$reference = $data['rollNo']. '-Fees';
} else {
// mess account
$hashData = "7bd65b21e13f2446b64d2594029fd957";
$pg1['account_id'] = "28546";
$accountType = 2;
$reference = $data['rollNo']. '-Mess';
}
$pg1['mode'] = "LIVE";
$pg1['channel'] = "10";
$pg1['reference_no'] = $reference;
$pg1['description'] = $data['batchYear']. "-" .$program['programCode'];
$pg1['amount'] = $amount;
$pg1['currency'] = $currency;
$pg1['return_url'] = "https://erp.iiita.ac.in/outer/aaa/PGResponse/online/$studentID/HDFC/$accountType";
$pg1['name'] = $data['nameEnglish'];
$pg1['phone'] = $data['phoneNo'];
$pg1['email'] = $data['email'];
$pg1['address'] = $data['homeAddress'];
$pg1['city'] = $this->model->getDistrictNameByDistrictID($data['homeDistrict']);
$pg1['state'] = $this->model->getStateNameByStateID($data['homeState']);
$pg1['postal_code'] = $data['homePIN'];
$pg1['country'] = $data['nationality'];
unset($_POST['securekey']);
unset($_POST['submitted']);
unset($_POST['curency']);
unset($_POST['studentID']);
ksort($pg1);
foreach ($pg1 as $key => $value){
//echo '[' .$key. '-' .$value. ']';
if (strlen($value) > 0) {
$hashData .= '|'.$value;
}
}
if (strlen($hashData) > 0) {
$secureHash = strtoupper(hash($HASHING_METHOD, $hashData));
}
// ========================= CANARA Bank PG
$pg2['prodid'] = 'IIIT';
$pg2['amt'] = $amount;
$pg2['txncurr'] = $currency;
$pg2['txnscamt'] = $amount;
$pg2['ru'] = "https://erp.iiita.ac.in/outer/aaa/PGResponse/online/$studentID/ATOM/1";
$pg2['clientcode'] = $data['rollNo']; //rollno
$pg2['txnid'] = $data['rollNo']; //rollno
$pg2['date'] = date("Y-d-m");
$pg2['TType'] = 'NBFundTransfer';
$pg2['custacc'] = '0627101019766';
$pg2['bookingid'] = '100001';
$pg2['udf1'] = $data['nameEnglish'];
$pg2['udf2'] = $data['email'];
$pg2['udf3'] = $data['phoneNo'];
$pg2['udf4'] = $reference;
$pg2['udf5'] = $data['batchYear']. "-" .$program['programCode'];
$pg2['udf6'] = $studentID;
$pg2['udf9'] = 1; // semester
foreach ($pg2 as $key => $value) {
$queryString .= $key . '=' .$value. '&';
}
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->candidateProfile($studentID);
$str .= "<table class='interface'>
<tr><td width='8%' nowrap>". $program['entranceName']. " Roll No.</td><td width='12%'><b>" .$data['rollNo']. "</b></td>
<td width='8%' nowrap align='right'>Name</td><td colspan='3'><b>" .$data['nameEnglish']. ' (' .$data['nameHindi']. ")</b></td>
<td width='8%' nowrap align='right'>Contact</td><td width='12%'><b>" .$data['phoneNo']. ", " .$data['email']. "</b></td>
<td width='8%' align='right'>Aadhaar No.</td><td width='12%'><b>" .$data['aadhaarNo']. "</b></td></tr>
</table>Above information are required for online payment.
<div align='center'><h1>" .$this->controller->accountTypes[$account]. "</h1>
<h4>Payable Amount: $currency " .number_format($_POST['amount'], 2). " ";
if ($account == 2 || $dLevel == 'UG') {
$str .= "<a href='' onclick=\"document.erpForm.submit(); return false;\" target='new' title='Confirm Payment'><img src='images/hdfc.png' width='60' height='20'></a>";
} else {
$str .= "<a href='https://erp.iiita.ac.in/atom.php?{$queryString}proceed=1' title='Confirm Payment' target='new'><img src='images/atom.png' width='60' height='20'></a>";
}
$str .= "</h4>
<h5>For payment you may route through either HDFC or ATOM Gateway, accordingly bank may charge for online transactions.</h5>
</div>";
foreach($pg1 as $key => $value) {
$str .= "<input type='hidden' name='" .$key. "' value='" .$value. "'>";
}
$str .= "<input type='hidden' name='secure_hash' value='" .$secureHash. "'>" .$this->pageFooter('', $toolbar);
return $str;
}
public function aaaExemption($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$studentID = $this->controller->manageExemption($action, $studentID); // initiate controller action
$exemptions = $this->model->listExemptions($studentID);
$uploads = $this->model->listUploads($studentID, $programID);
$programs = $this->model->selectProgram();
$program = $this->model->getProgram($programID);
$dl = $program['entranceName'];
$applicants = $this->model->selectApplicant($programID);
if ($programID && $studentID) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/refresh/$studentID/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$studentID/$programID'); return false;\" title='Save Form'><span class='button'><i class='far fa-save'></i></span></a>";
//<a href='' onclick=\"inner('$app/$menu/delete/$studentID/$programID'); return false;\" title='Delete Exemption'><span class='button'><i class='far fa-trash-alt'></i></span></a>";
//<a href='' onclick=\"self.close(); return false;\" title='Close Window'><span class='button'><i class='far fa-window-close'></i></span></a>";
}
$findbar = "Program <select name='programID1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
<span class='alert'>$dl</span> Roll No. <select name='studentID1' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.options[this.selectedIndex].value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($applicants as $applicant) {
$channel = ($this->checkGogreen($studentID) == TRUE ? 'darkgreen' : '#FA8072');
$star = ($applicant['astatus'] == 'Interested' ? ($channel == 'darkgreen' ? '' : ' *') : '');
$findbar .= "<option style='color: $channel' value='" .$applicant['studentID'] . "'" .($applicant['studentID'] == $studentID ? self::SL : ''). ">" .$applicant['rollNo']. ' (' .trim($applicant['nameEnglish']). ")$star</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $studentID) {
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$applicant = $this->model->getApplicant($applicantID);
$category = $applicant['pwdStatus'] == 'Y' ? 'PWD' : $applicant['category'];
if (array_key_exists($applicant['offerCategory'], $this->controller->dasaCategorys)) {
$category = $applicant['offerCategory'];
}
$documents = $this->model->selectDocchart($programID, $category);
$str .= $this->candidateProfile($studentID). "<center><span class='plainbar'><b>
[ Name: " .$applicant['nameEnglish']. ' (' .$applicant['nameHindi']. ") ]
[ Contact: " .$applicant['phoneNo']. ", " .$applicant['email']. " ]
[ Aadhaar No.: " .$applicant['aadhaarNo']. " ]</b></span></center>
<table style='min-height: 300px' width='100%' onload='resizeIframe(this);'>
<tr><th width='50%'>Pre-requisit #{$studentID} List</th><th>Exempted List</th></tr>
<tr valign='top'><td nowrap>";
// list deficit documents
foreach ($documents as $document) {
$docheadCode = $document['docheadCode'];
if ($this->model->getMyExemption($studentID, $docheadCode) || $this->model->getMyUpload($studentID, $docheadCode)) continue;
$i++;
$docs .= "<li><input type='checkbox' id='doc' name='docheadCode[]' value='$docheadCode'>$docheadCode - " .$document['docheadName']. " (" .$document['specification']. ")" .($document['original'] == 'Y' ? ' <u>(Original)</u>' : ''). "</li>";
}
// list deficit payments
foreach ($this->controller->accountTypes as $docheadCode => $desc) {
if ($this->model->getMyExemption($studentID, $docheadCode) || $this->model->getMyPayment($studentID, $docheadCode)) continue;
$i++;
$docs .= "<li><input type='checkbox' id='doc' name='docheadCode[]' value='$docheadCode'>" .strtoupper(substr($desc, 0, 4)). " - $desc </li>";
}
if ($i) {
$dateRemind = $this->dateAdd(10);
$str .= "<span class='toolbar'><input type='checkbox' onclick='toggle(this, \"doc\")'> Toggle All</span>
<ol>$docs</ol>
<table class='rightbar'>
<tr><td>Due Date <input type='text' name='dateRemind' value='$dateRemind' size='10' placeholder='YYYY-MM-DD'><span class='toolbar'>$toolbar</span></td></tr>
<tr valign='top'><td><textarea name='remark' rows='3' cols='30' placeholder='remarks'></textarea></td></tr>
</table>";
} else {
$str .= "<h4>none</h4>";
}
$str .= "</td><td>";
foreach($exemptions as $exemption) {
$j++;
$docheadCode = $exemption['docheadCode'];
$docheadName = $exemption['docheadName'];
if (!$docheadName) $docheadName = $this->controller->accountTypes[$exemption['docheadCode']];
$exms .= "<li><input type='checkbox' id='exm' name='docheadCode[]' value='$docheadCode'> $docheadCode - $docheadName (to submit by " . $exemption['dateRemind']. ($exemption['remark'] ? ', '. $exemption['remark'] : ''). ")</li>";
}
if ($j) {
$str .= "<input type='checkbox' onclick='toggle(this, \"exm\")'> Check All
<ol>$exms</ol>";
} else {
$str .= "<h4>none</h4>";
}
$str .= "</td></tr>
</table>";
} else {
$str .= "<h1 align='center'>Select program and roll No. to proceed with.</h1>";
}
return $str;
}
public function aaaEnrolment($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolmentID = $this->controller->manageEnrolment($action, $enrolmentID); // initiate controller action
$programs = $this->model->selectProgram();
$applicants = $this->model->selectApplicant($programID);
$enrolments = $this->model->selectEnrolment($programID);
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'";
if ($programID == $program['programID']) {
$findbar .= self::SL;
$dl = $program['entranceName'];
}
$findbar .= ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
if ($action == 'new') {
$findbar .= " <span class='alert'>$dl</span>
Roll No. <select id='aid' name='applicantID' style='width: 200px' onchange=\"inner('$app/$menu/new/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($applicants as $applicant) {
$channel = ($this->checkGogreen($applicant['studentID']) == TRUE ? 'darkgreen' : '#FA8072');
$star = ($applicant['astatus'] == 'Interested' ? ($channel == 'darkgreen' ? '' : ' *') : '');
$findbar .= "<option style='color: $channel' value='" .$applicant['studentID'] . "'" .($applicant['studentID'] == $studentID ? self::SL : ''). ">" .$applicant['rollNo']. ' (' .trim($applicant['nameEnglish']). ")$star</option>";
}
$findbar .= "</select>";
$alert = "Select program and roll No. to proceed with.";
} else {
$findbar .= " Enrollment No. <select id='eid' name='enrolmentID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($enrolments as $enrolment) {
$deficit = ($this->model->listMyExemptions($enrolment['studentID']) ? 'red' : '');
$findbar .= "<option style='color: $deficit' value='" .$enrolment['studentID'] . "'" .($enrolment['studentID'] == $studentID ? self::SL : ''). ">" .$enrolment['enrolmentNo']. ' (' .trim($enrolment['nameEnglish']). ")$star</option>";
}
$findbar .= "</select>" .($programID && !$studentID ? " <a href='' onclick=\"inner('$app/$menu/new/0/$programID'); return false;\" title='New Enrollment'><span class='button'><i class='far fa-file'></i></span></a>" : '');
$alert = "Select program and enrollment No. to proceed with.";
}
if ($programID && $studentID) {
$this->model->tupleID = $studentID;
//if ($this->checkGogreen($studentID) == TRUE) { //commented so that fee exempted case can be processed
//$toolbar = "<a href='' onclick=\"popup('$app/upload/new/$studentID/', 'Upload Documents', 600, 600); return false;\" title='Upload Documents'><span class='button'><i class='fas fa-upload'></i></span></a>";
//} else {
//$toolbar .= "Fees not yet deposited, Can't proceed further.";
//}
if ($enrolmentID) {
$toolbar = $this->erpToolbar($toolbar);
$toolbar .= "<a href='' onclick=\"popup('$app/upload/new/$studentID/', 'Upload Documents', 600, 600); return false;\" title='Upload Documents'><span class='button'><i class='fas fa-upload'></i></span></a>
<a href='' onclick=\"popup('$app/receipt/print/$studentID', 'Enrollment Receipt', 1000, 600); return false;\" title='Enrollment Receipt'><span class='button'><i class='far fa-list-alt'></i></span></a>
<a href='' onclick=\"popup('$app/IDCard/print/$studentID/$programID', 'ID Card', 600, 500); return false;\" title='ID Card'><span class='button'><i class='far fa-id-card'></i></span></a>";
//<a href='' onclick=\"popup('hms/booking/open/0/$enrolmentID', 'Hostel Allotment', 1000, 600); return false;\" title='Hostel Allotment'><span class='button'><i class='fas fa-bed'></i></span></a>
} else {
if (($this->model->getPayment($studentID, 1) || $this->model->getMyExemption($studentID, 1)) && ($this->model->getPayment($studentID, 2) || $this->model->getMyExemption($studentID, 2))) $toolbar = $this->erpToolbar($toolbar);
else $toolbar = "<a href='' onclick=\"inner('$app/$menu/new/$studentID/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>";
$toolbar .= "<a href='' onclick=\"popup('$app/upload/new/$studentID/', 'Upload Documents', 600, 600); return false;\" title='Upload Documents'><span class='button'><i class='fas fa-upload'></i></span></a>";
}
}
$toolplus = ($this->model->getPendingUploads($studentID) == TRUE ? -1 : 1);
flush();
$str = $this->pageHeader($findbar, $toolbar, $toolplus);
if ($studentID) {
$str .= $this->candidateProfile($studentID);
$str .= $this->studentForm($action, $studentID). $this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>$alert</h1>";
}
return $str;
}
public function aaaInsurence($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolmentID = $this->controller->manageInsurence($action, $enrolmentID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$programs = $this->model->selectProgram();
$enrolments = $this->model->selectEnrolment($programID);
$data = $this->model->getInsurence($enrolmentID); // get record
if ($studentID) {
$this->model->tupleID = $studentID;
if ($data['mcaipID']) $toolbar .= "<a href='' onclick=\"popup('$app/mcaip/print/$studentID/$programID', 'MCAIP Form', 1000, 700); return false;\" title='Print MCAIP Form'><span class='button'><i class='fab fa-wpforms'></i></span></a>";
$toolbar = $this->erpToolbar($toolbar);
}
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
Enrollment No. <select id='eid' name='enrolmentID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($enrolments as $enrolment) {
$findbar .= "<option value='" .$enrolment['studentID'] . "'" .($enrolment['studentID'] == $studentID ? self::SL : ''). ">" .$enrolment['enrolmentNo']. ' (' .trim($enrolment['nameEnglish']). ")$star</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($studentID) {
$str .= "<table width='100%'>
<tr><th>Student #{$studentID} Detail</th><th>Declarations</th></tr>
<tr valign='top'><td width='50%'>" .$this->studentDetail($studentID). "</td><td width='50%'>
<table class='interface'>";
if ($data['maritalStatus'] == 'M') {
$str .= "<tr><td colspan='2'><b>Spouse's detail</b></td></tr>
<tr><td width='20%' nowrap>Spouse Name</td><td><input type='text' id='sname' name='spouseName' size='30' value='" .$data['spouseName']. "' placeholder='Name of spouse' $ro>
Age <input type='number' name='spouseAge' style='width: 50px' value='" .$data['spouseAge']. "' $ro></td></tr>
<tr><td nowrap>Address<sup>3</sup></td><td><input type='text' id='sadd' name='spouseAddress' size='40' value='" .$data['spouseAddress']. "' placeholder='(Offic address, if applicable)' $ro>
PIN Code <input type='text' id='spin' name='spousePIN' size='7' value='" .$data['spousePIN']. "' placeholder='Pin code' $ro></td></tr>
<tr><td nowrap>Phone No.</td><td nowrap><input type='text' id='sphone' name='spousePhone' size='20' value='" .$data['spousePhone']. "' placeholder='Emergency contact number' $ro>
Email <input type='text' id='semail' name='spouseEmail' size='30' value='" .$data['spouseEmail']. "' placeholder='Functional email address' $ro></td></tr>
<tr><td colspan='2'><b>I Child's detail</b></td></tr>
<tr bgcolor='#f4f6f6'><td nowrap>Child Name</td><td><input type='text' name='child1Name' size='30' value='" .$data['child1Name']. "' placeholder='Name of I child' $ro>
Age <input type='number' name='child1Age' style='width: 50px' value='" .$data['child1Age']. "' $ro>
Gender <select name='child1Gender' style='width: 55px'>";
foreach ($this->controller->genders as $code => $desc) {
$str .= "<option value='$code'" .($data['child1Gender'] == $code ? self::SL : ''). ">" .$desc. "</option>";
}
$str .= "</select></td></tr>
<tr bgcolor='#f4f6f6'><td nowrap>Address <input type='checkbox' name='same3' value='1' onclick=\"form.c1add.value=form.sadd.value; form.c1pin.value=form.spin.value; form.c1phone.value=form.sphone.value; form.c1email.value=form.semail.value;\"> Same<sup>3</sup></td>
<td><input type='text' id='c1add' name='child1Address' size='40' value='" .$data['child1Address']. "' placeholder='(Offic address, if applicable)' $ro>
PIN Code <input type='text' id='c1pin' name='child1PIN' size='7' value='" .$data['child1PIN']. "' placeholder='Pin code' $ro></td></tr>
<tr bgcolor='#f4f6f6'><td nowrap>Phone No.</td><td nowrap><input type='text' id='c1phone' name='child1Phone' size='20' value='" .$data['child1Phone']. "' placeholder='Emergency contact number' $ro>
Email <input type='text' id='c1email' name='child1Email' size='30' value='" .$data['child1Email']. "' placeholder='Functional email address' $ro></td></tr>
<tr><td colspan='2'><b>II Child's detail</b></td></tr>
<tr><td nowrap>Child Name</td><td nowrap><input type='text' id='c2name' name='child2Name' size='30' value='" .$data['child2Name']. "' placeholder='Name of II child' $ro>
Age <input type='number' name='child2Age' style='width: 55px' value='" .$data['child2Age']. "' $ro>
Gender <select name='child2Gender' style='width: 50px'>";
foreach ($this->controller->genders as $code => $desc) {
$str .= "<option value='$code'" .($data['child2Gender'] == $code ? self::SL : ''). ">" .$desc. "</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Address <input type='checkbox' name='same4' value='1' onclick=\"form.c2add.value=form.sadd.value; form.c2pin.value=form.spin.value; form.c2phone.value=form.sphone.value; form.c2email.value=form.semail.value;\"> Same<sup>3</sup></td>
<td><input type='text' id='c2add' name='child2Address' size='40' value='" .$data['child2Address']. "' placeholder='(Offic address, if applicable)' $ro>
PIN Code <input type='text' id='c2pin' name='child2PIN' size='7' value='" .$data['child2PIN']. "' placeholder='Pin code' $ro></td></tr>
<tr><td nowrap>Phone No.</td><td nowrap><input type='text' id='c2phone' name='child2Phone' size='20' value='" .$data['child2Phone']. "' placeholder='Emergency contact number' $ro>
Email <input type='text' id='c2email' name='child2Email' size='30' value='" .$data['child2Email']. "' placeholder='Functional email address' $ro></td></tr>";
}
$str .= "<tr valign='top'><td>Known Diseases</td><td><textarea name='knownDiseases' rows='5' cols='60' placeholder='List diseases in order to (a) (b) (c) (d) (e) etc.' $ro>" .$data['knownDiseases']. "</textarea></td></tr>
</table></td></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program and enrollment No. to proceed with.</h1>";
}
return $str;
}
public function aaaSliding($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolmentID = $this->controller->manageSliding($action, $enrolmentID); // initiate controller action
if ($action == 'save') return $this->aaaEnrolment('open', $studentID);
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$programs = $this->model->selectProgram();
$enrolments = $this->model->selectEnrolment($programID);
$program = $this->model->getProgram($programID);
$degreeLevel = $program['degreeLevel'];
$slidings = $this->model->listSlidings($programID);
$xprograms = $this->model->selectProgram();
$programs = $this->model->selectProgram($degreeLevel);
$isScope = count($programs);
$enrolment = $this->model->getEnrolment($enrolmentID);
if ($studentID) {
$this->model->tupleID = $studentID;
$toolbar = $this->erpToolbar();
}
$findbar = "Program <select name='xprogramID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($xprograms as $xprogram) {
$findbar .= "<option value='" .$xprogram['programID']. "'" .($programID == $xprogram['programID'] ? self::SL : ''). ">" .$xprogram['programCode']. "</option>";
}
$findbar .= "</select>
Enrollment No. <select name='enrolmentID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($enrolments as $row) {
$findbar .= "<option value='" .$row['studentID'] . "'" .($row['studentID'] == $studentID ? self::SL : ''). ">" .$row['enrolmentNo']. ' (' .$row['nameEnglish'].")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $studentID) {
$str .= $this->candidateProfile($studentID);
$str .= "<table width='100%'>
<tr><th>Student #{$studentID} Detail</th><th>Sliding Detail</th><th>Sliding List</th></tr>
<tr valign='top'><td width='30%'>
<table class='interface'>
<tr><td width=20%' nowrap>Student's Name</td><td><b>" .$enrolment['nameEnglish']. " (" .$enrolment['nameHindi']. ")</b></td></tr>
<tr><td nowrap>Father's Name</td><td><b>" .$enrolment['fatherName']. "</b></td></tr>
<tr><td nowrap>Mother's Name</td><td><b>" .$enrolment['motherName']. "</b></td></tr>
<tr><td nowrap>Category</td><td><b>" .$this->controller->categorys[$enrolment['category']]. "</b></td></tr>
<tr><td nowrap>Nationality</td><td><b>". $this->model->getCountryNameByCountryCode($enrolment['nationality']). "</b></td></tr>
<tr><td nowrap>Aadhaar No.</td><td><b>" .$enrolment['aadhaarNo']. "</b></td></tr>
</table>
</td><td width='50%'>
<table class='interface'>";
if ($isScope) {
$str .= "<tr><td width='20%' nowrap>New Program</td><td><select name='programID' style='width: 200px'>";
foreach ($programs as $program) {
if ($program['degreeLevel'] == $degreeLevel && $program['programID'] <> $programID) {
$str .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : $this->dis). ">" .$program['programCode']."</option>";
}
}
$str .= "</select></td></tr>
<tr valign='top'><td>Remark</td><td><textarea name='remark' rows='3' cols='60' placeholder='put a remark here.' $ro>" .$enrolment['remark']. "</textarea></td></tr>";
} else {
$str .= "<tr><td colspan='2'><b class='alert'>No sliding option available at this institute.</b></td></tr>";
}
$str .= "</table>
</td><td width='20%'>
<ul class='listbar'>";
foreach($slidings as $sliding) {
$str .= "<li>" .$sliding['enrolmentNo']. ' - ' .$sliding['nameEnglish']. "</li>";
}
$str .= "</ul></td></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program and enrollment No. to proceed with.</h1>";
}
return $str;
}
public function aaaWithdrawal($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$withdrawID = $this->model->getWithdrawIDByStudentID($studentID);
if (!$withdrawID) $withdrawID = 0;
$withdrawID = $this->controller->manageWithdrawal($action, $withdrawID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock; // ensure default edit lock
$programs = $this->model->selectProgram();
$enrolments = $this->model->selectEnrolment($programID);
$enrolment = $this->model->getEnrolment($enrolmentID);
$withdrawals = $this->model->selectWithdrawal($programID);
$withdrawal = $this->model->getWithdrawal($withdrawID);
if ($withdrawal['accountNo']) $toolbar = "<a href='' onclick=\"popup('$app/receipt/print/$studentID/$programID', 'Withdrawal Receipt', 1000, 600); return false;\" title='Print Receipt'><span class='button'><i class='far fa-list-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/mail/$studentID/$programID'); return false;\" title='Notify Withdrawal'><span class='button'><i class='far fa-envelope'></i></span></a>";
$this->model->tupleID = $studentID;
if ($studentID) $toolbar = $this->erpToolbar($toolbar);
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select> ";
if ($action == 'new') {
$findbar .= "Enrollment No. <select id='eid' name='enrolmentID1' style='width: 200px' onchange=\"inner('$app/$menu/new/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($enrolments as $enrolment1) {
$findbar .= "<option value='" .$enrolment1['studentID'] . "'" .($enrolment1['studentID'] == $studentID ? self::SL : ''). ">" .$enrolment1['enrolmentNo']. ' (' .$enrolment1['nameEnglish'].")</option>";
}
$findbar .= "</select>";
} else {
$findbar .= "Enrollment No. <select id='eid' name='enrolmentID1' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($withdrawals as $withdrawal1) {
$findbar .= "<option value='" .$withdrawal1['studentID'] . "'" .($withdrawal1['studentID'] == $studentID ? self::SL : ''). ">" .$withdrawal1['enrolmentNo']. ' (' .$withdrawal1['nameEnglish']. ")</option>";
}
$findbar .= "</select>";
if ($programID && !$withdrawID) $findbar .= "<a href='' onclick=\"inner('$app/$menu/new/0/$programID'); return false;\" title='New Withdrawal'><span class='button'><i class='far fa-file'></i></span></a>";
}
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $studentID) {
$str .= $this->candidateProfile($studentID);
$str .= "<table width='100%'>
<tr><th>Student #{$studentID} Detail</th><th>Withdrwal #{$withdrawID} Detail</th></tr>
<tr valign='top'><td width='50%'>
<table class='report'>
<tr><td width=20%' nowrap>Student Name</td><td>" .$enrolment['nameEnglish']. " (" .$enrolment['nameHindi']. ")</td></tr>
<tr><td nowrap>Father Name</td><td>" .$enrolment['fatherName']. "</td></tr>
<tr><td nowrap>Mother Name</td><td>" .$enrolment['motherName']. "</td></tr>
<tr><td nowrap>Category</td><td>" .$this->controller->categorys[$enrolment['category']]. "</td></tr>
<tr><td nowrap>Contact</td><td>" .$enrolment['phoneNo']. ' (' .$enrolment['email']. ")</td></tr>
<tr><td nowrap>Permanent Address</td><td>". $enrolment['homeAddress']. '<br>' .$this->model->getDistrictNameByDistrictID($enrolment['homeDistrict']). '-' .$enrolment['homePIN']. ' (' .$this->model->getStateNameByStateID($enrolment['homeState']). ') ' .$this->model->getCountryNameByCountryCode($enrolment['nationality']). "</td></tr>
<tr><td nowrap>Aadhaar No.</td><td>" .$enrolment['aadhaarNo']. "</td></tr>
</table>
</td><td width='50%'>
<table class='interface'>
<tr><td nowrap>Withdrawal Date</td><td><input type='text' name='dateWithdraw' size='15' value='" .($withdrawal['dateWithdraw'] ? $withdrawal['dateWithdraw'] : date("Y-m-d")). "' placeholder='YYYY-MM-DD format' $ro></td></tr>
<tr><td nowrap>Reason of Withdrawal</td><td nowrap><select name='withdrawReason' style='width: 250px'>";
foreach ($this->controller->withdrawReasons as $code) {
$str .= "<option value='$code'" .($withdrawal['withdrawReason'] == $code ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select></td></tr>
<tr valign='top'><td>Remark</td><td><textarea name='remark' rows='2' cols='60' $ro>" .$withdrawal['remark']. "</textarea></td></tr>
<tr><td colspan='2'><b>A/c details for Refund and Receipt</b></td></tr>
<tr><td nowrap>Account No.</td><td><input type='text' name='accountNo' size='20' value='" .$enrolment['accountNo']. "' placeholder='Alphanumeric' $ro></td></tr>
<tr><td nowrap>Holder Name</td><td><input type='text' name='holderName' size='50' value='" .$enrolment['holderName']. "' placeholder='50 characters max.' $ro></td></tr>
<tr><td nowrap>Bank Name</td><td><input type='text' name='bankName' size='50' value='" .$enrolment['bankName']. "' placeholder='50 characters max.' $ro></td></tr>
<tr><td nowrap>IFSC Code</td><td><input type='text' name='ifscCode' size='20' value='" .$enrolment['ifscCode']. "' placeholder='In capitals' $ro></td></tr>
</table><input type='hidden' name='studentID' value='$studentID'>
<span class='rightbar'><span class='alert'>A/c details are required for receipt printing.</span></span>
Please ensure nodues is propoerly obtained by the student in order to process his/her withdrawal here.
Closing of LDAP and Email accounts and settlement of fees will be processed separately by concern departments.
</td></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program and enrollment No. to proceed with.</h1>";
}
return $str;
}
public function aaaNodeficit($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$studentID = $this->controller->manageNodeficit($action, $studentID); // initiate controller action
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolment = $this->model->getEnrolment($enrolmentID);
$programs = $this->model->selectProgram();
$deficits = $this->model->selectDeficit($programID);
if ($action == 'docUpload') {
$exemptions = $this->model->listExemptions($studentID);
foreach ($exemptions as $exemption) {
$docheadCode = $exemption['docheadCode'];
$docheadName = $exemption['docheadName'];
if ($docheadCode == 1 || $docheadCode == 2) { // for fees and mess account
$docheadName = $this->controller->accountTypes[$docheadCode];
$docheadCode = strtoupper(substr($docheadName, 0, 4));
}
$docs .= "<li><input type='checkbox' id='doc' name='docheadCode[]' value='$docheadCode'> $docheadCode - $docheadName" .($exemption['original'] == 'Y' ? ' <u>(Original)</u>' : ''). "</li>";
}
$str = "<table width='100%' style='border-collapse: collapse; font-size: 12px;'>
<tr style='line-height: 30px'>
<th width='50%'>Deficit List</th><th>Deficit Upload</th></tr>
<tr valign='top'><td nowrap>
<span class='toolbar'><input type='checkbox' onclick='toggle(this, \"doc\")'> Toggle All</span>
<ol>" .($docs ? $docs : 'None'). "</ol>
<span class='rightbar'><span class='alert'>
Check available documents from above list and select <br>
the PDF file of page-wise scanned documents to upload<br>
here in order to clear the listed deficiency of this student.
</span></span>
</td><th nowrap><br>";
if ($docs) {
$str .= "PDF File <input type='file' name='fileToUpload' id='fileToUpload' size='50'>
<input type='submit' name='submit' value='UPLOAD' title='Upload selected file'>
<input type='hidden' name='studentID' value='$studentID'><input type='hidden' name='programID' value='$programID'><br>
<br>
<font color='red'>". $this->controller->errorText. "</font><br>
<hr>
After upload 'Refresh Page' to get fresh list of submitted documents.
<hr><br>";
}
$str .= "</th></tr>
</table>
";
} else {
if ($programID && $studentID) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/refresh/$studentID/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>";
// <a href='' onclick=\"inner('$app/$menu/save/$studentID/$programID'); return false;\" title='Save Form'><span class='button'><i class='far fa-save'></i></span></a>
}
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
Enrollment No. <select name='studentID' style='width: 200px' onchange=\"inner('$app/$menu/edit/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($deficits as $deficit) {
$findbar .= "<option value='" .$deficit['studentID'] . "'" .($deficit['studentID'] == $studentID ? self::SL : ''). ">" .$deficit['enrolmentNo']. ' (' .$deficit['nameEnglish'].")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $studentID) {
$str .= $this->candidateProfile($studentID). "<center><span class='plainbar'><b>
[ Name: " .$enrolment['nameEnglish']. ' (' .$enrolment['nameHindi']. ") ]
[ Contact: " .$enrolment['phoneNo']. ", " .$enrolment['email']. " ]
[ Aadhaar No.: " .$enrolment['aadhaarNo']. " ]</b></span></center>
<iframe name='inframe' src='inner/$app/$menu/docUpload/$studentID/$programID' width='100%' frameborder='0' scrolling='auto' onload='resizeIframe(this);'></iframe>";
$uploads = $this->model->listMyUploads($studentID);
foreach($uploads as $upload) {
$docheadCode = $upload['docheadCode'];
$docheadName = $upload['docheadName'];
$z++;
$docs .= "($z) $docheadCode-$docheadName ";
if ($fname != $upload['fileName']) {
$extName = strtolower(pathinfo($upload['fileName'], PATHINFO_EXTENSION));
$size = number_format(filesize(__DIR__ . "/../uploads/documents/" .$upload['fileName']) / 1024, 2). ' KB';
//list($width, $height, $type, $attr) = getimagesize("uploads/documents/" .$upload['fileName']);
$files .= "[ <a href='uploads/documents/" .$upload['fileName']. "' title='Download Document' target='inframe1'>" .$upload['fileName']. "</a> ($size) ]";
}
$fname = $upload['fileName'];
}
$str .= "<h3>Uploaded Documents</h3>
<table style=\"background: url('images/pdf-icon.png') no-repeat right bottom; background-size: 50px 50px;\" width='100%'>
<tr><th>$files</th></tr>
<tr><td>$docs</td></tr>
</table>";
} else {
$str .= "<h1 align='center'>Select program and enrollment No. to proceed with.</h1>";
}
}
return $str;
}
public function aaaBranchChange($action, $enrolmentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->controller->manageBranchChange($action, $enrolmentID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = '';//$this->controller->editLock; // ensure default edit lock
if ($enrolmentID) {
$data = $this->model->getEnrolment($enrolmentID);
$programID = $data['programID'];
$studentID = $data['studentID'];
$toolbar = "<a href='' onclick=\"inner('$app/$menu/new/0/$programID); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$enrolmentID/$programID'); return false;\" title='Save Form'><span class='button'><i class='far fa-save'></i></span></a>
<a href='' onclick=\"popup('$app/IDCard/print/$enrolmentID/$programID/0', 'ID Card', 600, 500); return false;\" title='Print ID-card'><span class='button'><i class='far fa-id-card'></i></span></a>";
$program = $this->model->getProgram($programID);
$degreeLevel = $program['degreeLevel'];
}
$programs = $this->model->selectProgram();
$enrolments = $this->model->selectEnrolment($programID);
$findbar = "Program <select name='xprogramID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
Enrollment No. <select id='eid' name='enrolmentID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach($enrolments as $enrolment) {
$findbar .= "<option value='" .$enrolment['enrolmentID'] . "'" .($enrolment['enrolmentID'] == $enrolmentID ? self::SL : ''). ">" .$enrolment['enrolmentNo']. ' (' .$enrolment['nameEnglish'].")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($enrolmentID) {
$str .= "<table width='100%'>
<tr><th>Student #{$studentID} Detail</th><th>New Roll No.</th></tr>
<tr valign='top'><td width='50%'>
<table class='interface'>
<tr><td width='20%' nowrap>Current Enrollment No.</td><td><b>" .$data['enrolmentNo']. "</b></td></tr>
<tr><td nowrap>Student's Name</td><td><b>" .$data['nameEnglish']. " (" .$data['nameHindi']. ")</b></td></tr>
<tr><td nowrap>Father's Name</td><td><b>" .$data['fatherName']. "</b></td></tr>
<tr><td nowrap>Mother's Name</td><td><b>" .$data['motherName']. "</b></td></tr>
<tr><td nowrap>Category</td><td><b>" .$this->controller->subCategorys[$data['category']]. "</b></td></tr>
<tr><td nowrap>Nationality</td><td><b>" .$this->model->getCountryNameByCountryCode($data['nationality']). "</b></td></tr>
<tr><td nowrap>Aadhaar No.</td><td><b>" .$data['aadhaarNo']. "</b></td></tr>
<tr><td nowrap>Contact No.</td><td><b>" .$data['phoneNo']. "</b></td></tr>
<tr><td nowrap>Email</td><td><b>" .$data['email']. "</b></td></tr>
</table>
</td><td width='50%'>
<table class='interface'>
<tr><td width='20%' nowrap>New Program</td><td><select name='programID' style='width: 200px'>";
foreach ($programs as $program) {
if ($program['degreeLevel'] == $degreeLevel && $program['programID'] <> $programID) {
$str .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']."</option>";
}
}
$str .= "</select></td></tr>
<tr><td width='20%' nowrap>New Enrollment No.</td><td><input type='text' name='enrolmentNo' value='' size='20' $ro></td></tr>
<tr valign='top'><td>Remark</td><td><textarea name='remark' rows='2' cols='60'>" .$data['eremark']. "</textarea></td></tr>
</table>
</td></tr></table>" .$this->pageFooter('', $toolbar);
}
return $str;
}
public function aaaMCAIP($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$program = $this->model->getProgram($programID);
$data = $this->model->getEnrolment($enrolmentID);
if ($data) {
try {
$photo = $this->model->getMyUpload($studentID, 'PHO');
$psign = $this->model->getMyUpload($studentID, 'SIG');
} catch (Exception $e) {
print $e->__toString();
}
$institute = $this->model->getInstitute();
// generate pdf file of receipt
$pdf = new erpLetterPad([], $institute);
$pdf->autoScriptToLang = true;
$pdf->autoLangToFont = true;
$pdf->SetDisplayMode(real, 'default');
// create first page
$pdf->AddPage();
$pdf->SetTitle('ERP PDF Generator');
$pdf->SetAuthor('IIIT-A');
$pdf->SetAutoPageBreak(0);
//$pdf->Rect(15, 185, 100 , '');
$pdf->SetFont('Times', 'B', 11);
$pdf->SetXY(15, 44);
$pdf->Cell(180, 4, "Broad Features of the Scheme*", 0, 1, 'C');
$pdf->SetFont('Times', '', 10);
$pdf->SetXY(15, 47);
$pdf->WriteHTML("<ol style='border: 1px solid red;'>
<li>MEDICLAIM Hospitalization Cover - Upto Rs. 60,000/- per annum.</li>
<li>Accedential Death OR Permanent Disabilement of Insured Student - Upto Rs. 5 Lakhs.</li>
<li>Carriage of Dead Body of the Insured, upon Accidental Death to place of Normal Residence - Rs. 5,000/-</li>
<li>Upon Accidental Death of Fee Paying Parent / Guardian - Rs. 3 Lakhs.</li>
<li>Education Expenses to Dependent Children of Married Insured Students - Upto Rs. 25,000/- per child.</li>
<li>Mediclaim coverage extends throughout India on 24x7 basis.</li>
<li>Territorial limits for Accidental Death / Permanent Disablement Insurence extend throughout the world.</li>
<li>Treatments under Alopathic System of Medicine are only covered.</li>
<li>Dental treatments and Physiotherapy are not covered for claims / reimbursements.</li>
<li>CASHLESS ACCESS SERVICES, at designated Hospitals, subject to Pre-Authorisation.</li>
<li>Spouse of Married Students AND also their dependent Children CAN be covered, for extension benefits, upon payment of additional premiums, NOT COVERED by default in this cover.</li>
</ol>
<i style='font-size: 11px'>(* Conditions Apply)</i>");
$pdf->Ln(10);
$pdf->WriteHTML("<h3 align='center'>Information required from each student to enabled him/her avail the benefit under the Scheme</h3>");
$pdf->Ln(1);
$pdf->Image(($photo ? 'https://erp.iiita.ac.in/uploads/photos/' .$photo : 'https://erp.iiita.ac.in/images/dummy.jpg'), 173, 160, 25, 28);
$title = $data['gender'] == 'F' ? 'Ms. ' : 'Mr. ';
$sdo = $data['gender'] == 'F' ? 'D/o. ' : 'S/o. ';
$countrys = $this->model->selectCountry();
if (!$data['nationality']) $data['nationality'] = 'IN';
foreach ($countrys as $country) {
if ($data['nationality'] == $country['countryCode']) $nationality = $country['countryName'];
}
$states = $this->model->selectState();
foreach ($states as $state) {
if ($data['homeState'] == $state['stateID']) $stateName = $state['stateName'];
}
$districts = $this->model->selectDistrict($data['homeState']. "\n");
if (!$data['homeDistrict']) $data['homeDistrict'] = 1;
foreach ($districts as $district) {
if ($data['homeDistrict'] == $district['districtID']) $districtName = $district['districtName'];
}
$dstate = (strpos($data['homeAddress'], $districtName) ? '' : $districtName). '-' .$data['homePIN']. ' (' .$stateName. ') ' .strtoupper($nationality);
$pdf->SetXY(15, 165);
$pdf->WriteHTML("<h4>1. Detail of the Student to be Insured:</h4>
<table width='100%' style='margin-left: 30px; font-size: 11.5px;'>
<tr><td width='20%'>Student Name</td><td>: " .$title .$data['nameEnglish']. ($data['nameHindi'] ? ' (' .$data['nameHindi']. ') ' : ' '). "</td><tr>
<tr><td>$sdo</td><td>: ". $data['fatherName']."</td></tr>
<tr><td>Address</td><td>: " .$data['commAddress']. '-' .$data['commPIN']. "</td></tr>
<tr><td>Enrollment No.</td><td>: " .$data['enrolmentNo']. "</td></tr>
<tr><td>Program Name</td><td>: " .$program['programCode']. "</td></tr>
<tr><td>Enrollment at</td><td>: " .$institute['instituteName']. "</td></tr>
<tr><td>Nationality</td><td>: " .$nationality. ' (Aadhar No.: ' .$data['aadhaarNo']. "</td></tr>
</table>
<h4>2. Complete Address of NORMAL RESIDENCE of the Enrolled Student:</h4>
<table width='100%' style='margin-left: 30px; font-size: 11.5px;'>
<tr><td width='20%'>Address</td><td>: " .$data['homeAddress']. ', ' .$dstate. "</td></tr>
<tr><td>Phone No.</td><td>: " .$data['phoneNo']. "</td></tr>
<tr><td>Email</td><td>: " .$data['email']. "</td></tr>
<tr><td>Police Station</td><td>: " .$data['policeStation']. ' (Area: ' .$this->controller->areas[$data['area']]. ")</td></tr>
</table>
<h4>3. Details of the FEE PAYING Parent / Guardian of the Enrolled Student:</h4>
<table width='100%' style='margin-left: 30px; font-size: 11.5px;'>
<tr><td>Guardian Name</td><td>: " .$data['guardianName']. ' (Profession: ' .$this->controller->professions[$data['guardianProfession']]. ')'. "</td></tr>
<tr><td width='20%'>Relationship</td><td>: " .$data['relationWith']. " of the Student</td></tr>
<tr><td>Address</td><td>: " .$data['guardianAddress']. "</td></tr>
<tr><td>Phone</td><td>: " .$data['guardianPhone']. "</td></tr>
<tr><td>Email</td><td>: " .$data['guardianEmail']. "</td></tr>
</table>");
// add second page
$pdf->AddPage();
$pdf->Ln(2);
$pdf->SetXY(15, 40);
$pdf->WriteHTML("<h4>4. Marital Status:</h4>
<table width='100%' style='margin-left: 35px; font-size: 11.5px;'>
<tr><td width='35%'>Married/Unmarried</td><td>: " .$this->controller->maritalStatuss[$data['maritalStatus']]. "</td></tr>
</table>");
$mcaip = $this->model->getInsurence($enrolmentID);
if ($data['maritalStatus'] == 'M') {
$pdf->WriteHTML("<table width='100%' style='margin-left: 50px; font-size: 11.5px;'>
<tr><td width='35%'>Spouse Name</td><td>: " .$mcaip['spouseName']. "</td></tr>
<tr><td>Age</td><td>: " .$mcaip['spouseAge']. "</td></tr>
<tr><td>Address</td><td>: " .$mcaip['spouseAddress']. '-' .$mcaip['spousePIN']. "</td></tr>
<tr><td>Phone</td><td>: " .$mcaip['spousePhone']. "</td></tr>
<tr><td>Email</td><td>: " .$mcaip['spouseEmail']. "</td></tr>
<tr><td colspan='2'></td></tr>
<tr><td>First Child Name</td><td>: " .$mcaip['child1Name']. "</td></tr>
<tr><td>Age</td><td>: " .$mcaip['child1Age']. "</td></tr>
<tr><td>Address</td><td>: " .$mcaip['child1Address']. '-' .$mcaip['child1PIN']. "</td></tr>
<tr><td>Phone</td><td>: " .$mcaip['child1Phone']. "</td></tr>
<tr><td>Email</td><td>: " .$mcaip['child1Email']. "</td></tr>
<tr><td colspan='2'></td></tr>
<tr><td>Second Child Name</td><td>: " .$mcaip['child2Name']. "</td></tr>
<tr><td>Age</td><td>: " .$mcaip['child2Age']. "</td></tr>
<tr><td>Address</td><td>: " .$mcaip['child2Address']. '-' .$mcaip['child2PIN']. "</td></tr>
<tr><td>Phone</td><td>: " .$mcaip['child2Phone']. "</td></tr>
<tr><td>Email</td><td>: " .$mcaip['child2Email']. "</td></tr>
</table>");
} else {
$pdf->WriteHTML("<table width='100%' style='margin-left: 50px; font-size: 11.5px;'>
<tr><td width='35%'>Spouse Name</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Age</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Address</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Phone</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Email</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td colspan='2'></td></tr>
<tr><td>First Child Name</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Age</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Address</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Phone</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Email</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td colspan='2'></td></tr>
<tr><td>Second Child Name</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Age</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Address</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Phone</td><td>: " .str_repeat('.', 80). "</td></tr>
<tr><td>Email</td><td>: " .str_repeat('.', 80). "</td></tr>
</table>");
}
$pdf->WriteHTML("<h4>5. Pre Existing Diseases*, at the time of admission into the Institute:</h4>
<ul>
<li>" .str_replace("<br />", "</li><li>", nl2br($mcaip['knownDiseases'])). "</li>
</ul><br><br><br>
<i style='font-size: 8pt; text-align: justify;'>(Note: The above is brief description of the salient features of the intended Insurence Policy and is not a replica of the full Policy Document. For details, reference to the Policy Document should be made.)</i>
<h3 align='center'><u>U N D E R T A K I N G</u></h3>
<ul style='font-size: 10pt; align: justify;'>
<li>I willingly AGREE to abide by the Terms and Conditions of the MEDICLAIM - cum - Accidental Insurence Policy as briefed herein above.</li>
<li>I shall personally be responsible for the correctness and completeness of the information provided above and to the satisfaction of the Insurence Company. Also in case of change in my Marital Status, for being eligible for the accrued benefits by the Insurence Company in the same respect, I shall keep the Institute duly apprised.</li>
<li>Also, I understand that all claims pertaining to Mediclaim-cum-Accidental Insurence Scheme shall be settled by Insurence Company only and Institute's liability in this respect shall be restricted to being assistive only.</li>
</ul>
<table align='right'>
<tr><td>Name of the Enrolled Student</td><td>: " .$data['nameEnglish']. ($data['nameHindi'] ? ' (' .$data['nameHindi']. ')' : ''). "</td></tr>
<tr><td>Enrollment No. of the Student</td><td>: " .$data['enrolmentNo']. "</td></tr>
</table>");
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 267);
$pdf->Cell(0, 10, '[ Seal & Signatures ]', 0, 1, 'C');
$pdf->Line(0, 275, 500, 275);
$pdf->SetFont('Helvetica', 'B', 9);
try {
$pdf->Image(($psign ? 'https://erp.iiita.ac.in/uploads/signatures/' .$psign : 'https://erp.iiita.ac.in/images/fake.png'), 26, 276, 16, 8);
} catch (Exception $e) {
$pdf->cell(26, 275, $e->getMessage(), 0, 1, 'L');
}
$pdf->SetXY(14, 280);
$pdf->Cell(0, 10, '(Student) (Parent/Guardian))', 0, 1, 'C');
$pdf->Line(0, 288, 500, 288);
$pdf->SetFont('Helvetica', 'I', 6.5);
$pdf->SetXY(150, 288);
$pdf->Cell(0, 5, 'Processed by: ' .$_SESSION['loginID']. ' (dated: ' .substr($data['dateEnrolment'], 0, 10). ')', 0, 1, 'R');
$outFile = 'mcaip-' .strtolower($enrolmentNo). '.pdf';
$pdf->Output(__DIR__ ."/../uploads/mcaips/$outFile", 'F');
$str .= $this->showPDF('mcaips', $outFile);
}
return $str;
}
public function aaaReceipt($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$withdrawal = $this->controller->params[0];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolment = $this->model->getEnrolment($enrolmentID);
if ($enrolment) {
$studentID = $enrolment['studentID'];
$programID = $enrolment['programID'];
$enrolmentNo = $enrolment['enrolmentNo'];
$category = $enrolment['category'];
$enrolCategory = $enrolment['enrolCategory'];
$pwdStatus = $enrolment['pwdStatus'];
$accountNo = $enrolment['accountNo'];
$holderName = $enrolment['holderName'];
$bankName = $enrolment['bankName'];
$ifscCode = $enrolment['ifscCode'];
$stateName = $this->model->getStateNameByStateID($enrolment['homeState']);
$ne = (array_search(ucwords(strtolower($stateName)), $this->controller->neStates) ? 1 : 0);
$remark = $enrolment['eremark'];
$i = strpos($remark, '[Slided');
if ($i) $sliding = substr($remark, $i);
$districtName = $this->model->getDistrictNameByDistrictID($enrolment['homeDistrict']);
$stateName = $this->model->getStateNameByStateID($enrolment['homeState']);
$countryName = strtoupper($this->model->getCountryNameByCountryCode($enrolment['nationality']));
$allotmentID = $this->model->getAllotmentIDByAllotteeNo($enrolmentNo);
$allotment = $this->model->getAllotment($allotmentID);
$hostelID = $allotment['hostelID'];
$roomID = $allotment['roomID'];
$hostelCode = $this->model->getHostelCodeByHostelID($hostelID);
$room = $this->model->getRoom($roomID);
$roomNo = $room['roomNo'];
$floorNo = $room['floorNo'];
$hostelRoom = "$roomNo in $hostelCode (" .$this->controller->floorNos[$floorNo]. " floor)";
try {
$photo = $this->model->getMyUpload($studentID, 'PHO');
$psign = $this->model->getMyUpload($studentID, 'SIG');
} catch (Exception $e) {
print $e->__toString();
}
$institute = $this->model->getInstitute();
$program = $this->model->getProgram($programID);
// generate pdf file of receipt
$pdf = new erpLetterPad([], $institute);
$pdf->autoScriptToLang = true;
$pdf->autoLangToFont = true;
$pdf->SetDisplayMode(real, 'default');
// create first page
$pdf->AddPage();
$pdf->SetTitle('ERP PDF Generator');
$pdf->SetAuthor('IIIT-A');
$pdf->SetAutoPageBreak(0);
$pdf->SetXY(20, 38);
$pdf->SetFont('Times', 'I', 8);
$pdf->Cell(178, 5, "Ref. No.: IIITA/AAA/" .$_SESSION["batchYear"]. '/' .$enrolmentNo. '/' .$studentID, 0, 0, 'R');
$pdf->SetXY(20, 45);
$pdf->SetFont('Times', 'U', 13);
$pdf->Cell(0, 0, ($withdrawal ? 'Withdrawal' : 'Enrollment'). ' Receipt - ' .$enrolment['batchYear'], 0, 1, 'C');
$pdf->SetFont('Times', 'I', 11);
$pdf->Cell(0, 12, '( Under ' .$enrolment['enrolCategory']. ' Category )', 0, 1, 'C');
$pdf->Ln(3);
if ($sliding) {
$pdf->SetFont('Times', 'B', 12);
$pdf->SetDrawColor(255, 0, 0);
$pdf->SetXY(55, 54);
$pdf->Cell(100, 10, $sliding, 1, 0, 'C');
}
try {
$pdf->Image(($photo ? "https://erp.iiita.ac.in/uploads/photos/{$photo}" : "https://erp.iiita.ac.in/images/dummy.jpg"), 175, 48, 22, 28);
} catch (Exception $e) {
$pdf->cell(175, 48, $e->getMessage(), 0, 1, 'L');
}
$passYear = $enrolment['batchYear'] + $program['timeDuration'];
$dob = new DateTime($enrolment['dateBirth']);
$dateBirth = $dob->format('d-m-Y');
$y = 60;
$pdf->SetXY(20, $y);
$pdf->WriteHTML("
<table width='100%' cellspecing='5' cellpadding='0' style='font-size: 11px;'>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Official Detail</h3></td></tr>
<tr><td width='17%' nowrap style='padding-left: 10px'>Program Name</td><td width='3%'>:</td><td width='80%'>" .$program['programCode']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Batch Year</td><td>:</td><td>" .$enrolment['batchYear']. ' - ' . $passYear. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Enrollment No.</td><td>:</td><td>" .$enrolment['enrolmentNo']. "<br></td></tr>");
if ($enrolment['hbookNo']) $pdf->WriteHTML("<tr><td nowrap style='padding-left: 10px'>Health Booklet No.</td><td>:</td><td>" .str_pad($enrolment['hbookNo'], 5, '0', STR_PAD_LEFT). "</td></tr>");
if ($hostelRoom) $pdf->WriteHTML("<tr><td nowrap style='padding-left: 10px'>Hostel Room No.</td><td>:</td><td>" .$hostelRoom. "</td></tr>");
$pdf->WriteHTML("<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Personal Detail</h3></td></tr>
<tr><td nowrap style='padding-left: 10px'>Student Name</td><td>:</td><td>" .$enrolment['nameEnglish']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Name in Hindi</td><td>:</td><td>" .$enrolment['nameHindi']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Date of Birth</td><td width='5%'>:</td><td>" .$dateBirth. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Gender</td><td>:</td><td>" .$this->controller->genders[$enrolment['gender']]. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Blood Group</td><td>:</td><td>" .$enrolment['bloodGroup']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>PWD Status</td><td>:</td><td>" .$this->controller->pwdStatuss[$enrolment['pwdStatus']]. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Category</td><td>:</td><td>" .$this->controller->subCategorys[$enrolment['category']]. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Marital Status</td><td>:</td><td>" .$this->controller->maritalStatuss[$enrolment['maritalStatus']]. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Religion</td><td>:</td><td>" .$this->controller->religions[$enrolment['religion']]. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Nationality</td><td>:</td><td>" .$countryName. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>" .($ne ? 'PAN/' : ''). "Aadhar No.</td><td>:</td><td>" .$enrolment['aadhaarNo']. "</td></tr>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Contact Detail</h3></td></tr>
<tr><td nowrap style='padding-left: 10px'>Phone No.</td><td>:</td><td>" .$enrolment['phoneNo']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Email</td><td>:</td><td>" .$enrolment['email']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Police Station</td><td>:</td><td>" .$enrolment['policeStation']. " (Area: " .$this->controller->areas[$enrolment['area']]. ")</td></tr>
<tr valign='top'><td nowrap style='padding-left: 10px'>Comm. Address</td><td>:</td><td>" .$enrolment['commAddress']. '-' .$enrolment['commPIN']. "</td></tr>
<tr valign='top'><td nowrap style='padding-left: 10px'>Perma. Address</td><td>:</td><td>" .$enrolment['homeAddress']. '<br>' .$districtName. '-' .$enrolment['homePIN']. " ($stateName) $countryName</td></tr>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Parent's / Guardian's Detail</h3></td></tr>
<tr><td nowrap style='padding-left: 10px'>Father's Name</td><td>:</td><td>" .$enrolment['fatherName']. ' (Profession: ' .$this->controller->professions[$enrolment['fatherProfession']]. ")</td></tr>
<tr valign='top'><td nowrap style='padding-left: 10px'>Contact</td><td>:</td><td>" .$enrolment['fatherAddress']. ', Phone: ' .$enrolment['fatherPhone']. ($enrolment['fatherEmail'] ? ", Email: " .$enrolment['fatherEmail'] : ''). "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Mother's Name</td><td>:</td><td>" .$enrolment['motherName']. ' (Profession: ' .$this->controller->professions[$enrolment['motherProfession']]. ")</td></tr>
<tr valign='top'><td nowrap style='padding-left: 10px'>Contact</td><td>:</td><td>" .$enrolment['motherAddress']. ', Phone: ' .$enrolment['motherPhone']. ($enrolment['motherEmail'] ? ", Email: " .$enrolment['motherEmail'] : ''). "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Guardian's Name</td><td>:</td><td>" .$enrolment['guardianName']. ' (Profession: ' .$this->controller->professions[$enrolment['guardianProfession']]. ') Relation: ' .$enrolment['relationWith']. "</td></tr>
<tr valign='top'><td nowrap style='padding-left: 10px'>Contact</td><td>:</td><td>" .$enrolment['guardianAddress']. ', Phone: ' .$enrolment['guardianPhone']. ($enrolment['guardianEmail'] ? ", Email: " .$enrolment['guardianEmail'] : ''). "</td></tr>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Academic Detail</h3></td></tr>
<tr><td nowrap style='padding-left: 10px'>X Grade/%</td><td>:</td><td>" .$enrolment['xGrade']. " (Year - " .$enrolment['xYear']. ", Board - " .$enrolment['xBoard']. ")</td></tr>
<tr><td nowrap style='padding-left: 10px'>XII Grade/%</td><td>:</td><td>" .$enrolment['xiiGrade']. " (Year - " .$enrolment['xiiYear']. ", Board - " .$enrolment['xiiBoard']. ")</td></tr>"
.($program['degreeLevel'] != 'UG' ? "<tr><td nowrap style='padding-left: 10px'>UG Grade/%</td><td>:</td><td>" .$enrolment['ugGrade']. " (Year - " .$enrolment['ugYear']. ", Institute - " .$enrolment['ugInstitute']. ")</td></tr>" : '')
.($enrolment['pgYear'] ? "PG Grade/%</td><td>:</td><td>" .$enrolment['pgGrade']. " (Year - " .$enrolment['pgYear']. ", Institute - " .$enrolment['pgInstitute']. ")</td></tr>" : ''). "
<tr><td nowrap style='padding-left: 10px'>Rank/Score</td><td>:</td><td>" .$enrolment['lastScore']. " (" .$program['entranceName']. ")</td></tr>");
if ($enrolment['abookNo'] !='-') $pdf->WriteHTML("<tr><td nowrap style='padding-left: 10px'>Answer Booklet No.</td><td>:</td><td>" .$enrolment['abookNo']. "</td></tr>");
$pdf->WriteHTML("</table>");
$y = 72;
$pdf->SetFont('Times', 'B', 10.5);
$pdf->SetXY(110, $y);
if ($withdrawal) {
$withdrawID = $this->model->getWithdrawIDByStudentID($studentID);
$withdrawal = $this->model->getWithdrawal($withdrawID);
$pdf->Cell(110, 5, " Fees Refund A/c.", 0, 0, 'L');
$pdf->SetFont('Helvetica', '', 9);
$y += 6;
$pdf->SetXY(113, $y);
$pdf->MultiCell(85, 5, " Account No. : $accountNo \n Holder Name : $holderName \n Bank Name : $bankName \n IFSC Code : $ifscCode", 0, 0, 'L');
$y += 20;
$pdf->SetTextColor(255, 0, 0);
$pdf->SetXY(106, $y);
$pdf->Cell(90, 5, "Dated: " .$withdrawal['dateWithdraw'], 0, 0, 'R');
$y += 5;
$pdf->SetFont('Times', 'B', 24);
$pdf->SetDrawColor(255, 0, 0);
$pdf->SetXY(100, $y);
$pdf->Cell(95, 10, " Admission Withdrawn ", 1, 0, 'C');
$pdf->SetFont('Helvetica', '', 10);
$y += 10;
$pdf->SetXY(100, $y);
$pdf->MultiCell(100, 5, "Reason: " .$withdrawal['withdrawReason'], 0, 0, 'L');
} else {
$pdf->Cell(20, 5, "Documents Submitted:", 0, 0, 'L');
$i = 0;
$uploads = $this->model->listUploads($studentID, $programID);
if ($uploads) {
foreach($uploads as $upload) {
$i++;
$docs .= ($i < 10 ? '0' : ''). "$i) " .$upload['docheadName'] .($upload['original'] == 'Y' ? ' (Original)' : ''). "\n";
}
$exemptions = $this->model->listExemptions($studentID);
foreach($exemptions as $exemption) {
$i++;
if ($exemption['docheadName']) $docs .= ($i < 10 ? '0' : ''). "$i) " .trim($exemption['docheadName']). ($upload['original'] == 'Y' ? ' (Original)' : ''). ' [to submit by ' .$exemption['dateRemind']. "]\n";
}
} else {
$docs = "\nPDF file of scanned certificates is missing.\n";
}
$y += 5;
$pdf->SetFont('Times', '', 8.5);
$pdf->SetXY(110, $y);
$pdf->MultiCell(87, 4, $docs, 1, 'L');
}
$y = 267;
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, $y);
$pdf->Cell(0, 10, '[ Seal & Signature ]', 0, 1, 'C');
$y += 8;
$pdf->SetDrawColor(0, 0, 0);
$pdf->Line(0, $y, 500, $y);
$pdf->SetFont('Helvetica', 'B', 9);
try {
$pdf->Image(($psign ? 'https://erp.iiita.ac.in/uploads/signatures/' .$psign : 'https://erp.iiita.ac.in/images/fake.png'), 22, 276, 15, 8);
} catch (Exception $e) {
$pdf->cell(22, $y, $e->getMessage(), 0, 1, 'L');
}
$y += 5;
$pdf->SetXY(14, $y);
$pdf->Cell(0, 10, '(Student) (Parent/Guardian) (AAA Office)', 0, 1, 'C');
$y += 8;
$pdf->Line(0, $y, 500, $y);
$pdf->SetFont('Helvetica', 'I', 6.5);
$pdf->SetXY(150, $y);
$pdf->Cell(0, 5, 'Processed by: ' .$_SESSION['loginID']. ' (dated: ' .substr($enrolment['dateEnrolment'], 0, 10). ')', 0, 1, 'R');
if (!$withdrawal) {
// *****************************create second page
$pdf->AddPage();
$pdf->SetXY(20, 38);
$pdf->SetFont('Times', 'I', 8);
$pdf->Cell(178, 5, "Ref. No.: IIITA/A&F/" .$_SESSION["batchYear"]. '/' .$enrolmentNo. '/' .$studentID, 0, 0, 'R');
$pdf->SetXY(20, 45);
$pdf->SetFont('Times', 'U', 13);
$pdf->Cell(0, 0, 'Provisional Fee Receipt - ' .$enrolment['batchYear'], 0, 1, 'C');
$pdf->SetFont('Times', 'I', 11);
$pdf->Cell(0, 12, '( Under ' .$enrolment['enrolCategory']. ' Category )', 0, 1, 'C');
$pdf->Ln(5);
if ($sliding) {
$pdf->SetFont('Times', 'B', 12);
$pdf->SetDrawColor(255, 0, 0);
$pdf->SetXY(55, 54);
$pdf->Cell(100, 10, $sliding, 1, 0, 'C');
}
try {
$pdf->Image(($photo ? 'https://erp.iiita.ac.in/uploads/photos/' .$photo : 'https://erp.iiita.ac.in/images/dummy.jpg'), 175, 48, 22, 28);
} catch (Exception $e) {
$pdf->cell(175, 48, $e->getMessage(), 0, 1, 'L');
}
foreach ($this->controller->dasaCategorys as $key => $value) {
if ($key == $enrolCategory) $feesCategory = $enrolCategory;
}
if (!$feesCategory) $feesCategory = ($pwdStatus == 'Y' ? 'PWD' : $category);
$candidateID = $this->model->getCandidateIDByRollNo($this->model->getRollNoByStudentID($studentID));
$candidate = $this->model->getCandidate($candidateID);
$payables = $this->model->listPayables($enrolment['programID'], $feesCategory);
foreach ($payables as $payable) {
if ($candidate['alumni'] == 'Y' && $payable['feeheadName'] == 'Alumni Fund') {
} else {
$fees .= "<tr><td>" .$payable['feeheadName']. "</td><td>(" .explode(' ', $this->controller->accountTypes[$payable['accountType']])[0]. ")</td><td>" .$this->controller->paymentTerms[$payable['paymentTerm']]. "</td><td align='right' nowrap>" .$payable['currency']. ' ' .number_format($payable['feeAmount'], 2). "</td></tr>";
if ($payable['paymentTerm'] < 9) {
$totalFees += $payable['feeAmount'];
} else {
$totalFees -= $payable['feeAmount'];
}
$y += 5;
}
}
$fees .= "<tr><td colspan='3' align='right'><br><b>Total</b></td><td align='right'><hr><b>" .($payable['currency'] ? $payable['currency'] : $this->rs). ' ' .number_format($totalFees, 2). "</b></td></tr>";
$prepaids = $this->model->listPrepaids($programID, $feesCategory);
foreach ($prepaids as $prepaid) {
$paid .= "<tr><td>Fees</td><td>" .$prepaid['feeheadName']. "</td><td>Counselling</td><td>(Direct)</td><td align='right'>" .$prepaid['currency']. ' ' .number_format($prepaid['feeAmount'], 2). "</td></tr>";
$totalPaid += $prepaid['feeAmount'];
}
$payments = $this->model->listPayments($studentID);
foreach ($payments as $payment) {
$paid .= "<tr><td>" .explode(' ', $this->controller->accountTypes[$payment['accountType']])[0]. "</td><td>" .$payment['paymentNo']. "</td><td>" .$payment['datePayment']. "</td><td>(" .$payment['paymentMode']. ")</td><td align='right' nowrap>" .($payment['currency'] ? $payment['currency'] : 'INR'). ' ' .number_format($payment['payAmount'], 2). "</td></tr>";
$totalPaid += $payment['payAmount'];
}
if ($this->model->getMyExemption($studentID, 1)) {
$paid .= "<tr><td colspan='5'>Fees payment exempted by competent authority temporarily (till " .$this->model->getMyExemption($studentID, 1). ") on written equest of student.</td></tr>";
}
if ($this->model->getMyExemption($studentID, 2)) {
$y += 5;
$paid .= "<tr><td colspan='5'>Mess charge payment exempted by competent authority temporarily (till " .$this->model->getMyExemption($studentID, 2). ") on written request of student.</td></tr>";
}
$paid .= "<tr><td colspan='4' align='right'><br><b>Total</b></td><td align='right'><hr><b>" .($payment['currency'] ? $payment['currency'] : $this->rs). ' ' .number_format($totalPaid, 2). "</b></td></tr>";
$pdf->SetFont('Times', '', 10);
$y = 60;
$pdf->SetXY(20, $y);
$pdf->WriteHTML("
<table width='100%' cellspecing='5' cellpadding='0' style='font-size: 11px;'>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Student Detail</h3></td></tr>
<tr><td width='17%' nowrap style='padding-left: 10px'>Program Name</td><td width='3%'>:</td><td width='80%'>" .$program['programCode']. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Batch Year</td><td>:</td><td>" .$enrolment['batchYear']. ' - ' . $passYear. "</td></tr>
<tr><td nowrap style='padding-left: 10px'>Enrollment No.</td><td>:</td><td>" .$enrolment['enrolmentNo']. "<br></td></tr>");
if ($enrolment['hbookNo']) $pdf->WriteHTML("<tr><td nowrap style='padding-left: 10px'>Health Booklet No.</td><td>:</td><td>" .str_pad($enrolment['hbookNo'], 5, '0', STR_PAD_LEFT). "</td></tr>");
$pdf->WriteHTML("<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Personal Detail</h3></td></tr>
<tr><td nowrap style='padding-left: 10px'>Student Name</td><td>:</td><td>" .$enrolment['nameEnglish']. ' (' .trim($enrolment['nameHindi']). ')' .($enrolment['gender'] == 'F' ? ' D/o ' : ' S/o '). $enrolment['fatherName']. "</td><tr>
<tr><td nowrap style='padding-left: 10px'>Address</td><td>:</td><td>" .$enrolment['homeAddress']. $districtName. '-' .$enrolment['homePIN']. ' (' .$stateName. ') ' .strtoupper($nationality). "</td></tr>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Fees Detail</h3></td></tr>
<tr><td colspan='3' style='padding-left: 10px'><table width='100%' cellspecing='5' cellpadding='0' style='font-size: 11px;'>
<tr><td width='55%'><b>Fee Heads</b></td><td width='10%'><b>(Account)</b></td><td width='15%' nowrap><b>Payment Term</b></td><td width='20%' nowrap align='right'><b>Amount</b></td></tr>
$fees
</table></td></tr>
<tr><td colspan='3' style='padding-top: 15px; padding-bottom: 5px'><h3>Payment Detail</h3></td></tr>
<tr><td colspan='3' style='padding-left: 10px'><table width='100%' cellspecing='5' cellpadding='0' style='font-size: 11px;'>
<tr><td width='20%'><b>Account</b></td><td width='20%'><b>Payment No.</b></td><td width='20%'><b>Dated</b></td><td width='20%'><b>(Payment Mode)</b></td><td width='20%' nowrap align='right'><b>Amount</b></td></tr>
$paid
</table></td></tr>
<tr><td colspan='2' style='padding-top: 15px; padding-bottom: 5px'><h3>Account Detail</h3></td><td><i>(for refund purposes)</i></td></tr>
<tr><td colspan='3' style='padding-left: 10px'><table width='100%' cellspecing='5' cellpadding='0' style='font-size: 11px;'>
<tr><td width='20%'><b>Account No.</b></td><td width='30%'><b>Holder Name</b></td><td width='30%'><b>Bank Name</b></td><td width='20%'><b>IFSC Code</b></td></tr>
<tr><td>$accountNo</td><td>$holderName</td><td>$bankName</td><td>$ifscCode</td></tr>
</table></td></tr>
</table>");
$y = 267;
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, $y);
$pdf->Cell(0, 10, '[ Seal & Signature ]', 0, 1, 'C');
$y += 8;
$pdf->SetDrawColor(0, 0, 0);
$pdf->Line(0, $y, 500, $y);
$pdf->SetFont('Helvetica', 'B', 9);
try {
$pdf->Image(($psign ? 'https://erp.iiita.ac.in/uploads/signatures/' .$psign : 'https://erp.iiita.ac.in/images/fake.png'), 22, 276, 15, 8);
} catch (Exception $e) {
$pdf->cell(22, $y, $e->getMessage(), 0, 1, 'L');
}
$y += 5;
$pdf->SetXY(14, $y);
$pdf->Cell(0, 10, '(Student) (Parent/Guardian) (A/c Office)', 0, 1, 'C');
$y += 8;
$pdf->Line(0, $y, 500, $y);
$pdf->SetFont('Helvetica', 'I', 6.5);
$pdf->SetXY(150, $y);
$pdf->Cell(0, 5, 'Processed by: ' .$_SESSION['loginID']. ' (dated: ' .substr($enrolment['dateEnrolment'], 0, 10). ')', 0, 1, 'R');
}
$outFile = 'receipt-' .strtolower($enrolmentNo). '.pdf';
$pdf->Output(__DIR__ ."/../uploads/receipts/$outFile", 'F');
$str = $this->showPDF('receipts', $outFile);
}
return $str;
}
public function aaaFormat($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programs = $this->model->selectProgram();
$institute = $this->model->getInstitute();
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
if ($programID == $program['programID']) $programCode = $program['programCode'];
}
$findbar .= "</select>";
$program = $this->model->getProgram($programID);
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
try {
// generate pdf file of receipt
$pdf = new erpLetterPad(['c', 'A4', 0, '', 0, 0, 0, 0, 0, 0, 'L'], $institute);
} catch (Exception $e) {
return $str.$e->getMessage();
}
$pdf->autoScriptToLang = true;
$pdf->autoLangToFont = true;
$pdf->SetDisplayMode(real, 'default');
//$pdf->_setPageSize([54,86], 'L');
// create first page
$pdf->AddPage();
$pdf->SetTitle('ERP PDF Generator');
$pdf->SetAuthor('IIIT-A');
$pdf->SetAutoPageBreak(0);
$pdf->SetFont('Times', 'U', 13);
$pdf->Cell(0, 0, "$programCode Enrollment Form - " .$_SESSION["batchYear"], 0, 1, 'C');
$pdf->SetFont('Times', 'I', 11);
$pdf->Cell(0, 12, '( Under ' .str_repeat('.', 30). ' Category )', 0, 1, 'C');
$pdf->Ln(5);
try {
$pdf->Image('https://erp.iiita.ac.in/images/dummy.jpg', 175, 48, 22, 28);
} catch (Exception $e) {
$pdf->cell(175, 48, $e->getMessage(), 0, 1, 'L');
}
$y = 60;
$pdf->SetXY(20, $y);
$pdf->WriteHTML("<h4>Official Details:</h4>
<table width='95%' cellspecing='5' cellpadding='0' style='margin-left: 25px; font-size: 11px;'>
<tr><td width='20%' nowrap>Program Name</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Batch Year</td><td>: " .str_repeat('.', 28). ' - ' . str_repeat('.', 29). "</td></tr>
<tr><td nowrap>Enrollment No.</td><td>: " .str_repeat('.', 60). "<br></td></tr>
</table>
<h4>Personal Details:</h4>
<table width='95%' cellspecing='5' cellpadding='0' style='margin-left: 25px; font-size: 11px;'>
<tr><td width='20%' nowrap>Student Name</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Date of Birth</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Gender</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Blood Group</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>PWD Status</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Category</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Marital Status</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Religion</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Nationality</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Aadhar No.</td><td>: " .str_repeat('.', 60). "</td></tr>
</table>
<table width='95%' cellspecing='5' cellpadding='0' style='margin-left: 25px; font-size: 11px;'>
<h4>Contact Details:</h4>
<tr><td width='20%' nowrap>Phone No.</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Email</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Police Station</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Communic. Address</td><td>: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Permanent Address</td><td>: " .str_repeat('.', 60). "</td></tr>
</table>
<h4>Parent's / Guardian's Details:</h4>
<table width='100%' cellspecing='5' cellpadding='0' style='margin-left: 25px; font-size: 11px;'>
<tr><td width='20%' nowrap>Father's Name</td><td>: " .str_repeat('.', 60). ' (Profession: ' .str_repeat('.', 40). ")</td></tr>
<tr><td nowrap>Address</td><td>: " .str_repeat('.', 150). "</td></tr>
<tr><td nowrap>Phone</td><td>: " .str_repeat('.', 60). " Email: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Mother's Name</td><td>: " .str_repeat('.', 60). ' (Profession: ' .str_repeat('.', 40). ")</td></tr>
<tr><td nowrap>Address</td><td>: " .str_repeat('.', 150). "</td></tr>
<tr><td nowrap>Phone</td><td>: " .str_repeat('.', 60). " Email: " .str_repeat('.', 60). "</td></tr>
<tr><td nowrap>Guardian's Name</td><td>: " .str_repeat('.', 60). ' (Profession: ' .str_repeat('.', 40). ') Relation: ' .str_repeat('.', 20). "</td></tr>
<tr><td nowrap>Address</td><td>: " .str_repeat('.', 150). "</td></tr>
<tr><td nowrap>Phone</td><td>: " .str_repeat('.', 60). " Email: " .str_repeat('.', 60). "</td></tr>
</table>
<h4>Academic Details:</h4>
<table width='100%' cellspecing='5' cellpadding='0' barder='1' style='margin-left: 25px; font-size: 11px;'>
<tr><th nowrap>Degree</th><th>Year</th><th>Grade</th><th>Board/University</th></tr>
<tr><th nowrap text-rotate='0'>X</th><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 100). "</td></tr>
<tr><th nowrap>XII</th><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.',100). "</td></tr>
<tr><th nowrap>UG</th><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 100). "</td></tr>
<tr><th nowrap>PG</th><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 100). "</td></tr>
<tr><th nowrap>Rank/Score</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>(" .$program['entranceName']. ")</td></tr>
</table>
<h4>Account Detail <span class='rightbar'>(for refund purposes)</span></h3>
<table width='100%' cellspecing='5' cellpadding='0' barder='1' style='margin-left: 25px; font-size: 11px;'>
<tr><td width='20%'><b>Account No.</b></td><td width='30%'><b>Holder Name</b></td><td width='30%'><b>Bank Name</b></td><td width='20%'><b>IFSC Code</b></td></tr>
<tr><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td><td>" .str_repeat('.', 20). "</td></tr>
</table>");
$documents = $this->model->selectDocchart($programID);
foreach($documents as $document) {
$docs .= "<li>" .$document['docheadName']. "</li>";
}
$pdf->SetXY(120, 75);
$pdf->WriteHTML("<h4 style='margin-left: 375px; margin-bottom: 0px; '>Documents Required:</h4><ol style='border: 1px solid red; margin-left: 375px; font-size: 10px;'>" .$docs. "</ol>");
$pdf->SetFont('Times', 'B', 10);
$pdf->SetXY(10, 267);
$pdf->Cell(0, 10, '[ Seal & Signatures ]', 0, 1, 'C');
$pdf->Line(0, 275, 500, 275);
$pdf->SetFont('Helvetica', 'B', 9);
$pdf->SetXY(14, 280);
$pdf->Cell(0, 10, '(Student) (Parent/Guardian) (AAA Office)', 0, 1, 'C');
$pdf->Line(0, 288, 500, 288);
$pdf->SetFont('Helvetica', 'I', 6.5);
$pdf->SetXY(150, 288);
$pdf->Cell(0, 5, 'Processed by: ' .str_repeat('.', 60). ' (dated: ..../..../..........)', 0, 1, 'R');
$outFile = 'format-' .$_SESSION["batchYear"]. '.pdf';
$pdf->Output(__DIR__ ."/../uploads/receipts/$outFile", 'F');
$str .= $this->showPDF('receipts', $outFile);
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
public function aaaIDCard($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
// generate pdf file of id card
$outFile = $this->prepareIDCard($enrolmentID, FALSE);
return $this->showPDF('idcards', $outFile);
}
public function aaaAttendance($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$institute = $this->model->getInstitute();
$programs = $this->model->selectProgram();
$findbar = "
Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
$enrolments = $this->model->listEnrolment($programID);
$program = $this->model->getProgram($programID);
// generate pdf file of receipt
$pdf = new erpLetterPad(['mode' => 'utf-8', 'format' => 'A4-L'], $institute);
$pdf->autoScriptToLang = true;
$pdf->autoLangToFont = true;
$pdf->SetDisplayMode(real, 'default');
// create first page
$pdf->SetTitle('ERP PDF Generator');
$pdf->SetAuthor('IIIT-A');
$pdf->SetAutoPageBreak(0);
$pb = TRUE;
foreach ($enrolments as $enrolment) {
$i++;
if ($pb) {
$pdf->AddPage();
$heading = 'Attendance Sheet [' .$program['programCode']. ' - Batch ' .$_SESSION["batchYear"]. '] Course: ' .str_repeat('. ', 20). ' Instructor: ' .str_repeat('. ', 20);
$pdf->SetFont('Times', 'U', 13);
$pdf->SetXY(10, 45);
$pdf->Cell(0, 0, $heading, 0, 1, 'C');
$pdf->Ln(2);
$x = 15;
$y = 52;
$pdf->SetFont('Times', 'B', 11);
$pdf->SetXY($x, $y);
$pdf->Cell(10, 5, 'Sr.', 1, 0, 'L');
$pdf->SetXY($x+10, $y);
$pdf->Cell(30, 5, 'Enrollment No.', 1, 1, 'L');
$pdf->SetXY($x+40, $y);
$pdf->Cell(80, 5, 'Name', 1, 1, 'L');
$pdf->SetXY($x+30, $y);
$pdf->Cell(85, 5, 'Date =>', 0, 1, 'R');
$pdf->SetFont('Times', 'B', 10);
for ($j=1; $j<31; $j++) {
$x = 125 + ($j * 5);
$pdf->SetXY($x, $y);
$pdf->Cell(5, 5, '', 1, 1, 'L');
}
$pdf->SetFont('Times', '', 9);
$pg++;
}
$x = 15;
$y += 5;
$pdf->SetXY($x, $y);
$pdf->Cell(10, 5, $i, 1, 0, 'L');
$pdf->SetXY($x+10, $y);
$pdf->Cell(30, 5, $enrolment['enrolmentNo'], 1, 1, 'L');
$pdf->SetXY($x+40, $y);
$pdf->Cell(80, 5, $enrolment['nameEnglish'], 1, 1, 'L');
for ($j=1; $j<31; $j++) {
$x = 125 + ($j * 5);
$pdf->SetXY($x, $y);
$pdf->Cell(5, 5, '', 1, 1, 'L');
}
$pb = ($i == ($pg * 29) ? TRUE : FALSE);
}
$outFile = 'asheet-' .strtolower($program['programCode']). '-' .$_SESSION['batchYear']. '.pdf';
$pdf->Output(__DIR__ ."/../uploads/attendances/$outFile", 'F');
$str .= $this->showPDF('attendances', $outFile);
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
public function aaaLDAP($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$dated = $this->controller->params[0];
$programs = $this->model->selectProgram();
$enrolments = $this->model->listDatedEnrolments();
$rows = $this->model->listEnrolment();
if ($programID) {
$rows = $this->model->listEnrolment($programID);
$prog = $this->model->getProgram($programID);
} else if ($dated) {
$rows = $this->model->datedEnrolments($dated);
}
$toolbar = "<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Form'><span class='button'><i class='fab fa-wpforms'></i></span></a>";
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/0'); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
OR Enrollment Date <select name='dateEnrolment' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0000-00-00'>Select</option>";
foreach ($enrolments as $enrolment) {
$findbar .= "<option value='" .$enrolment['Dated']. "'" .($dated == $enrolment['Dated'] ? self::SL : ''). ">" .$enrolment['Dated']. ' (Count: ' .$enrolment['no']. ")</option>";
}
$findbar .= "</select>";
//$program = $this->model->getProgram($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th nowrap>LDIF Records</th></tr>
<tr valign='top'><td>";
foreach ($rows as $row) {
$i++;
if (!$programID) $prog = $this->model->getProgram($row['programID']);
$programOU = explode(' (', str_replace(')', '', $prog['programCode']));
//$dn = "ou=" .$row['batchYear']. ",ou=" .$programOU[1]. ",ou=" .$programOU[0]. ",ou=Student,dc=iiita,dc=ac,dc=in";
$dn = "uid=" .$row['enrolmentNo']. ",ou=" .$row['batchYear']. ",ou=" .$programOU[1]. ",ou=" .$programOU[0]. ",ou=Student,dc=iiita,dc=ac,dc=in";
$str .= "dn: " .$dn. "<br>
accountstatus: Active<br>
businesscategory: everyone<br>
businesscategory: student<br>
businesscategory: " .strtolower($programOU[0]. '-' .$programOU[1]). '-' .$row['batchYear']. "<br>
cn: " .str_replace(' ', '-', $row['nameEnglish']). "-". $row['enrolmentNo']. "<br>
description: " .$prog['programCode']. "<br>
employeenumber: " .$row['enrolmentNo']. "<br>
gecos: " .strtoupper($row['nameEnglish']). "<br>
gidnumber: " .$row['batchYear']. "<br>
givenname: " .strtoupper(explode(' ', $row['nameEnglish'])[0]). "<br>
homedirectory: /opt/arithme/mailstore/mail.iiita.ac.in/homedirs/" .$row['enrolmentNo']. "<br>
labeleduri: http://profile.iiita.ac.in/" .$row['enrolmentNo']. "<br>
loginshell: /bin/bash<br>
mail: " .$row['enrolmentNo']. "@iiita.ac.in<br>
mailalternateaddress: " .$row['email']. "<br>
mailhost: mail.iiita.ac.in<br>
mailmessagestore: /opt/arithme/mailstore/mail.iiita.ac.in/maildirs/student/" .$row['batchYear']. "/" .$row['enrolmentNo']. "<br>
mailquotasize: 524288000<br>
mobile: " .$row['phoneNo']. "<br>
objectclass: top<br>
objectclass: person<br>
objectclass: posixAccount<br>
objectclass: shadowAccount<br>
objectclass: inetOrgPerson<br>
objectclass: organizationalPerson<br>
objectclass: qmailUser<br>
sn: " .end(explode(' ', trim($row['nameEnglish']))). "<br>
uid: ". $row['enrolmentNo']. "<br>
uidnumber: " .$row['batchYear']. ($row['studentID'] < 10 ? '00' : ($row['studentID'] < 100 ? '0' : '')) .$row['studentID']. "<br>
userpassword: " .$row['dateBirth']. "<br><br>";
}
$str .= "</td></tr>
<table>Total: $i";
return $str;
}
public function aaaGmail($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$dated = $this->controller->params[0];
$programs = $this->model->selectProgram();
$enrolments = $this->model->listDatedEnrolments();
$rows = $this->model->listEnrolment();
if ($programID) {
$rows = $this->model->listEnrolment($programID);
$prog = $this->model->getProgram($programID);
} else if ($dated) {
$rows = $this->model->datedEnrolments($dated);
}
$toolbar = "<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Form'><span class='button'><i class='fab fa-wpforms'></i></span></a>";
$findbar = "Program <select name='programID1' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
OR Enrollment Date <select name='dateEnrolment1' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($enrolments as $enrolment) {
$findbar .= "<option value='" .$enrolment['Dated']. "'" .($dated == $enrolment['Dated'] ? self::SL : ''). ">" .$enrolment['Dated']. ' (Count: ' .$enrolment['no']. ")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th nowrap>EnrolmentNo,Name,Program,Gender,AlternateEmail,PhoneNo</td></tr>
<tr valign='top'><td>";
foreach ($rows as $row) {
$i++;
if (!$programID) $prog = $this->model->getProgram($row['programID']);
$str .= $row['enrolmentNo']. "," .trim(strtoupper($row['nameEnglish'])). "," .$prog['programCode']. "," .$this->controller->genders[$row['gender']]. "," .strtolower($row['email']). "," .$row['phoneNo']. "<br>";
}
$str .= "</table>Total: $i";
$str .= "<table width='100%'>
<tr><th nowrap>AlternateEmail</td></tr>
<tr valign='top'><td>";
foreach ($rows as $row) {
$j++;
$str .= strtolower($row['email']). ", ";
}
$str .= "</table>Total: $j";
/*
$str .= "<table width='100%'>
<tr><th nowrap>MobileNo</td></tr>
<tr valign='top'><td>";
foreach ($rows as $row) {
$k++;
$str .= (strlen($row['phoneNo']) > 10 ? substr($row['phoneNo'], -10) : $row['phoneNo']). ", ";
}
$str .= "</table>Total: $k";
*/
return $str;
}
public function aaaAviral($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$dated = $this->controller->params[0];
$programs = $this->model->selectProgram();
$enrolments = $this->model->listDatedEnrolments();
if ($programID) {
$rows = $this->model->listEnrolment($programID);
$prog = $this->model->getProgram($programID);
} else if ($dated) {
$rows = $this->model->datedEnrolments($dated);
}
$toolbar = "<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Form'><span class='button'><i class='fab fa-wpforms'></i></span></a>";
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.value+'/0000-00-00'); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>
OR Enrollment Date <select name='dateEnrolment' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">
<option value='0000-00-00'>Select</option>";
foreach ($enrolments as $enrolment) {
$findbar .= "<option value='" .$enrolment['Dated']. "'" .($dated == $enrolment['Dated'] ? self::SL : ''). ">" .$enrolment['Dated']. ' (Count: ' .$enrolment['no']. ")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table width='100%'>
<tr><th nowrap>CSV Format: User,StudentID,Name,Batch,DoB,Gender,Category,Channel,Section,Email,AadhaarNo,PhoneNo,Semester</th></tr>
<tr valign='top'><td>";
foreach ($rows as $row) {
$i++;
if (!$programID) $prog = $this->model->getProgram($row['programID']);
if ($row['programID'] == 1) {
if ((int)substr($row['enrolmentNo'], -3) < 103) $section = 'A';
else $section = 'B';
} else if ($row['programID'] == 2) {
$section = 'C';
} else {
$section = 'A';
}
$str .= $row['enrolmentNo']. ',' .$row['enrolmentNo']. ',' .strtoupper(trim($row['nameEnglish'])). ',' .$row['batchYear']. ',' .$row['dateBirth']. ',' .$this->controller->genders[$row['gender']]. ',' .trim($row['category']). ',' .$prog['entranceName']. ",$section," .strtolower($row['email']). ',' .$row['aadhaarNo']. ',' .(strlen($row['phoneNo']) > 10 ? substr($row['phoneNo'], -10) : $row['phoneNo']). ',1<br>';
}
$str .= "</td></tr>
<table>Total: $i";
return $str;
}
public function aaaPGPayment($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$account = $this->controller->params[0];
$amount = $this->controller->params[1];
$currency = $this->controller->params[2];
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$data = $this->model->getApplicant($applicantID); // get record
$programID = $data['programID'];
$program = $this->model->getProgram($programID);
$dLevel = $program['degreeLevel'];
$str = "<form name='payment' method='POST' action='https://secure.ebs.in/pg/ma/payment/request/' target='self'>";
$HASHING_METHOD = "sha512";
// HDFC Bank PG details
if ($account == 1) {
// fees account
$hashData = "020bc4ca9304d76f471b03213f73d035";
$pg1['account_id'] = "25146";
$account = 1;
$pg1['reference_no']= $data['rollNo']. "-Fees";
} else {
// COW account
$hashData = "7bd65b21e13f2446b64d2594029fd957";
$pg1['account_id'] = "28546";
$account = 2;
$pg1['reference_no']= $data['rollNo']. "-Mess";
}
$pg1['channel'] = "10";
$pg1['mode'] = "LIVE";
$pg1['description'] = $data['batchYear']. "-" .$program['programCode'];
$pg1['amount'] = $amount;
$pg1['currency'] = $currency;
$pg1['return_url'] = "https://erp.iiita.ac.in/outer/aaa/PGResponse/online/$studentID/HDFC/$account";
$pg1['name'] = trim($data['nameEnglish']);
$pg1['phone'] = trim($data['phoneNo']);
$pg1['email'] = trim($data['email']);
$pg1['address'] = trim($data['homeAddress']);
$pg1['city'] = $this->model->getDistrictNameByDistrictID($data['homeDistrict']);
$pg1['state'] = $this->model->getStateNameByStateID($data['homeState']);
$pg1['postal_code'] = trim($data['homePIN']);
$pg1['country'] = trim($data['nationality']);
unset($_POST['securekey']);
unset($_POST['submitted']);
ksort($pg1);
foreach ($pg1 as $key => $value){
$str .= "<input type='hidden' name='$key' value='$value'>";
if (strlen($value) > 0) {
$hashData .= '|' .$value;
}
}
if (strlen($hashData) > 0) {
$secureHash = strtoupper(hash($HASHING_METHOD, $hashData));
}
$str .= "<input type='hidden' name='secure_hash' value='$secureHash'>";
// CANARA Bank PG details
$pg2['product'] = "IIIT";
$pg2['TType'] = "NBFundTransfer";
$pg2['AccountNo'] = "0627101019766";
$pg2['ru'] = "https://erp.iiita.ac.in/outer/aaa/PGResponse/online/$studentID/ATOM/1";
$pg2['bookingid'] = "100001";
$pg2['clientcode'] = trim($data['rollNo']); //urlencode(base64_encode(rollno))
$pg2['udf1'] = trim($data['nameEnglish']);
$pg2['udf2'] = trim($data['email']);
$pg2['udf3'] = trim($data['phoneNo']);
$pg2['udf4'] = trim($data['rollNo']). '-Fees';
$pg2['udf5'] = $data['batchYear']. "-" .$program['programCode'];
$pg2['udf6'] = $studentID;
$pg2['udf9'] = 1; // semester
$pg2['amount'] = $amount;
ksort($pg2);
foreach ($pg2 as $key => $value) {
$queryString .= $key. '=' .$value. '&';
}
$str .= "<b style='text-align: center'> Payable amount: $currency " .number_format($amount, 2). " [ Pay by ";
if ($account == 2 || $dLevel == 'UG') {
$str .= "<a href='' onclick=\"document.payment.submit(); return false;\" target='_top' title='Confirm Fees Payment'><img src='/images/hdfc.png' width='60' height='20'></a>";
} else {
$str .= "<a href='https://erp.iiita.ac.in/atom.php?{$queryString}action=$action' title='Confirm Fees Payment' target='_new'><img src='/images/atom.png' width='60' height='20'></a>";
}
$str .= " ] $status</b>
</form>";
return $str;
}
public function aaaPGResponse($action, $studentID) {
$app = $this->controller->app; // required for toolbar and urls
$menu = $this->controller->menu; // required for toolbar and urls
$pg = $this->controller->params[0];
$accountType = $this->controller->params[1];
$studentID = $this->controller->managePayment($action, $studentID);
$str = $this->pageHeader($menu);
$str .= "<br>" .$this->controller->accountTypes[$accountType]. " Payment of Roll No. " .$this->model->getRollNoByStudentID($studentID). " thru $pg Payment Gateway
<br><span class='findbar'><span class='alert'>Status: " .$this->controller->errorText. "</span></span><br><br>
<b>Parameters received:</b>
<table class='report'>";
foreach ($_REQUEST as $key => $value) {
$str .= "<tr><td>$key</td><td>: $value</td></tr>";
}
$str .= "</table>
<a href='https://paynetzuat.atomtech.in/paynetz/vfts?merchantid=18589&merchanttxnid=" .$_REQUEST['mer_txn']. "&amt=" .$_REQUEST['amt']. "&tdate=" .date("Y-m-d"). "' target='_blank' title='Check Tansaction'>Check Transaction Status</a>";
//transaction tracking url
return $str;
}
public function aaaOTP($action, $tuple) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$str = "<h3>" .$this->model->getMenuTitle($menu). "</h3>
Select Program: ";
$programs = $this->model->selectProgram();
foreach ($programs as $program) {
if ($program['programID'] == $tuple) {
$prg = "<b>" .$program['programCode']. "</b>";
$str .= "[ $prg ]";
} else {
$str .= "[ <a href='' onclick=\"inner('$app/$menu/generate/" .$program['programID']. "'); return false;\" title='Create account and mail OTP'>" .$program['programCode']. "</a> ]";
}
}
if ($prg) {
$str .= "<br><br>List of applicants under $prg
<table width='100%'>
<tr><th>#</th><th>RollNo</th><th>Name</th><th>Gender</th><th>PhoneNo</th><th>Email</th><th>State</th><th>Status</th></tr>";
$applicants = $this->model->listApplicants($tuple); // get record
foreach ($applicants as $applicant) {
if ($applicant['status'] == 'Offered') {
$i++;
$str .= "<tr><td>$i</td><td>" .$applicant['rollNo']. "</td><td>" .$applicant['nameEnglish']. "</td><td>" .$applicant['gender']. "</td><td>" .$applicant['phoneNo']. "</td><td>" .$applicant['email']. "</td><td>" .$this->controller->states[$applicant['homeState']]. "</td><td>" .$applicant['status']. "</td></tr>";
// add account, if does not exist, in user database otherwise update.
$no++;
$rno = $applicant['rollNo'];
$dob = $applicant['dateBirth'];
//$otp = rand(1111,9999);
$this->model->saveOTP($rno,6,'MDB',$dob,1,1,0);
// send OTP via mail to the registered email address by central board.
$phoneNo = $applicant['phoneNo']; // comma separated cell numbers
$email = $applicant['email']; // email address of applicant
$subject = "Login credentials @ IIIT Allahabad";
$message = "Dear Applicant
<br><br>
Greeting from IIIT Allahabad.
<br><br>
Fortunately you are listed for $prg program at this great institution of national importance. For online registration and enrolment your login credential is as below:
<br><br>
Login ID: $rno (your JEE Mains RollNo)<br>
Password: $dob (your date of birth)
<br><br>
Please login at https://erp.iiita.ac.in to fill up your application form and to upload scanned copies of your degree/certificates (under AAA link).
Feel free to drop a mail at erp.support@iiita.ac.in in case you need so.
<br><br>
<i>(for AAA Section)</i>";
if ($action == 'generate') {
//$this->controller->erpMailer($email, $subject, $message);
// send OTP via SMS to registered mobile number provided by central board.
//$phoneNo = substr($phoneNo, 0, -1); // remove last comma
$message = "For online registration at IIIT Allahabad your loginID is $rno (your JEE Mains RollNo) and Password is $dob (your date of birth)";
if (substr($phoneNo, 0,2) != '91') $phoneNo = '91' .$phoneNo;
$out = $this->controller->erpSMS($phoneNo, $message);
}
}
}
$str .= "</table>";
if ($no) {
$str .= "User account maintained and OTP email/SMS sent to newly added $no applicant" .($no > 1 ? 's' : ''). " successfully. (SMS ID: $out)";
//$str .= "User account maintained and email sent to newly added $no applicant" .($no > 1 ? 's' : ''). " successfully.";
} else if ($i){
$str .= "New applicant could not be identified for login account setting.";
}
} else {
$str .= "<dir>
Click on the program to send welcome mail containing enrolment guidelines to all the offered candidates under the program.
</dir>";
}
return $str;
}
public function aaaPrograms($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$rows = $this->model->printPrograms();
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaFeecharts($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$program = $this->model->getProgram($programID); // get record
$dl = $program['degreeLevel'];
$toolbar = $this->erpPrintbar();
$cats = ($dl == 'UG' ? array_merge($this->controller->categorys, $this->controller->dasaCategorys) : $this->controller->categorys);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table class='report' width='100%'>";
if ($programID) {
$feecharts = $this->model->selectFeechart($programID);
$str .= "<tr><th width='25%'>Fee Head/Category</th><th>Account</th><th>Term</th><th nowrap>" .implode('</th><th nowrap>', array_keys($cats))."</th></tr>";
foreach ($feecharts as $feechart) {
if ($feechart['feeheadID'] != $feeheadID) {
if ($feeheadID) $str .= "</tr>";
$str .= "<tr><th>" .$feechart['feeheadName']. "</th><td nowrap>" .$this->controller->accountTypes[$feechart['accountType']]. "</td><td nowrap>" .$this->controller->paymentTerms[$feechart['paymentTerm']]. "</td>";
}
$categorys = explode(',', $feechart['category']);
foreach (array_keys($cats) as $code) {
if (in_array($code, $categorys)) {
$currency= ($feechart['currency'] == 'INR' ? $this->rs : $this->do);
$str .= "<td style='font-size: 10px; text-align: right' nowrap>$currency " .number_format($feechart['feeAmount'], 2). "</td>";
$curency[$code] = $currency;
$total[$code] += $feechart['feeAmount'];
}
}
$feeheadID = $feechart['feeheadID'];
}
$str .= "<tr><th colspan='3'>Total (Fees + Mess Charge)</th><th nowrap>$currency" .implode("</th><th nowrap>$currency", array_map("number_format", $total, array_fill(0, count($total), 2))). "</th></tr>";
} else {
$fees = $this->model->listFeecharts();
foreach ($fees as $fee) {
$programIDs = explode(',', $fee['programID']);
$categorys = explode(',', $fee['category']);
foreach ($programIDs as $programID) {
foreach ($categorys as $category) {
$curency[$programID][$category] = ($fee['currency'] == 'INR' ? $this->rs : $this->do);
$amount[$programID][$category] += $fee['feeAmount'];
}
}
}
$str .= "<tr><th width='25%'>Program/Category</th><th nowrap>" .implode('</th><th nowrap>', array_keys($cats)). "</th></tr>";
foreach ($programs as $program) {
$programID = $program['programID'];
$str .= "<tr><th><a href='' onclick=\"inner('$app/$menu/print/" .$program['programID']. "'); return false;\">" .$program['programCode']. "</a></th>";
foreach ($cats as $code => $desc) {
$str .= "<td style='font-size: 10px; text-align: center' nowrap>" .$curency[$programID][$code] . ' ' .number_format($amount[$programID][$code], 2). "</td>";
}
$str .= "</tr>";
}
}
$str .= "</table>";
return $str;
}
public function aaaDocuments($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$program = $this->model->getProgram($programID); // get record
$dl = $program['degreeLevel'];
$toolbar = $this->erpPrintbar();
$cats = ($dl == 'UG' ? array_merge($this->controller->categorys, $this->controller->dasaCategorys) : $this->controller->categorys);
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table class='report' width='100%'>";
if ($programID) {
$doccharts = $this->model->selectDocchart($programID);
$str .= "<tr><th width='25%'>Dochead/Category</th><th>" .implode('</th><th>', array_keys($cats)). "</th></tr>";
foreach ($doccharts as $docchart) {
$docheadID = $docchart['docheadID'];
$categorys = explode(',', $docchart['category']);
$str .= "<tr><th>" .$docchart['docheadCode']. ' - ' .$docchart['docheadName']. "</th>";
foreach ($categorys as $category) {
$doc[$docheadID][$category] = 1;
}
foreach ($cats as $code => $desc) {
$str .= "<td style='font-size: 10px; text-align: center' nowrap>";
if ($doc[$docheadID][$code]) {
$str .= "<i class='fas fa-check'></i>";
$countNo[$code]++;
} else {
$str .= "<span class='alert'>N/A</span>";
}
$str .= "</td>";
}
$str .= "</tr>";
}
$str .= "<tr><th>Total Docheads</th><th>" .implode('</th><th>', $countNo). "</th></tr>";
} else {
$doccharts = $this->model->listDoccharts();
foreach ($doccharts as $docchart) {
$programIDs = explode(',', $docchart['programID']);
$categorys = explode(',', $docchart['category']);
foreach ($programIDs as $programID) {
foreach ($categorys as $category) {
$countNo[$programID][$category]++;
}
}
}
//$str .= "<pre>" .var_dump($countNo). "</pre>";
$str .= "<tr><th width='25%'>Program/Category</th><th>" .implode('</th><th>', array_keys($cats)). "</th></tr>";
foreach ($programs as $program) {
$programID = $program['programID'];
$str .= "<tr><th><a href='' onclick=\"inner('$app/$menu/print/" .$program['programID']. "'); return false;\">" .$program['programCode']. "</a></th>";
foreach ($cats as $code => $desc) {
$str .= "<td style='font-size: 10px; text-align: center' nowrap>" .($countNo[$programID][$code] ? $countNo[$programID][$code] : 'N/A'). "</td>";
}
$str .= "</tr>";
}
}
$str .= "</table>";
return $str;
}
public function aaaSeatmatrixs($action, $batchYear) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$pcats = array_keys($this->controller->categorys);
$ucats = array_merge($pcats,['DASA']);
$sexs = array_keys($this->controller->genders);
$str = $this->pageHeader($findbar, $toolbar);
foreach ($this->controller->degreeLevels as $degreeLevel => $desc) {
$cats = ($degreeLevel == 'UG' ? $ucats : $pcats);
$programs = $this->model->selectProgram($degreeLevel);
if ($programs) {
foreach ($programs as $program) {
foreach ($cats as $cat) {
foreach (array_keys($this->controller->genders) as $sex) {
$no[$cat][$sex] = 0;
}
}
// loop through records
$programID = $program['programID'];
$total[$programID] = 0;
$enrolments = $this->model->selectEnrolment($programID);
foreach ($enrolments as $enrolment) {
$ecat = trim($enrolment['enrolCategory']);
$ecat = ($ecat ? (strtoupper($ecat) == 'OPEN' ? 'GEN' : $ecat) : trim($enrolment['category']));
$ecat = (strtoupper($ecat) == 'OBC' ? 'GEN' : $ecat);
$sex = trim($enrolment['gender']);
$no[$ecat][$sex]++;
$total[$programID]++;
}
if ($total[$programID]) {
$rows .= "<tr><td>" .$program['programCode']. "</td>";
foreach ($cats as $cat) {
if ($cat != 'OBC') {
foreach (array_keys($this->controller->genders) as $sex) {
$tno = 0;
$row = $this->model->getSeatMatrix($programID, $cat, $sex);
$seatNo = ($row['seatNo'] ? $row['seatNo'] : 0);
$no1 = ($no[$cat][$sex] ? $no[$cat][$sex] : 0);
$rows .= "<td align='center'>" .$no1. ($seatNo ? '/' .$seatNo : ''). "</td>";
$t += $no1;
if ($row) {
$tno += $seatNo;
} else {
$row = $this->model->getSeatMatrix($programID, $cat, '-');
$tno = ($row['seatNo'] ? $row['seatNo'] : 0);
}
}
$rows .= "<td align='center'>{$t}/{$tno}</th>";
$t = 0;
$ttno += $tno;
}
}
$rows .= "<td align='center'>" .$total[$programID]. ($ttno ? '/' .$ttno : ''). "</td></tr>";
$ttno = 0;
}
}
if ($rows) {
$str .= "<table border='1' class='report'>
<tr valign='top'><th rowspan='2'>$desc<br>Programs</th>";
foreach ($cats as $cat) {
if ($cat != 'OBC') $str .= "<th colspan='4'>$cat</th>";
}
$str .= "<th rowspan='2'>Program<br>Total</th></tr>
<tr>";
for ($i = 0; $i < count($cats) - 1; $i++) {
foreach (array_keys($this->controller->genders) as $sex) {
$str .= "<th>" .($sex == 'T' ? 'N' : $sex). "</th>";
}
$str .= "<th>Total</th>";
}
$str .= "</tr>
$rows
</table><br>";
$rows = '';
}
}
}
return $str;
}
public function aaaCandidates($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$institutes = $this->model->selectInstitute(); // get record
$programs = $this->model->selectDegree(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['degreeLevel']. "'" .($program['degreeLevel'] == $programID ? self::SL : ''). ">" .$program['degreeLevel']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->listCandidates($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaApplicants($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->listApplicants($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaEnrolments($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$institute = $this->model->getInstitute();
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'";
if ($program['programID'] == $programID) {
$findbar .= self::SL;
$programCode = $program['programCode'];
}
$findbar .= ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->listEnrolments($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaDatedEnrolments($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->listDatedEnrolments($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaStudent($action, $queryText) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$students = $this->model->findStudent($queryText);
$no = count($students);
$toolbar = "$no Record" .($no > 1 ? 's' : ''). " found.";
$findbar = "Enrollment No. <input type='text' id='eno' name='enrolmentNo' size='20' value='$queryText' placeholder='e.g. IIT201800' onkeypress=\"if (event.key === 'Enter') {inner('aaa/student/find/'+this.value); return false;}\">
<a href='' onclick=\"inner('$app/$menu/find/'+$('#eno').val()); return false;\" title='Student Detail'><span class='button'><i class='fas fa-search'></i></span></a>";
$str = $this->pageHeader($findbar, $toolbar);
if ($no) {
foreach ($students as $student) {
$enrolmentID = $this->model->getEnrolmentIDByEnrolmentNo($student['enrolmentNo']);
$enrolment = $this->model->getEnrolment($enrolmentID); // get record
$enrolmentNo = $enrolment['enrolmentNo'];
$outFile = $this->prepareIDCard($enrolmentID, TRUE);
$allottee = $this->model->findAllottee($enrolmentNo);
if ($allottee) {
$student['hostelRoom']= $allottee['roomNo']. ' in ' .$allottee['hostelCode']. ' (' .$this->controller->floorNos[$allottee['floorNo']]. ' floor)';
}
$student['gender'] = $this->controller->genders[$student['gender']];
$student['category']= $this->controller->categorys[$student['category']];
$i = count($student);
$str .= "<table width='100%'>
<tr valign='top'><th width='50%'>Student Detail</th><td rowspan='$i' align='center'>" .$this->showPDF('idcards', $outFile). "</td></tr>
<tr valign='top'><td>
<table class='report' width='100%' style='background: url(uploads/photos/$photo); background-repeat: no-repeat; background-position: right; background-size: 250px;'>";
foreach ($student as $key => $value) {
$str .= "<tr valign='top'><td width='19%'><b>" .ucfirst($key). "</b></td><td width='1%'>:</td><td width='80%'>" .strtoupper($value). "</td></tr>";
}
$str .= "</table>
</td></tr></table>";
}
if (!$student) {
$this->controller->errorText = 'Record of matching parameter does not exist in database.';
$str .= "<h1 align='center'>Record of matching does not exist in database.</h1>";
}
} else {
$str .= "<h1 align='center'>Type in Enrollment No. or Name to find student record.</h1>";
}
//print_r($enrolment);
return $str;
}
public function aaaStudents($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programID = $this->controller->manageStudent($action, $programID); // excel download
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>" .($programID && file_exists(__DIR__ .'/../uploads/excel-' .$programID. '.csv') ? " <a href='uploads/excel-" .$programID. ".csv'>Download Excel</a>" : " <a href='' onclick=\"inner('$app/$menu/excel/$programID'); return false;\" title='Generate Excel Sheet'>Generate Excel</a>");
$rows = $this->model->printStudents($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
//$str .= $this->printGrid($rows) .($rows ? $this->erpPrintbar() : '');
return $str;
}
public function aaaPayments($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select> ";
if ($programID) {
foreach ($this->controller->accountTypes as $key => $desc) {
$findbar .= "[ $desc: " .str_replace('INR', $this->rs, $this->model->getPaidAmount($programID, $key)). " ]";
}
}
$rows = $this->model->paymentSummary($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaExemptions($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->exemptionSummary($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function aaaWithdrawals($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$rows = $this->model->listWithdrawals($programID);
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($rows);
return $str;
}
public function candidateProfile($studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
if ($studentID) {
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$enrolmentNo = $this->model->getEnrolmentNoByStudentID($studentID);
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$applicant = $this->model->getApplicant($applicantID);
$rollNo = $applicant['rollNo'];
$programID = $applicant['programID'];
$candidateID = $this->model->getCandidateIDByRollNo($rollNo);
$candidate = $this->model->getCandidate($candidateID);
$institute = $this->model->getInstitute();
$program = $this->model->getProgram($programID);
$instituteCode = $institute['instituteCode'];
$programCode = $program['programCode'];
$offerCategory = trim($applicant['offerCategory']);
$gender = $this->controller->genders[$applicant['gender']];
$dob = $applicant['dateBirth'];
$batchYear = $applicant['batchYear'];
$category = $applicant['category'];
$pwdStatus = $applicant['pwdStatus'];
$homeState = ucwords(strtolower($candidate['stateEligibility']));
$feesCategory = ($pwdStatus == 'Y' ? 'PWD' : $category);
// for DASA candidates
$feesCategory = (in_array($offerCategory, array_keys($this->controller->dasaCategorys)) ? $offerCategory : $feesCategory);
// get due amounts from fee structure
$feesDue = $this->model->getPayable($programID, $feesCategory, 1);
$messDue = $this->model->getPayable($programID, $feesCategory, 2);
if ($candidate['alumni'] == 'Y') {
$alumniFund = $this->model->getAlumniFund($programID, $feesCategory);
$feesDue['amount'] -= $alumniFund['amount'];
$alum = "* Alumni";
}
// get prepaid amount at ccmt/csab
$prePaid = $this->model->getPrepaid($programID, $feesCategory);
// collect paid amounts and heads (may be multiple transactions, so summed amount of each head)
$feesPaid = $this->model->getPayment($studentID, 1) + $prePaid;
$messPaid = $this->model->getPayment($studentID, 2);
// calculate balance amount
$balFees = ($this->model->getMyExemption($studentID, 1) ? 0 : $feesDue['amount'] - $feesPaid);
$balMess = ($this->model->getMyExemption($studentID, 2) ? 0 : $messDue['amount'] - $messPaid);
$currency = ($feesDue['curency'] ? $feesDue['curency'] : $messDue['curency']);
// avoid negative balance due to over payment
if ($balFees < 0) $balFees = 0;
if ($balMess < 0) $balMess = 0;
$dues = $balFees + $balMess;
$photo = $this->model->getMyUpload($studentID, 'PHO'); // get record
$myPhoto = "<img src='" .($photo ? 'uploads/photos/' .$photo : 'images/dummy.png'). "' width='90' height='90'>";
$sign = $this->model->getMyUpload($studentID, 'SIG'); // get record
$mySign = "<img src='" .($sign ? 'uploads/signatures/' .$sign : 'images/fake.png'). "' width='90' height='20'>";
$channel = (($dues == 0 && $photo && $sign) ? 'green' : 'pink');
//$exemptedFees = $this->model->getMyExemption($studentID, 1) ? "<a href='' onclick=\"inner('$app/exemption/edit/$studentID/$programID'); return false;\" title='See Exemption'><b>Exempted</b></a>" : '';
//$exemptedMess = $this->model->getMyExemption($studentID, 2) ? "<a href='' onclick=\"inner('$app/exemption/edit/$studentID/$programID'); return false;\" title='See Exemption'><b>Exempted</b></a>" : '';
$deficit = ($this->model->listMyExemptions($studentID) ? "<span class='rightbar'>* deficit</span>" : '');
$color = ($deficit ? 'red' : 'brown');
$str = "<table class='summary' width='100%'>
<tr><td class='$channel' colspan='2'><b>Official detail</b> [ <a href='' onclick=\"if (this.innerHTML == 'Hide') {this.innerHTML = 'Show'; document.getElementById('tb').style.visibility='collapse';} else {this.innerHTML = 'Hide'; document.getElementById('tb').style.visibility='visible';} return false;\" style='text-decoration: none;'>Hide</a> ]</td>
<td class='$channel' colspan='2'>State: $homeState</td>
<td class='$channel' colspan='2'><b style='font-size: 14px; color:$color'>Roll No.: $rollNo</b> <span class='alert'>$deficit</span></td>";
if ($menu == 'Applicant') { //inner/$app/PGPayment/$action/$studentID/$account/$amount/$currency
if ($feesDue['amount'] > $feesPaid || $messDue['amount'] > $messPaid) {
$str .= "<td class='$channel'>" .($feesDue['amount'] > $feesPaid ? "<a href='inner/$app/PGPayment/payFees/$studentID/1/$balFees/$currency' target='iframe' title='Pay Fees'>Pay Fees</a>" : ''). " $exemptedFees $alum</td>
<td class='$channel'>" .($messDue['amount'] > $messPaid ? "<a href='inner/$app/PGPayment/payMess/$studentID/2/$balMess/$currency' target='iframe' title='Pay Mess'>Pay Mess</a>" : ''). " $exemptedMess</td>";
} else {
$str .= "<td class='$channel' colspan='2'>Enrollment No.: <a href='' onclick=\"inner('$app/enrolment/open/$studentID/$programID'); return false;\" title='Enrolment Form'>$enrolmentNo</a></td>";
}
} else {
$str .= "<td class='$channel'>";
if ($feesDue['amount'] > $feesPaid) {
if (!$this->model->getMyExemption($studentID, 1)) {
$str .= "<a href='' onclick=\"inner('$app/payment/new/$studentID/1/$balFees/$currency'); return false;\" title='Pay Fees'>Pay Fees</a>
<a class='rightbar' href='inner/$app/PGPayment/online/$studentID/1/$balFees/$currency' target='iframe' title='Pay Online'><span class='button'><i class='far fa-credit-card'></i></span>";
} else {
$str .= "<span class='alert'>Exempted</span>";
}
} else {
$str .= "<a href='' onclick=\"popup('$app/payment/open/$studentID/1/$balFees/$currency', 'Fees Payment', 1000, 600); return false;\" title='Fees Transactions'>Transactions</a>";
}
$str .= " $exemptedFees $alum</td>
<td class='$channel'>";
if ($messDue['amount'] > $messPaid) {
if (!$this->model->getMyExemption($studentID, 2)) {
$str .= "<a href='' onclick=\"inner('$app/payment/new/$studentID/2/$balMess/$currency'); return false;\" title='Pay Mess'>Pay Mess</a>
<a class='rightbar' href='inner/$app/PGPayment/payMess/$studentID/2/$balMess/$currency' target='iframe' title='Pay Online'><span class='button'><i class='far fa-credit-card'></i></span></a>";
} else {
$str .= "<span class='alert'>Exempted</span>";
}
} else {
$str .= "<a href='' onclick=\"popup('$app/payment/open/$studentID/2/$balMess/$currency', 'Mess Payment', 1000, 600); return false;\" title='Mess Transactions'>Transaction</a>";
}
$str .= "</td>";
}
$str .= "<td align='center' nowrap><a href='inner/$app/upload/signUpload/$studentID/$programID' target='iframe' title='Click on Signature to change'>$mySign</a></td></tr>
<tbody id='tb'>
<tr valign='top'><td width='10%'><b>Institute</b></td><td width='10%'><b>Program</b></td><td width='10%'><b>Batch</b></td><td width='10%'><b>Category</b></td><td width='10%'><b>DoB</b></td><td width='10%'><b>Gender</b></td><td width='16%' nowrap><b>Fees Amount</b></td><td width='16%' nowrap><b>Mess Charges</b></td><td rowspan='4' align='center' nowrap><a href='inner/$app/upload/photoUpload/$studentID/$programID' target='iframe' title='Click on Photo to Change'>$myPhoto</a></td></tr>
<tr valign='top'><td>$instituteCode</td><td>$programCode</td><td nowrap>$batchYear</td><td>" .$candidate['category'].($pwdStatus == 'Y' ? ' (PwD)' : ''). "</td><td>$dob</td><td>$gender</td><td nowrap>Due: " .$feesDue['curency']. ' ' .number_format($feesDue['amount'], 2). "</td><td nowrap>Due: " .$messDue['curency']. ' ' .number_format($messDue['amount'], 2). "</td></tr>
<tr><td><b>Rank</b></td><td><b>Quota</b></td><td><b>Choice</b></td><td><b>Round</b></td><td><b>Status</b></td><td><b>State</b></td><td nowrap>Paid: " .$feesDue['curency']. ' ' .number_format($feesPaid, 2). "</td><td nowrap>Paid: " .$messDue['curency']. ' ' .number_format($messPaid, 2). "</td></tr>
<tr><td>" .$candidate['allotedRank']. "</td><td>" .$candidate['quota']. "</td><td>" .$candidate['choiceNo']. ($candidate['willingness'] ? ' (' .$candidate['willingness']. ')' : ''). "</td><td>" .$candidate['roundName']. "</td><td>" .$candidate['status']. "</td><td nowrap>$homeState</td><td nowrap>Bal.: " .$feesDue['curency']. ' ' .number_format($balFees, 2). "</td><td nowrap>Bal.: " .$messDue['curency']. ' ' .number_format($balMess, 2). "</td></tr>
</tbody>
</table>";
}
return $str;
}
// *************************************************************************************************************
function studentForm($action, $studentID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$ro = $this->controller->editLock;
$program = $this->model->getProgram($programID); // to get degreeLevel
$degreeLevel = $program['degreeLevel'];
$enrolmentID = $this->model->getEnrolmentIDByStudentID($studentID);
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
if ($enrolmentID) {
$data = $this->model->getEnrolment($enrolmentID);
$homeState = $data['homeState'];
} else {
$data = $this->model->getApplicant($applicantID);
$candidateID = $this->model->getCandidateIDByRollNo($data['rollNo']);
$candidate = $this->model->getCandidate($candidateID);
$state = explode(" (", $candidate['stateEligibility']);
$stateName = $state[0];
$ne = (array_search(ucwords(strtolower($stateName)), $this->controller->neStates) ? 1 : 0);
$homeState = $this->model->getStateIDByStateName($stateName);
}
$str .= "<table class='interface'>
<tr><th nowrap>Student #{$studentID} Detail<span class='rightbar'>Processed by: " .($data['loginID'] ? ucwords($data['loginID']) : $_SESSION['loginID']). " (dated: " .($data['datedata'] ? $data['dateEnrolment'] : date("Y-m-d: H:i:s")). ")</span></th>
<th><iframe id='iframe' name='iframe' src='' width='100%' height='30px' frameborder='0' scrolling='no'></iframe></th></tr>
<tr valign='top'><td width='50%'><input type='hidden' name='studentID' value='$studentID'>
<table class='interface'>
<tr><td colspan='2'><b>Personal detail</b></td></tr>
<tr><td nowrap>Student Name <span class='rightbar'>(in English)</span></td><td><input type='text' name='nameEnglish' size='60' value='" .$data['nameEnglish']. "' placeholder='full name in english' $ro></td></tr>
<tr><td nowrap><span class='rightbar'>(in Hindi)</span></td><td><input type='text' name='nameHindi' size='60' value='" .$data['nameHindi']. "' placeholder='name in hindi (use google input)' $ro></td></tr>
<tr><td nowrap>Date of Birth</td><td nowrap><input type='text' name='dateBirth' size='25' value='" .$data['dateBirth']. "' placeholder='YYYY-MM-DD' $ro>
<span class='rightbar'>Gender <select name='gender' style='width: 150px' $ro>";
foreach ($this->controller->genders as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['gender']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></span></td></tr>
<tr><td nowrap>Blood Group</td><td nowrap><select name='bloodGroup' style='width: 150px' $ro>";
foreach ($this->controller->bloodGroups as $code) {
$str .= "<option value='$code'" .(trim($data['bloodGroup']) == $code ? self::SL : $this->dis). ">" .($code ? $code : 'Unknown'). "</option>";
}
$str .= "</select>
<span class='rightbar'>PwD <select name='pwdStatus' style='width: 150px' $ro>";
foreach ($this->controller->pwdStatuss as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['pwdStatus']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></span></td></tr>
<tr><td nowrap>Category</td><td><select name='category' style='width: 150px' onchange=\"if (this.value=='OBC' || this.value=='OBC-NCL') {form.subc.style.visibility='visible'; $('label[for=subl]').text('Sub Category');} else {form.subc.style.visibility='hidden'; $('label[for=subl]').text('');} return false;\" $ro>
<option value='GEN'>Select</option>";
foreach ($this->controller->subCategorys as $code => $desc) {
$str .= "<option value='$code'" .($data['category'] == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select>
<span class='rightbar'><label for='subl'>Sub Category</label> <input id='subc' type='text' name='subCategory' size='25' value='" .$data['subCategory']. "' placeholder='Caste name' $ro></span></td></tr>
<tr><td>Marital Status</td><td nowrap><select name='maritalStatus' style='width: 150px' $ro>";
foreach ($this->controller->maritalStatuss as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['maritalStatus']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select>
<span class='rightbar'>Religion <select name='religion' style='width: 150px'" .$this->dis. ">";
foreach ($this->controller->religions as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['religion']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></span></td></tr>
<tr><td nowrap>Nationality</td><td nowrap><select name='nationality' style='width: 150px' $ro>";
$countrys = $this->model->selectCountry();
if (!$data['nationality']) $data['nationality'] = 'IN';
foreach ($countrys as $country) {
$str .= "<option value='" .$country['countryCode']. "'" .(trim($data['nationality']) == $country['countryCode'] ? self::SL : $this->dis). ">" .$country['countryName']. "</option>";
}
$str .= "</select>
<span class='rightbar'>" .($ne ? 'PAN/' : ''). "Aadhaar No. <input type='text' name='aadhaarNo' size='25' value='" .$data['aadhaarNo']. "' maxlength='14' placeholder='12 digits (e.g. 1111-1111-1111)' $ro></span></td></tr>
<tr><td colspan='2'><b>Contact detail</b></td></tr>
<tr><td nowrap>Email</td><td nowrap><input type='text' name='email' size='60' value='" .$data['email']. "' placeholder='Functional email address for alert mails' $ro>
<span class='rightbar'>Phone No.<input type='text' name='phoneNo' size='25' value='" .$data['phoneNo']. "' placeholder='Mobile number for OTP SMS and call' $ro></span></td></tr>
<tr><td nowrap>Permanent Address<sup>1</sup></td><td><input type='text' id='padd' name='homeAddress' size='60' value='" .$data['homeAddress']. "' placeholder='Native place address' $ro>
<span class='rightbar'>Area <select name='area' style='width: 150px'" .$this->dis. ">";
foreach ($this->controller->areas as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['area']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>PIN Code</td><td nowrap><input type='text' id='ppin' name='homePIN' size='25' value='" .$data['homePIN']. "' placeholder='6 digits pin code' $ro>
<span class='rightbar'>Police Station <input type='text' name='policeStation' size='25' value='" .$data['policeStation']. "' placeholder='Name of the nearest police station' $ro></span></td></tr>
<tr><td nowrap>District</td><td nowrap>
<select id='district' name='homeDistrict' style='width: 150px' title='To get districts of your state, save form with state name' $ro>";
if (!$data['homeState']) $data['homeState'] = 9;
$districts = $this->model->selectDistrict($homeState);
if (!$data['homeDistrict']) $data['homeDistrict'] = 1;
foreach ($districts as $district) {
$str .= "<option value='" .trim($district['districtID']). "'" .($data['homeDistrict'] == $district['districtID'] ? self::SL : $this->dis). ">" .$district['districtName']. "</option>";
}
$str .= "</select>
<span class='rightbar'> State <select id='state' name='homeState' style='width: 150px' title='To get districts of your state, save form with state name' onchange=\"update_district(this.value)\" $ro>";
$states = $this->model->selectState();
foreach ($states as $state) {
$str .= "<option value='" .trim($state['stateID']). "'" .($state['stateID'] == $homeState ? self::SL : $this->dis). ">" .$state['stateName']. "</option>";
}
$str .= "</select></span></td></tr>
<tr valign='top'><td nowrap>Comm. Address <input type='checkbox' name='same1' value='1' onclick=\"form.cadd.value=form.padd.value;form.cpin.value=form.ppin.value;\"> Same<sup>1</sup>
</td><td><input type='text' id='cadd' name='commAddress' size='60' value='" .$data['commAddress']. "' placeholder='For correspondence in emergency' $ro></td></tr>
<tr><td nowrap>PIN Code</td><td><input type='text' id='cpin' name='commPIN' size='25' value='" .$data['commPIN']. "' placeholder='6 digits pin code' $ro></td></tr>
<tr><td colspan='2'><hr><b>Account detail</b> (for refund purposes)
<table width='100%' align='center'><tr>
<td>Account No. <input type='text' name='accountNo' size='10' value='" .$data['accountNo']. "' $ro></td>
<td>Holder Name <input type='text' name='holderName' size='20' value='" .$data['holderName']. "' $ro></td>
<td>Bank Name <input type='text' name='bankName' size='20' value='" .$data['bankName']. "' $ro></td>
<td>IFSC Code <input type='text' name='ifscCode' size='10' value='" .$data['ifscCode']. "' $ro></td></tr>
</table>
<hr></td></tr>
</table></td><td>
<table class='interface'>
<tr><td colspan='2'><b>Father's detail</b><span class='rightbar'>House Hold Income <i class='fas fa-rupee-sign'></i> <input type='text' name='hhIncome' size='25' value='" .$data['hhIncome']. "' placeholder=Income nnnnnn.nn' $ro></span></td></tr>
<tr><td width='20%' nowrap>Father Name</td><td>
<select id='fttl' name='fatherTitle' style='width: 50px' $ro>";
list($ftitle, $fname) = explode(" ", $data['fatherName'], 2);
foreach (array_merge($this->controller->maleTitles, $this->controller->earnedTitles) as $code) {
$str .= "<option value='$code'" .($code == $ftitle ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select><input type='text' id='fname' name='fatherName' size='50' value='" .$fname. "' placeholder='' $ro>
<span class='rightbar'>Profession <select id='fprof' name='fatherProfession' style='width: 150px' $ro>";
foreach ($this->controller->professions as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['fatherProfession']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></span></td></tr>
<tr><td nowrap>Address<sup>2</sup></td><td><input type='text' id='fadd' name='fatherAddress' size='60' value='" .$data['fatherAddress']. "' placeholder='(Offic address, if applicable)' $ro></td></tr>
<tr><td nowrap>Email</td><td nowrap><input type='text' id='femail' name='fatherEmail' size='60' value='" .$data['fatherEmail']. "' placeholder='Functional email address' $ro>
<span class='rightbar'>Phone No. <input type='text' id='fphone' name='fatherPhone' size='25' value='" .$data['fatherPhone']. "' placeholder='Emergency contact number' $ro></span></td></tr>
<tr><td colspan='2'><b>Mother's detail</b></td></tr>
<tr><td nowrap>Mother Name</td><td>
<select id='mttl' name='motherTitle' style='width: 50px' $ro>";
list($mtitle, $mname) = explode(" ", $data['motherName'], 2);
foreach (array_merge($this->controller->femaleTitles, $this->controller->earnedTitles) as $code) {
$str .= "<option value='$code'" .($code == $mtitle ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select><input type='text' id='mname' name='motherName' size='50' value='" .$mname. "' placeholder='' $ro>
<span class='rightbar'>Profession <select id='mprof' name='motherProfession' style='width: 150px' $ro>";
foreach ($this->controller->professions as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['motherProfession']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></span></td></tr>
<tr><td nowrap>Address <input type='checkbox' name='same2' value='1' onclick=\"form.madd.value=form.fadd.value; form.mphone.value=form.fphone.value; form.memail.value=form.femail.value;\"> Same<sup>2</sup></td>
<td><input type='text' id='madd' name='motherAddress' size='60' value='" .$data['motherAddress']. "' placeholder='(Offic address, if applicable)' $ro></td></tr>
<tr><td nowrap>Email</td><td nowrap><input type='text' id='memail' name='motherEmail' size='60' value='" .$data['motherEmail']. "' placeholder='Functional email address' $ro>
<span class='rightbar'>Phone No. <input type='text' id='mphone' name='motherPhone' size='25' value='" .$data['motherPhone']. "' placeholder='Emergency contact number' $ro></span></td></tr>
<tr><td colspan='2'><b>Fee paying guardian's detail</b> [ Select from <input type='radio' name='choice' value='1' " .self::CK. ' ' .$this->dis. "> Others <input type='radio' name='choice' value='2'" .($data['relationWith'] == 'Father' ? self::CK : $this->dis). " onclick=\"form.gttl.value=form.fttl.value; form.gname.value=form.fname.value; form.gprof.value=form.fprof.value; form.rwith.value='Father'; form.gadd.value=form.fadd.value; form.gphone.value=form.fphone.value; form.gemail.value=form.femail.value;\"> Father <input type='radio' name='choice' value='3'" .($data['relationWith'] == 'Mother' ? self::CK : ''). " onclick=\"form.gttl.value=form.mttl.value; form.gname.value=form.mname.value; form.gprof.value=form.mprof.value; form.rwith.value='Mother'; form.gadd.value=form.madd.value; form.gphone.value=form.mphone.value; form.gemail.value=form.memail.value;\"> Mother ]</td></tr>
<tr><td nowrap>Guadian Name</td><td nowrap>
<select id='gttl' name='guardianTitle' style='width: 50px' $ro>";
list($gtitle, $gname) = explode(" ", $data['guardianName'], 2);
foreach (array_unique(array_merge($this->controller->maleTitles, $this->controller->femaleTitles, $this->controller->earnedTitles)) as $code) {
$str .= "<option value='$code'" .($code == $gtitle ? self::SL : $this->dis). ">$code</option>";
}
$str .= "</select><input type='text' id='gname' name='guardianName' size='50' value='$gname' placeholder='' $ro>
<span class='rightbar'>Profession <select id='gprof' name='guardianProfession' style='width: 150px' $ro>";
foreach ($this->controller->professions as $code => $desc) {
$str .= "<option value='$code'" .(trim($data['guardianProfession']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$str .= "</select></td></tr>
<tr><td nowrap>Relation With</td><td><input type='text' id='rwith' name='relationWith' size='60' value='" .$data['relationWith']. "' placeholder='Relation with candidate' $ro></span></td></tr>
<tr><td nowrap>Address <input type='checkbox' name='same8' value='1' onclick=\"form.gadd.value=form.fadd.value; form.gphone.value=form.fphone.value; form.gemail.value=form.femail.value;\"> Same<sup>2</sup></td>
<td><input type='text' id='gadd' name='guardianAddress' size='60' value='" .$data['guardianAddress']. "' placeholder='(Offic address, if applicable)' $ro></td></tr>
<tr><td nowrap>Email</td><td nowrap><input type='text' id='gemail' name='guardianEmail' size='60' value='" .$data['guardianEmail']. "' placeholder='Functional email address' $ro>
<span class='rightbar'>Phone No. <input type='text' id='gphone' name='guardianPhone' size='25' value='" .$data['guardianPhone']. "' placeholder='Emergency contact number' $ro></span></td></tr>
<tr valign='top'><td>Remark</td><td><textarea name='remark' rows='2' cols='60' placeholder='Put your remark here' $ro>" .$data['eremark']. "</textarea></td></tr>
</table>
</td></tr>
<tr valign='top' bgcolor='#f4f6f6'><td colspan='2'>
<table class='interface'>
<tr><td><b>Academic detail</b></td><td colspan='2' align='right'>JEE-AIR/GATE/CAT Score</td><td><input type='text' name='lastScore' size='10' value='" .$data['lastScore']. "' $ro></td><td colspan='8'>(Select board name of X, XII and institute/university name of UG, PG (if applicable) from the given drop-down lists below.)</td></tr>";
$xBoards = "<select id='xbl' name='xBoardlist' style='width: 20px;' onchange=\"form.xbt.value=this.value;\"" .$this->dis. ">";
$xiiBoards = "<select id='xiibl' name='xiiBoardlist' style='width: 20px;' onchange=\"form.xiibt.value=this.value;\"" .$this->dis. ">";
foreach (array_unique(array_merge($this->controller->secondarys, $this->controller->hsecondarys)) as $code => $desc) {
$xBoards .= "<option value='$code'" .(trim($data['xBoard']) == $code ? self::SL : $this->dis). ">$desc</option>";
$xiiBoards .= "<option value='$code'" .(trim($data['xiiBoard']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$xBoards .= "</select>";
$xiiBoards .= "</select>";
$str .= "<tr><td width='8%' nowrap align='right'>X Grade Point/%</td><td nowrap><input type='text' name='xGrade' size='6' value='" .$data['xGrade']. "' placeholder='Mark/GP' $ro></td>
<td width='8%' nowrap align='right'>Passing Year</td><td><input type='text' name='xYear' size='10' value='" .$data['xYear']. "' placeholder='4 digits' $ro></td>
<td width='8%' nowrap align='right'>Board</td><td nowrap><input id='xbt' type='text' name='xBoard' size='30' value='" .$data['xBoard']. "' $ro>$xBoards</td>
<td width='8%' nowrap align='right'>XII Grade Point/%</td><td nowrap><input type='text' name='xiiGrade' size='6' value='" .$data['xiiGrade']. "' placeholder='Mark/GP' $ro></td>
<td width='8%' nowrap align='right'>Passing Year</td><td><input type='text' name='xiiYear' size='10' value='" .$data['xiiYear']. "' placeholder='4 digits' $ro></td>
<td width='8%' nowrap align='right'>Board</td><td nowrap><input id='xiibt' type='text' name='xiiBoard' size='30' value='" .$data['xiiBoard']. "' $ro>$xiiBoards</td></tr>";
if ($degreeLevel != 'UG') {
$ugInstitutes = "<select id='ugil' name='ugInstitutelist' style='width: 20px' onchange=\"form.ugit.value=this.value;\"" .$this->dis. ">";
$pgInstitutes .= "<select id='pgil' name='pgInstitutelist' style='width: 20px' onchange=\"form.pgit.value=this.value;\"" .$this->dis. ">";
foreach ($this->controller->institutes as $code => $desc) {
$ugInstitutes .= "<option value='$code'" .(trim($data['ugInstitute']) == $code ? self::SL : $this->dis). ">$desc</option>";
$pgInstitutes .= "<option value='$code'" .(trim($data['pgInstitute']) == $code ? self::SL : $this->dis). ">$desc</option>";
}
$ugInstitutes .= "</select>";
$pgInstitutes .= "</select>";
$str .= "<tr><td nowrap align='right'>UG Grade Point/%</td><td nowrap><input type='text' name='ugGrade' size='6' value='" .$data['ugGrade']. "' placeholder='Mark/GP' $ro></td>
<td nowrap align='right'>Passing Year</td><td><input type='text' name='ugYear' size='10' value='" .$data['ugYear']. "' placeholder='4 digits' $ro></td>
<td width='8%' nowrap align='right'>Institute</td><td nowrap><input id='ugit' type='text' name='ugInstitute' size='30' value='" .$data['ugInstitute']. "' $ro>$ugInstitutes</td>
<td nowrap align='right'>PG Grade Point/%</td><td nowrap><input type='text' name='pgGrade' size='6' value='" .$data['pgGrade']. "' placeholder='Mark/GP' $ro></td>
<td nowrap align='right'>Passing Year</td><td><input type='text' name='pgYear' size='10' value='" .$data['pgYear']. "' placeholder='4 digits' $ro></td>
<td width='8%' nowrap align='right'>Institute</td><td nowrap><input id='pgit' type='text' name='pgInstitute' size='30' value='" .$data['pgInstitute']. "' $ro>$pgInstitutes</td></tr>";
}
$applicant = $this->model->getApplicant($applicantID);
$str .= "</table></td></tr>
</table>
<span class='findbar'><span class='alert'>Response Date: " .$applicant['dateResponse']. "</span></span>";
if ($menu == 'enrolment') {
$abookNo = $data['abookNo'];
$abookNos = explode('-', $abookNo);
$str .= "<span class='findbar'>
Health Booklet No. <input type='text' id='hbook' name='hbookNo' size='25' value='" .$data['hbookNo']. "' placeholder='6 digits number' $ro>
Answer Booklet No. <input type='text' name='abookNo1' size='10' value='" .$abookNos[0]. "' placeholder='123' $ro> to <input type='text' name='abookNo2' size='10' value='" .$abookNos[1]. "' placeholder='789' $ro>
</span>";
}
return $str;
}
function studentDetail($studentID) {
$student = $this->model->getStudent($studentID);
$photo = $this->model->getMyUpload($studentID, 'PHO');
$sign = $this->model->getMyUpload($studentID, 'SIG');
$str = "<table class='report'>
<tr height='30px' valign='middle'><td colspan='2'><b>Personal Detail</b></td><td rowspan='7' align='center'><img src='/uploads/photos/$photo' width='150' height='150'><br><img src='/uploads/signatures/$sign' width='150' height='60'></td></tr>
<tr><td width='20%' nowrap>Student Name</td><td>: " .$student['nameEnglish']. " (" .$student['nameHindi']. ")</td></tr>
<tr><td nowrap>Date of Birth</td><td nowrap>: " .$student['dateBirth']. "<span class='toolbar'>(Blood Group: " .$student['bloodGroup']. ")</span></td></tr>
<tr height='50px' valign='bottom'><td colspan='2'><b>Contact Detail</b><span class='toolbar'>Police Station - " .$student['policeStation']. " (Area: " .$this->controller->areas[$student['area']]. ")</span></td></tr>
<tr><td nowrap>Contact</td><td nowrap>: " .$student['phoneNo']. ', ' .$student['email']. "</td></tr>
<tr><td nowrap>Permanent Address</td><td>: " .$student['homeAddress']. '<br> ' .$this->model->getDistrictNameByDistrictID($student['homeDistrict']). '-' .$student['homePIN']. ' (' .$this->model->getStateNameByStateID($student['homeState']). ") " .$this->model->getCountryNameByCountryCode($student['nationality']). "</td></tr>
<tr valign='top'><td nowrap>Comm. Address</td><td>: " .$student['commAddress']. '-' .$student['commPIN']. "</td></tr>
</table>";
return $str;
}
public function prepareIDCard($enrolmentID, $specimen) {
$enrolment = $this->model->getEnrolment($enrolmentID);
if ($enrolment) {
$programID = $enrolment['programID'];
$enrolmentNo = $enrolment['enrolmentNo'];
$photo = $this->model->getMyUpload($enrolment['studentID'], 'PHO'); // get record
$psign = $this->model->getMyUpload($enrolment['studentID'], 'SIG'); // get record
$institute = $this->model->getInstitute();
$program = $this->model->getProgram($programID);
$pdf = new IDCard($institute, 'L', 'mm', array(54, 86)); //CR80
$pdf->SetFillColor(0, 32, 100);
$pdf->SetDisplayMode(real, 'default');
// create first page
$pdf->AddPage();
$pdf->SetTitle('ERP PDF Generator');
$pdf->SetAuthor('IIIT-A');
$pdf->SetAutoPageBreak(0);
if ($specimen) {
$pdf->SetDrawColor(255, 0, 0);
$pdf->Line(0, 0, 86, 54);
$pdf->Line(0, 54, 86, 0);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(255, 0, 0);
$pdf->SetFont('Arial', '', 15);
$pdf->SetXY(5, 17);
$pdf->Write(4, 'SPECIMEN CARD');
}
$pdf->SetLeftMargin(3);
$pdf->SetRightMargin(3);
$pdf->SetFont('Times', 'BU', 7.5);
$pdf->SetTextColor(220, 20, 60);
$pdf->SetXY(80, 17);
$pdf->Cell(0, 4, 'IC No.: ' .$enrolment['enrolmentNo'], 0, 1, 'R');
$pdf->SetFont('Arial', 'B', 7.5);
$pdf->SetTextColor(0, 0, 0);
$pdf->Write(4, 'Student Name');
$pdf->SetXY(22, 21);
$pdf->Cell(0, 4, ': ' .strtoupper($enrolment['nameEnglish']), 0, 1, 'L');
$pdf->Write(4, 'Father\'s Name');
$pdf->SetXY(22, 25);
$fname = explode(' ',strtoupper($enrolment['fatherName']), 2);
$pdf->Cell(0, 4, ': ' .$fname[1], 0, 1, 'L');
$pdf->Write(4, 'Enrollment No.');
$pdf->SetXY(22, 29);
$pdf->Cell(0, 4, ': ' .$enrolment['enrolmentNo'], 0, 1, 'L');
$dob = new DateTime($enrolment['dateBirth']);
$dateBirth = $dob->format('d-m-Y');
$pdf->Write(4, 'Date of Birth');
$pdf->SetXY(22, 33);
$pdf->Cell(0, 4, ': ' .$dateBirth, 0, 1, 'L');
$pdf->Write(4, 'Blood Group');
$pdf->SetXY(22, 37);
$pdf->Cell(0, 4, ': ' .$enrolment['bloodGroup'], 0, 1, 'L');
$pdf->Write(4, 'Program Code');
$pdf->SetXY(22, 41);
$pdf->Cell(0, 4, ': ' .$program['programCode'], 0, 1, 'L');
$pdf->Write(4, 'Validity Period');
$pdf->SetXY(22, 45);
$pdf->Cell(0, 4, ': Jul-' .$enrolment['batchYear']. ' to ' .$this->controller->monthNames[6] .'-'. ($enrolment['batchYear'] + $program['timeDuration']), 0, 1, 'L');
$pdf->Image(($photo ? 'uploads/photos/'. $photo : 'images/dummy.jpg'), 64, 25, 18, 22);
//$pdf->SetXY(85, 49.5);
$pdf->Image(($institute['signImage'] ? 'uploads/signatures/' .$institute['signImage'] : 'images/fake.png'), 64, 46, 18, 4);
$pdf->SetRightMargin(3);
$pdf->Cell(0, 4, $institute['idSignatory'], 0, 1, 'R');
$districtName = $this->model->getDistrictNameByDistrictID($enrolment['homeDistrict']);
$stateName = $this->model->getStateNameByStateID($enrolment['homeState']);
$countryName = strtoupper($this->model->getCountryNameByCountryCode($enrolment['nationality']));
// back page
$pdf->AddPage();
$pdf->SetTopMargin = 4;
$pdf->SetLeftMargin(3);
$pdf->SetRightMargin(3);
if ($specimen) {
$pdf->SetDrawColor(255, 0, 0);
$pdf->Line(0, 0, 86, 54);
$pdf->Line(0, 54, 86, 0);
$pdf->SetDrawColor(0, 0, 0);
$pdf->SetTextColor(255, 0, 0);
$pdf->SetFont('Arial', '', 15);
$pdf->SetXY(5, 17);
$pdf->Write(4, 'SPECIMEN CARD');
}
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(3, 3.15);
$pdf->SetFont('Helvetica', 'BU', 8);
$pdf->Cell(0, 4, 'COMMUNICATION ADDRESS', 0, 1, 'C');
$pdf->SetFont('Helvetica', '', 7);
if (strtolower($enrolment['homeAddress']) == strtolower($enrolment['commAddress'])) {
$addr = $enrolment['homeAddress']. "\n{$districtName}-". $enrolment['homePIN']. " ({$stateName}) $countryName";
} else {
$addr = $enrolment['commAddress']. ", $countryName-" .$enrolment['commPIN'];
}
$pdf->SetXY(3, 7.5);
$pdf->MultiCell(75, 3.5, strtoupper($addr. "\nPhone: " .$enrolment['phoneNo']), 0, 'C');
if ($enrolment['abookNo'] != '-') {
$pdf->SetXY(3, 22);
$pdf->Write(3, 'Answer Booklet No.: ' .$enrolment['abookNo']);
}
$pdf->SetXY(3, 25);
$pdf->Write(4, 'Specimen Signature of Card Holder: ');
$pdf->SetXY(45, 22);
$pdf->Cell(35, 7, '', 1, 1, 'L'); // draw rectangle
$pdf->Image(($psign ? 'uploads/signatures/' .$psign : 'images/fake.png'), 47, 22.15, 30, 6);
$pdf->Ln(5);
$pdf->Line(0, 29, 100, 29);
$pdf->SetXY(0, 30);
$pdf->SetFont('Helvetica', 'BU', 8);
$pdf->Cell(0, 4, 'IF FOUND KINDLY RETURN TO', 0, 1, 'C');
$pdf->Ln(1);
$pdf->SetXY(0, 36);
$pdf->SetFont('Helvetica', '', 7);
$pdf->MultiCell(0, 1.5, str_replace("<br />", "\n", nl2br($institute['idAddressee'])), 0, 'C');
$outFile = 'idcard-' .strtolower($enrolmentNo). '.pdf';
$pdf->Output(__DIR__ ."/../uploads/idcards/$outFile", 'F');
}
return $outFile;
}
public function aaaStatus() {
$app = $this->controller->app;
$this->controller->menu = 'status';
$programs = $this->model->selectProgram($degreeLevel);
$enrolments = $this->model->totalEnrolments();
// program-wise student status
$str .= $this->pageHeader('As On ' .date('jS F, Y'), $toolbar). "
<table class='report'>
<tr><th rowspan='2'>Program</th>";
foreach ($this->controller->genders as $gender => $desc) {
$i = count($this->controller->categorys)+1;
$str .= "<th colspan='$i'>$desc Students</th>";
}
$str .= "<th rowspan='2'>Total</th></tr>
<tr>";
asort($this->controller->categorys);
for ($i=0; $i< count($this->controller->genders); $i++) {
foreach ($this->controller->categorys as $category => $desc) {
if ($category != 'OBC-NCL') $str .= "<th>$category</th>";
}
$str .= "<th>DASA</th><th>Total</th>";
}
$str .= "</tr>";
foreach ($enrolments as $enrolment) {
$batchYear = $enrolment['batchYear'];
$programID = $enrolment['programID'];
$gender = trim($enrolment['gender']);
$category = (strtoupper(trim($enrolment['enrolCategory'])) == 'OPEN' ? 'GEN' : trim($enrolment['enrolCategory']));
if (!in_array(trim($category), array_keys($this->controller->categorys))) {
$dasaPGC[$programID. '-' .$gender. '-' .$category]++;
$totalC[$category]++;
$category = 'DASA';
} else if ($category == 'OBC-NCL') {
$category = 'OBC';
}
if ($enrolment['pwdStatus'] == 'Y') $category = 'PWD';
$noPGC[$programID. '-' .$gender. '-' .$category]++;
$noPG[$programID. '-' .$gender]++;
$noP[$programID]++;
if ($category == 'DASA') {
}
}
foreach ($this->controller->degreeLevels as $degreeLevel => $desc) {
foreach ($programs as $program) {
$programID = $program['programID'];
foreach (array_keys($this->controller->genders) as $gender) {
$dasaTitle[$programID. '-' .$gender] = '';
foreach (array_keys($this->controller->dasaCategorys) as $key) {
$dasaTitle[$programID. '-' .$gender] .= ($dasaPGC[$programID. '-' .$gender. '-' .$key] ? $key. ' (' .$dasaPGC[$programID. '-' .$gender. '-' .$key]. ') ' : '');
}
}
}
}
foreach ($this->controller->degreeLevels as $degreeLevel => $desc) {
$programs = $this->model->selectProgram($degreeLevel);
foreach ($programs as $program) {
$programID = $program['programID'];
$programCode = $program['programCode'];
$str .= "<tr><th>$programCode</th>";
foreach (array_keys($this->controller->genders) as $gender) {
foreach (array_keys($this->controller->categorys) as $category) {
if ($category != 'OBC-NCL') {
$no = ($noPGC[$programID. '-' .$gender. '-' .$category] ? $noPGC[$programID. '-' .$gender. '-' .$category] : 0);
$str .= "<td align='center'>$no</td>";
$totalGC[$gender. '-' .$category] += $no;
$totalG[$gender] += $no;
$totalC[$category] += $no;
}
}
$no = ($noPGC[$programID. '-' .$gender. '-DASA'] ? $noPGC[$programID. '-' .$gender. '-DASA'] : 0);
$str .= "<td align='center'>" .($no ? "<a title='" .$dasaTitle[$programID. '-' .$gender]. "'>$no</a>" : $no). "</td><td align='center' class='alert'>" .($noPG[$programID. '-' .$gender] ? $noPG[$programID. '-' .$gender] : 0). "</td>";
$totalGC[$gender. '-DASA'] += $no;
$totalG[$gender] += $no;
$totalC['DASA'] += $no;
}
$str .= "<td align='center' class='alert'>" .($noP[$programID] ? $noP[$programID] : 0). "</td></tr>";
}
}
$grandTotal = 0;
$str .= "<tr><th>Total</th>";
foreach (array_keys($this->controller->genders) as $gender) {
foreach (array_keys($this->controller->categorys) as $category) {
if ($category != 'OBC-NCL') {
$no = ($totalGC[$gender. '-' .$category] ? $totalGC[$gender. '-' .$category] : 0);
$str .= "<th align='center'>$no</th>";
$grandTotal += $no;
}
}
$no = ($totalGC[$gender. '-DASA'] ? $totalGC[$gender. '-DASA'] : 0);
$str .= "<th align='center'>$no</th><th align='center'>" .($totalG[$gender] ? $totalG[$gender] : 0). "</th>";
$grandTotal += $no;
}
$str .= "<th align='center'>$grandTotal</th></tr>
</table>
<table class='report'>
<tr><th>#</th><th>Category Code</th><th>Category Name</th><th>Count</th></tr>";
$i = 0;
foreach (array_merge($this->controller->categorys, $this->controller->dasaCategorys) as $key => $desc) {
if ($key != 'OBC-NCL') {
$i++;
$no = ($totalC[$key] ? $totalC[$key] : 0);
$str .= "<tr><td>$i</td><th>$key</th><td>$desc</td><th>$no</th></tr>";
$total += $no;
}
}
$str .= "<tr><th colspan='3'>Total No. of Students</th><th>$total</th></tr>
</table>";
return $str;
}
//***********************************************************************
//* award functions *
//***********************************************************************
public function aaaDegree($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$degreeID = $this->controller->params[0];
$degreeID = $this->controller->manageDegree($action, $degreeID); // initiate controller action
$degree = $this->model->getDegree($programID);
$degreeID = $degree['degreeID'];
// controller locks/unlocks field through manage call
$ro = '';
$program = $this->model->getProgram($programID);
$programs = $this->model->selectProgram();
$toolbar = "<a href='' onclick=\"inner('$app/$menu/edit/$programID/$degreeID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$programID/$degreeID'); return false;\" title='Save record'><span class='button'><i class='far fa-save'></i></span></a>
<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Form'><span class='button'><i class='fa fa-print'></i></span></a>";
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program1) {
$findbar .= "<option value='" .$program1['programID']. "'" .($programID == $program1['programID'] ? self::SL : ''). ">" .$program1['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
$str .= "<table class='interface' width='80%'>
<tr><td nowrap align='center'><textarea name='hindiText1' rows='3' cols='100%' style='text-align: center' $ro>" .$degree['hindiText1']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>हिंदी में छात्र का नाम</b> </td></tr>
<tr><td nowrap align='center'><textarea name='hindiText2' rows='2' cols='100%' style='text-align: center' $ro>" .$degree['hindiText2']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>" .$program['courseNameH']. "</b></td></tr>
<tr><td nowrap align='center'><textarea name='hindiText3' rowa='2' cols='100%' style='text-align: center' $ro>" .$degree['hindiText3']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>" .$program['branchNameH']. "</b></td></tr>
<tr><td nowrap align='center'><textarea name='hindiText4' rowa='5' cols='100%' style='text-align: center' $ro>" .$degree['hindiText4']. "</textarea></td></tr>
<tr><td align='center'><img src='images/separator4.jpg' width='50%' height='20'></td></tr>
<tr><td nowrap align='center'><textarea name='englishText1' rowa='3' cols='100%' style='text-align: center' $ro>" .$degree['englishText1']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>Student's name in English</b></td></tr>
<tr><td nowrap align='center'><textarea name='englishText2' rowa='2' cols='100%' style='text-align: center' $ro>" .$degree['englishText2']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>" .$program['courseName']."</b></td></tr>
<tr><td nowrap align='center'><textarea name='englishText3' rowa='2' cols='100%' style='text-align: center' $ro>" .$degree['englishText3']. "</textarea></td></tr>
<tr><td nowrap align='center'><b>" .$program['branchName']. "</b></td></tr>
<tr><td nowrap align='center'><textarea name='englishText4' rowa='5' cols='100%' style='text-align: center' $ro>" .$degree['englishText4']. "</textarea></td></tr>
</table>".$this->pageFooter('', $toolbar);
return $str;
}
// ***********************************************************
// award functions
// ***********************************************************
function aaaCorrection($action, $graduandID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$enrolmentNo = ($this->controller->params[0] ? $this->controller->params[0] : $_SESSION['loginID']);
$graduandID = ($graduandID ? $graduandID : $this->model->getGraduandIDByEnrolmentNo($enrolmentNo));
$graduandID = $this->controller->manageGraduand($action, $graduandID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = '';
$graduand = $this->model->getGraduand($graduandID);
$enrolmentNo = $graduand['enrolmentNo'];
$programCode = $graduand['programCode']; // to explode
if ($graduandID) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/open/$graduandID/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$graduandID/$programID'); return false;\" title='Save Record'><span class='button'><i class='far fa-save'></i></span></a>
<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Page'><span class='button'><i class='fa fa-print'></i></span></a>";
}
//$findbar = "<i class='fas fa-arrow-right'></i> Type Enrollment No. <input type='text' name='enrolmentNo' size='20' value='$enrolmentNo' placeholder='Fetch graduand detail' onkeypress=\"if (event.key === 'Enter') {inner('$app/$menu/open/0/'+this.value); return false;}\" onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">";
$str = $this->pageHeader($findbar, $toolbar, $toolplus);
if ($graduandID) {
$str .= "<table width='100%'>
<tr><th>Details to be printed on Degree</th><th>Specimen Degree</th></tr>
<tr valign='top'><td width='50%' align='center'>
<table class='interface' width='100%'>
<tr><td nowrap>Enrollment No.</td><td><b>" .$graduand['enrolmentNo']. "</b></td></tr>
<tr><td nowrap>Name (in English)</td><td nowrap>" .$graduand['nameEnglish']. "</td></tr>
<tr><th nowrap>Correction, if required</th><td><input type='text' name='nameEnglishx' size='50' value='" .$graduand['nameEnglishx']. "' placeholder='full name in english' $ro></td></tr>
<tr><td nowrap>Name (in Hindi)</td><td nowrap>" .$graduand['nameHindi']. "</td></tr>
<tr><th nowrap>Correction, if required</th><td><input type='text' name='nameHindix' size='50' value='" .$graduand['nameHindix']. "' placeholder='full name in hindi' $ro></td></tr>";
if (strpos($programCode, 'PhD')) $str .="<tr nowrap><td nowrap>PhD Topic</td><td><textarea name='topicPHD' rows='3' cols='60' placeholder='PhD topic' $ro>" .$graduand['topicPHD']. "</textarea></td></tr>";
$str .= "<tr><td nowrap>Contact No.</td><td><input type='text' name='contactNo' size='50' value='" .$graduand['contactNo']. "' placeholder='mobile number(s), separated by comma' $ro></td></tr>
<tr><td nowrap>Email Address</td><td><input type='text' name='email' size='50' value='" .$graduand['email']. "' placeholder='other than @iiita.ac.in' $ro></td></tr>
</table><span class='rightbar'>$toolbar
<b class='alert'>" .(stripos($this->controller->errorText, 'come') ? '' : $this->controller->errorText). "</b>
</span>
<h4>Important Information</h4>
<ul>
<li>Please check your information and submit correct name (in English/Hindi), if correction is required.</li>
<li>Suggested changes by the student shall be reviewed by AAA official for final update of record in database.</li>
<li>Photograph, if not shown in 'SPECIMEN COPY' of degree means student has not participated in official photo session for this purpose. Such students are advised to mail their good quality digital photographs (size 35x50 mm) in JPG format at ashutosh@iiita.ac.in for IIITA and vivekanand@iiitl.ac.in for IIITL.</li>
<li>Students can submit their correct name (in Hindi and English both) and photographs till 26/01/2019. After this, records will be freezed with printing of grade cards for Jul-Dec semester.</li>
<li>Your contact No. and email is important to communicate any official information. Any changes thereafter shall be entertained with penal charges only.</li>
<li>Use Google input keyboard to type your name in Hindi.</li>
</ul>
</td><td width='50%'>";
$programCodes = explode('-', $programCode);
// check for multiple degrees
foreach ($programCodes as $programCode) {
$i++;
$programID = $this->model->getProgramIDByProgramCode($programCode);
$this->controller->params = $programID;
$str .= $this->aaaSpecimen('show', $graduandID);
}
$str .= "</td></tr>
</table>";
} else {
$str .= "<h1 align='center'>Type in enrollment No. of graduand to proceed with.</h1>";
}
return $str;
}
public function aaaGraduand($action, $graduandID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$graduandID = $this->controller->manageGraduand($action, $graduandID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = $this->controller->editLock;
$programs = $this->model->selectProgram();
$program = $this->model->getProgram($programID);
$programCode = $program['programCode'];
$programTitle = $program['programTitle'];
$programTitleH = $program['programTitleH'];
if ($graduandID) $toolbar = $this->erpToolbar("<a href='' onclick=\"popup('$app/specimen/print/$graduandID/$programID', 'Specimen Degree', 1000, 650); return false;\" title='Specimen degree'><span class='button'><i class='far fa-sun'></i></span></a>");
if ($programID) $toolbar .= "<a href='' onclick=\"popup('$app/upload/photosUpload/$graduandID/$programID', 'Photo Upload', 700, 200); return false;\" title='Click on student record below for single photo upload'><span class='button'><i class='fas fa-upload'></i></span></a>";
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/open/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program1) {
$findbar .= "<option value='" .$program1['programID']. "'" .($programID == $program1['programID'] ? self::SL : ''). ">" .$program1['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
//$str .= "<div align='center'><h4>Course: " .$program['courseName']. ' [ ' .$program['courseNameH']. ' ] Branch: ' .$program['branchName']. ' [ ' .$program['branchNameH']. ' ] ' .($program['specializationName'] ? 'Specialization: ' .$program['specializationName']. ' [ ' .$program['specializationNameH']. ' ]' : ''). '</h4></div>';
$graduands = $this->model->selectGraduand($programID);
$str .= "<table width='100%' class='report'>
<tr><th width='2%'>Sr.</th><th width='10%'>Photo</th><th width='10%' nowrap>Enrollment No.</th><th width='17%' nowrap>Name (English)</th><th width='17%' nowrap>Correction Proposed</th><th width='17%' nowrap>Name (Hindi)</th><th width='17%' nowrap>Correction Proposed</th><th width='5%'>Grade Point</th></tr>";
foreach ($graduands as $graduand) {
$i++;
$enrolmentNo = $graduand['enrolmentNo'];
$star = ($graduand['nameEnglishx'] || $graduand['nameHindix'] || $graduand['contactNo'] || $graduand['email'] ? " <span class='alert'><i class='fas fa-check'></i></span>" : '');
if ($star) $count++;
$str .= "<tr><td>$i</td>";
if ($graduand['graduandID'] == $graduandID) {
$str .= "<td colspan='7'><table class='interface'>
<tr><td rowspan='7'><a href='' onclick=\"popup('$app/upload/photosupload/$graduandID/$programID', 'Photo Upload', 700, 200); return false;\" title='Upload Photo'><img src='uploads/photos/" .strtolower($graduand['enrolmentNo']). ".jpg' width='100' height='120' /></a></td>
<td nowrap>Enrollment No.</td><td nowrap><input type='text' name='enrolmentNo' size='20' value='" .$graduand['enrolmentNo']. "' placeholder='10 characters' $ro></td></tr>
<tr><td nowrap>Name (In English)</td><td nowrap><input type='text' name='nameEnglish' size='50' value='" .$graduand['nameEnglish']. "' placeholder='full name in english' $ro> " .$graduand['nameEnglishx']. "</td></tr>
<tr><td nowrap>Name (In Hindi)</td><td nowrap><input type='text' name='nameHindi' size='50' value='" .$graduand['nameHindi']. "' placeholder='full name in hindi' $ro> " .$graduand['nameHindix']. "</td></tr>
<tr><td nowrap>Grade Point</td><td nowrap><input type='number' name='gradePoint' size='5' value='" .$graduand['gradePoint']. "' placeholder='nn.nnn' $ro></td></tr>";
if (strpos($programCode, 'PhD')) $str .="<tr><th>PhD Topic</th><td nowrap><textarea name='topicPHD' rows='3' cols='75' placeholder='PhD topic' $ro>" .$graduand['topicPHD']. "</textarea></td></tr>";
$str .= "<tr><td>Contact No.</td><td><input type='text' name='contactNo' size='50' value='" .$graduand['contactNo']. "' placeholder='mobile number(s), separated by comma' $ro></td></tr>
<tr><td nowrap>Email</td><td><input type='text' name='email' size='50' value='" .$graduand['email']. "' placeholder='other than @iiita.ac.in' $ro></td></tr>
</table></td>";
} else {
$str .= "<td><img src='/uploads/photos/" .strtolower($graduand['enrolmentNo']). ".jpg' width='30' height='40' /></td>
<td><a href='' onclick=\"inner('$app/$menu/open/" .$graduand['graduandID']. "/$programID'); return false;\">" .$graduand['enrolmentNo']. "</a>$star</td><td>" .$graduand['nameEnglish']. "</td><td><span" .($graduand['nameEnglish'] == $graduand['nameEnglishx'] ? '' : " class='alert'"). ">" .$graduand['nameEnglishx']. "</span></td><td>" .$graduand['nameHindi']. "</td><td><span" .($graduand['nameHindi'] == $graduand['nameHindix'] ? '' : " class='alert'"). ">" .$graduand['nameHindix']. "</span></td><td>" .$graduand['gradePoint']. "</td>";
}
$str .= "</tr>";
}
$str .= "</table><span class='alert'><i class='fas fa-check'></i> marked enrollments " .($count ? "(total: $count) " : ''). "have seen their record online.</span></td></tr>
</table>" .$this->pageFooter('', $toolbar);
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
function aaaTravelplan($action, $planID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$enrolmentNo = strtoupper(($this->controller->params[0] ? $this->controller->params[0] : $_SESSION['loginID']));
$planID = $this->controller->manageTravelplan($action, $planID); // initiate controller action
// controller locks/unlocks field through manage call
$ro = '';
$travelplan = $this->model->getTravelplan($enrolmentNo);
if ($enrolmentNo) {
$toolbar = "<a href='' onclick=\"inner('$app/$menu/open/$planID/$enrolmentNo'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$planID/$enrolmentNo'); return false;\" title='Save Record'><span class='button'><i class='far fa-save'></i></span></a>
<a href='' onclick=\"printMe('contentbar'); return false;\" title='Print Page'><span class='button'><i class='fa fa-print'></i></span></a>";
}
$findbar = "<i class='fas fa-arrow-right'></i> Type Enrollment No. <input type='text' name='enrolmentNo' size='20' value='$enrolmentNo' placeholder='Fetch travelplan detail' onkeypress=\"if (event.key === 'Enter') {inner('$app/$menu/open/0/'+this.value); return false;}\" onchange=\"inner('$app/$menu/open/0/'+this.value); return false;\">";
$str = $this->pageHeader($findbar, $toolbar);
if ($enrolmentNo) {
$str .= "<table width='100%'>
<tr><th>Graduand #" .$travelplan['graduandID']. " detail</th><th>Travelplan #" .$travelplan['planID']. " detail</th></tr>
<tr valign='top'><td width='50%'>
<table class='report'>
<tr><td width='20%' nowrap>Enrollment No.</td><td><b>$enrolmentNo</b></td></tr>
<tr><td nowrap>Program Code</td><td><b> " .$travelplan['programCode']. "</b></td></tr>
<tr><td nowrap>Name (in English)</td><td nowrap> " .$travelplan['nameEnglish']. "</td></tr>
<tr><td nowrap>Name (in Hindi)</td><td nowrap> " .$travelplan['nameHindi']. "</td></tr>
<tr><td nowrap>Contact No.</td><td> " .$travelplan['contactNo']. "</td></tr>
<tr><td nowrap>Email</td><td> " .$travelplan['email']. "</td></tr>
<tr><td nowrap>Grade Point</td><td nowrap> " .$travelplan['gradePoint']. "</td></tr>";
if (strpos($travelplan['programCode'], 'PhD')) {
$str .="<tr><th>PhD Topic</th><td nowrap> " .$travelplan['topicPHD']. "</td></tr>";
}
$str .= "</table>
</td><td width='50%'>
<table class='interface'>
<tr><td width='20%' nowrap>Arrival Date</th><td><input type='text' name='dateArrival' size='50' value='" .$travelplan['dateArrival']. "' placeholder='yyyy-mm-dd hh:mm:nn format' $ro></td></tr>
<tr><td nowrap>Departure Date</td><td nowrap><input type='text' name='dateDeparture' size='50' value='" .$travelplan['dateDeparture']. "' placeholder='yyyy-mm-dd hh:mm:ss format' $ro></td></tr>
<tr><td nowrap>Campus Stay</td><td>";
if (empty($travelplan['campusStay'])) $travelplan['campusStay'] = 'N';
foreach ($this->controller->yesnoChoices as $key => $value) {
if ($value) $str .= "<input type='radio' name='campusStay' value='$key'" .($key == $travelplan['campusStay'] ? ' checked' : ''). ">$value ";
}
$str .= "</td></tr>
<tr><td nowrap>No. of Companion</td><td><input type='number' name='companion' value='" .$travelplan['companion']. "' placeholder='number' $ro></td></tr>
<tr><td>Contact No.</td><td><input type='text' name='contactNo' size='50' value='" .$travelplan['contactNo']. "' placeholder='mobile number(s), separated by comma' $ro></td></tr>
<tr><td nowrap>Email</td><td><input type='text' name='email' size='50' value='" .$travelplan['email']. "' placeholder='other than @iiita.ac.in' $ro></td></tr>
<tr><td nowrap>Remark</td><td><textarea name='remark' rows='3' cols='75' placeholder='any matter' $ro>" .$travelplan['remark']. "</textarea></td></tr>
</table><span class='toolbar'>$toolbar</span>
</td></tr>
</table>";
} else {
$str .= "<h1 align='center'>Type in enrollment No. of graduand to proceed with.</h1>";
}
return $str;
}
public function aaaGraduands($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$graduands = $this->model->listGraduands($programID);
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($graduands);
return $str;
}
public function aaaTravelplans($action, $programID) {
$app = $this->controller->app; // application envoked
$menu = $this->controller->menu; // menu envoked
$programs = $this->model->selectProgram(); // get record
$travelplans = $this->model->listTravelplans($programID);
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/print/'+this.value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($program['programID'] == $programID ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
$str .= $this->printReport($travelplans);
return $str;
}
public function aaaPrintDegree($action, $graduandID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programID = $this->controller->params[0];
$programs = $this->model->selectProgram();
$graduands = $this->model->selectGraduand($programID);
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/show/0/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program1) {
$findbar .= "<option value='" .$program1['programID']. "'" .($programID == $program1['programID'] ? self::SL : ''). ">" .$program1['programCode']. "</option>";
}
$findbar .= "</select>
Enrollment No. <select name='graduandID' style='width: 200px' onchange=\"inner('$app/$menu/show/'+this.value+'/$programID'); return false;\">
<option value='0'>Select</option>";
foreach ($graduands as $graduand) {
$findbar .= "<option value='" .$graduand['graduandID']. "'" .($graduandID == $graduand['graduandID'] ? self::SL : ''). ">" .$graduand['graduandID'].'-'.$graduand['enrolmentNo']. ' (' .$graduand['nameEnglish']. ")</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID && $graduandID) {
$program = $this->model->getProgram($programID);
$programCode = $program['programCode'];
$data = $this->model->getGraduand($graduandID);
$enrolmentNo = $data['enrolmentNo'];
$programCodes = explode('-', $programCode);
$j = 0;
$i = 0;
// check for multiple degrees
foreach ($programCodes as $programCode) {
$i++;
$outFile = 'degree-' .$enrolmentNo. '-' .$i. '.pdf';
$pdfs[$j] = $outFile;
$programID = $this->model->getProgramIDByProgramCode($programCode);
$outFile = $this->createDegree($programID, $graduandID, $outFile);
$j++;
}
$outFile = $this->mergeDegrees($pdfs, 'degree-' .$enrolmentNo. '.pdf');
$str .= $this->showPDF('degrees', $outFile);
} else {
$str .= "<h1 align='center'>Select program and enrolment No. to proceed with.</h1>";
}
return $str;
}
function createDegree($programID, $graduandID, $outFile) {
//if (!file_exists(__DIR__. '/../uploads/degrees/degree-' .$outFile)) {
$data = $this->model->getGraduand($graduandID);
if ($data) {
$enrolmentNo = $data['enrolmentNo'];
$nameEnglish = strtoupper($data['nameEnglish']);
$nameHindi = $data['nameHindi'];
$gradePoint = $data['gradePoint'];
$program = $this->model->getProgram($programID);
$programCode = strtoupper($program['programCode']);
$programTitle = $program['programTitle'];
$programTitleH = $program['programTitleH'];
$courseName = strtoupper($program['courseName']);
$courseNameH = $program['courseNameH'];
$branchName = strtoupper($program['branchName']);
$branchNameH = $program['branchNameH'];
$specializationName = strtoupper($program['specializationName']);
$specializationNameH= $program['specializationNameH'];
// with honours tag applies to UG programs only
if (substr($programCode, 0, 5) == 'BTECH' && $gradePoint >= 8.5) {
$withHonoursH = '<b> ससम्मान </b>';
$withHonoursE = strtoupper('with <b>Honour</b>');
} else {
$withHonoursH = '';
$withHonoursE = '';
}
$text = $this->model->getDegree($programID);
if ($text) {
$hindiText1 = $text['hindiText1'];
$hindiText2 = $text['hindiText2'];
$hindiText3 = $text['hindiText3'];
$hindiText4 = $text['hindiText4'];
$englishText1 = $text['englishText1'];
$englishText2 = $text['englishText2'];
$englishText3 = $text['englishText3'];
$englishText4 = $text['englishText4'];
$hindiText = "<p align='center' style='line-height: 1.75; letter-spacing: 1.25; overflow: hidden'>$hindiText1<br><b>$nameHindi</b><br>$hindiText2 $withHonoursH<br><b>$courseNameH</b><br>$hindiText3<br><b>$branchNameH" .($specializationNameH ? "<br>( $specializationNameH में विषेशज्ञता )" : '').($programTitleH ? "<br>( $programTitleH के अंतर्गत )" : '')."</b><br>$hindiText4</p>";
$englishText = "<p align='center' style='line-height: 1.75; letter-spacing: 1.5; overflow: hidden'>$englishText1<br><b>$nameEnglish</b><br>$withHonoursE $englishText2<br><b>$courseName</b><br>$englishText3<br><b>$branchName" .($specializationName ? "<br>( SPECIALIZATION IN $specializationName )" : '').($programTitle ? "<br>( under $programTitle )" : ''). "</b><br>$englishText4</p>";
// create new PDF document
$pdf = new \Mpdf\Mpdf();
$pdf->autoScriptToLang = true;
$pdf->autoLangToFont = true;
$pdf->SetXY(10, 20);
$pdf->SetFont('sans-serif', '', 11);
$pdf->WriteHTML("<p align='right' style='letter-spacing: 1.5; overflow: hidden'>Enrollment No.: $enrolmentNo</p>", \Mpdf\HTMLParserMode::HTML_BODY, false, false);
// set photograph
$photo = 'http://erp.iiita.ac.in/uploads/photos/' .strtolower($enrolmentNo). '.jpg';
try {
$pdf->Image($photo, 162, 88, 30, 35, 'JPG');
} catch (Exception $e) {
$str .= "Error: " .$e->getMessage();
}
// set hindi text to print
$pdf->SetMargins(15, 10, 50);
$pdf->SetXY(10, 93);
$pdf->WriteHTML($hindiText);
// print a separator
$separator = 'http://erp.iiita.ac.in/images/separator4.jpg';
$pdf->Image($separator, 40, 155, 130, 3, 'JPG');
// set english text to print
$pdf->SetMargins(15, 10, 50);
$pdf->SetXY(10, 165);
$pdf->WriteHTML($englishText);
// print date using Write()
$pdf->SetMargins(15, 10, 25);
$pdf->SetAutoPageBreak(true, 5);
$pdf->SetXY(1, 255);
$pdf->WriteHTML("<p align='center' style='overflow: hidden'><b>14 September, " .$_SESSION["batchYear"]. "</b></p>", \Mpdf\HTMLParserMode::HTML_BODY, false, false);
// print date using Write()
$pdf->SetXY(20, 268);
$pdf->WriteHTML("<p style='overflow: hidden'>( रवि कान्त )<br>( Ravi Kant )<br>अध्यक्ष, शासी मंडल<br>Chairman, Board of Governors</p>");
$pdf->SetXY(50, 268);
$pdf->WriteHTML("<p align='right' style='overflow: hidden'>( पी. नागभूषण )<br>( P. Nagabhushan )<br>अध्यक्ष, अभिषद<br>Chairman, Senate</p>");
// output PDF document
$pdf->Output(__DIR__. '/../uploads/degrees/' .strtolower($outFile), 'F');
}
}
//}
return $outFile;
}
function mergeDegrees(Array $fileNames, $outFile) {
$mpdf = new \Mpdf\Mpdf();
$mpdf->autoScriptToLang = true;
$mpdf->autoLangToFont = true;
$mpdf->SetTitle('IIITA');
$mpdf->SetAuthor('ERP & A');
$mpdf->SetSubject('Degree');
if ($fileNames) {
$mpdf->SetImportUse();
for ($i = 0; $i < count($fileNames); $i++) {
$curFile = __DIR__. '/../uploads/degrees/' .strtolower($fileNames[$i]);
if (file_exists($curFile)) {
$pageCount = $mpdf->SetSourceFile($curFile);
for ($p = 1; $p <= $pageCount; $p++) {
$tplId = $mpdf->ImportPage($p);
$wh = $mpdf->getTemplateSize($tplId);
if ($p == 1) {
$mpdf->state = 0;
$mpdf->UseTemplate ($tplId);
} else {
$mpdf->state = 1;
$mpdf->AddPage($wh['w'] > $wh['h'] ? 'L' : 'P');
$mpdf->UseTemplate($tplId);
}
}
}
}
}
$mpdf->Output(__DIR__. '/../uploads/degrees/' .strtolower($outFile), 'F');
unset($mpdf);
return $outFile;
}
function aaaSpecimen($action, $graduandID) {
$data = $this->model->getGraduand($graduandID);
$programID = $data['programID'];
$nameEnglish = strtoupper($data['nameEnglish']);
$nameHindi = $data['nameHindi'];
$gradePoint = $data['gradePoint'];
$program = $this->model->getProgram($programID);
$programCodes = explode('-', $program['programCode']);
$programTitle = $program['programTitle'];
$programTitleH = $program['programTitleH'];
// check for multiple degrees
foreach ($programCodes as $programCode) {
$programID = $this->model->getProgramIDByProgramCode($programCode);
$program = $this->model->getProgram($programID);
$programCode = strtoupper($program['programCode']);
$courseName = strtoupper($program['courseName']);
$courseNameH = $program['courseNameH'];
$branchName = strtoupper($program['branchName']);
$branchNameH = $program['branchNameH'];
$specializationName = strtoupper($program['specializationName']);
$specializationNameH= $program['specializationNameH'];
// with honours tag applies to UG programs only
if (substr($programCode, 0, 5) == 'BTECH' && $gradePoint >= 8.5) {
$withHonoursH = '<b> ससम्मान </b>';
$withHonoursE = strtoupper('with <b>Honour</b>');
} else {
$withHonoursH = '';
$withHonoursE = '';
}
$text = $this->model->getDegree($programID);
if ($text) {
$hindiText1 = $text['hindiText1'];
$hindiText2 = $text['hindiText2'];
$hindiText3 = $text['hindiText3'];
$hindiText4 = $text['hindiText4'];
$englishText1 = $text['englishText1'];
$englishText2 = $text['englishText2'];
$englishText3 = $text['englishText3'];
$englishText4 = $text['englishText4'];
$hindiText = "<p>$hindiText1<br><b>$nameHindi</b><br>$hindiText2 $withHonoursH<br><b>$courseNameH</b><br>$hindiText3<br><b>$branchNameH" .($specializationNameH ? "<br>( $specializationNameH में विषेशज्ञता )" : '').($programTitleH ? "<br>( $programTitleH के अंतर्गत )" : '')."</b><br>$hindiText4</p>";
$englishText = "<p>$englishText1<br><b>$nameEnglish</b><br>$withHonoursE $englishText2<br><b>$courseName</b><br>$englishText3<br><b>$branchName" .($specializationName ? "<br>( SPECIALIZATION IN $specializationName )" : '').($programTitle ? "<br>( under $programTitle )" : ''). "</b><br>$englishText4</p>";
$str .= "<table width='100%' border='0' style='background: #ffffff url(\"/images/degree-bg.jpg\") no-repeat right top; background-size: 100% 100%'>
<tr valign='bottom'><td colspan='3' align='right' height='60' style='letter-spacing: 1.5; border-spacing: 25px'>Enrollment No.: " .$data['enrolmentNo']. str_repeat(" ", 10). "</td></tr>
<tr><td colspan='3' height='265'></td></tr>
<tr valign='top'><td></td><td nowrap align='center' style='line-height: 1.75; letter-spacing: 1.5'><br><br>$hindiText<br></td><td align='center'><img src='/uploads/photos/" .strtolower($data['enrolmentNo']). ".jpg' width='80' height='90' /></td></tr>
<tr><td colspan='3' align='center'><img src='/images/separator4.jpg' width='200' height='5' /></td></tr>
<tr><td colspan='3' nowrap align='center' style='line-height: 1.75; letter-spacing: 1.25'>$englishText<br><br></td></tr>
<tr valign='top'><td width='25%' nowrap>" .str_repeat(" ", 10). "( रवि कान्त )<br>" .str_repeat(" ", 10). "( Ravi Kant )<br>" .str_repeat(" ", 10). "अध्यक्ष, शासी मंडल<br>" .str_repeat(" ", 10). "Chairman, Board of Governors<br><br></td>
<td align='center' width='50%' nowrap><b>14 September, " .$_SESSION["batchYear"]. "</b></td>
<td align='right' width='25% nowrap'>( पी. नागभूषण )" .str_repeat(" ", 10). "<br>( P. Nagabhushan )" .str_repeat(" ", 10). "<br>अध्यक्ष, अभिषद" .str_repeat(" ", 10). "<br>Chairman, Senate" .str_repeat(" ", 10). "<br></td></tr>
</table><br>";
}
}
return $str;
}
/// ********************************************************************************************
function aaaPhotograph($action, $enrolmentNo) {
$enrolmentID = $this->model->getEnrolmentIDByEnrolmentNo($enrolmentNo);
if ($enrolmentID) {
$studentID = $this->model->getStudentIDByEnrolmentID($enrolmentID);
$photo = $this->model->getMyUpload($studentID, 'PHO'); // get record
} else {
$graduandID = $this->model->getGraduandIDByEnrolmentNo($enrolmentNo);
$photo = ($graduandID ? $enrolmentNo.'.jpg' : 'dummy.jpg');
}
return "<a href='' onClick=\"photograph('picture'); return false;\"><img src='/uploads/photos/$photo' width='150' height='166' name='picture' border='0' alt='$enromentNo Photograph'></a>";
}
public function aaaPhotoshop($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programs = $this->model->selectProgram();
$students = $this->model->listStudents($programID);
$width = 180; // width of new photo
$height = 200; // height of new photo
$toolbar = ($programID ? "<a href='' onclick=\"inner('$app/$menu/download/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='' onclick=\"inner('$app/$menu/save/$programID'); return false;\" title='Save Record'><span class='button'><i class='far fa-save'></i></span></a>" : '');
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/download/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
$str .= "<table border='1' width='100%'><tr>";
foreach ($students as $student) {
if (!($i % 4)) {
$str .= "</tr><tr>";
flush();
}
$i++;
$studentID = $student['studentID'];
$enrolmentNo = $student['enrolmentNo'];
$nameEnglish = $student['nameEnglish'];
$photoFile = $this->model->getFileNameByDocheadCode($studentID, 'PHO');
$ufile = __DIR__ ."/../uploads/photos/$photoFile"; // uploaded file
$efile = __DIR__ ."/../uploads/photos/$enrolmentNo.jpg"; // enrolment no. wise file
$cfile = __DIR__ ."/../uploads/tmp/$enrolmentNo.jpg"; // size reduced file
$ffile = __DIR__ ."/../uploads/tmp/{$enrolmentNo}x.jpg"; // face detected file
$str .= "<td nowrap align='center'><h2>#$i</h2>";
try {
list($owidth, $oheight, $type, $attr) = getimagesize($ufile);
if ($type == 2) {
copy(__DIR__ ."/../uploads/photos/$photoFile", $efile);
$img = $this->controller->erpReimage($efile, $width, $height, true);
if ($img == 'Error') {
$x = $efile;
$str .= "<h1>$x</h1>";
} else {
imagejpeg($img, $cfile);
// detect face in the photograph
$photo = new Face_Detector(__DIR__ .'/../detection.dat');
$w = $photo->face_detect($cfile); //w = 166 for 200 x 200 and 149 for 180 x 200
$ofile = $photo->toJpeg($ffile);
//list($widthc, $heightc, $type, $attr) = getimagesize($ffile);
$str .= "<a href='../uploads/photos/$photoFile' target='_blank'>
" .($ofile == 'Error' ? $ofile : "<img src='../uploads/tmp/{$enrolmentNo}x.jpg' width='160' height'160'>"). "</a><br>
[ Size<sub>Original</sub>: $owidth x $oheight ] [ Size<sub>Cropped</sub>: $width x $height ]<br>
$nameEnglish ($enrolmentNo)<br>" .($w < 120 ? "<b><input type='checkbox' name='studentID[]' value='$studentID'> Reject Improper Photo</b>" : 'Acceptable Photograph');
}
} else {
$str .= "<a href='../uploads/photos/$photoFile' target='_blank'>
<img src='../uploads/photos/$photoFile' width='160' height'160'></a><br>
[ Size<sub>Original</sub>: $width x $height ] [ <b>Not a JPG</b> ]<br>
$nameEnglish ($enrolmentNo)<br><b><input type='checkbox' name='studentID[]' value='$studentID'> Reject Improper Photo</b>";
}
} catch (Exception $e) {
$str .= "<h1>Error: " .$e->__toString(). '</h1>';
$this->controller->errorText = 'Error' .$e->getMessage();
break;
}
$str .= "</td>";
if ($i > 35) break;
}
$str .= "</tr></table>";
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
public function aaaPhotozip($action, $programID) {
$app = $this->controller->app;
$menu = $this->controller->menu;
$programs = $this->model->selectProgram();
$students = $this->model->listStudents($programID);
$toolbar = ($programID ? "<a href='' onclick=\"inner('$app/$menu/download/$programID'); return false;\" title='Refresh Page'><span class='button'><i class='fas fa-sync-alt'></i></span></a>
<a href='/uploads/photos/program-$programID.zip' title='Download Photos'><i class='fas fa-download'></i></a>" : '');
$findbar = "Program <select name='programID' style='width: 200px' onchange=\"inner('$app/$menu/download/'+this.options[this.selectedIndex].value); return false;\">
<option value='0'>Select</option>";
foreach ($programs as $program) {
$findbar .= "<option value='" .$program['programID']. "'" .($programID == $program['programID'] ? self::SL : ''). ">" .$program['programCode']. "</option>";
}
$findbar .= "</select>";
$str = $this->pageHeader($findbar, $toolbar);
if ($programID) {
$str .= "<table width='100%'>
<tr><th>#</th><th>Student Name</th><th>Uploaded File</th><th>Renamed File</th><th>Photograph</th><th>Archive Status</th></tr>";
foreach ($students as $student) {
$studentID = $student['studentID'];
$eno = strtoupper($student['enrolmentNo']);
$photoFile = $this->model->getFileNameByDocheadCode($studentID, 'PHO');
$fnames = explode('.', $photoFile);
$ext = end($fnames);
$i++;
copy(__DIR__ ."/../uploads/photos/$photoFile", __DIR__ ."/../uploads/photos/$eno.$ext");
$err = $this->controller->erpZip(__DIR__ . "/../uploads/photos/program-$programID.zip", __DIR__ ."/../uploads/photos/$eno.$ext");
$str .= "<tr><td>$i</td><td>$eno -" .$student['nameEnglish']. "</td><td>$photoFile</td><td>$eno.$ext</td><td><img src='/uploads/photos/$eno.$ext' width='30' height='40'></td><td>$err</td></tr>";
}
$str .= "</table>";
} else {
$str .= "<h1 align='center'>Select program to proceed with.</h1>";
}
return $str;
}
function checkGogreen($studentID) {
if ($studentID) {
// get payment status
$applicantID = $this->model->getApplicantIDByStudentID($studentID);
$data = $this->model->getApplicant($applicantID);
$programID = $data['programID'];
$feesCategory = ($data['pwdStatus'] == 'Y' ? 'PWD' : $data['category']);
// for DASA candidates
$feesCategory = (in_array($data['offerCategory'], array_keys($this->controller->dasaCategorys)) ? $data['offerCategory'] : $feesCategory);
$feesDue = $this->model->getPayable($programID, $feesCategory, 1);
$messDue = $this->model->getPayable($programID, $feesCategory, 2);
// get prepaid amount at ccmt/csab
$prePaid = $this->model->getPrepaid($programID, $feesCategory);
// collect paid amounts and heads (may be multiple transactions, so summed amount of each head)
$feesPaid = $this->model->getPayment($studentID, 1) + $prePaid;
$messPaid = $this->model->getPayment($studentID, 2);
// calculate balance amount
$balFees = ($this->model->getMyExemption($studentID, 1) ? 0 : $feesDue['amount'] - $feesPaid);
$balMess = ($this->model->getMyExemption($studentID, 2) ? 0 : $messDue['amount'] - $messPaid);
$dues = $balFees + $balMess;
// get photograph & signature files
$photo = $this->model->getMyUpload($studentID, 'PHO'); // get record
$sign = $this->model->getMyUpload($studentID, 'SIG'); // get record
if ($dues <= 0 && $photo && $sign) return TRUE;
}
return FALSE;
}
}
/*
function abbreviate( $strString, $intLength = NULL ) {
$defaultAbbrevLength = 8; //Default abbreviation length if none is specified
//Set up the string for processing
$strString = preg_replace("/[^A-Za-z0-9]/", '', $strString); //Remove non-alphanumeric characters
$strString = ucfirst( $strString ); //Capitalize the first character (helps with abbreviation calcs)
$stringIndex = 0;
//Figure out everything we need to know about the resulting abbreviation string
$uppercaseCount = preg_match_all('/[A-Z]/', $strString, $uppercaseLetters, PREG_OFFSET_CAPTURE); //Record occurences of uppercase letters and their indecies in the $uppercaseLetters array, take note of how many there are
$targetLength = isset( $intLength ) ? intval( $intLength ) : $defaultAbbrevLength; //Maximum length of the abbreviation
$uppercaseCount = $uppercaseCount > $targetLength ? $targetLength : $uppercaseCount; //If there are more uppercase letters than the target length, adjust uppercaseCount to ignore overflow
$targetWordLength = round( $targetLength / intval( $uppercaseCount ) ); //How many characters need to be taken from each uppercase-designated "word" in order to best meet the target length?
$abbrevLength = 0; //How long the abbreviation currently is
$abbreviation = ''; //The actual abbreviation
//Create respective arrays for the occurence indecies and the actual characters of uppercase characters within the string
for($i = 0; $i < $uppercaseCount; $i++) {
//$ucIndicies[] = $uppercaseLetters[1]; //Not actually used. Could be used to calculate abbreviations more efficiently than the routine below by strictly considering indecies
$ucLetters[] = $uppercaseLetters[0][$i][0];
}
$characterDeficit = 0; //Gets incremented when an uppercase letter is encountered before $targetCharsPerWord characters have been collected since the last UC char.
$wordIndex = $targetWordLength; //HACK: keeps track of how many characters have been carried into the abbreviation since the last UC char
while( $stringIndex < strlen( $strString ) ) { //Process the whole input string...
if( $abbrevLength >= $targetLength ) //...unless the abbreviation has hit the target length cap
break;
$currentChar = $strString[ $stringIndex++ ]; //Grab a character from the string, advance the string cursor
if( in_array( $currentChar, $ucLetters ) ) { //If handling a UC char, consider it a new word
$characterDeficit += $targetWordLength - $wordIndex; //If UC chars are closer together than targetWordLength, keeps track of how many extra characters are required to fit the target length of the abbreviation
$wordIndex = 0; //Set the wordIndex to reflect a new word
} else if( $wordIndex >= $targetWordLength ) {
if( $characterDeficit == 0 ) //If the word is full and we're not short any characters, ignore the character
continue;
else
$characterDefecit--; //If we are short some characters, decrement the defecit and carry on with adding the character to the abbreviation
}
$abbreviation .= $currentChar; //Add the character to the abbreviation
$abbrevLength++; //Increment abbreviation length
$wordIndex++; //Increment the number of characters for this word
}
return $abbreviation;
}
*/
?>