Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 160 |
AdmissionDetailsOther | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
462.00 | |
0.00% |
0 / 160 |
__construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
__clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
getSportsDetails | |
0.00% |
0 / 1 |
306.00 | |
0.00% |
0 / 152 |
<?php | |
namespace com\linways\core\ams\professional\service\admission; | |
use com\linways\core\ams\professional\service\BaseService; | |
class AdmissionDetailsOther extends BaseService | |
{ | |
// /Condition 1 - Presence of a static member variable | |
private static $_instance = null; | |
// /Condition 2 - Locked down the constructor | |
private function __construct() | |
{ | |
} | |
// Prevent any oustide instantiation of this class | |
// /Condition 3 - Prevent any object or instance of that class to be cloned | |
private function __clone() | |
{} | |
// Prevent any copy of this object | |
// /Condition 4 - Have a single globally accessible static method | |
public static function getInstance() | |
{ | |
if (! is_object(self::$_instance)) // or if( is_null(self::$_instance) ) or if( self::$_instance == null ) | |
self::$_instance = new self(); | |
return self::$_instance; | |
} | |
function getSportsDetails($mapperList, $studentID = "", $action = "", $otherDetails = NULL) | |
{ | |
if ($action == 'display_form') | |
{ | |
if(!empty($mapperList) && $mapperList !=null) | |
{ | |
$response .=" | |
<div class='row'> | |
<div class='col-md-12'><h4>{{title}}</h4> | |
<div class='row mtl'> | |
<div class='col-md-2'></div> | |
<div class='col-md-8'> | |
<table class='table table-striped table-hover'>"; | |
foreach ($mapperList as $mapper) | |
{ | |
switch($mapper['field']) | |
{ | |
case "sportsName" : | |
$response .= " | |
<tr> | |
<td width='35%'>".$mapper['caption']."</td> | |
<td> | |
<div class='row'> | |
<div class='col-xs-9'> | |
$otherDetails->sportsName | |
</div> | |
</div> | |
</td> | |
</tr>"; | |
break; | |
case "sportsPartLevel" : | |
$response .=" | |
<tr> | |
<td width='35%'>".$mapper['caption']."</td> | |
<td> | |
<div class='row'> | |
<div class='col-xs-9'> | |
$otherDetails->sportsPartLevel | |
</div> | |
</div> | |
</td> | |
</tr>"; | |
break; | |
case "sportsPrizeWin" : | |
$response .=" | |
<tr> | |
<td width='35%'>".$mapper['caption']."</td> | |
<td> | |
<div class='row'> | |
<div class='col-xs-9'> | |
$otherDetails->sportsPrizeWin | |
</div> | |
</div> | |
</td> | |
</tr>"; | |
break; | |
case "title": | |
$response = str_replace("{{title}}", $mapper['caption'], $response); | |
break; | |
} | |
} | |
} | |
$response .=" </table> | |
</div> | |
</div> | |
</div> | |
</div>"; | |
} | |
else | |
{ | |
if(!empty($mapperList) && $mapperList !=null) | |
{ | |
$response .="<h4>{{title}}</h4>"; | |
foreach ($mapperList as $mapper) | |
{ | |
$isRequired = $mapper['isRequired']===false?"":"<span style='color:#F00;font-size:16px;'>*</span>"; | |
switch($mapper['field']) | |
{ | |
case "sportsName" : | |
$response .= " | |
<div class='form-group'> | |
<label class='col-sm-4 control-label'> | |
".$mapper['caption']." | |
</label> | |
<div class='col-sm-8 controls'> | |
<div class='row'> | |
<div class='col-xs-9'> | |
<input type='text' name='sportsName' id='sportsName' class='form-control' value='$otherDetails->sportsName' /> | |
</div> | |
</div> | |
</div> | |
</div>"; | |
break; | |
case "sportsPartLevel" : | |
$selected[$otherDetails->sportsPartLevel]='selected'; | |
$response .= " | |
<div class='form-group'> | |
<label class='col-sm-4 control-label'> | |
".$mapper['caption']." | |
</label> | |
<div class='col-sm-8 controls'> | |
<div class='row'> | |
<div class='col-xs-9'> | |
<select name='sportsPartLevel' id='sportsPartLevel' class='form-control input-md'/> | |
<option value=''>---select---</option> | |
<option value='School' ".$selected['School'].">School</option> | |
<option value='College' ".$selected['College'].">College</option> | |
<option value='District' ".$selected['District'].">District</option> | |
<option value='University' ".$selected['University'].">University</option> | |
<option value='State' ".$selected['State'].">State</option> | |
<option value='National' ".$selected['National'].">National</option> | |
<option value='International' ".$selected['International'].">International</option> | |
</select> | |
</div> | |
</div> | |
</div> | |
</div>"; | |
break; | |
case "sportsPrizeWin" : | |
$winSelected[$otherDetails->sportsPrizeWin]='selected'; | |
$response .= " | |
<div class='form-group'> | |
<label class='col-sm-4 control-label'> | |
".$mapper['caption']." | |
</label> | |
<div class='col-sm-8 controls'> | |
<div class='row'> | |
<div class='col-xs-9'> | |
<select name='sportsPrizeWin' id='sportsPrizeWin' class='form-control input-md'/> | |
<option value=''>---select---</option> | |
<option value='School' ".$winSelected['School'].">School</option> | |
<option value='College' ".$winSelected['College'].">College</option> | |
<option value='District' ".$winSelected['District'].">District</option> | |
<option value='University' ".$winSelected['University'].">University</option> | |
<option value='State' ".$winSelected['State'].">State</option> | |
<option value='National' ".$winSelected['National'].">National</option> | |
<option value='International' ".$winSelected['International'].">International</option> | |
</select> | |
</div> | |
</div> | |
</div> | |
</div>"; | |
break; | |
case "title": | |
$response = str_replace("{{title}}", $mapper['caption'], $response); | |
break; | |
} | |
} | |
} | |
} | |
$response = str_replace("{{title}}", '', $response); | |
return $response; | |
} | |
} | |