%PDF- %PDF-
Direktori : /var/www/html/buggydubrovnik.com/prodaja/ |
Current File : //var/www/html/buggydubrovnik.com/prodaja/unprodavac.php |
<?php if (session_id() == ""){ session_cache_expire(30); session_start(); } if(!isset($_SESSION['userx']) && !isset($_SESSION['user'])) {header( 'Location: auth.php' ) ; exit;} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="style.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>EXCURSIONS-PRODAVAČI</title> <script language="JavaScript" type="text/javascript" src="businesslayer.js"></script> <script type="text/javascript"> var vari = ""; var podaci=new Array(); var pProdavac=new Array(); function ParsirajSve(value) { value = value.split("##"); for (var i = 0; i < value.length; i++) { var tmp = value[i].split("=="); value[tmp[0]] = tmp[1]; } return value; } function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); } function Prikazi() { var formObj = document.forms['partner']; formObj.sPartneri.options.length = 0; formObj.sProdajnamjesta.options.length = 0; formObj.sProdavaci.options.length = 0; document.getElementById("ime").value=""; document.getElementById("komentar").value=""; document.getElementById('bpromijeni').style.display="none"; document.getElementById('bunesi').style.display="none"; MakeRequestLoadAllPartner(); //`IDPartner``naziv``puniNaziv``oib``adresa``odgovornaOs podaci = ParsirajSve(vari); var opt = document.createElement("option");document.getElementById("sPartneri").options.add(opt); opt.text = "ODABERITE PARTNERA"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sPartneri").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; for(i=0;i<podaci['brojac'];i++) { var opt = document.createElement("option"); document.getElementById("sPartneri").options.add(opt); opt.text = podaci['naziv'+i]; opt.value =podaci['idpartner'+i]; } var opt = document.createElement("option");document.getElementById("sProdajnamjesta").options.add(opt); opt.text = "ODABERITE PRODAJNO MJESTO"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sProdajnamjesta").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sProdavaci").options.add(opt); opt.text = "ODABERITE PRODAVAČA"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sProdavaci").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; } function OdaberiPartnera(){ var formObj = document.forms['partner']; formObj.sProdajnamjesta.options.length = 0; formObj.sProdavaci.options.length = 0; document.getElementById("ime").value=""; document.getElementById("komentar").value=""; var opt = document.createElement("option"); document.getElementById("sProdajnamjesta").options.add(opt); opt.text = 'ODABERITE PRODAJNO MJESTO'; opt.value = -1; var opt = document.createElement("option"); document.getElementById("sProdajnamjesta").options.add(opt); opt.text = '-----------------------------------------'; opt.value = -1; selectElement1 = document.getElementById('sPartneri'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; if(selectedValue1 != -1){ MakeRequestLoadPKProdajnoMj(selectedValue1); pProdajnamjesta = ParsirajSve(vari); for(i=0;i<pProdajnamjesta['brojac'];i++) { var opt = document.createElement("option"); document.getElementById("sProdajnamjesta").options.add(opt); opt.text = pProdajnamjesta['naziv'+i]; opt.value = pProdajnamjesta['idprodajnomj'+i]; } } var opt = document.createElement("option");document.getElementById("sProdavaci").options.add(opt); opt.text = "ODABERITE PRODAVAČA"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sProdavaci").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; } function OdaberiProdajno(){ var formObj = document.forms['partner']; formObj.sProdavaci.options.length = 0; document.getElementById("ime").value=""; document.getElementById("komentar").value=""; var opt = document.createElement("option"); document.getElementById("sProdavaci").options.add(opt); opt.text = 'ODABERITE PRODAVAČA'; opt.value = -1; var opt = document.createElement("option"); document.getElementById("sProdavaci").options.add(opt); opt.text = '-----------------------------------------'; opt.value = -1; selectElement1 = document.getElementById('sProdajnamjesta'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; if(selectedValue1 != -1){ MakeRequestLoadPKProdavac(selectedValue1); pProdavac = ParsirajSve(vari); for(i=0;i<pProdavac['brojac'];i++) { var opt = document.createElement("option"); document.getElementById("sProdavaci").options.add(opt); opt.text = pProdavac['ime'+i]; opt.value = i; } document.getElementById('bpromijeni').style.display="none"; document.getElementById('bunesi').style.display="inline"; } } function OdaberiProdavac(){ selectElement1 = document.getElementById('sProdavaci'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; document.getElementById("ime").value=""; document.getElementById("komentar").value=""; if(selectedValue1 != -1){ document.getElementById("ime").value=pProdavac['ime'+selectedValue1]; document.getElementById("komentar").value=pProdavac['komentar'+selectedValue1]; document.getElementById('bpromijeni').style.display="inline"; document.getElementById('bunesi').style.display="none"; } } function unesi() { selectElement1 = document.getElementById('sPartneri'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; selectElement2 = document.getElementById('sProdajnamjesta'); selectedValue2 = selectElement2[selectElement2.selectedIndex].value; if(confirm("Unijeti prodavača u bazu? ") && (selectedValue1 != -1)&& (selectedValue2 != -1) &&(document.getElementById("ime").value.length>1 && document.getElementById("komentar").value.length>1) ) { MakeRequestInsertProdavac( 0, selectedValue2 , document.getElementById("ime").value, document.getElementById("komentar").value , 1,1,1); alert('Prodavač je unesen, možete odmah upisati podatke za novog prodavača za isto prodajno mjesto'); OdaberiProdajno(); } } function promijeni() { selectElement1 = document.getElementById('sPartneri'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; selectElement2 = document.getElementById('sProdajnamjesta'); selectedValue2 = selectElement2[selectElement2.selectedIndex].value; selectElement3 = document.getElementById('sProdavaci'); selectedValue3 = selectElement3[selectElement3.selectedIndex].value; if(confirm("Promijeniti prodavača? ") && (selectedValue1 != -1)&& (selectedValue2 != -1) && (selectedValue3 != -1) &&(document.getElementById("ime").value.length>1 && document.getElementById("komentar").value.length>1) ) { MakeRequestUpdateProdavac( pProdavac['IDProdajnoMjP'+selectedValue3], selectedValue2 , document.getElementById("ime").value, document.getElementById("komentar").value , 1,1,1); alert('Promijenili ste prodavača'); OdaberiProdajno(); } } function brisiprodavaca() { selectElement1 = document.getElementById('sPartneri'); selectedValue1 = selectElement1[selectElement1.selectedIndex].value; selectElement2 = document.getElementById('sProdajnamjesta'); selectedValue2 = selectElement2[selectElement2.selectedIndex].value; selectElement3 = document.getElementById('sProdavaci'); selectedValue3 = selectElement3[selectElement3.selectedIndex].value; if(confirm("Izbrisati prodavača? ") && (selectedValue1 != -1)&& (selectedValue2 != -1) && (selectedValue3 != -1) &&(document.getElementById("ime").value.length>1 && document.getElementById("komentar").value.length>1) ) { MakeRequestDeleteProdavac( pProdavac['IDProdajnoMjP'+selectedValue3]); alert('Izbrisali ste prodavača'); OdaberiProdajno(); } } </script> </head> <body onload="Prikazi();" style=" margin:0 auto;"> <div id="gornjatraka"> <div style="float:right; margin-right:5px;padding-top:55px;">Prijavljeni ste kao <b><?php if (isset($_SESSION['user'])){ echo $_SESSION['user'];} else{ echo $_SESSION['userx'];}?></b></div> </div> <div id="main"> <div id="izborniklijevo"> <div class="izbornik"><img src="slike/home.png" style="vertical-align:middle" /> <a href="start.php"> Glavni izbornik</a> </div> <div class="izbornik"><img src="slike/filer.png" style="vertical-align:middle" /> <a href="excursions.php"> Izleti početna</a></div> <div class="izbornik"><img src="slike/uizlet.png" style="vertical-align:middle" /> <a href="krizlet.php"> Kreiraj izlet</a></div> <div class="izbornik"><img src="slike/pin.png" style="vertical-align:middle" /> <a href="unmjkuplj.php"> Mjesta kupljenja</a></div> <div class="izbornik"><img src="slike/partner.png" style="vertical-align:middle" /> <a href="unpart.php"> Unos partnera</a></div> <div class="izbornik"><img src="slike/bus.png" style="vertical-align:middle" /> <a href="unvozila.php"> Unos vozila</a></div> <div class="izbornik"><img src="slike/vodic.png" style="vertical-align:middle" /><a href="unvodica.php"> Unos vodiča</a></div> <div class="izbornik"><img src="slike/wheel.png" style="vertical-align:middle" /> <a href="unvozaca.php"> Unos vozača</a></div> <div class="izbornik"><img src="slike/vodic.png" style="vertical-align:middle" /><a href="unprodavac.php"> Unos prodavaca</a></div> </div> <div id="tijelo"> <div style="width:100%; margin-bottom:25px; font-size:18px; color:#333; text-decoration:underline; text-align:left; padding-top:20px;">UNOS PRODAVAČA</div> <div id="dropdown"> <form name="unos" action=""> <table> <tr><td>Ime:</td><td><input name="ime" id="ime" type="text" /></td></tr> <tr> <td>Komentar:</td><td><textarea name="komentar" id="komentar" style=" text-align:left; height:125px; width:250px;" type="text" ></textarea></td></tr> <tr><td></td><td><input name="id" type="hidden" /></td></tr> <tr><td colspan="2" height="20px;" align="center"></td></tr> <tr><td align="center" ></td><td><div id="bpromijeni"><img onclick="javascript:promijeni();" style="cursor:pointer;" src="slike/spremi.jpg" /></div> <div id="bunesi"><img onclick="javascript:unesi();" style="cursor:pointer;" src="slike/unesi.jpg" /></div></td></tr> </table> </form> </div> <div id="desno"> <a href="javascript:brisiprodavaca();"><img src="slike/x.png" style="vertical-align:middle;" border="0"/></a> <br /> <form name="partner"><select id="sPartneri" onchange="OdaberiPartnera();"></select> <br /><br /> <select id="sProdajnamjesta" onchange="OdaberiProdajno();"></select> <br /><br /> <select id="sProdavaci" onchange="OdaberiProdavac();"></select> <br /><br /> </form> <br /><br /><img src="slike/unosnovog.jpg" onclick="javascript:location.reload(true);" style="cursor:pointer;" /> </div> <div id="skriveni" style="visibility:hidden"></div> </div> </div> </body> </html>