function loginForm() { $('popup').innerHTML = '

Přihlášení

\
\

\
\
\
\
\ \ \

\
'; Element.show('popup'); } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function getList(skupina){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=getlist&skupina='+skupina, onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')} }) } function getListtridit(skupina,trid){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=getlist&skupina='+skupina+'&seradit='+trid, onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')} }) } function getDetail(id){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=getdetail&id='+id, onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')} }) } function getMenu(){ new Ajax.Updater('menu', 'ajax.php', { method: 'post', parameters: 'akce=getmenu', onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')} }) } function Rename(tab, col, id, dat, func){ new Ajax.Updater('debug', 'ajax.php', { onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')}, method: 'post', parameters: 'akce=rename&tab='+tab+'&col='+col+'&id='+id+'&data='+dat, onSuccess:function(request) {eval(func)} }) } function addVyrobek(skupina){ $('popup').innerHTML = '

Nový výrobek

\
\

\ \
\ \
\ \
\ \
\ \
\ \
\ \
\ \ (0=není (skryje zboží), 1=ano,2=dočasně nedostupné)
\ \ \

\
'; Element.show('popup'); } function editVyrobek(id,katc, jmeno, popis, omezeni, extra,sklad, oldcena, cena){ jmeno = WebToolKit.url.decode(jmeno); katc = WebToolKit.url.decode(katc); popis = WebToolKit.url.decode(popis); omezeni = WebToolKit.url.decode(omezeni); extra = WebToolKit.url.decode(extra); sklad = WebToolKit.url.decode(sklad); $('popup').innerHTML = '

Editace výrobku

\
\

\ \
\ \
\ \
\ \
\ \
\ \
\ \
\ \ (0=není (skryje zboží), 1=ano,2=dočasně nedostupné)
\ \ \

\
'; Element.show('popup'); } function saveVyrobek(id, skupina){ Element.show('work'); Element.hide('popup'); new Ajax.Updater('debug', 'ajax.php', { method: 'post', parameters: 'akce=savevyrobek&id='+id+'&katc='+$F('katc')+'&jmeno='+$F('jmeno')+'&popis='+$F('popis')+'&cena='+$F('cena')+'&skupina='+skupina+'&omezeni='+$F('omezeni')+'&extra='+$F('extra')+'&oldcena='+$F('oldcena')+'&sklad='+$F('sklad'), onLoading:function(request){Element.show('work')}, onComplete:function(request){ Element.hide('work'); if(skupina) getList(skupina) else getDetail(id); } }) } function delVyrobek(id,skupina){ new Ajax.Updater('debug', 'ajax.php', { method: 'post', parameters: 'akce=delvyrobek&id='+id, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work'),getList(skupina)} }) } function delSkupina(id){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=delskupina&id='+id, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work');getMenu()} }) } function delPicx(vyrobek,id){ new Ajax.Updater('debug', 'ajax.php', { onLoading:function(request) {Element.show('work')}, onComplete:function(request) {Element.hide('work')}, method: 'post', parameters: 'akce=delpicx&id='+id }) getDetail(vyrobek); } function reloadKosik(){ new Ajax.Updater('kosik', 'ajax.php', { method: 'post', parameters: 'akce=reloadkosik', onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} });} function flushKosik(){ new Ajax.Updater('kosik', 'ajax.php', { method: 'post', parameters: 'akce=flushkosik', onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work');reloadKosik();} }); } function getKosik(){ Cobj = readCookie('Cobj'); if(Cobj){ showObj(Cobj); }else{ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=getkosik', onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} }) } } function Objednej(){ new Ajax.Updater('debug', 'ajax.php', { method: 'post', parameters: 'akce=objednej&jmeno='+$F('jmeno')+'&telefon='+$F('telefon')+'&email='+$F('email')+'&adresa='+$F('adresa')+'&doruceni='+$F('doruceni')+'&faktura='+$F('faktura')+'&poznamka='+$F('poznamka')+'&agree='+$F('agree'), onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work'); showObj($('debug').innerHTML); reloadKosik(); } }); } function confirmObj(){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=comfirmobj', onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work'); reloadKosik();} }); } function showObj(id){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=showobj&id='+id, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work');} }) } function changeStav(id,stav){ new Ajax.Updater('popup', 'ajax.php', { method: 'post', parameters: 'akce=changestav&id='+id+'&stav='+stav, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} }) Element.show('popup'); } function changeStav2(id, stav){ new Ajax.Updater('debug', 'ajax.php', { method: 'post', parameters: 'akce=changestav2&predmet='+$F('predmet')+'&zprava='+$F('zprava')+'&send='+$F('send')+'&id='+id+'&stav='+stav, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} }) showObj(id); Element.hide('popup'); } function delObj() { Element.show('work'); new Ajax.Updater('debug', 'ajax.php', { method: 'post', parameters: 'akce=delobj', onComplete:function(request) {reloadKosik();} }); $('data').innerHTML = ''; Element.hide('work'); } function checkObj(){ if($F('jmeno') && $F('telefon') && $F('email')){ Objednej(); }else{ window.alert('Nezadali jste všechny povinné údaje/Please, fill all necessary information in, thank you.'); } } function includeData(id){ new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=include&id='+id, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} }); } function listObj(from,filtr,noform){ if(noform != 'yes'){ filtr = $F('filtr'); from = $F('from'); } new Ajax.Updater('data', 'ajax.php', { method: 'post', parameters: 'akce=listobj&filtr='+filtr+'&from='+from, onLoading:function(request){Element.show('work')}, onComplete:function(request){Element.hide('work')} }); } function showPicx(url){ Element.show('work'); $('popup').innerHTML='
Obrázek výrobku
[zavřít]
'; Element.show('popup'); Element.hide('work'); }