%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/buggydubrovnik.com/prodaja/
Upload File :
Create Path :
Current File : //var/www/html/buggydubrovnik.com/prodaja/unvodica.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-VODIČ</title>
    <link href="glyphicons.css" rel="stylesheet" type="text/css"/>
    <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 language="JavaScript" type="text/javascript" src="businesslayer.js"></script>

<script type="text/javascript">

trenutniBrZaposlenika=0;
cijeneIzlet=new Array();
var vari = "";
var izleTip= 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()
{	
	document.getElementById('bunesi').style.display="inline";
	document.getElementById('bpromijeni').style.display="none";
	var formObj = document.forms['partner'];
	formObj.sPartneri.options.length = 0;
	document.unos.ime.value = "";
	document.unos.prezime.value ="";
	document.unos.telefon.value="";
	document.unos.mail.value="";
	document.unos.id.value="";
	
	MakeRequestLoadAllIzletTip();
	izleTip=ParsirajSve(vari);
	
	ispisiIzlete="<table>";
	for(i=0;i<izleTip['brojac'];i++)
	{
		ispisiIzlete+='<tr><td style="min-width:105px;">'+izleTip['naziv'+i]+'</td><td><input style="width:105px; font-size: 1em"  name="cijena'+i+'" type="text" /> kn</td></tr>'
	}
	ispisiIzlete+="</table>";
	document.getElementById("cijenaIzlet").innerHTML=ispisiIzlete;

	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];
        opt.value = i;
	} 
}


function PrikaziJednog()

{
	document.getElementById('bunesi').style.display="none";
	document.getElementById('bpromijeni').style.display="inline";
	var selectElement1 = document.getElementById('sPartneri');
	var selectedValue1 = selectElement1[selectElement1.selectedIndex].value;
	rbr=selectedValue1;
	Id=podaci['idzaposlenik'+rbr];

	if(rbr!=-1)
	{	
		trenutniBrZaposlenika=rbr;
		
		MakeRequestLoadPKIzletPogonTrosakOS(Id);
		cijeneIzlet=ParsirajSve(vari);
		
		document.unos.ime.value = podaci['ime'+rbr];
	 	document.unos.prezime.value =podaci['prezime'+rbr];
	 	document.unos.telefon.value=podaci['kontakt'+rbr];
	 	document.unos.mail.value=podaci['mail'+rbr];
	 	document.unos.id.value=Id;
		
		for(i=0;i<cijeneIzlet['brojac'];i++)
		{
	   		document.unos.elements["cijena"+i].value=cijeneIzlet['cijena'+i];
	   	}
	}
}

function unesi()
{
	if(confirm("Unijeti vodiča u bazu? "))
	{
		nijebroj=0;
		for(i=0;i<izleTip['brojac'];i++)
		{
			if (IsNumeric(document.unos.elements["cijena"+i].value) == false) nijebroj=1;  
		}
	
		if (nijebroj == 0) 
		{
			MakeRequestInsertZaposlenik( 0, document.unos.ime.value,  document.unos.prezime.value, document.unos.telefon.value, document.unos.mail.value, 2, "", 0);
			idunesenizaposlenik=vari;
			for(i=0;i<izleTip['brojac'];i++)
			{if(document.unos.elements["cijena"+i].value=="")document.unos.elements["cijena"+i].value="0";
				MakeRequestInsertIzletPogonTrosak( 0, idunesenizaposlenik, izleTip['idizlettip'+i], document.unos.elements["cijena"+i].value, 0, 0, 0, 2, "");
			}
			alert("Vodič uspješno unesen !");
			Prikazi();
		}
		else alert("Jedna od cijena po izletu nije unešena u ispravnom formatu");
	}
}


function promijeni()
{
	if(confirm("Potvrditi promjene? "))
	{
		Id=document.unos.id.value;
		MakeRequestUpdateZaposlenik( Id, document.unos.ime.value,  document.unos.prezime.value, document.unos.telefon.value, document.unos.mail.value, 2, "", 0);
		for(i=0;i<izleTip['brojac'];i++)
		{
			MakeRequestUpdateIzletPogonTrosak ( cijeneIzlet['idizletpogontrosak'+i], Id, izleTip['idizlettip'+i], document.unos.elements["cijena"+i].value, 0, 0, 0, 2, "");
		}
		alert("Promjena je uspješno izvršena !");
		Prikazi();
	}
}

function brisivodica()
{
	MakeRequestDeleteZaposlenik(document.unos.id.value);Prikazi();
}
</script>
<style>
    #rabatdiv div, #rabatdivcij div {
        float:none!important;
        width: auto!important;
    }

    #desno {
        float:none;
        position:absolute;
        top:10px;
        background: none!important;
        display: block;
        right: 0;
    }

    .checkbox label {
        width: 15%;
    }
    .checkbox input {
        width: auto;
    }
    .button-smaller {
        font-weight: 400;
        padding: 0.2em;
        font-size: 1.1em;

    }
    label {
        display: inline-block;
        width: 25%;
        text-align: left;
    }
    select {
        font-size: 1.3em;
    }
    input {
        width: 60%;
        font-size: 1.5em;
    }
    .bigger-glyphicon {
        margin-left: 5px;
        font-size: 1.5em;
        font-weight: 700;
    }
    .align-left {
        text-align: left;
    }
    #sPartneri {
        font-size: 1.4em!important;
    }
    #tijelo {
        background: none;
    }
    div {
        margin-top: 0.5em;
    }
    .padded {
        padding: 1em;
    }
    @media (max-width: 768px) {

        #desno {
            float: none!important;
            position: relative;

        }
        #tijelo {
            margin-top: 100px!important;
            float: none!important;
        }
        input {
            width: 90%;
        }
        label {
            display: block;
            width: 100%;
        }
    }

</style>
</head>


<body onload="Prikazi();" 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-map-marker"></span> <a href="excursions.php">&nbsp;Izleti početna</a>
            </div>

            <div class="izbornik"><span class="glyphicon glyphicon-pencil"></span> <a href="krizlet.php">&nbsp;Kreiraj izlet</a>
            </div>
            <div class="izbornik"><span class="glyphicon glyphicon-flag"></span> <a href="unmjkuplj.php">&nbsp;Mjesta kupljenja</a>
            </div>

            <div class="izbornik"><span class="glyphicon glyphicon-briefcase"></span> <a href="unpart.php">&nbsp;Unos partnera</a>
            </div>


            <div class="izbornik"><span class="glyphicon glyphicon-plane"></span> <a href="unvozila.php">&nbsp;Unos vozila</a>
            </div>

            <div class="izbornik"><span class="glyphicon glyphicon-user"></span><a href="unvodica.php"> &nbsp;Unos vodiča</a>
            </div>

            <div class="izbornik"><span class="glyphicon glyphicon-road"></span> <a href="unvozaca.php">&nbsp;Unos vozača</a>
            </div>
	</div>
        <div id="desno"><br /><button class="button"  onclick="javascript:location.reload(true);" >UNOS NOVOG</button>
        </div>
	<div id="tijelo">
    	<h1 class="title">UNOS/IZMJENA VODIČA</h1>
        <br/>

        <form name="partner"><select id="sPartneri" onchange="PrikaziJednog();"></select><a href="javascript:brisivodica();"><span class="glyphicon-remove-circle glyphicon bigger-glyphicon orange" ></span></a></form>
		<div id="dropdown">
			<form name="unos" action="">
                <div><label>Ime:</label><input name="ime" type="text" /></div>
                <div><label>Prezime:</label><input name="prezime" type="text" /></div>
                <div><label>Kontakt telefon :</label><input name="telefon" type="text" /></div>
                <div><label>E-mail :</label><input name="mail" type="text" /><input name="id" type="hidden" /></div>
                <div></div>
                <div class="linija"></div>
                <div><b>Cijene po izletu :</b></div>
				<div></div>
				<div id="cijenaIzlet"></div>

				<div class="linija"></div>
                <div></div>
				<div><div id="bpromijeni"><button class="button" onclick="javascript:promijeni();" >SPREMI</button></div> &nbsp; <div id="bunesi"><button class="button" onclick="javascript:unesi();">UNESI</button></div>
				</div>

			</form>
		</div>
		

		
        <div id="skriveni"  style="visibility:hidden"></div>
	</div>
</div>
</body>
</html>


Zerion Mini Shell 1.0