A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: models/Admin_user.php
Line Number: 1010
Backtrace:
File: /var/app/current/application/models/Admin_user.php Line: 1010 Function: _error_handler
File: /var/app/current/application/controllers/Adminuser.php Line: 427 Function: force_recheck
File: /var/app/current/index.php Line: 319 Function: require_once
public function force_recheck($jid)
{
$status=0;
$job_details=$this->db->query("SELECT * FROM prins_job_details WHERE jid='".$jid."' AND (status='-1' OR status='2')")->result();
$agent_details=$this->db->get_where('prins_agents',array('agent_id'=>$job_details[0]->agent_id))->result();
$s3_list=$this->listobject($job_details[0]->s3_path,$agent_details[0]->bucket_name);
if($job_details[0]->json_list != $s3_list['count'])
{
$keys=$s3_list['keys'];
for($i=0;$i<$s3_list['count'];$i++)
{
$position=strrpos($keys[$i]['Key'],"/");
$name=substr($keys[$i]['Key'],$position + 1);
$s3_keys[]=$name;
}
$dynamic_fields=json_decode($job_details[0]->dynamic_fields,true);
for($j=0;$j<count($dynamic_fields);$j++)
{
if($dynamic_fields[$j]['typevalue']=='image' || $dynamic_fields[$j]['typevalue']=='video')
{
$json_keys[]=$dynamic_fields[$j]['value'];
}
}
$missing_key=array_diff($json_keys,$s3_keys);
$template='<div class="row-fluid">';
$template .='<div class="col-md-12 col-sm-12 center">';
$template .='<table class="table table-striped table-bordered bulk_action">';
$template .='<tr>';
$template .='<th>These Files are Not uploaded</th';
$template .='</tr>';
$template .='<tr>';
$template .='<th class="center">Missing Files</th';
$template .='</tr>';
for($n=0;$n<count($missing_key);$n++)
{
$template .='<tr><td class="prins-warning">';
$template .=$missing_key[$n]; // line number 1010 error
$template .='</td></tr>'; //undefined offset error
}
$template .='</table>';
$template .='</div>';
$template .='</div>';
return $template;
}