| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902 |
- var oldImageData = null;
- var step = 0;
- var temps = null;
- function forgotpass() {
- $('#forgotFRM').show();
- }
- function setOrderState(id,state) {
- if (id!=='' && state!=='') {
- $.post('/admin/orders/set/',{id: id, state: state},function(resp) {});
- }
- else {
- return false;
- }
- }
- function reloadOrderStatus(orderId, uuid) {
- if (orderId !== '' && uuid !== '') {
- var btn = $('#status_' + orderId + ' button');
- btn.prop('disabled', true);
- btn.html('<i class="fa fa-circle-o-notch fa-spin"></i> Loading...');
- $.post('/admin/orders/reloadstatus/', {order_id: orderId, uuid: uuid}, function(resp) {
- var data = JSON.parse(resp);
- if (data.success) {
- $('#status_' + orderId).html(data.status);
- $('#errorcode_' + orderId).html(data.error_code);
- $('#errormsg_' + orderId).html(data.error_message);
- } else {
- btn.prop('disabled', false);
- btn.html('<i class="fa fa-refresh"></i> Reload');
- }
- });
- }
- }
- function validateForm(frm,cropper,cropper2) {
- var inputError = false;
- var selector = frm+' input[data-validate]';
-
- $(selector).each(function() {
- if ($(this).val()=='') {
- inputError = true;
- $(this).addClass('field-error');
- }
- else {
- $(this).removeClass('field-error');
- }
- });
- if ($('#user_pass1').val()!='') {
- if ($('#user_pass1').val()!='' && $('#user_pass2').val()=='') {
- $('#user_pass1').addClass('field-error');
- $('#user_pass2').addClass('field-error');
- inputError = true;
- }
- else {
- $('#user_pass1').removeClass('field-error');
- $('#user_pass2').removeClass('field-error');
- }
- }
-
- if (!inputError) {
- /*if (cropper!=='' && cropper!==null) {
- var imageData = $(cropper).cropit('export');
- if (imageData) $('#tempContainer').val(imageData);
- }
- if (cropper2!=='' && cropper2!==null) {
- var imageData2 = $(cropper2).cropit('export');
- if (imageData2) $('#tempContainer2').val(imageData2);
- }*/
-
- $(frm).submit();
- }
- }
- function validateUser(frm,cropper,cropper2) {
- var inputError = false;
- var selector = frm+' input[data-validate]';
-
- $(selector).each(function() {
- if ($(this).val()=='') {
- inputError = true;
- $(this).addClass('field-error');
- }
- else {
- $(this).removeClass('field-error');
- }
- });
- if ($('#user_pass1').val()!='') {
- if ($('#user_pass1').val()!='' && $('#user_pass2').val()=='') {
- $('#user_pass1').addClass('field-error');
- $('#user_pass2').addClass('field-error');
- inputError = true;
- }
- else {
- $('#user_pass1').removeClass('field-error');
- $('#user_pass2').removeClass('field-error');
- }
- }
-
- if (!inputError) {
- var tableSelected = $('#mytable_hotels_selected').dataTable();
- var data = tableSelected.fnGetData(); // array of rows
- var names = [];
- var id = '';
- for (var i = 0; i < data.length; i++) {
- console.log(data[i][0]);
- id = $(data[i][0]).attr('data-id');
- names.push(id);
- }
-
- $('#selectedHotels').val(names);
-
- /*if (cropper!=='' && cropper!==null) {
- var imageData = $(cropper).cropit('export');
- if (imageData) $('#tempContainer').val(imageData);
- }
- if (cropper2!=='' && cropper2!==null) {
- var imageData2 = $(cropper2).cropit('export');
- if (imageData2) $('#tempContainer2').val(imageData2);
- }*/
-
- $(frm).submit();
- }
- }
- function setModuleRoleStatus(roleID,moduleID) {
- if (roleID!=='' && moduleID!=='') {
- var request = {
- roleID: roleID,
- moduleID: moduleID
- };
- $.post('/admin/roles/set',request,function(data) {
- return true;
- });
- }
- else {
- return false;
- }
- }
- function setUserState(userid) {
- if (userid!='') {
- var request = {
- user_id: userid
- };
-
- $.post('/admin/users/set',request,function(data) {
- return true;
- });
- }
- else {
- return false;
- }
- }
- function setUserDefaultMailer(userid) {
- if (userid!='') {
- var request = {
- user_id: userid
- };
-
- $.post('/admin/users/setdefaultmailer',request,function(data) {
- return true;
- });
- }
- else {
- return false;
- }
- }
- function updateTranslate(obj) {
- var code = obj.attr('data-lang-code');
- var key = obj.attr('data-lang-key');
- var text = obj.val();
- var hash = '#'+key;
-
- var request = {
- code: code,
- key: key,
- text: text
- };
-
- $.post('/admin/translator/set/',request,function(data) {
- obj.next('span').removeClass('hideme');
- setTimeout(function() {
- obj.next('span').addClass('hideme');
- },1000);
- });
- }
- function deleteGaleryItem(designID,galeryID) {
- var request = {
- id: designID,
- galery_id: galeryID
- };
-
- $.post('/admin/galery/delete/',request,function(data) {
- $('#galery').html(data);
- });
- }
- function changeMainDesign(designID,galeryID,obj) {
- var request = {
- id: designID,
- galery_id: galeryID
- };
-
- $.post('/admin/galery/set/',request,function(data) {
- $('#galery').html(data);
- });
- }
- function changePriceMode(obj) {
- var objValue = $(obj).attr('id');
-
- if (objValue!='') {
- if (objValue==='normal_price_selector') {
- $('#product_offer_price').attr('disabled','true');
- $('#product_price').removeAttr('disabled');
- }
- else {
- $('#product_offer_price').removeAttr('disabled');
- $('#product_price').attr('disabled','true');
- }
- }
- }
- function add_product_option(obj) {
- var pid = $(obj).attr('data-pid');
- $.get('/admin/products/newoption/?pid='+pid,function(data) {
- //$('#product_options_list').append(data);
- document.location.reload();
- });
- }
- function save_product_option(oid,tags) {
- var option_name_hash = '#option_name_'+oid;
- //var option_values_hash = '#option_options_'+oid;
- $.post('/admin/products/saveoption',{oid: oid, option_name: $(option_name_hash).val(), option_values: tags},function(data) {
- $('#variants_list').html(data);
- $('input[type="checkbox"]').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- function save_variation(obj) {
- if (obj) {
- var variation_id = $(obj).attr('data-id');
- var variation_data_type = $(obj).attr('name');
- var variation_data = $(obj).val();
-
- $.post('/admin/products/savevariation',{variation_id: variation_id, variation_data_type: variation_data_type, variation_data: variation_data},function(data) {
-
- });
- }
- else {
- return false;
- }
- }
- function set_variation_status(obj,state) {
- if (obj) {
- var variation_id = $(obj).attr('data-id');
- var variation_data_type = $(obj).attr('name');
- var variation_data = state;
-
- $.post('/admin/products/savevariation',{variation_id: variation_id, variation_data_type: variation_data_type, variation_data: variation_data},function(data) {
- });
- }
- }
- function delete_product_option(obj) {
- if (obj) {
- var option_id = $(obj).attr('data-oid');
- $.post('/admin/products/deleteoption',{option_id: option_id},function(data) {
- //alert(data);
- $(obj).parent('div').parent('div').remove('.row');
- $('#variants_list').html(data);
- $('input[type="checkbox"]').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- function add_new_product_meta(obj) {
- var key = $('#new_meta_key').val();
- var value = $('#new_meta_value').val();
- var pid = $(obj).attr('data-pid');
-
- $.post('/admin/products/addmeta',{meta_key: key, meta_value: value, meta_pid: pid},function(data) {
- $('#product_meta_list').html(data);
- $('#new_meta_key').val('');
- $('#new_meta_value').val('');
- });
- }
- function delete_product_meta(obj) {
- var mid = $(obj).attr('data-mid');
- var pid = $(obj).attr('data-pid');
-
- $.post('/admin/products/deletemeta',{meta_id: mid, meta_pid: pid},function(data) {
- $('#product_meta_list').html(data);
- });
- }
- function save_product_meta_data(obj) {
- var mid = $(obj).attr('data-mid');
- var tipus = $(obj).attr('name');
- var data = $(obj).val();
-
- $.post('/admin/products/savemeta',{meta_id: mid, meta_field: tipus, meta_data: data},function(data) {
- });
- }
- function saveBannerImage() {
- validateForm('#bannerEditor',null,null);
- }
- function setLendingStatus(status) {
- $('#lending_status').val(status);
- return true;
- }
- function save_todo(param_type,param_value,todo_id) {
- var datum = $('#todo_date').val();
- var szoveg = $('#todo_text').val();
-
- if (szoveg!='') {
- if (param_type==='user') {
- $.post('/admin/todo/add',{todo_date: datum, todo_text: szoveg, todo_user_id: param_value, todo_id: todo_id},function(result) {
- window.location.reload();
- });
- }
- else {
- $.post('/admin/todo/add',{todo_date: datum, todo_text: szoveg, todo_lending_id: param_value, todo_id: todo_id},function(result) {
- window.location.reload();
- });
- }
- }
- }
- function delete_todo(todo_id) {
- $.post('/admin/todo/delete',{todo_id: todo_id},function(result) {
- window.location.reload();
- });
- }
- function update_input(obj,destination) {
- var objVal = $(obj).val();
- var objFilter = $(obj).attr('data-filter');
-
- if (objFilter!='') {
- objVal = Math.round(eval(objFilter));
- }
- $(destination).val(objVal);
- return true;
- }
- function finish_todo(obj) {
- var objID = $(obj).attr('data-id');
- var objState = $(obj).is(':checked');
- $.post('/admin/todo/finish',{todo_id: objID, state: objState},function(result) {});
- }
- function next_block() {
- var probe = step+1;
- var last = step;
- var next_hash = '#step_'+probe;
- var last_hash = '#step_'+last;
- var obj = $(next_hash);
- if (obj.length) {
- step++;
- $(obj).removeClass('inactive-list').addClass('active-list');
- $(last_hash).removeClass('active-list').addClass('inactive-list');
- $('.nextBtn').removeAttr('disabled');
- $('.prevBtn').removeAttr('disabled');
- check_for_prev_next();
- }
- else {
- $('.nextBtn').attr('disabled','true');
- }
- }
- function prev_block() {
- var probe = step-1;
- var last = step;
- var next_hash = '#step_'+probe;
- var last_hash = '#step_'+last;
- var obj = $(next_hash);
-
- if (obj.length) {
- step--;
- $(obj).removeClass('inactive-list').addClass('active-list');
- $(last_hash).removeClass('active-list').addClass('inactive-list');
- $('.nextBtn').removeAttr('disabled');
- $('.prevBtn').removeAttr('disabled');
- check_for_prev_next();
- }
- else {
- $('.prevBtn').attr('disabled','true');
- }
- }
- function check_for_prev_next() {
- var probe = step+1;
- var last = step;
- var next_hash = '#step_'+probe;
- var last_hash = '#step_'+last;
- var obj = $(next_hash);
- if (obj.length) {
- $('.nextBtn').removeAttr('disabled');
- }
- else {
- $('.nextBtn').attr('disabled','true');
- }
- probe = step-1;
- last = step;
- next_hash = '#step_'+probe;
- last_hash = '#step_'+last;
- obj = $(next_hash);
-
- if (obj.length) {
- $('.prevBtn').removeAttr('disabled');
- }
- else {
- $('.prevBtn').attr('disabled','true');
- }
- }
- function show_works_add() {
- $('#workEditor').slideDown('fast');
- }
- function update_field(obj,table,field,id,key,currency) {
- var new_value = $(obj).val();
- $.post('/admin/updater/save',{
- table: table,
- field: field,
- id: id,
- value: new_value,
- key: key,
- currency: currency
- },function(result){
- $(obj).parent('td').removeClass('in-edit');
- $(obj).parent('td').html(result);
- });
- }
- function simple_update_field(obj,table,field,id,key,category) {
- var new_value = $(obj).val();
- $.post('/admin/factors/save',{
- table: table,
- field: field,
- id: id,
- value: new_value,
- key: key,
- category: category
- },function(result){});
- }
- function update_multiple_field(obj,table,field,id,key,currency) {
- var new_value = $(obj).val();
- $.post('/admin/multiupdater/save',{
- table: table,
- field: field,
- id: id,
- value: new_value,
- key: key,
- currency: currency
- },function(result){
- $(obj).parent('td').removeClass('in-edit');
- $(obj).parent('td').html(result);
- });
- }
- function update_field_by_object(obj,recolor,reload) {
- var new_value = $(obj).val();
- var id = $(obj).attr('data-id');
- var key = $(obj).attr('data-key');
- var table = $(obj).attr('data-table');
- var field = $(obj).attr('name');
- var is_radio = $(obj).attr('type');
-
- if ($(obj).parent('button').hasClass('radiobtn')) {
- if ($(obj).parent('button').children('i').hasClass('fa-dot-circle-o')) {
- new_value = '1';
- if (recolor==='true') {
- $(obj).parent('button').parent('td').parent('tr').removeClass('uj-elem');
- }
- }
- else {
- new_value = '2';
- if (recolor==='true') {
- $(obj).parent('button').parent('td').parent('tr').addClass('uj-elem');
- }
- }
- }
-
- $.post('/admin/updater/save/',{
- table: table,
- field: field,
- id: id,
- value: new_value,
- key: key
- },function(result) {
- if (reload==='true') {
- window.location.reload();
- }
- });
- }
- function update_bill_image(id,obj) {
- var filename = $('.uploadedFile').val();
- $.post('/admin/bills/updatefile/',{
- id: id,
- filename: filename
- },function(response){
- window.location.reload();
- });
- }
- function update_bill(id,obj) {
- var filename = $('.uploadedFile').val();
- $.post('/admin/costlist/updatebill/',{
- id: id,
- filename: filename
- },function(response){
- window.location.reload();
- });
- }
- function update_rajz_image(id,obj) {
- var filename = $('.uploadedFile').val();
-
- if (filename!=='') {
- $.post('/admin/rajzok/updatefile/',{
- id: id,
- filename: filename
- },function(response){
- window.location.reload();
- });
- }
- }
- function update_document(id,obj) {
- var filename = $('.uploadedFile').val();
- $.post('/admin/beszerzes/updatedoc/',{
- id: id,
- filename: filename
- },function(response){
- window.location.reload();
- });
- }
- function show_partner_add() {
- $('#partnerEditor').toggle('fast');
- }
- function show_client_add() {
- $('#clientEditor').toggle('fast');
- }
- function show_bill_add() {
- $('#editor_form').slideDown('fast');
- }
- function show_rajz_add() {
- $('#editor_form').toggle('fast');
- }
- function show_beszerzes_add() {
- $('#editor_form').toggle();
- $('#beszerzesEditor').slideDown('fast');
- $('#beszer_uploader').slideDown('fast');
- }
- function show_group_add(group) {
- if (group!=='') {
- $('#'+group).toggle('fast');
- }
- else {
- return false;
- }
- }
- function export_xlsx() {
- $.post('/admin/costlist/export',function(response) {
- window.location=response;
- });
- }
- function export_gyartas_xlsx() {
- $.post('/admin/gyartas/export',function(response) {
- window.location=response;
- });
- }
- function remove_filter() {
- window.location='/admin/costlist/clear';
- }
- function assign_partner(obj) {
- var base_id = $(obj).attr('data-base-id');
- var dest_id = $(obj).val();
-
- if (window.confirm('Figyelem! Valóban egyesíteni kívánja a két partnert?')) {
- $.post('/admin/partners/assign/',{
- base_id: base_id,
- dest_id: dest_id
- },function(response) {
- window.location.reload();
- });
- }
- }
- function assign_client(obj) {
- var base_id = $(obj).attr('data-base-id');
- var dest_id = $(obj).val();
-
- if (window.confirm('Figyelem! Valóban egyesíteni kívánja a két ügyfelet?')) {
- $.post('/admin/clients/assign/',{
- base_id: base_id,
- dest_id: dest_id
- },function(response) {
- window.location.reload();
- });
- }
- }
- function change_currency(obj) {
- var actual_currency = $(obj).val();
-
- $.post('/admin/costlist/setcurrency/',{
- currency: actual_currency
- },function(response){
- $('.currency').html(actual_currency);
- if (actual_currency!=='HUF') {
- $('#arfolyam').show();
- $('#egyseg_arfolyam').show();
- }
- else {
- $('#arfolyam').hide();
- $('#egyseg_arfolyam').hide();
- }
- });
- }
- function set_currency_field(obj) {
- var new_value = $(obj).val();
- var id = $(obj).attr('data-id');
- var key = $(obj).attr('data-key');
- var table = $(obj).attr('data-table');
- var field = $(obj).attr('name');
- $.post('/admin/updater/save',{
- table: table,
- field: field,
- id: id,
- value: new_value,
- key: key
- },function(result){});
- }
- function radiobtn_set_state(obj) {
- var state = $(obj).val();
- var on_state = $(obj).attr('data-on-value');
- var off_state = $(obj).attr('data-off-value');
- var default_state = $(obj).attr('data-default-value');
-
- var on_icon = $(obj).attr('data-on-icon');
- var off_icon = $(obj).attr('data-off-icon');
- var default_icon = $(obj).attr('data-default-icon');
-
- if (state===default_state) {
- $(obj).val(default_state);
- $(obj).children('span').html(default_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(default_icon);
- $(obj).children('input[type=hidden]').val(default_state);
- }
- else if (state===on_state) {
- $(obj).val(on_state);
- $(obj).children('span').html(on_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(on_icon);
- $(obj).children('input[type=hidden]').val(on_state);
- }
- else if (state===off_state) {
- $(obj).val(off_state);
- $(obj).children('span').html(off_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(off_icon);
- $(obj).children('input[type=hidden]').val(off_state);
- }
- }
- function checkbtn_set_state(obj) {
- var state = $(obj).val();
-
- var on_state = $(obj).attr('data-on-value');
- var off_state = $(obj).attr('data-off-value');
- var default_state = $(obj).attr('data-default-value');
-
- var on_icon = $(obj).attr('data-on-icon');
- var off_icon = $(obj).attr('data-off-icon');
- var default_icon = $(obj).attr('data-default-icon');
- if (state===default_state) {
- $(obj).val(default_state);
- $(obj).children('span').html(default_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(default_icon);
- }
- else if (state===on_state) {
- $(obj).val(on_state);
- $(obj).children('span').html(on_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(on_icon);
- }
- else if (state===off_state) {
- $(obj).val(off_state);
- $(obj).children('span').html(off_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(off_icon);
- }
- else {
- $(obj).val(default_state);
- $(obj).children('span').html(default_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(default_icon);
- }
- }
- function checkbtn_change_state(obj) {
- var active_state = $(obj).attr('value');
-
- var on_state = $(obj).attr('data-on-value');
- var off_state = $(obj).attr('data-off-value');
- var default_state = $(obj).attr('data-default-value');
-
- var on_icon = $(obj).attr('data-on-icon');
- var off_icon = $(obj).attr('data-off-icon');
- var default_icon = $(obj).attr('data-default-icon');
- if (active_state===default_state || active_state==='') {
- $(obj).val(on_state);
- $(obj).children('span').html(on_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(on_icon);
- $(obj).children('input[type=hidden]').val(on_state);
- }
- else if (active_state===on_state) {
- $(obj).val(off_state);
- $(obj).children('span').html(off_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(off_icon);
- $(obj).children('input[type=hidden]').val(off_state);
- }
- else if (active_state===off_state) {
- $(obj).val(default_state);
- $(obj).children('span').html(default_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(default_icon);
- $(obj).children('input[type=hidden]').val(default_state);
- }
- }
- function radiobtn_change_state(obj,event_trigger,reloader) {
- var active_state = $(obj).val();
-
- var on_state = $(obj).attr('data-on-value');
- var off_state = $(obj).attr('data-off-value');
- var default_state = $(obj).attr('data-default-value');
-
- var on_icon = $(obj).attr('data-on-icon');
- var off_icon = $(obj).attr('data-off-icon');
- var default_icon = $(obj).attr('data-default-icon');
-
- if (active_state===on_state) {
- $(obj).val(off_state);
- $(obj).children('span').html(off_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(off_icon);
- $(obj).children('input[type=hidden]').val(off_state);
- $(obj).removeClass('btn-success');
- $(obj).addClass('btn-info');
- }
- else if (active_state===off_state) {
- $(obj).val(on_state);
- $(obj).children('span').html(on_state);
- $(obj).children('i').attr('class','fa');
- $(obj).children('i').addClass(on_icon);
- $(obj).children('input[type=hidden]').val(on_state);
- $(obj).removeClass('btn-info');
- $(obj).addClass('btn-success');
- }
-
- if (event_trigger===true) {
- $(obj).children('input[type=hidden]').trigger('change');
-
- }
- }
- function set_currency_field(obj) {
-
- }
- function show_partner_details(partner_details,obj) {
- if ($(partner_details).css('display')==='block') {
- $('.partner-details').hide();
- }
- else {
- $('.partner-details').hide();
- $(partner_details).show();
- }
- }
- function show_client_details(client_details,obj) {
- if ($(client_details).css('display')==='block') {
- $('.client-details').hide();
- }
- else {
- $('.client-details').hide();
- $(client_details).show();
- }
- }
- function editable(obj,update_parts) {
- if (!$(obj).hasClass('in-edit')) {
- $(obj).addClass('in-edit');
- var actual_value = $(obj).html();
- console.log(actual_value);
- var currency = $(obj).attr('data-currency');
- if (currency==='true') {
- actual_value = actual_value.replace(",- Ft","");
- actual_value = actual_value.replace(" ","");
- }
- var field_name = $(obj).attr('data-field');
- var table_name = $(obj).attr('data-table');
- var row_id = $(obj).attr('data-id');
- var key = $(obj).attr('data-key');
- if (update_parts==true) {
- $(obj).html('<input style="width: 100%;" type="text" name="'+field_name+'" id="'+field_name+'" value="'+actual_value+'" class="form-control edit" onblur="javascript: update_field($(this),\''+table_name+'\',\''+field_name+'\',\''+row_id+'\',\''+key+'\',\''+currency+'\'); window.location=\'/admin/rendelesek/\';">');
- }
- else {
- $(obj).html('<input style="width: 100%;" type="text" name="'+field_name+'" id="'+field_name+'" value="'+actual_value+'" class="form-control edit" onblur="javascript: update_field($(this),\''+table_name+'\',\''+field_name+'\',\''+row_id+'\',\''+key+'\',\''+currency+'\');">');
- }
- $('#'+field_name).focus();
- }
- }
- function multiple_editable(obj) {
- if (!$(obj).hasClass('in-edit')) {
- $(obj).addClass('in-edit');
- var actual_value = $(obj).html();
- console.log(actual_value);
- var currency = $(obj).attr('data-currency');
- if (currency==='true') {
- actual_value = actual_value.replace(",- Ft","");
- actual_value = actual_value.replace(" ","");
- }
- var field_name = $(obj).attr('data-field');
- var table_name = $(obj).attr('data-table');
- var row_id = $(obj).attr('data-id');
- var key = $(obj).attr('data-key');
- $(obj).html('<input type="text" name="'+field_name+'" id="'+field_name+'" value="'+actual_value+'" class="form-control edit" onblur="update_multiple_field($(this),\''+table_name+'\',\''+field_name+'\',\''+row_id+'\',\''+key+'\',\''+currency+'\')">');
- $('#'+field_name).focus();
- }
- }
- function open_upload(obj) {
- $(obj).parent('div').children('.myuploader').click();
- }
- function start_upload(obj) {
- var input = obj;
- var files = input.files;
- var data = new FormData();
- var id = $(obj).attr('data-id');
-
- $.each(files, function(key, value) {
- data.append(key, value);
- });
-
- data.append('id',id);
-
- var old = $(obj).parent('div').children('.uploder').html();
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-circle-o-notch fa-spin"></i>');
-
- $.ajax({
- url: '/admin/bills/updatefile/',
- type: 'POST',
- data: data,
- cache: false,
- processData: false,
- contentType: false,
- success: function(resp) {
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-check"></i>');
- $(obj).parent('div').children('.bill-image').attr('href',resp);
- $(obj).parent('div').children('.bill-image').children('button').children('i').attr('class','fa fa-eye');
- var clearIcon = setInterval(function() {
- $(obj).parent('div').children('.uploder').html(old);
- clearInterval(clearIcon);
- },3000);
- }
- });
- }
- function start_upload_rajz(obj) {
- var input = obj;
- var files = input.files;
- var data = new FormData();
- var id = $(obj).attr('data-id');
-
- $.each(files, function(key, value) {
- data.append(key, value);
- });
-
- data.append('id',id);
-
- var old = $(obj).parent('div').children('.uploder').html();
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-circle-o-notch fa-spin"></i>');
-
- $.ajax({
- url: '/admin/rajzok/updatefile/',
- type: 'POST',
- data: data,
- cache: false,
- processData: false,
- contentType: false,
- success: function(resp) {
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-check"></i>');
- $(obj).parent('div').children('.bill-image').attr('href',resp);
- var clearIcon = setInterval(function() {
- $(obj).parent('div').children('.uploder').html(old);
- clearInterval(clearIcon);
- },3000);
- }
- });
- }
- function start_upload_document(obj) {
- var input = obj;
- var files = input.files;
- var data = new FormData();
- var id = $(obj).attr('data-id');
-
- $.each(files, function(key, value) {
- data.append(key, value);
- });
-
- data.append('id',id);
- data.append('MAX_FILE_SIZE','90000000');
-
- var old = $(obj).parent('div').children('.uploder').html();
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-circle-o-notch fa-spin"></i>');
-
- $.ajax({
- url: '/admin/sales/updatefile/',
- type: 'POST',
- data: data,
- cache: false,
- processData: false,
- contentType: false,
- success: function(resp) {
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-check"></i>');
- $(obj).parent('div').children('.bill-image').attr('href',resp);
- var clearIcon = setInterval(function() {
- $(obj).parent('div').children('.uploder').html(old);
- clearInterval(clearIcon);
- },3000);
- }
- });
- }
- function start_upload_techno(obj) {
- var input = obj;
- var files = input.files;
- var data = new FormData();
- var id = $(obj).attr('data-id');
-
- $.each(files, function(key, value) {
- data.append(key, value);
- });
-
- data.append('id',id);
-
- var old = $(obj).parent('div').children('.uploder').html();
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-circle-o-notch fa-spin"></i>');
-
- $.ajax({
- url: '/admin/techno/updatefile/',
- type: 'POST',
- data: data,
- cache: false,
- processData: false,
- contentType: false,
- success: function(resp) {
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-check"></i>');
- $(obj).parent('div').children('.bill-image').attr('href',resp);
- var clearIcon = setInterval(function() {
- $(obj).parent('div').children('.uploder').html(old);
- clearInterval(clearIcon);
- },3000);
- }
- });
- }
- function start_upload_beszer(obj) {
- var input = obj;
- var files = input.files;
- var data = new FormData();
- var id = $(obj).attr('data-id');
-
- $.each(files, function(key, value) {
- data.append(key, value);
- });
-
- data.append('id',id);
-
- var old = $(obj).parent('div').children('.uploder').html();
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-circle-o-notch fa-spin"></i>');
-
- $.ajax({
- url: '/admin/beszerzes/updatedoc/',
- type: 'POST',
- data: data,
- cache: false,
- processData: false,
- contentType: false,
- success: function(resp) {
- $(obj).parent('div').children('.uploder').html('<i class="fa fa-check"></i>');
- $(obj).parent('div').children('.bill-image').attr('href',resp);
- var clearIcon = setInterval(function() {
- $(obj).parent('div').children('.uploder').html(old);
- clearInterval(clearIcon);
- },3000);
- }
- });
- }
- function show_bill(e,obj) {
- e.preventDefault();
- $(obj).orangeBox('create');
- }
- function scroll_left(obj) {
- $('#scroller').scrollLeft($('#scroller').scrollLeft()-100);
- }
- function scroll_right() {
- $('#scroller').scrollLeft($('#scroller').scrollLeft()+100);
- }
- function set_kategoria_state() {
- var act = $('#cost_type_id').val();
- if (act==='9' || act==='11') {
- $('#cost_category_id').val('');
- $('#cost_category_id').attr('disabled','true');
- }
- else {
- $('#cost_category_id').removeAttr('disabled');
- }
- }
- function set_filters_partner(obj) {
- var values = $(obj).val();
- if (values!==null) {
- $('#clients_filter').hide();
- temps = $('#filter_forras').children('optgroup[label="bevétel"]');
- $('#filter_forras').children('optgroup[label="bevétel"]').remove();
- $(".mypayment").select2({placeholder: 'Válasszon fizetési módot!'});
- }
- else {
- $('#clients_filter').show();
- $('#filter_forras').prepend(temps);
- $(".mypayment").select2({placeholder: 'Válasszon fizetési módot!'});
- }
- }
- function set_filters_client(obj) {
- var values = $(obj).val();
- if (values!==null) {
- $('#partners_filter').hide();
- temps = $('#filter_forras').children('optgroup[label="kiadás"]');
- $('#filter_forras').children('optgroup[label="kiadás"]').remove();
- $(".mypayment").select2({placeholder: 'Válasszon fizetési módot!'});
- }
- else {
- $('#partners_filter').show();
- $('#filter_forras').append(temps);
- $(".mypayment").select2({placeholder: 'Válasszon fizetési módot!'});
- }
- }
- function client_text(obj) {
- var value = $(obj).val();
- if (value!=='' && value!=='undefined' && value!==null) {
- $('#cost_partner').attr('disabled','true');
- $('#cost_type_id').children('option[value=7]').hide();
- $('#cost_type_id').children('option[value="12"]').hide();
- $('#cost_type_id').children('option[value="44"]').hide();
- $('#cost_category_id').attr('disabled','true');
- }
- else {
- $('#cost_partner').removeAttr('disabled');
- $('#cost_type_id').children('option[value=7]').show();
- $('#cost_type_id').children('option[value="12"]').show();
- $('#cost_type_id').children('option[value="44"]').show();
- $('#cost_category_id').removeAttr('disabled');
- }
- }
- function partner_text(obj) {
- var value = $(obj).val();
- if (value!=='' && value!=='undefined' && value!==null) {
- $('#cost_client').attr('disabled','true');
- $('#cost_type_id').children('option[value="9"]').hide();
- $('#cost_type_id').children('option[value="11"]').hide();
- }
- else {
- $('#cost_client').removeAttr('disabled');
- $('#cost_type_id').children('option[value="9"]').show();
- $('#cost_type_id').children('option[value="11"]').show();
- }
- }
- function set_egyseg_forall() {
- var egyseg = $('#rajz_egyseg :selected').html();
- $('#rajz_min_rendeles').next('span').html(egyseg);
- $('#rajz_alert').next('span').html(egyseg);
- }
- function add_alkatresz(obj,reszegyseg,altipus) {
- $.post('/admin/gyartas/addalkatresz/',{
- reszegyseg: reszegyseg,
- altipus: altipus
- },function(resp) {
- window.location.reload();
- });
- }
- function add_altipus(obj,reszegyseg) {
- $.post('/admin/gyartas/addaltipus/',{
- reszegyseg: reszegyseg
- },function(resp) {
- window.location.reload();
- });
- }
- function add_reszegyseg(obj) {
- $.post('/admin/gyartas/addreszegyseg/',{},function(resp) {
- window.location.reload();
- });
- }
- function allocate_parts(id) {
- window.location='/admin/rendelesek/allocate/?id='+id;
- // $.post('/admin/rendelesek/allocate/',{
- // id: id
- // },function(response) {
- // window.location.reload();
- // });
- }
- function get_gep_data(gep) {
- $.post('/admin/gyartas/gepinfo/',{gep: gep},function(response) {
- $('#dialog').html(response);
- $('.wrapper').addClass('blur');
- $('#dialog').modal({
- escapeClose: true,
- clickClose: true,
- showClose: true
- });
- });
- }
- function get_cikknev_data(obj,target) {
- $.post('/admin/autocomplete/getcikknev/',{value: $(obj).val()},function(resp) {
- if (resp=='') {
- $(target).removeAttr('disabled');
- }
- else {
- $(target).val(resp);
- $(target).attr('disabled','true');
- }
- });
- }
- function get_cikkszam_data(obj,target) {
- $.post('/admin/autocomplete/getcikkszam/',{value: $(obj).val()},function(resp) {
- if (resp=='') {
- $(target).removeAttr('disabled');
- }
- else {
- $(target).val(resp);
- $(target).attr('disabled','true');
- }
- });
- }
- function set_admin_email_notifications(obj,id) {
- $.post('/admin/admins/notifications/',{id: id},function(resp) {});
- }
- function set_admin_creator(admin_id, creator_id) {
- $.post('/admin/admins/setcreator/',{admin_id: admin_id, admin_creator: creator_id},function(resp) {});
- }
- function add_new_referens() {
- $.get('/admin/ertekeles/referenskereses',function(resp) {
- $('#dialog').html(resp);
- $('.wrapper').addClass('blur');
- $('#dialog').modal({
- escapeClose: true,
- clickClose: true,
- showClose: true
- });
- $(".select2").select2({
- dropdownParent: $('#dialog')
- });
- });
- }
- function add_new_iroda() {
- $.get('/admin/irodak/irodakereses',function(resp) {
- $('#dialog').html(resp);
- $('.wrapper').addClass('blur');
- $('#dialog').modal({
- escapeClose: true,
- clickClose: true,
- showClose: true
- });
- $(".select2").select2({
- dropdownParent: $('#dialog')
- });
- });
- }
- function setIrodaState(id) {
- $.get('/admin/irodak/setstate/?id='+id,function(resp) {
- });
- }
- function add_agent_to_db(id) {
- $.get('/admin/ertekeles/addreferens/?id='+id,function(resp) {
- window.location='/admin/ertekeles/edit/?id='+resp;
- });
- }
- function add_iroda_to_db(id) {
- $.get('/admin/irodak/addiroda/?id='+id,function(resp) {
- window.location='/admin/irodak/edit/?id='+resp;
- });
- }
- function isNumber(evt) {
- evt = (evt) ? evt : window.event;
- var charCode = (evt.which) ? evt.which : evt.keyCode;
- if (charCode==46) {
- return true;
- }
- else {
- if (charCode > 31 && (charCode < 48 || charCode > 57)) {
- return false;
- }
- return true;
- }
- }
- function loadEvents(groupID) {
- if (groupID!=='') {
- $.get('/api/loadevents/?groupid=' + groupID,function(resp) {
- $('#parent_event').html(resp);
- });
- }
- }
- function loadMenu(eventID) {
- if (eventID!=='') {
- $.get('/api/loadmenus/?eventid=' + eventID,function(resp) {
- $('#parent_menu').html(resp);
- });
- }
- }
- function loadProds(groupID) {
- if (groupID!=='') {
- $.get('/api/loadprods/?groupid=' + groupID,function(resp) {
- $('#parent_prods').html(resp);
- });
- }
- }
- function loadMenuDetails(obj) {
- var label = $(obj).find(':selected').data('label');
- var description = $(obj).find(':selected').data('description');
- var price = $(obj).find(':selected').data('price');
- console.log(label, description, price);
- $('#box_title').val(label);
- $('#box_subtitle').val(description);
- $('#box_price').val(price);
- }
- $(document).ready(function() {
- $('.checkbtn').each(function() {
- //checkbtn_set_state($(this));
- });
-
- if (active_page.indexOf('beszerzes')==-1) {
- $('.radiobtn').each(function() {
- radiobtn_set_state($(this));
- });
- }
- $('#page_content').trumbowyg({
- btnsDef: {
- image: {
- dropdown: ['insertImage', 'upload'],
- ico: 'insertImage'
- }
- },
- btns: [
- ['viewHTML'],
- ['formatting'],
- ['foreColor', 'backColor'],
- ['strong', 'em', 'del'],
- ['superscript', 'subscript'],
- ['link'],
- ['image'],
- ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
- ['unorderedList', 'orderedList'],
- ['horizontalRule'],
- ['removeformat'],
- ['fullscreen']
- ],
- plugins: {
- upload: {
- serverPath: '/upload.php',
- fileFieldName: 'image',
- urlPropertyName: 'data.link'
- }
- }
- });
-
- $('#page_content_en').trumbowyg({
- btnsDef: {
- image: {
- dropdown: ['insertImage', 'upload'],
- ico: 'insertImage'
- }
- },
- btns: [
- ['viewHTML'],
- ['formatting'],
- ['foreColor', 'backColor'],
- ['strong', 'em', 'del'],
- ['superscript', 'subscript'],
- ['link'],
- ['image'],
- ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
- ['unorderedList', 'orderedList'],
- ['horizontalRule'],
- ['removeformat'],
- ['fullscreen']
- ],
- plugins: {
- upload: {
- serverPath: '/upload.php',
- fileFieldName: 'image',
- urlPropertyName: 'data.link'
- }
- }
- });
-
- $('#battle_start').datetimepicker();
- $('#battle_end').datetimepicker();
- check_for_prev_next();
-
- $('#dialog').on($.modal.BEFORE_CLOSE,function(event,modal) {
- $('.wrapper').removeClass('blur');
- });
-
- $('.roles').on('click',function(event) {
- var roleID = $(this).attr('data-role-id');
- var moduleID = $(this).attr('data-module-id');
- setModuleRoleStatus(roleID,moduleID);
- });
-
- $('.states').on('ifChecked',function(event) {
- var userID = $(this).val();
- setUserState(userID);
- });
-
- $('.states').on('ifUnchecked',function(event) {
- var userID = $(this).val();
- setUserState(userID);
- });
-
- $('.galery-image-item').on('mouseover',function() {
- $(this).children('.minimal').show();
- $(this).children('.deleter').show();
- });
-
- $('.galery-image-item').on('mouseout',function() {
- $(this).children('.minimal').hide();
- $(this).children('.deleter').hide();
- });
-
- $('.variation_status').on('ifChecked',function(event) {
- set_variation_status($(this),true);
- });
-
- $('.variation_status').on('ifUnchecked',function(event) {
- set_variation_status($(this),false);
- });
- $('.szuro').on('click',function() {
- var filter = '.'+$(this).val();
- $('.all').hide();
- $(filter).show();
- });
-
-
- $('.editable').on("click",function() {
- if (!$(this).hasClass('in-edit')) {
- $(this).addClass('in-edit');
- var actual_value = $(this).html();
- var currency = $(this).attr('data-currency');
-
- if (currency==='true') {
- actual_value = actual_value.replace(",- Ft","");
- actual_value = actual_value.replace(" ","");
- }
-
- var field_name = $(this).attr('data-field');
- var table_name = $(this).attr('data-table');
- var row_id = $(this).attr('data-id');
- var key = $(this).attr('data-key');
- $(this).html('<input type="text" name="'+field_name+'" id="'+field_name+'" value="'+actual_value+'" class="form-control edit" onblur="update_field($(this),\''+table_name+'\',\''+field_name+'\',\''+row_id+'\',\''+key+'\',\''+currency+'\')">');
- $('#'+field_name).focus();
- }
- });
-
-
- $(".select2").select2();
- $(".mypartner").select2({placeholder: 'Válasszon partnert!'});
-
- $(".fmachines").select2({placeholder: 'Válasszon gépet!'});
- $(".fparts").select2({placeholder: 'Válasszon részegységet!'});
-
- $(".myclient").select2({placeholder: 'Válasszon ügyfelet!'});
- $(".mypayment").select2({placeholder: 'Válasszon fizetési módot!'});
- $(".mycategory").select2({placeholder: 'Válasszon kategóriát!'});
-
-
- $('.datepicker').datepicker({
- autoclose: true
- });
-
- $('#cost_partner').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomplete/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
-
- $('#cost_client').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomplete/search_client/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('.rendeles_ugyfel').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomplete/search_client/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#filter_bill_number').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autobill/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#cost_bill_number').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autobill/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#beszer_beepites_cikkszam').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocikkszam/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#filter_comment').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomment/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
-
-
- $('#cost_egyseg_cikkszam').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomplete/cikkszam/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
-
- $('#cost_egyseg_nev').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autocomplete/cikknev/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
-
- $('#beszer_termek').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autotermek/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#beszer_anyagminoseg').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autominoseg/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#beszer_egyseg').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autoegyseg/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('#beszer_kategoria').autocomplete({
- source: function(request,response) {
- $.ajax({
- url: '/admin/autokategoria/search/',
- dataType: "jsonp",
- data: {
- term: request.term
- },
- success: function(data) {
- response(data);
- }
- });
- },
- minLength: 1
- });
- $('.uploadMe').on('click',function() {
- //$.post('/admin/bills/updatefile',{id: },function(response) {});
- });
-
-
- var msg_timer = setTimeout(function() {
- $('.callout-success').hide();
- },3000);
-
-
- $('#mytable').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable2').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable3').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_tech').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_rendelesek').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- //$('#mytable4').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- //$('#mytable5').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable6').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable7').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytablex').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytablex').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_s1').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_s2').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_s3').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- $('#mytable_s4').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- //$('#mytable_hotels_forselect').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
- //$('#mytable_hotels_selected').wrap('<div style="overflow-x: scroll;" id="scroller"></div>');
-
- $('.main-header').swipe({
- swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
- if ($('.skin-black').hasClass('sidebar-collapse')) {
- $('.skin-black').removeClass('sidebar-collapse');
- $('#fogantyu').css('left','0px');
- }
- else {
- $('.skin-black').addClass('sidebar-collapse');
- $('#fogantyu').css('left','230px');
- }
- if ($('.skin-black').hasClass('sidebar-open')) {
- $('.skin-black').removeClass('sidebar-open');
- }
- else {
- $('.skin-black').addClass('sidebar-open');
- }
- }
- });
-
-
- $('.main-sidebar').swipe({
- swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
- if ($('.skin-black').hasClass('sidebar-collapse')) {
- $('.skin-black').removeClass('sidebar-collapse');
- $('#fogantyu').css('left','0px');
- }
- else {
- $('.skin-black').addClass('sidebar-collapse');
- $('#fogantyu').css('left','230px');
- }
- if ($('.skin-black').hasClass('sidebar-open')) {
- $('.skin-black').removeClass('sidebar-open');
- }
- else {
- $('.skin-black').addClass('sidebar-open');
- }
- }
- });
- $('#fogantyu').swipe({
- swipe: function(event, direction, distance, duration, fingerCount, fingerData) {
- if ($('.skin-black').hasClass('sidebar-collapse')) {
- $('.skin-black').removeClass('sidebar-collapse');
- $('#fogantyu').css('left','0px');
- }
- else {
- $('.skin-black').addClass('sidebar-collapse');
- $('#fogantyu').css('left','230px');
- }
- if ($('.skin-black').hasClass('sidebar-open')) {
- $('.skin-black').removeClass('sidebar-open');
- }
- else {
- $('.skin-black').addClass('sidebar-open');
- }
- }
- });
-
-
- if (screen.width<767) {
- $('#coll-hack').addClass('collapsed-box');
- $('#coll-sign').removeClass('fa-minus');
- $('#coll-sign').addClass('fa-plus');
- }
-
- });
- $(window).resize(function() {
- if (screen.width<767) {
- $('#coll-hack').addClass('collapsed-box');
- $('#coll-sign').removeClass('fa-minus');
- $('#coll-sign').addClass('fa-plus');
- }
- else {
- $('#coll-hack').removeClass('collapsed-box');
- $('#coll-sign').removeClass('fa-plus');
- $('#coll-sign').addClass('fa-minus');
- }
- });
|