I am having frustration because of this error. When I am still programming php without using any framework my code is ok but when I transferred it in codeigniter, it always says severity undefined functions. Please check my posted code:
foreach($data['employee'] as $val)
{
if($val['Active']==0)
{
$status = @strtoupper('Resigned');
}
else
{
$status = @strtoupper('Active');
}
$str = @substr($val['WS_Code'],0,-2);
if($str == "PR")
{
$line = @substr($val['WS_Code'],0,-1);
$str2 = @substr($val['WS_Code'],-1);
if($str2 == 'B')
{
$section = "BRIEF";
}
else
{
$section = "PANTY";
}
}
elseif($str == "SP")
{
$line = @substr($val['WS_Code'],0,-1);
$str2 = @substr($val['WS_Code'],-1);
if($str2 == "B")
{
$section = "BRIEF";
}
else
{
$section = "PANTY";
}
}
elseif($str == "BL")
{
$section = "BRIEF";
$str2 = @substr($str,-3,2);
$line = $str2;
}
elseif($str == "PL")
{
$section = "PANTY";
$str2 = @substr($str,-3,2);
$line = $str2;
}
And here is the rest of the code and how I use it:
<tr>
<td><label class='control-label'>Section:</label></td>
<td>
<select class='form-control' name='cmbsection' id='cmbsection'>
<option value='".$section."'>".$section."</option>
";
$section_code = array();
$section_code[] = $section;
foreach($data['sectionlist'] as $value)
{
if(!in_array($value['sectionName'],$section_code))
{
echo "<option value='".$value['sectionName']."'>".$value['sectionName']."</option>";
}
}
echo "
</select>
</td>
<td><label class='control-label'>Line:</label></td>
<td>
<select class='form-control' name='cmbline' id='cmbline'>
";
$line_code = array();
$line_code[] = $line;
echo "
<option value='$line'>$line</option>
";
foreach($data['linelist'] as $value)
{
if(!in_array($value['lineName'],$line_code))
{
echo "<option value='".$value['lineName']."'>".$value['lineName']."</option>";
}
}
echo "
</select>
</td>
</tr>
Please note that I am echoing a table inside the controller and the error always points the $section and$line in the if(!in_array($value['lineName'],$line_code)) code.


error_reporting(E_ALL); ini_set('display_errors', 1);