Created
August 21, 2015 19:01
-
-
Save joeyemery/b902f434e7390fff2606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```` /*$output .= "<script> | |
$(function() { | |
var orderId = " . $order->getOriginalQuote()->getId() . "; | |
$.ajax({ | |
url: 'http://api.molekula.com/third-party/v1/pickingslip-scanner/' + orderId + '/images', | |
type: 'GET', | |
dataType: 'json' | |
}) | |
.done(function(data) { | |
if (data.status_code != 200) { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
return false; | |
} | |
$('#" . $line->getId() . " .order-line-images').each(function() { | |
var id = {$line->getId()}; | |
if (id == 90004692) { | |
$(this).html(' '); | |
} else { | |
if (data.data[id] !== undefined) { | |
$(this).html('<img src=\"data:image/jpeg;base64,' + data.data[id] + '\" class=\"img-responsive modal-image\" height=\"100\" width=\"100\" data-order-id=\"' + id + '\">'); | |
} else if (data.data[$(this).attr('data-order-id')] !== undefined) { | |
$(this).html('<img src=\"data:image/jpeg;base64,' + data.data[$(this).attr('data-order-id')] + '\" class=\"img-responsive modal-image\" height=\"100\" width=\"100\" data-order-id=\"' + id + '\">'); | |
} | |
} | |
}); | |
}) | |
.fail(function() { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
}); | |
$('.evidence-fix').live('dblclick', function() { | |
$.ajax({ | |
url: 'http://api.molekula.com/third-party/v1/pickingslip-scanner/' + orderId + '/fix-images', | |
type: 'GET', | |
dataType: 'json', | |
async: false | |
}) | |
.done(function(data) { | |
if (data.status_code != 200) { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
return false; | |
} | |
$.ajax({ | |
url: 'http://api.molekula.com/third-party/v1/pickingslip-scanner/' + orderId + '/images', | |
type: 'GET', | |
dataType: 'json', | |
async: false | |
}) | |
.done(function(data) { | |
if (data.status_code != 200) { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
return false; | |
} | |
$('#" . $line->getId() . " .order-line-images').each(function() { | |
var id = $(this).attr('data-order-id'); | |
if (id == 90004692) { | |
$(this).html(' '); | |
} else { | |
$(this).html('<img src=\"data:image/jpeg;base64,' + data.data[id] + '\" class=\"img-responsive modal-image\" height=\"100\" width=\"100\">'); | |
} | |
}); | |
}) | |
.fail(function() { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
}); | |
}) | |
.fail(function() { | |
$('#{$line->getId()} .order-line-images').each(function() { | |
$(this).text('No image found'); | |
}); | |
}); | |
}); | |
}); | |
</script>";*/```` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment