<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$filename = isset($_POST['filename']) ? $_POST['filename'] : '';
$count = isset($_POST['corecount']) ? $_POST['corecount'] : '';
$impobj = new WPImporter_includes_helper();
$getrec = $impobj->csv_file_data($filename);
$csvheaders = $impobj->headers;
$returndata = "<table><tr><td><input type='text' name='coremapping{$count}' id = 'coremapping{$count}'/></td>";
$returndata .= "<td class='left_align'> <select name='coretextbox{$count}' id='coretextbox{$count}' class='uiButton'>";
$returndata .= "<option id = 'select'>-- Select --</option>";
foreach ($csvheaders as $headerkey => $headervalue) {
    $returndata .= "<option value = 'textbox{$headerkey}'>{$headervalue}</option>";
}
$returndata .= "</select></td>";
$returndata .= "<td></td><td></td></tr></table>";
print_r($returndata);
die;
    $allcustomposts = '';
    $mFieldsArr = '';
    $delimeter = '';
    $filename = '';
    $records = '';
    if (isset($_POST['uploadfilename']) && $_POST['uploadfilename'] != '') {
        $file_name = $_POST['uploadfilename'];
        $filename = $impCE->convert_string2hash_key($file_name);
    }
    if (isset($_POST['mydelimeter'])) {
        $delimeter = $_POST['mydelimeter'];
    }
    if (isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
        $uploaded_csv_name = $_POST['upload_csv_realname'];
    }
    $getrecords = $impCE->csv_file_data($filename);
    $getcustomposts = get_post_types();
    foreach ($getcustomposts as $keys => $value) {
        if ($value != 'featured_image' && $value != 'attachment' && $value != 'wpsc-product' && $value != 'wpsc-product-file' && $value != 'revision' && $value != 'nav_menu_item' && $value != 'post' && $value != 'page' && $value != 'wp-types-group' && $value != 'wp-types-user-group') {
            $allcustomposts .= $value . ',';
        }
    }
    ?>
						<table style="font-size: 12px;" class="table table-striped" id='FIELDGRP'>
							<tr>
									<div align='center' style='float:right;'>
										<?php 
    $cnt = count($impCE->defCols) + 2;
    $cnt1 = count($impCE->headers);
    $records = count($getrecords);
    $imploaded_array = implode(',', $impCE->headers);