Getting an error if I am clicking on a link to view the list of certificates.It is working fine in some systems I have tested about 3-4 system with the same code it is working fine but in one system it is not working.
Here is the code were i am getting issue at count
<?php
if (count(@$certificate_attachments)>0) {
foreach ($certificate_attachments as $cert_key => $cert_val) {
if ((strpos($cert_val, ".png")) || (strpos($cert_val, ".jpg")) || (strpos($cert_val, ".jpeg"))) {
?>
<div class="col-md-3">
<a href="<?php echo ATTACHMENTS_PATH; ?>certificates/<?php echo $profileInfo['email_id']; ?>/<?php echo $cert_val; ?>" title="Certificates" class="thickbox ">
<img height="100" width="100" class="certif" src="<?php echo ATTACHMENTS_PATH; ?>certificates/<?php echo $profileInfo['email_id']; ?>/<?php echo $cert_val; ?>" />
</a>
</div>
<?php
} else {
?>
<div class="col-md-3">
<a href="#TB_inline?height=800&width=500&inlineId=pdfContent<?php echo $cert_key; ?>" title="" class="thickbox">
<img height="100" width="100" src="<?php echo $this->config->item('img_path_portal_doctor'); ?>pdf-icon.png" class="">
</a>
</div>
<div id="pdfContent<?php echo $cert_key; ?>" style="display: none;">
<p>
<object type="application/pdf" width="600" height="500" frame-resize data="<?php echo ATTACHMENTS_PATH; ?>certificates/<?php echo $profileInfo['email_id']; ?>/<?php echo $cert_val; ?>">
<embed src="<?php echo ATTACHMENTS_PATH; ?>certificates/<?php echo $profileInfo['email_id']; ?>/<?php echo $cert_val; ?>" type="application/pdf" />
</object>
</p>
</div>
<?php
}
}
} else {
?>
Not provided any Certificates.
<?php
}
?>
</div>
getting this error:
A PHP Error was encountered
Severity: Warning
Message: count(): Parameter must be an array or an object that implements Countable
Filename: doctor/profile.php
Line Number: 533
But it is working in fine the system which i am working and tested in another 2-3 systems with the same code it is also working fine but when client is running this code it is getting this issue in client system.