%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/buggydubrovnik.com/prodaja/statistika/
Upload File :
Create Path :
Current File : //var/www/html/buggydubrovnik.com/prodaja/statistika/stvozaci.php

<?php

	if (session_id() == ""){

		session_cache_expire(30);

		session_start();

	}

if(!isset($_SESSION['userx']))

 		{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>

<script type="text/javascript" src="statsBL.js" ></script>

<script src="../jquery.js"></script>

<link href="../glyphicons.css" type="text/css" rel="stylesheet"/>

<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 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" rel="stylesheet" type="text/css"/>

<title>STATISTIKA-VOZAČI</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);

	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("sIzleti").options.add(opt);

		opt.text = "SVI IZLETI";

        opt.value = "-1";

		

	var opt = document.createElement("option");document.getElementById("sIzleti").options.add(opt);

		opt.text = "----------------------------------------";

        opt.value = "-1";

		

	for(i=0;i<pizleti['brojac'];i++)

	{

		var opt = document.createElement("option");

		document.getElementById("sIzleti").options.add(opt);

		opt.text = pizleti['naziv'+i];

        opt.value = i;

	} 			

	

	MakeRequestLoadAllZaposlenik();

	pvodici = ParsirajSve(vari);

	

	var opt = document.createElement("option");document.getElementById("sVodici").options.add(opt);

		opt.text = "SVI VOZAČI";

        opt.value = "-1";

		

	var opt = document.createElement("option");document.getElementById("sVodici").options.add(opt);

		opt.text = "----------------------------------------";

        opt.value = "-1";

	for(i=0;i<pvodici['brojac'];i++)

	{

		var opt = document.createElement("option");

		document.getElementById("sVodici").options.add(opt);

		opt.text = pvodici['prezime'+i] + ' ' + pvodici['ime'+i];

        opt.value = i;

	} 			

}	



	

function prikaziDiv(){

	index = document.getElementById('vrselect').selectedIndex;

	

	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";}

	

	 if((index!=2)&&(index!=3)) {document.getElementById('oddodiv').style.display="none";document.getElementById('vrazmakdiv').style.display="none";}

}





function Prikaziskriveni(){

	iprikaz = document.getElementById('vodabir').selectedIndex;

	

	if(iprikaz!=0) {document.getElementById('skrivenidio').style.display="inline";}

	

	if(iprikaz ==0) {document.getElementById('skrivenidio').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 iprikaz = document.getElementById('vodabir').selectedIndex;

 

 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&&index!=3) {

  datum = new Date();

 odkad = datum.getFullYear() + '-01-01';

 dokad = datum.getFullYear() + '-12-31';

 }

 

 if(index==2){ 

	var vpocetak;

	var vkraj;

	vrijednost = (document.unos.pocetak1.value).split("-"); 

   //za dan

	if(document.unos.vrazmak[0].checked){	

		odkad=vrijednost[2]+'-'+vrijednost[1]+'-'+vrijednost[0];

		dokad=vrijednost[2]+'-'+vrijednost[1]+'-'+vrijednost[0];

   //za tjedan

	}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();

		}

   //za mjesec

	}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();

   //za godinu

	}else if(document.unos.vrazmak[3].checked){

		odkad=vrijednost[2]+'-01-01';

		dokad=vrijednost[2]+'-12-31';

	}

 }

 

 

 document.getElementById('t1').innerHTML="";	 

 

 var selectElement1 = document.getElementById('sIzleti');

 var selectedValue1 = selectElement1[selectElement1.selectedIndex].value;

 var idizleta = 'SVI';

 if(selectedValue1 != -1){

  idizleta = pizleti['idizlettip'+selectedValue1];

 }

			

			

 selectElement1 = document.getElementById('sVodici');

 selectedValue1 = selectElement1[selectElement1.selectedIndex].value;

 var idvodic = 'SVI';

 if(selectedValue1 != -1){

  idvodic = pvodici['idzaposlenik'+selectedValue1];

 }

 

 if(iprikaz==0){

		DohvatiStatistiku6(odkad, dokad, 'voznja', 'vozac', 'SVI','SVI','SVI');

		ostaliPodaci=ParsirajSve(vari);

		

		var tvozilatekst="";

		var brizletaukupno=0;

	

			

			

			

		tvozilatekst=' <table class="podaci" align="center" cellspacing="1" cellpadding="5"  style=" border-width:1px; margin-top:25px; font-family:Verdana;font-size:12px; color:#FFF;  border-color:#FFF;"><tr height="30px" style="background-color:#002951;"><td width="150px" style="background-color:#FFF"></td><td style="background-image:url(../slike/tablecell1.jpg);" width="150px" align="center">Broj vožnji</td></tr>';

		

		for(i=0;i<ostaliPodaci['brojac'];i++)

		{ 

		brizletaukupno+=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]+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+ostaliPodaci['brizleta'+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>'+brizletaukupno+'</b></td></tr>';

		

		

			document.getElementById('t1').innerHTML+=tvozilatekst+'</table>';

 }

			

			

		

 

		if (iprikaz==1){	

		DohvatiStatistiku6(odkad, dokad, 'izlet', 'vozac', idizleta, idvodic,'SVI');

		ostaliPodaci=ParsirajSve(vari);

		

		var tvozilatekst="";

		brizletaukupno=0;

		

		tvozilatekst=' <table  class="podaci" align="center" cellspacing="1" cellpadding="5"  style=" border-width:1px; margin-top:25px; color:#FFF; font-family:Verdana;font-size:12px;  border-color:#FFF;"><tr height="30px" style="background-color:#002951;"><td width="150px" style="background-color:#FFF"></td><td style="background-image:url(../slike/tablecell1.jpg);" width="150px" align="center">Naziv izleta</td></tr>';

		

		for(i=0;i<ostaliPodaci['brojac'];i++)

		{

			brizletaukupno+=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['datum'+i]+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+ostaliPodaci['naziv'+i]+'</td></tr>';

			

			}

			

			

			document.getElementById('t1').innerHTML=tvozilatekst+'</table>';

			

		}

		

		

		

		

		if (iprikaz==2){	

		DohvatiStatistiku6(odkad, dokad, 'voznjaizleti', 'vozac', idizleta, idvodic, 'SVI');

		

		ostaliPodaci=ParsirajSve(vari);

		

		tvozilatekst="";

		brizluk = 0;

		

		

		tvozilatekst=' <table class="podaci" align="center" cellspacing="1" cellpadding="5"  style=" border-width:1px; margin-top:25px; color:#FFF;font-family:Verdana;font-size:12px;   border-color:#FFF;"><tr height="30px" style="background-color:#002951;"><td width="150px" style="background-color:#FFF"></td><td style="background-image:url(../slike/tablecell1.jpg);" width="150px" align="center">Broj vožnji</td></tr>';

		

		for(i=0;i<ostaliPodaci['brojac'];i++)

		{ 

		brizluk += parseInt(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['prezime'+i]+' '+ostaliPodaci['ime'+i]+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+ostaliPodaci['brizleta'+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;">'+brizluk+'</td></tr>';

			

			

			document.getElementById('t1').innerHTML=tvozilatekst+'</table>';

			

		}

		

		

		

}









function CallPrint(strid)

{

	var selectElement2 = document.getElementById('sIzleti');

 	var tizlet = selectElement2[selectElement2.selectedIndex].text;

	

	var selectElement2 = document.getElementById('sVodici');

 	var tvozac = 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 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>'+tizlet+'</b></td></tr><tr><td align="left" width="200px">Vozač:</td><td> <b>'+tvozac+'</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">&nbsp;Glavni izbornik</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-stats"></span> <a href="index.php">&nbsp;Grafovi</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-map-marker"></span> <a href="stexcursions.php">&nbsp;Statistika Izlet</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-briefcase"></span> <a href="stpart.php">&nbsp;Statistika Partner</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-user"></span> <a href="stvodici.php">&nbsp;Statistika Vodič</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-road"></span> <a href="stvozaci.php">&nbsp;Statistika Vozač</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-plane"></span> <a href="stvozila.php">&nbsp;Statistika Vozila</a></div>

        <div class="izbornik"><span class="glyphicon glyphicon-euro"></span> <a href="obracuni.php">&nbsp;Obračuni</a></div>

		

	</div>

	

    <div id="tijelo">

    	<h1 class="title">STATISTIKA VOZAČ</h1>



        <div id="dropdown1">



       

        <div id="t1"></div><br /><br />

          <div id="t2"></div><br /><br />

        	</div>



	<div id="desno1"><br />

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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;"  >

   <b>Tip prikaza:</b>

   <select id="vodabir" onchange="Prikaziskriveni();"><option value="1" >Vozači po izletima</option><option value="2">Izleti odabranog vozača</option><option value="2">Broj vožnji izleta</option></select> <br />

   <br /><br />

   <div id="skrivenidio">

   <select id="sIzleti"  onchange=""></select> <br />

   <br /><br />

   <select id="sVodici"  onchange=""></select><br /><br /><br /></div>

   <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>

Zerion Mini Shell 1.0