%PDF- %PDF-
Direktori : /var/www/html/buggydubrovnik.com/prodaja/statistika/ |
Current File : //var/www/html/buggydubrovnik.com/prodaja/statistika/stexcursions.php |
<?php if (session_id() == "") { session_cache_expire(30); session_start(); } if (!isset($_SESSION['userx'])) { header('Location: ../auth.php'); exit; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="../jquery.js"></script> <script type="text/javascript" src="statsBL.js"></script> <link href="../glyphicons.css" type="text/css" rel="stylesheet"/> <script> jQuery(document).ready(function () { var sidemenu = $("#izborniklijevo"); jQuery("#toggleMenuButton").on("click", function () { if (sidemenu.hasClass("active")) { sidemenu.removeClass("active"); jQuery(this).removeClass("active"); } else { sidemenu.addClass("active"); jQuery(this).addClass("active"); } }); }); </script> <script language="JavaScript" type="text/javascript" src="../calendar_eu.js"></script> <link rel="stylesheet" href="../calendar.css"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link href="../style.css" rel="stylesheet" type="text/css"/> <link href="stats.css" type="text/css" rel="stylesheet"/> <title>STATISTIKA-EXCURSIONS</title> <script type="text/javascript"> var vari = ""; var index = 0; var ptablica = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); var pizleti = new Array(); function formatCurrency(num) { num = num.toString().replace(/\$|\,/g, ''); if (isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num * 100 + 0.50000000001); var cents = num % 100; num = Math.floor(num / 100).toString(); if (cents < 10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3)); return (((sign) ? '' : '-') + num + '.' + cents + ' Kn'); } function popuniDropdown() { MakeRequestLoadAllIzletTip(); pizleti = ParsirajSve(vari); var opt = document.createElement("option"); document.getElementById("sPartneri").options.add(opt); opt.text = "SVI IZLETI"; opt.value = "-1"; var opt = document.createElement("option"); document.getElementById("sPartneri").options.add(opt); opt.text = "----------------------------------------"; opt.value = "-1"; for (i = 0; i < pizleti['brojac']; i++) { var opt = document.createElement("option"); document.getElementById("sPartneri").options.add(opt); opt.text = pizleti['naziv' + i]; opt.value = i; } } function prikaziDiv() { index = document.getElementById('vrselect').selectedIndex; if ((index != 2) && (index != 3)) { document.getElementById('oddodiv').style.display = "none"; document.getElementById('vrazmakdiv').style.display = "none"; } if (index == 2) { document.getElementById('oddodiv').style.display = "none"; document.getElementById('vrazmakdiv').style.display = "inline"; } if (index == 3) { document.getElementById('oddodiv').style.display = "inline"; document.getElementById('vrazmakdiv').style.display = "none"; } } 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; } var odkad = ''; var dokad = ''; function PovuciPodatke() { var selectElement1 = document.getElementById('sPartneri'); var selectedValue1 = selectElement1[selectElement1.selectedIndex].value; var idizleta = 'SVI'; if (selectedValue1 != -1) { idizleta = pizleti['idizlettip' + selectedValue1]; } if (index == 3) { vrijednost = (document.unos.pocetak.value).split("-"); odkad = vrijednost[2] + '-' + vrijednost[1] + '-' + vrijednost[0]; vrijednost = (document.unos.kraj.value).split("-"); dokad = vrijednost[2] + '-' + vrijednost[1] + '-' + vrijednost[0]; } if (index == 2) { var vpocetak; var vkraj; vrijednost = (document.unos.pocetak1.value).split("-"); if (document.unos.vrazmak[0].checked) { odkad = vrijednost[2] + '-' + vrijednost[1] + '-' + vrijednost[0]; dokad = vrijednost[2] + '-' + vrijednost[1] + '-' + vrijednost[0]; } else if (document.unos.vrazmak[1].checked) { var dan = new Date(vrijednost[2], (parseInt(vrijednost[1], 10) - 1), vrijednost[0]); var DuT = dan.getDay(); if (DuT == 0) { vpocetak = new Date(vrijednost[2], (parseInt(vrijednost[1], 10) - 1), vrijednost[0]); vpocetak.setDate(vpocetak.getDate() - 6); odkad = vpocetak.getFullYear() + '-' + (vpocetak.getMonth() + 1) + '-' + vpocetak.getDate(); dokad = vrijednost[2] + '-' + vrijednost[1] + '-' + vrijednost[0]; } else { vpocetak = new Date(vrijednost[2], (parseInt(vrijednost[1], 10) - 1), vrijednost[0]); vpocetak.setDate(vpocetak.getDate() - (DuT - 1)); vkraj = new Date(vpocetak); vkraj.setDate(vpocetak.getDate() + 6); odkad = vpocetak.getFullYear() + '-' + (vpocetak.getMonth() + 1) + '-' + vpocetak.getDate(); dokad = vkraj.getFullYear() + '-' + (vkraj.getMonth() + 1) + '-' + vkraj.getDate(); } } else if (document.unos.vrazmak[2].checked) { odkad = vrijednost[2] + '-' + vrijednost[1] + '-01'; vkraj = new Date(vrijednost[2], vrijednost[1], 1); vkraj.setDate(vkraj.getDate() - 1); dokad = vkraj.getFullYear() + '-' + (vkraj.getMonth() + 1) + '-' + vkraj.getDate(); } else if (document.unos.vrazmak[3].checked) { odkad = vrijednost[2] + '-01-01'; dokad = vrijednost[2] + '-12-31'; } } if (index != 2 && index != 3) { datum = new Date(); odkad = datum.getFullYear() + '-01-01'; dokad = datum.getFullYear() + '-12-31'; } DohvatiStatistiku(odkad, dokad, 'izlet', 'izlet', idizleta); //alert (vari); podaci = ParsirajSve(vari); ptablica = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); for (i = 0; i < podaci['brojac']; i++) { ptablica[0] += parseInt(podaci['odrasli' + i]); ptablica[1] += parseInt(podaci['djeca' + i]); ptablica[3] += parseInt(podaci['cijenaodrasli' + i]); ptablica[4] += parseInt(podaci['cijenadjeca' + i]); //rabat odrasli ptablica[6] += parseInt(podaci['rabatodrasli' + i]); //rabat djeca ptablica[7] += parseInt(podaci['rabatdjeca' + i]); } //ukupan broj putnika ptablica[2] += ptablica[0] + ptablica[1]; //ukupni promet ptablica[5] += ptablica[3] + ptablica[4]; //ukupni rabat ptablica[8] += ptablica[6] + ptablica[7]; document.getElementById('brputod').innerHTML = ptablica[0]; document.getElementById('brputdj').innerHTML = ptablica[1]; document.getElementById('brputuk').innerHTML = ptablica[2]; document.getElementById('bpod').innerHTML = formatCurrency(ptablica[3]); document.getElementById('bpdj').innerHTML = formatCurrency(ptablica[4]); document.getElementById('bpuk').innerHTML = formatCurrency(ptablica[5]); document.getElementById('rod').innerHTML = formatCurrency(ptablica[6]); document.getElementById('rdj').innerHTML = formatCurrency(ptablica[7]); document.getElementById('ruk').innerHTML = formatCurrency(ptablica[8]); DohvatiStatistiku(odkad, dokad, 'izletbroj', 'izlet', idizleta); ostaliPodaci = ParsirajSve(vari); brvozuk = ostaliPodaci['brvozila0']; DohvatiStatistiku(odkad, dokad, 'vozilo', 'izlet', idizleta); ostaliPodaci = ParsirajSve(vari); var netoukupno = 0; var tvozilatekst = ""; var brojputuk = 0; var brvozuk = 0; //alert(vari); tvozilatekst = ' <table class="podaci" align="center" cellspacing="1" cellpadding="5" style=" border-width:1px; margin-top:25px; font-family:Verdana, Geneva, sans-serif; font-size:12px;color:#FFF; border-color:#FFF;"><tr height="30px" style="background-color:#002951;"><td width="100px" style="background-color:#FFF"></td><td style="background-image:url(../slike/tablecell1.jpg);" width="100px" align="center">Broj izleta</td><td width="100px" style="background-image:url(../slike/tablecell1.jpg);" align="center">Broj putnika</td><td style="background-image:url(../slike/tablecell1.jpg);" width="100px" align="center">Neto promet</td></tr>'; for (i = 0; i < ostaliPodaci['brojac']; i++) { netoukupno += Number(ostaliPodaci['netodobit' + i]); brojput = Number(ostaliPodaci['brodrasli' + i]) + Number(ostaliPodaci['brdjeca' + i]); brojputuk += brojput; brvozuk += Number(ostaliPodaci['brizleta' + i]); tvozilatekst += '<tr height="30"><td style="background-image:url(../slike/tablecell1.jpg); background-repeat:repeat-x; background-color:#005fbb; background-position:top;">' + ostaliPodaci['naziv' + i] + ' ' + ostaliPodaci['registracija' + i] + '</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">' + ostaliPodaci['brizleta' + i] + '</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">' + brojput + '</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">' + formatCurrency(ostaliPodaci['netodobit' + i]) + '</td></tr>'; } tvozilatekst += '<tr height="2px"><td colspan="4"></td></tr> <tr height="30"><td style=" background-image:url(../slike/tablecell1.jpg);">UKUPNO</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>' + brvozuk + '</b></td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>' + brojputuk + '</b></td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>' + formatCurrency(netoukupno) + '</b></td></tr>'; document.getElementById('tvozila').innerHTML = tvozilatekst + '</table>'; tpartneritekst = '<table class="podaci" align="center" cellspacing="1" cellpadding="5" style=" border-width:1px; margin-top:25px; color:#FFF; font-family:Verdana, Geneva, sans-serif; font-size:12px; border-color:#FFF;"><tr height="30px" style="background-color:#002951;"><td width="250px" style="background-color:#FFF"></td><td style="background-image:url(../slike/tablecell1.jpg);" width="250px" align="center">Broj putnika</td></tr>'; var partbrojputuk = 0; DohvatiStatistiku(odkad, dokad, 'partner', 'izlet', idizleta); ostaliPodaci = ParsirajSve(vari); for (i = 0; i < ostaliPodaci['brojac']; i++) { brojput = Number(ostaliPodaci['brodraslih' + i]) + Number(ostaliPodaci['brdjece' + i]); partbrojputuk += brojput; tpartneritekst += '<tr height="30"><td style="background-image:url(../slike/tablecell1.jpg); background-repeat:repeat-x; background-color:#005fbb; background-position:top;">' + ostaliPodaci['naziv' + i] + '</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">' + brojput + '</td></tr>'; } tpartneritekst += ' <tr height="30"><td style=" background-image:url(../slike/tablecell1.jpg);">UKUPNO</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>' + partbrojputuk + '</b></td></tr>'; document.getElementById('partbrput').innerHTML = tpartneritekst + '</table>'; } function CallPrint(strid) { var selectElement2 = document.getElementById('sPartneri'); var tpartner = selectElement2[selectElement2.selectedIndex].text; var datum = new Date(); tdatum = datum.getFullYear() + '-' + (parseInt(datum.getMonth()) + 1) + '-' + datum.getDate(); vrijednost = (tdatum.split("-")); datumt = vrijednost[2] + '.' + vrijednost[1] + '.' + vrijednost[0] + '.'; vrijednost = (odkad.split("-")); odkadt = vrijednost[2] + '.' + vrijednost[1] + '.' + vrijednost[0] + '.'; vrijednost = (dokad.split("-")); dokadt = vrijednost[2] + '.' + vrijednost[1] + '.' + vrijednost[0] + '.'; var prtContent = document.getElementById(strid); var WinPrint = window.open('', '', 'left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write('<div style="margin:0 auto; font-weight:bold; text-align:center"><span style="font-family:Arial"><table class="podaci" align="center" style="font-family:Verdana; font-size:12px;"><tr><td align="left" width="200px" >Datum:</td><td> <b>' + datumt + '</b></td></tr><tr><td align="left" width="200px" >Period:</td><td> <b>' + odkadt + ' - ' + dokadt + '</b></td></tr><tr><td align="left" width="200px">Izlet:</td><td> <b>' + tpartner + '</b></td></tr></table></span></div>' + prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); prtContent.innerHTML = strOldOne; } </script> </head> <body onload="javascript:popuniDropdown();" style=" margin:0 auto;"> <div id="gornjatraka"> <span id="toggleMenuButton"></span> <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"><span class="glyphicon glyphicon-home"></span><a href="../start.php"> Glavni izbornik</a> </div> <div class="izbornik"><span class="glyphicon glyphicon-stats"></span> <a href="index.php"> Grafovi</a></div> <div class="izbornik"><span class="glyphicon glyphicon-map-marker"></span> <a href="stexcursions.php"> Statistika Izlet</a></div> <div class="izbornik"><span class="glyphicon glyphicon-briefcase"></span> <a href="stpart.php"> Statistika Partner</a></div> <div class="izbornik"><span class="glyphicon glyphicon-user"></span> <a href="stvodici.php"> Statistika Vodič</a></div> <div class="izbornik"><span class="glyphicon glyphicon-road"></span> <a href="stvozaci.php"> Statistika Vozač</a></div> <div class="izbornik"><span class="glyphicon glyphicon-plane"></span> <a href="stvozila.php"> Statistika Vozila</a></div> <div class="izbornik"><span class="glyphicon glyphicon-euro"></span> <a href="obracuni.php"> Obračuni</a></div> </div> <div id="tijelo"> <h1 class="title">STATISTIKA IZLET</h1> <div id="dropdown1"> <table align="center" class="podaci" cellspacing="1" cellpadding="5" style=" border-width:1px; font-family:Verdana, Geneva, sans-serif; font-size:12px; margin-top:25px; color:#FFF; border-color:#FFF;"> <tr height="30px" style="background-color:#002951;"> <td width="100px" style="background-color:#FFF"></td> <td style="background-image:url(../slike/tablecell1.jpg);" width="100px" align="center">ODRASLI</td> <td width="100px" style="background-image:url(../slike/tablecell1.jpg);" align="center">DJECA</td> <td style="background-image:url(../slike/tablecell1.jpg);" width="100px" align="center">UKUPNO</td> </tr> <tr height="30"> <td style=" background-image:url(../slike/tablecell1.jpg);">BROJ PUTNIKA</td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="brputod" style="text-align:center; ;"></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="brputdj" style="text-align:center; ; "></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="brputuk" style="text-align:center; ;"></div> </td> </tr> <tr height="30"> <td style=" background-image:url(../slike/tablecell1.jpg);">BRUTO PROMET</td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="bpod" style="text-align:center; "></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="bpdj" style="text-align:center; ;"></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="bpuk" style="text-align:center; ;"></div> </td> </tr> <tr height="30"> <td style=" background-image:url(../slike/tablecell1.jpg);">RABAT</td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="rod" style="text-align:center; "></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="rdj" style="text-align:center; "></div> </td> <td style="background-image:url(../slike/tablecell3.jpg);"> <div id="ruk" style="text-align:center; ; "></div> </td> </tr> </table> <br/><br/> <div id="tvozila"></div> <br/><br/> <div id="partbrput"></div> <br/><br/> </div> <div id="desno1"><br/> <A HREF="javascript:CallPrint('dropdown1');"><b><img border="0" src="../slike/print.png" style="vertical-align:middle"/> PRINT</b></A><br/><br/> <form name="unos"> <table class="podaci" style="margin-left:15px;"> <tr> <td style="width:150px;"><select id="sPartneri" onchange="PrikaziJednog();"></select> <br/> <br/><br/><select onchange="javascript:prikaziDiv();" id="vrselect"> <option>Odaberite format</option> <option>------------------------</option> <option value="1"><b>Zadani periodi</b></option> <option value="2"><b>Odabir datuma</b></option> </select> <br/> <br/><br/> <div id="vrazmakdiv">Početni datum:<br/><input style="max-width:90px;" name="pocetak1" type="text"/> <script type="text/javascript"> new tcal({ // form name 'formname': 'unos', // input name 'controlname': 'pocetak1' }); </script> <br/> <input type="radio" name="vrazmak"/> Dan<br/> <input type="radio" name="vrazmak"/> Tjedan<br/> <input type="radio" name="vrazmak"/> Mjesec<br/> <input type="radio" name="vrazmak"/> Godina<br/></div> <div id="oddodiv">Početni datum:<br/><input style="max-width:90px;" name="pocetak" type="text"/> <script type="text/javascript"> new tcal({ // form name 'formname': 'unos', // input name 'controlname': 'pocetak' }); </script> <br/> Krajnji datum:<br/><input style="max-width:90px;" name="kraj" type="text"/> <script type="text/javascript"> new tcal({ // form name 'formname': 'unos', // input name 'controlname': 'kraj' }); </script> </div> </td> </tr> </table> </form> <br/><br/> <button class="button" onclick="PovuciPodatke();">PRIKAŽI</button> </div> </div> </div> </body> </html>