%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/unpart.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 rel="stylesheet" href="calendar.css" />



<script language="JavaScript" type="text/javascript" src="calendar_eu.js"></script>-->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

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

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

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

<script language="JavaScript" type="text/javascript" src="businesslayer.js"></script>

<script type="text/javascript">



var prodajnaMjesta=new Array();

var trenutniBr=0;

var lrabati=new Array();

var vari = "";

var sviIzleti=new Array();

var podaci=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 Prikazi()

{

	var formObj = document.forms['partner'];

	formObj.sPartneri.options.length = 0;

	document.getElementById("rabatdiv").innerHTML="";

	document.getElementById("rabatdivcij").innerHTML="";

	document.getElementById('bpromijeni').style.display="none";

	document.getElementById('bunesi').style.display="inline";



	MakeRequestLoadAllIzletTip1();

	sviIzleti=ParsirajSve(vari);

	

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

		{

			document.getElementById("rabatdiv").innerHTML+='<div style=" width:100%;height:30px;  margin-bottom:3px;"><span style="min-width: 250px; display: inline-block">'+sviIzleti['naziv'+i]+'</span><input style="height:30px;width:50px;" name="rabatcijena'+i+'" type="text" /><select id="rabatvrsta'+i+'"><option value="4" selected>Kn</option><option value="3">%</option><option value="20">Prod.</option></select></div>';

		}

		







	

	MakeRequestLoadAllPartner();

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

	podaci = ParsirajSve(vari);

	

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

		opt.text = "ODABERITE PARTNERA";

        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['naziv'+i];

        opt.value = i;

	} 

}





function PrikaziJednog()

{	

	document.getElementById('prodmjestadiv').style.display="inline";

	document.getElementById('bunesi').style.display="none";

	document.getElementById('bpromijeni').style.display="inline";

	

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

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

	Id=selectedValue1;

	trenutniBr=Id;



	if(Id!=-1)

	{	

		trenutniBr=Id;

		document.getElementById("rabatdiv").innerHTML="";

		document.getElementById("rabatdivcij").innerHTML="";

		var formObj = document.forms['unos'];

		formObj.spMjesta.options.length = 0;



		MakeRequestLoadPKIzletPogonTrosakPT(podaci['idpartner'+Id]);

		lrabati=ParsirajSve(vari);
		



//		alert (vari);



		

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

		{

			if(lrabati['tip'+i]==3) document.getElementById("rabatdivcij").innerHTML+='<div style="width:100%;height:30px;margin-bottom:3px;"><span style="min-width:250px; display: inline-block">'+sviIzleti['naziv'+i]+'</span><input style="height:30px;width:80px;" name="rabatcijena'+i+'" value="'+lrabati['cijena'+i]+'"  type="text" /><select id="rabatvrsta'+i+'"><option value="4">Kn</option><option value="3" selected>%</option><option value="20">Prod.</option></select></div>';

			

			else if(lrabati['tip'+i]==4)  document.getElementById("rabatdivcij").innerHTML+='<div style=" width:100%;height:30px;margin-bottom:3px;"><span style="min-width:250px; display: inline-block">'+sviIzleti['naziv'+i]+'</span><input style="height:30px;width:80px;" name="rabatcijena'+i+'" value="'+lrabati['cijena'+i]+'"  type="text" /><select id="rabatvrsta'+i+'"><option value="4" selected>Kn</option><option value="3">%</option><option value="20">Prod.</option></select></div>';
			
			else  document.getElementById("rabatdivcij").innerHTML+='<div style=" width:100%;height:30px;margin-bottom:3px;"><span style="min-width:250px; display: inline-block">'+sviIzleti['naziv'+i]+'</span><input style="height:30px;width:80px;" name="rabatcijena'+i+'" value="'+lrabati['cijena'+i]+'"  type="text" /><select id="rabatvrsta'+i+'"><option value="4" >Kn</option><option value="3">%</option><option value="20" selected>Prod.</option></select></div>';

		}

		

		

		MakeRequestLoadPKProdajnoMj(podaci['idpartner'+Id]);

		prodajnaMjesta=ParsirajSve(vari);

	

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

		{

			document.unos.spMjesta.options[i]=new Option(prodajnaMjesta['naziv'+i], prodajnaMjesta['idprodajnomj'+i], true, false);

		} 

	

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

 		var selectedIndex2 = selectElement2.selectedIndex;

		if(selectedIndex2 <= 0){

			selectedIndex2 = 0;

		}

		document.unos.prnz.value = prodajnaMjesta['naziv'+selectedIndex2];

	

		 document.unos.naziv.value = podaci['naziv'+Id];

		 document.unos.puniNaziv.value =podaci['puninaziv'+Id];

		 document.unos.oib.value=podaci['oib'+Id];

		 document.unos.adresa.value=podaci['adresa'+Id];

		 document.unos.odgosoba.value=podaci['odgovornaosoba'+Id];

		 document.unos.id.value=podaci['idpartner'+Id];

	}

}





function brisipmjesto()

{

	if(confirm("Izbrisati prodajno mjesto? "))

	{

	var selectElement = document.getElementById('spMjesta');

	var selectedValue = selectElement[selectElement.selectedIndex].value;

	MakeRequestDeleteProdajnoMj(selectedValue);PrikaziJednog(trenutniBr);

	alert("Mjesto je izbrisano");

	}

}



function brisipartnera()

{

	if(confirm("Izbrisati partnera? "))

	{

	MakeRequestDeletePartner(document.unos.id.value);Prikazi();

	alert("Partner je izbrisan");

	}

}





function unesi()

{

	if(confirm("Unijeti partnera u bazu? "))

	{

		MakeRequestInsertPartner(0, document.unos.naziv.value,document.unos.puniNaziv.value,document.unos.oib.value,document.unos.adresa.value,document.unos.odgosoba.value, 0,0,"",0);

	

		idnovipartner=vari;

	

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

		{

			var selectElement1 = document.getElementById('rabatvrsta'+i);

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

			MakeRequestInsertIzletPogonTrosak(0,idnovipartner,sviIzleti['idizlettip'+i],document.unos.elements['rabatcijena'+i].value,0,0,0,selectedValue1);

		}

		

		MakeRequestLoadAllBoatKategorijaPlovila();

		podacikatplov = ParsirajSve(vari);

		

		for(var i=0; i<podacikatplov['brojac']; i++){

			

			MakeRequestInsertBoatNajamPartner( 0, idnovipartner, podacikatplov['idkategorijaplovila'+i], 0, '-', 0);

		

		}

		

		

		alert("Partner je uspješno unesen");



		Prikazi();

	}

}





function promijeni()

{

	if(confirm("Potvrditi promjene? "))

	{

		Id=document.unos.id.value;

		MakeRequestUpdatePartner( Id, document.unos.naziv.value,document.unos.puniNaziv.value,document.unos.oib.value,document.unos.adresa.value,document.unos.odgosoba.value, 0,0,"",0);

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

		{

			var selectElement1 = document.getElementById('rabatvrsta'+i);

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

			

			MakeRequestUpdateIzletPogonTrosak(lrabati['idizletpogontrosak'+i],Id,sviIzleti['idizlettip'+i],document.unos.elements['rabatcijena'+i].value,0,0,0,selectedValue1);

			

		}

		alert("Promjena je uspješno izvršena !");

	

	   Prikazi();

	   document.getElementById("unos").reset();

	  

	  document.getElementById('spMjesta').options.length = 0;



	}

}

function UnesiNaziv(){



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

 		var selectedIndex2 = selectElement2.selectedIndex;

		document.unos.prnz.value = prodajnaMjesta['naziv'+selectedIndex2];

}



function promijeniNaziv(){

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

 	var selectedIndex2 = selectElement2.selectedIndex;

	

	MakeRequestUpdateProdajnoMj( prodajnaMjesta['idprodajnomj'+selectedIndex2], prodajnaMjesta['idpartner'+selectedIndex2], document.unos.prnz.value, prodajnaMjesta['tip'+selectedIndex2], "", 0);

	alert('Naziv uspješno promijenjen!');

	PrikaziJednog(trenutniBr);

}

</script>







<title>Poslovanje</title>

</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="tijelo">

    	<h1 class="title">UNOS/IZMJENA PARTNERA</h1>



        <div id="desno">

            <br />

           <button class="button" onclick="javascript:location.reload(true);" >UNOS NOVOG</button>

        </div>



        <div id="dropdown">

            <form name="partner"><select id="sPartneri"  onchange="PrikaziJednog();"></select> <a href="javascript:brisipartnera();"><span class="glyphicon-remove-circle glyphicon bigger-glyphicon orange" ></span></a></form>

        <form name="unos" id="unos">

        <div><label>Naziv :</label><input name="naziv" type="text" /></div>

            <div><label>Puni naziv :</label><input name="puniNaziv" type="text" /></div>

            <div><label>Adresa :</label><input name="adresa" type="text" /></div>

            <div><label>OIB :</label><input name="oib" type="text" /></div>

            <div><label>Odgovorna osoba :</label><input name="odgosoba" type="text" /><input name="id" type="hidden" /></div>



      

       <div><b>Odobreni rabat</b></div>



        <div id="rabatdiv"></div>



       <div id="rabatdivcij"></div>



		<div class="linija"></div>



        

        <div id="prodmjestadiv">

        <div><b>Prodajna mjesta :</b></div>

        <div><select id="spMjesta" style="max-width:150px;width:150px;" onchange="javascript:UnesiNaziv();"></select><a href="javascript:brisipmjesto();"><span class="glyphicon-remove-circle glyphicon bigger-glyphicon orange"  style="vertical-align:middle;" border="0"></span></a>

  		</div>

  		<div></div>



            <div><label>Promijeni naziv :</label><input name="prnz" type="text" /></div>

 		<div><button class="button button-smaller" onclick="javascript:promijeniNaziv();" style="cursor:pointer;"  >PROMIJENI NAZIV</button></div>

  		<div></div>



            <div><label>Novo prodajno mj. :</label><input name="npmj" type="text" /></div>

         <div><button class="button button-smaller" onclick="javascript:MakeRequestInsertProdajnoMj(0,document.unos.id.value,document.unos.npmj.value,1,'',0);alert('Prodajno mjesto uspješno uneseno!');PrikaziJednog(trenutniBr);">UNESI</button></div>

        </table></div>





		<div></div>

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



		</div>

        

      <!--  

        <div id="prodavacidiv"><table>

        <tr><td valign="top">

        <br /><b>Prodavac : (ne radi)</b></td>

        <td>&nbsp;<a href="javascript:brisipmjesto();"><img src="slike/x.png" style="vertical-align:middle;" border="0"/></a><br /> &nbsp;<select id="spMjesta" style="max-width:150px;width:150px;" onchange="javascript:UnesiNaziv();"></select>

  		</td></tr>

  		<tr><td colspan="2" height="10px;"></td></tr>



  		<tr><td>Promijeni ime:</td><td><input name="prnz" type="text" /></td></tr>

 		<tr><td></td><td style="text-align:center;"><img onclick="javascript:promijeniNaziv();" style="cursor:pointer;"  src="slike/spremi.jpg" /></td></tr> 

  		<tr><td colspan="2" height="10px;"></td></tr>



  		<tr><td>Novi prodavac. :</td><td><input name="npmj" type="text" /></td></tr>

 		<tr><td></td><td style="text-align:center;"><img onclick="javascript:MakeRequestInsertProdajnoMj(0,document.unos.id.value,document.unos.npmj.value,1,'',0);alert('Prodajno mjesto uspješno uneseno!');PrikaziJednog(trenutniBr);" style="cursor:pointer;"  src="slike/unesi.jpg" /></td></tr> 

        </table></div></td></tr>



		<tr><td colspan="2" class="linija"></td></tr>

		<tr><td colspan="2" height="20px;" align="center"></td></tr>

		<tr><td align="center" colspan="2"><div id="bpromijeni"><img onclick="javascript:promijeni();" style="cursor:pointer;"  src="slike/spremi.jpg" /></div> &nbsp; <div id="bunesi"><img onclick="javascript:unesi();" style="cursor:pointer;"  src="slike/unesi.jpg" /></div></td></tr>



		</table> -->

        

		</form>



		</div>







</div>

</div>

</body>

</html>


Zerion Mini Shell 1.0