%PDF- %PDF-
Direktori : /var/www/html/buggydubrovnik.com/prodaja/ |
Current File : //var/www/html/buggydubrovnik.com/prodaja/nalog.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> <?php $idizlet = $_GET["idizlet"];$idvozilo = $_GET["idvozilo"];?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Putni nalog</title> <link rel="stylesheet" href="style.css" /> <script language="JavaScript" type="text/javascript" src="businesslayer.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="jquery.js"></script> <script> $(document).ready(function(){ var sidemenu=$("#izborniklijevo") $("#toggleMenuButton").on("click", function(){ if(sidemenu.hasClass("active")) { sidemenu.removeClass("active") $(this).removeClass("active") } else { sidemenu.addClass("active") $(this).addClass("active") } }) }) </script> <script type="text/javascript"> var vari = ""; var idpn = 0; var pn =""; var ispis=""; 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 printaj(){ document.getElementById("printlink").style.visibility='hidden'; document.getElementById("mail").style.visibility='hidden'; window.print(); document.getElementById("printlink").style.visibility='visible'; document.getElementById("mail").style.visibility='visible'; } function Prikazi() { //DA li postoji vec putni nalog DohvatiPN(<?php echo $idizlet.','.$idvozilo ;?>); //document.write(vari); if(vari.length>1) { pn=ParsirajSve(vari); if(pn['izletorganizacija'].length >0 ) { idpn =pn['izletorganizacija'].length; } } //alert(vari);alert(pn);alert(pn['izletorganizacija']); MakeRequestLoadPKIzletJED('<?php echo $idizlet;?>'); izlet=ParsirajSve(vari); document.getElementById('nizlet').innerHTML='<span style="font-size:16px;"><b>Naziv usluge: Dubrovnik - '+izlet['naziv0']+', '+izlet['datum0']+'</b></span><br /><br />'; MakeRequestLoadPKVozilo('<?php echo $idvozilo; ?>'); vozilo=ParsirajSve(vari); document.getElementById('nvozilo').innerHTML='<span style="font-size:16px;"><b>Vozilo: '+vozilo['naziv']+', '+vozilo['registracija']+'</b></span><br /><br />'; MakeRequestLoadAllZaposlenikVodic(); podaci = ParsirajSve(vari); var opt = document.createElement("option");document.getElementById("sPartneri").options.add(opt); opt.text = "ODABERITE VODIČA"; 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['ime'+i]+' '+podaci['prezime'+i]+' '+podaci['kontakt'+i];; opt.value = podaci['idzaposlenik'+i]; } document.getElementById("sPartneri").value = "2"; PrikaziMail(); MakeRequestLoadAllZaposlenik(); podaci = ParsirajSve(vari); var opt = document.createElement("option");document.getElementById("sPartneri1").options.add(opt); opt.text = "ODABERITE VOZAČA"; opt.value = "-1"; var opt = document.createElement("option");document.getElementById("sPartneri1").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; for(i=0;i<podaci['brojac'];i++) { var opt = document.createElement("option"); document.getElementById("sPartneri1").options.add(opt); opt.text = podaci['ime'+i]+' '+podaci['prezime'+i]+' '+podaci['kontakt'+i]; opt.value =podaci['idzaposlenik'+i]; } document.getElementById("sPartneri1").value = "3"; MakeRequestLoadPKRezervacijaIZVO('<?php echo $idizlet;?>','<?php echo $idvozilo; ?>'); //idrezervacija, idizlet, idprodajnogmj, idmjkupljenja, vrijeme, odrasli, djeca, cijenaodrasli, cijenadjeca, kontakt, napomena, broj, tekst(mjkupljenja),naziv(prod.mjesto) podaci = ParsirajSve(vari);//alert(vari); ispis='<table cellspacing="2" cellpadding="5" border="1" style="border-collapse:collapse; border-color:#000; color:#000;"><tr><td width="75px"><b>Vrijeme</b></td><td width="150px"><b>Mjesto kupljenja</b></td><td width="20px"><b>Odrasli</b></td><td width="20px"><b>Djeca</b></td><td width="150px"><b>Ukupno</b></td><td width="150px"><b>Kontakt</b></td><td width="200px"><b>Napomena</b></td></tr>'; var ukupno=0; var ukupnodj=0; var ukupnood=0; for(i=0;i<podaci['brojac'];i++){ ukupno=0; ukupno = parseInt(podaci['odrasli'+i])+parseInt(podaci['djeca'+i]); ukupnodj+=parseInt(podaci['djeca'+i]); ukupnood+=parseInt(podaci['odrasli'+i]); ispis+='<tr><td width="75px">'+podaci['vrijeme'+i]+'</td><td width="150px">'+podaci['tekst'+i]+'</td><td width="20px">'+podaci['odrasli'+i]+'</td><td width="20px">'+podaci['djeca'+i]+'</td><td width="150px">'+ukupno+'</td><td >'+podaci['kontakt'+i]+'</td><td>'+podaci['napomena'+i]+'</td></tr>'; } ispis+='<tr><td width="75px"> <b>UKUPNO PUTNIKA</b></td><td width="150px"> </td><td width="20px">'+ukupnood+'</td><td width="20px">'+ukupnodj+'</td><td width="150px">'+(parseInt(ukupnood)+parseInt(ukupnodj))+'</td><td width="150px"></td><td align="left" ></td></tr></table>'; document.getElementById("tijelo1").innerHTML=ispis; // Ako je postojeci zapis odaberi ljude iz drop down-a if (parseInt(idpn)>0) { var vd = 0; for (vd=0; vd<document.getElementById("sPartneri").options.length; vd++) { if ( document.getElementById("sPartneri").options[vd].value == pn['idzapt1'] ) { document.getElementById("sPartneri").options[vd].selected = true;} } for (vd=0; vd<document.getElementById("sPartneri1").options.length; vd++) { if ( document.getElementById("sPartneri1").options[vd].value == pn['idzapv1'] ) { document.getElementById("sPartneri1").options[vd].selected = true;} } PrikaziMail(); } } function Pohrani() { var selectElement1 = document.getElementById('sPartneri'); var idzapt1 = selectElement1[selectElement1.selectedIndex].value; var selectElement2 = document.getElementById('sPartneri1'); var idzapv1 = selectElement2[selectElement2.selectedIndex].value; if (parseInt(idpn)==0) { MakeRequestInsertIzletOrganizacija( 0,<?php echo $idizlet ?>, <?php echo $idvozilo ?>, idzapv1, 0, idzapt1, 0, 1, ""); idpn= parseInt(vari); //alert(vari); } else { MakeRequestUpdateIzletOrganizacija( idpn,<?php echo $idizlet ?>, <?php echo $idvozilo ?>, idzapv1, 0, idzapt1, 0, 1, ""); } alert('Zapis je pohranjen'); } function Pohranimail() { var selectElement1 = document.getElementById('sPartneri'); var idzapt1 = selectElement1[selectElement1.selectedIndex].value; var idzapt1tx = selectElement1[selectElement1.selectedIndex].text; var selectElement2 = document.getElementById('sPartneri1'); var idzapv1 = selectElement2[selectElement2.selectedIndex].value; var idzapv1tx = selectElement2[selectElement2.selectedIndex].text; if (parseInt(idpn)==0) { MakeRequestInsertIzletOrganizacija( 0,<?php echo $idizlet ?>, <?php echo $idvozilo ?>, idzapv1, 0, idzapt1, 0, 1,document.mail.email.value); idpn= parseInt(vari); //alert(vari); } else { MakeRequestUpdateIzletOrganizacija( idpn,<?php echo $idizlet ?>, <?php echo $idvozilo ?>, idzapv1, 0, idzapt1, 0, 1, document.mail.email.value); } var mailsla= document.mail.email.value; var message = ''; message =message +"Vozilo: "+document.getElementById("nvozilo").innerHTML+"Dubrovnik - "+document.getElementById("nizlet").innerHTML+'<br /><br />Vozač : <b>'+idzapv1tx+'</b><br /><br />Vodič : <b>'+idzapt1tx+'</b><br /> <br /><br />'; message+=ispis; message=message.replace('&','and'); //document.getElementById('gornjatraka').innerHTML=message; Posaljimail(mailsla, message); alert('Zapis je pohranjen, mail poslan'); } function PrikaziMail() { var selectElement1 = document.getElementById('sPartneri'); var idzapt1 = selectElement1[selectElement1.selectedIndex].value; if(parseInt(idzapt1)>0){ MakeRequestLoadPKZaposlenik(idzapt1); var pod = ParsirajSve(vari); document.mail.email.value=pod['mail'];} } function Posaljimail(msl,msg) { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { vari = xmlHttp.responseText; } } var parameters="email="+msl+"&message="+msg; xmlHttp.open("POST", "sendemail.php", false); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //xmlHttp.setRequestHeader("Content-length", parameters.length); //xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(parameters); } </script> </head> <body onload="Prikazi();" style="font-family:Verdana, Geneva, sans-serif; font-size:12px;"> <div id="gornjatraka" style="margin-bottom:20px"> <span id="toggleMenuButton"></span> <div id="nizlet" style="float:left; width:100%;"></div> <div id="nvozilo" style="float:left; width:100%;"></div> <div> <form name="partner">Vodič: <select id="sPartneri" onchange="PrikaziMail();"></select><br /><br /> Vozač: <select id="sPartneri1" ></select></form><br /><br /> </div> <div id="tijelo1"></div><div style="float:left; width:100%;"> Stanje brojila na polasku: __________ <br /> Stanje brojila na povratku: __________ <br /><br /> Na put sam krenuo: _________ u ______ h<br /> S puta sam se vratio: _________ u ______ h<br /><br /> Na putu sam proveo: _________ h, što čini ______ dnevnica po kn<br /><br /> <b>Troškovi</b><br /><br /> Dnevnice : __________ kn<br /> __________: __________ kn<br /> __________: __________ kn<br /> __________: __________ kn<br /><br /> <b>Ukupno troškovi: </b> ____________ kn<br /><br /> Datum sastavljanja: __________ <br /><br /> Potpis vozača: ______________ <br /><br /><br /> Ovaj dokument je sačinjen u elektronskom obliku i kao takav punovažan bez pečata. <A id="printlink" HREF="javascript:printaj()"><br /><br /><br /><br /><b><img border="0" src="slike/print.png" style="vertical-align:middle" /> PRINT</b></A> <form id="mail" name="mail" method="post" onsubmit="Pohranimail();"><br /> <input type="hidden" name="message" /> <img src="slike/email.png" style="vertical-align:middle" /> <b>E-MAIL</b> :<input type="text" name="email" /><input type="submit" value="Pošalji" /> </form> </div> <div id="tijelo2"></div> <?php $message='<span style="font-size:16px;"><b>Mercedes Viano DU 889 DS</b></span><br /><br /> Izlet : <b>Mostar</b><br /><br /> Vozač : <b>Ivan Ivic 098 999</b><br /><br /> Vodič : <b>Ivan Grbic 098 999</b><br /> <br /><br /> <table cellspacing="2" cellpadding="5" border="1" style="border-collapse:collapse; border-color:#000;" ><tr><td width="75px"><b>Vrijeme</b></td><td width="150px"><b>Mjesto kupljenja</b></td><td width="20px"><b>Odrasli</b></td><td width="20px"><b>Djeca</b></td><td width="150px"><b>Ukupno</b></td><td width="150px"><b>Mjesto prodaje</b></td><td width="150px"><b>Kontakt</b></td><td width="200px"><b>Napomena</b></td></tr> <tr><td width="75px"> 08:00</td><td width="150px"> H. Hilton</td><td width="20px"> 2</td><td width="20px"> 0</td><td width="150px">2</td><td width="150px"> H.Hilton</td><td >099587887</td><td align="center" ></td></tr> <tr><td width="75px"> 08:10</td><td width="150px"> H. Petka</td><td width="20px">3</td><td width="20px"> 1</td><td width="150px">4</td><td width="150px"> H.Petka</td><td >09987557</td><td align="left" >Napomena nsjs sddd dffd</td></tr> <tr><td width="75px"> <b>UKUPNO PUTNIKA</b></td><td width="150px"> </td><td width="20px">5</td><td width="20px">1</td><td width="150px">6</td><td width="150px"></td><td ></td><td align="left" ></td></tr> </table> '; ?> </body> </html>