for (var i = 0; i < certificate.v.dataX.length; i++) {
    try {
        certificate.v.dataX[i].first = $('#cert_' + i + '_First').val();
        certificate.v.dataX[i].last = $('#cert_' + i + '_Last').val();
        certificate.v.dataX[i].email = $('#cert_' + i + '_Email').val();
        certificate.v.dataX[i].certificate = $('#cert_' + i + '_Certificate').val();

    } catch (err) {}
}
$('#JSON').val(JSON.stringify(certificate.v.dataX));
copy($('#JSON').val());


data = '';
data = '[{"field_id":"0","first":"s","last":"r","email":"scott.reph@gmail.com","certificate":"1-5","status":"success","action_del":"N"},{"field_id":"0","first":"a","last":"x","email":"s@r.com","certificate":"6","status":"","action_del":"N"}]';
certificate.v.dataX = JSON.parse(data)
certificate.order.buildPageFromJSON();
for (var i = 0; i < certificate.v.dataX.length; i++) {
    if (certificate.v.dataX[i].status === 'success') {
        $('#row_'+i+' .eDelete').html('<br />Success');
        $('#row_'+i+' .eDelete').css('color','forestgreen');
    } else {
        $('#row_'+i+' .eDelete').html('<br />Failure');
    }
}


var processed = true;
for (var ii = 0; ii < certificate.v.dataX.length; ii++) {
    if (certificate.v.dataX[ii].action_del === 'N') {
        if (certificate.v.dataX[ii].status === 'success') {} else {
            processed = false;
        }
    }
}
if (processed) {
    $('#processCertificatesButton').css('display','none');
}
console.log(processed)
