}
    }
    $id = array();
    for ($i = 0; $i < count($fileName); $i++) {
        $temp = explode(".", $fileName[$i]);
        $newfilename = round(microtime(true)) . $temp[0] . '.' . end($temp);
        $data['post_content'] = $newfilename;
        $data['post_type'] = 'slide';
        $data['post_status'] = 'top';
        if (move_uploaded_file($tmp_name[$i], UPLOAD_DIR . $newfilename)) {
            if ($post->insert_posts($data)) {
                $id[] = $main_db->insert_id;
            }
        }
    }
    $allImg = $post->get_multi_results_by_ID($id);
    $return = '';
    $id = NULL;
    if ($allImg != NULL) {
        foreach ($allImg as $img) {
            $src = upload_dir() . $img->post_content;
            $return .= '<li> <a href="#" data-id="' . $img->id . '"> <span class="media_trash"> <i class="fa fa-times"></i></span><img src="' . $src . '" alt=""> </a></li>';
        }
        echo $return;
    } else {
        echo $main_db->last_query;
    }
}
if (isset($_FILES['customers'])) {
    foreach ($_FILES['customers'] as $key => $value) {
        if (is_array($value)) {