Example #1
0
function aad_callback()
{
    if (isset($_POST['dataVal'])) {
        $retdat = $_POST['dataVal'];
        $rethmil = get_field_list_massimport($retdat);
        echo json_encode(array("sucs" => $rethmil));
    } else {
        echo json_encode(array("sucs" => "WRONG"));
    }
    die;
}
Example #2
0
<?php

require '../../../wp-load.php';
if (isset($_POST['dataVal'])) {
    $retdat = $_POST['dataVal'];
    get_field_list_massimport($retdat);
}
function get_field_list_massimport($num)
{
    $ararr = apply_filters('massimport_getfields', $num);
    $html = '<div style="margin-top: 20px;padding: 5px;background:#E4E4E4;"><strong>ALL csv files should be comma delimited and double quote encased.  Make sure you export your files from excel or other similar programs appropriately.  Additionaly, if you are using special characters or language characters foreign to English, please make sure that you use UTF-8 encoding before saving the file! </strong></div><br/><br/><h3>These are the fields within the form you wish to import.  Make sure the CSV headers match those listed below:</h3><br/><div style="clear:both"></div><div style="width: 90%;float:left"><table style="border:1px solid #ceccce;-moz-border-radius: 5px;border-radius: 5px;width:100%;"><colgroup><col style="" /><col style="border-left:1px solid #ceccce;" /><col style="border-left:1px solid #000;" /></colgroup><thead><tr><th style="background: #ceccce; color:white; text-align:left;">ID</th><th style="background: #ceccce; color:white;text-align:left;">LABEL</th><th style="background: #ceccce;color:white;text-align:left;">TYPE</th><th style="background: #ceccce;color:white;text-align:left;">Syntax</th></tr></thead><tbody>';
    $j = 0;
    for ($i = 0; $i < sizeof($ararr); $i++) {
        if ($ararr[$i]['type'] == 'section' || $ararr[$i]['type'] == 'page' || $ararr[$i]['id'] == null) {
        } else {
            if ($j % 2 == 0) {
                $evenstyle = 'style = "background: #f5f5f5;-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;-moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset;box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;"';
            } else {
                $evenstyle = '';
            }
            $j++;
            $html .= "<tr " . $evenstyle . "><td>" . $ararr[$i]['id'] . "</td><td style='width:auto;white-space: nowrap;padding-right:5px;'>" . $ararr[$i]['label'] . "</td><td>" . $ararr[$i]['type'] . "</td><td>";
            switch ($ararr[$i]['type']) {
                case 'list':
                    $html .= "example: apples,oranges,peaches";
                    if ($ararr[$i]['value']) {
                        if ($ararr[$i]['value'][0] != "") {
                            $html .= "&nbsp;&nbsp;&nbsp;&nbsp;Recorded Values: ";
                            $pieces = explode(",", $ararr[$i]['value']);
                            for ($ms = 0; $ms < sizeof($pieces); $ms++) {
                                $html .= $pieces[$ms] . ", ";