D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
test
/
public
/
js
/
Filename :
manager.js
back
Copy
$(function () { var changed = $('#for_changed').html(); if (!changed) { changed = '-' } $('#changed').val(changed); $('#width').change(function () { var data = $(this).val(); var width_out = parseInt($('#width_out').val()); var height_out = parseInt($('#height_out').val()); var height = parseInt(data * height_out / width_out); var size = parseInt(data * height); var catalog = parseInt($('#catalogs_id').val()); console.log(height); $('#height').val(height); $('#size_show').val(size); $('#size').val(size); getSize(data, height, catalog); }); $('#catalogs_id').change(function () { var catalog = parseInt($(this).val()); var width = parseInt($('#width').val()); var height = parseInt($('#height').val()); getSize(width, height, catalog); }); function getSize(width, height, catalog) { console.log(width); console.log(height); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, type: "post" }); $.ajax({ url: '/manager/ajax/sum', data: 'width=' + width + '&height=' + height + '&catalog=' + catalog, success: function (data) { console.log(data); $('#manager_sum').text(data); var r = data / 80; var h = Number((r).toFixed(1)); var hh = h / 2; console.log(hh); if (hh > 4) { hh = 4; } $('#putdate_end').val(hh); }, error: function (data) { console.log(data); } }); } $('.oa').click(function () { var data = $(this).attr("data-id"); var res = data; console.log(res); $.ajax({ data: "id=" + res, url: "/manager/ajax", type: "post", success: function (data) { $(".modal-content").html(data); $("#myModal").modal("toggle"); }, error: function (msg) { $(".modal-content").text("Some error! Please, try again with small picture or crop this one."); } }); }); });