%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/stpart.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 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"/>

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

<title>STATISTIKA-PARTNERI</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("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;

	} 





	MakeRequestLoadAllPartner();

	//`IDPartner``naziv``puniNaziv``oib``adresa``odgovornaOs

	pPartneri = ParsirajSve(vari);

	

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

		opt.text = "SVI PARTNERI";

        opt.value = "-1";

		

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

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

        opt.value = "-1";

		

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

	{

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

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

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

        opt.value = i;

	} 

	

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

		opt.text = "SVA PRODAJNA MJESTA";

        opt.value = "-1";

		

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

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

        opt.value = "-1";

			

}	

	

function OdaberiPartnera(){

	formObj = document.forms['unos'];

	formObj.sProdajnamjesta.options.length = 0;

	

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

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

			opt.text = 'SVA PRODAJNA MJESTA';

   	    	opt.value = -1;

			

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

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

			opt.text = '-----------------------------------------';

   	    	opt.value = -1;

	

	selectElement1 = document.getElementById('sPartneripopis');

 	selectedValue1 = selectElement1[selectElement1.selectedIndex].value;

 	if(selectedValue1 != -1){

		MakeRequestLoadPKProdajnoMj(pPartneri['idpartner'+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 = 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 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];

 }

 

 selectElement1 = document.getElementById('sPartneripopis');

 selectedValue1 = selectElement1[selectElement1.selectedIndex].value;

 var idpartnera = 'SVI';

 if(selectedValue1 != -1){

 	idpartnera = pPartneri['idpartner'+selectedValue1];

 }

 

 selectElement1 = document.getElementById('sProdajnamjesta');

 selectedValue1 = selectElement1[selectElement1.selectedIndex].value;

 var idprodajnomjesto = 'SVI';

 if(selectedValue1 != -1){

 	idprodajnomjesto = pProdajnamjesta['idprodajnomj'+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("-"); 

   //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';

	}

 }

 

 if(index!=2&&index!=3) {

 	datum = new Date();

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

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

 }

	// PARTNER: tip=partner, subj=partner, idizlettip=idizlettip,   idtrazeno= idpartner, idtrazeno1= idprodajnomjesto

	DohvatiStatistiku6(odkad, dokad, 'partner', 'partner', idizleta, idpartnera, idprodajnomjesto);

	podaci = ParsirajSve(vari);

	ptablica = new Array(0,0,0,0,0,0,0,0,0);

	

	var	tpartnertekst=' <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 putnika</td><td width="100px" style="background-image:url(../slike/tablecell1.jpg);" align="center">Bruto promet</td><td style="background-image:url(../slike/tablecell1.jpg);" width="100px" align="center">Rabat</td></tr>';

		//alert(podaci);

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

	{

		//broj odraslih		

		ptablica[0] += parseInt(podaci['brodraslih'+i]);

		//broj djece

		ptablica[1] += parseInt(podaci['brdjece'+i]);

		//ukupan broj putnika

		ptablica[2] += parseInt(podaci['ukupnoputnika'+i]);

		//promet odrasli

		ptablica[3] += parseInt(podaci['cijenaodrasli'+i]);

		//promet djeca

		ptablica[4] += parseInt(podaci['cijenadjeca'+i]);

		//ukupni promet

		ptablica[5] += parseInt(podaci['ukupnocijena'+i]);

		//rabat odrasli

		ptablica[6] += parseInt(podaci['rabatodrasli'+i]);

		//rabat djeca

		ptablica[7] += parseInt(podaci['rabatdjeca'+i]);

		//ukupni rabat

		ptablica[8] += parseInt(podaci['ukupnorabat'+i]);

		

		tpartnertekst+='<tr height="30"><td style="background-image:url(../slike/tablecell1.jpg); background-repeat:repeat-x; background-color:#005fbb; background-position:top;">'+podaci['naziv'+i]+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+podaci['ukupnoputnika'+i]+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+formatCurrency(podaci['ukupnocijena'+i])+'</td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;">'+formatCurrency(podaci['ukupnorabat'+i])+'</td></tr>';

	} 

		tpartnertekst+=' <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>'+ptablica[2]+'</b></td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>'+formatCurrency(ptablica[5])+'</b></td><td style="background-image:url(../slike/tablecell3.jpg);text-align:center;"><b>'+formatCurrency(ptablica[8])+'</b></td></tr></table>';

		document.getElementById('tpartner').innerHTML=tpartnertekst;

		

		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]);

				

}







function CallPrint(strid)

{

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

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

	

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

 	var tpMjesto = 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>'+tpartner+'</b></td></tr><tr><td align="left" width="200px">Prodajno mjesto:</td><td> <b>'+tpMjesto+'</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 PARTNER</h1>



        <div id="dropdown1">

        <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">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="tpartner">

    </div>

        	</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;"  ><select id="sPartneri"  onchange="PrikaziJednog();"></select> <br />

   <br /><br />

   <select id="sPartneripopis"  onchange="javascript:OdaberiPartnera();"></select><br />

   <br /><br />

   <select id="sProdajnamjesta"  onchange=""></select><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>

Zerion Mini Shell 1.0