Professional Documents
Culture Documents
Zavrsni Rad - Konacna Verzija
Zavrsni Rad - Konacna Verzija
0
2 POPIS SKRAĆENICA
1
3 PRILOG 1 – IZVORNI KOD WEB APLIKACIJE
config.php
1. <?php
2. // DB credentials.
3. define('DB_HOST','localhost');
4. define('DB_USER','root');
5. define('DB_PASS','');
6. define('DB_NAME','carrental');
7. // Establish database connection.
8. try
9. {
10. $dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER, DB_PASS,array(PD
O::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
11. }
12. catch (PDOException $e)
13. {
14. exit("Error: " . $e->getMessage());
15. }
index.php
1. <?php
2. session_start();
3. include('includes/config.php');
4. error_reporting(0);
5.
6. ?>
7.
8. <!DOCTYPE HTML>
9. <html lang="en">
10. <head>
11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12. <meta http-equiv="X-UA-Compatible" content="IE=edge">
13. <meta name="viewport" content="width=device-width,initial-scale=1">
14. <meta name="keywords" content="">
15. <meta name="description" content="">
16. <title>RentACar Portal</title>
17. <!--Bootstrap -->
18. <link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css">
19. <link rel="stylesheet" href="assets/css/style.css" type="text/css">
20. <link rel="stylesheet" href="assets/css/owl.carousel.css" type="text/css">
21. <link rel="stylesheet" href="assets/css/owl.transitions.css" type="text/css">
22. <link href="assets/css/slick.css" rel="stylesheet">
23. <link href="assets/css/bootstrap-slider.min.css" rel="stylesheet">
24. <link href="assets/css/font-awesome.min.css" rel="stylesheet">
25. <link rel="stylesheet" id="switcher-css" type="text/css" hre
f="assets/switcher/css/switcher.css" media="all" />
26. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/red.css" title="red" media="all" data-default-color="true" />
27. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/orange.css" title="orange" media="all" />
28. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/blue.css" title="blue" media="all" />
29. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/pink.css" title="pink" media="all" />
2
30. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/green.css" title="green" media="all" />
31. <link rel="alternate stylesheet" type="text/css" href="assets/switcher/cs
s/purple.css" title="purple" media="all" />
32. <link rel="apple-touch-icon-precomposed" sizes="144x144" hre
f="assets/images/favicon-icon/apple-touch-icon-144-precomposed.png">
33. <link rel="apple-touch-icon-precomposed" sizes="114x114" hre
f="assets/images/favicon-icon/apple-touch-icon-114-precomposed.html">
34. <link rel="apple-touch-icon-precomposed" sizes="72x72" hre
f="assets/images/favicon-icon/apple-touch-icon-72-precomposed.png">
35. <link rel="apple-touch-icon-precomposed" href="assets/images/favicon-icon/apple-
touch-icon-57-precomposed.png">
36. <link rel="shortcut icon" href="assets/images/favicon-icon/favicon.png">
37. <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" re
l="stylesheet">
38. </head>
39. <body>
40.
41. <!-- Start Switcher -->
42. <?php include('includes/colorswitcher.php');?>
43. <!-- /Switcher -->
44.
45. <!--Header-->
46. <?php include('includes/header.php');?>
47. <!-- /Header -->
48.
49. <!-- Banners -->
50. <section id="banner" class="banner-section">
51. <div class="container">
52. <div class="div_zindex">
53. <div class="row">
54. <div class="col-md-5 col-md-push-7">
55. <div class="banner_content">
56. <h1>Pronadjite posebno auto za sebe.</h1>
57. <p>Imamo vise od hiljadu vozila koje mozete pronaci na portalu. </p>
58. <a href="#" class="btn">Procitaj vise <span class="angle_arrow"><i cl
ass="fa fa-angle-right" aria-hidden="true"></i></span></a> </div>
59. </div>
60. </div>
61. </div>
62. </div>
63. </section>
64. <!-- /Banners -->
65.
66.
67. <!-- Resent Cat-->
68. <section class="section-padding gray-bg">
69. <div class="container">
70. <div class="section-header text-center">
71. <h2>Pronadjite auto <span>Auto za vas</span></h2>
72. <p>Mi smo kompanija profesinalaca, tima mladih, uspješnih ljudi, koji imaju
jasnu poslovnu strategiju. I svoju viziju posmatraju kroz prizmu najboljih u posl
u.
73.
74. Planovima i razvojnom politikom, nastojati se nametnuti kao lider rent-a-car agen
cija.</p>
75. </div>
76. <div class="row">
77.
78. <!-- Nav tabs -->
79. <div class="recent-tab">
80. <ul class="nav nav-tabs" role="tablist">
81. <li role="presentation" class="active"><a href="#resentnewcar" role="ta
b" data-toggle="tab">New Car</a></li>
82. </ul>
83. </div>
3
84. <!-- Recently Listed New Cars -->
85. <div class="tab-content">
86. <div role="tabpanel" class="tab-pane active" id="resentnewcar">
87.
88. <?php $sql = "SELECT tblvehicles.VehiclesTitle,tblbrands.BrandName,tblvehicles.Pr
icePerDay,tblvehicles.FuelType,tblvehicles.ModelYear,tblvehicles.id,tblvehicles.S
eatingCapacity,tblvehicles.VehiclesOverview,tblvehicles.Vimage1 from tblvehicles
join tblbrands on tblbrands.id=tblvehicles.VehiclesBrand";
89. $query = $dbh -> prepare($sql);
90. $query->execute();
91. $results=$query->fetchAll(PDO::FETCH_OBJ);
92. $cnt=1;
93. if($query->rowCount() > 0)
94. {
95. foreach($results as $result)
96. {
97. ?>
98.
99. <div class="col-list-3">
100. <div class="recent-car-list">
101. <div class="car-info-box"> <a href="vehical-details.php?vhid=<?php echo ht
mlentities($result->id);?>"><img src="admin/img/vehicleimages/<?php echo htmlenti
ties($result->Vimage1);?>" class="img-responsive" alt="image"></a>
102. <ul>
103. <li><i class="fa fa-car" aria-hidden="true"></i><?php echo htmlentities($r
esult->FuelType);?></li>
104. <li><i class="fa fa-calendar" aria-hidden="true"></i><?php echo htmlentiti
es($result->ModelYear);?> Model</li>
105. <li><i class="fa fa-user" aria-hidden="true"></i><?php echo htmlentities($
result->SeatingCapacity);?> seats</li>
106. </ul>
107. </div>
108. <div class="car-title-m">
109. <h6><a href="vehical-details.php?vhid=<?php echo htmlentities($result-
>id);?>"><?php echo htmlentities($result->BrandName);?> , <?php echo htmlentities
($result->VehiclesTitle);?></a></h6>
110. <span class="price">$<?php echo htmlentities($result->PricePerDay);?> /Da
y</span>
111. </div>
112. <div class="inventory_info_m">
113. <p><?php echo substr($result->VehiclesOverview,0,70);?></p>
114. </div>
115. </div>
116. </div>
117. <?php }}?>
118.
119. </div>
120. </div>
121. </div>
122. </section>
123. <!-- /Resent Cat -->
124.
125. <!-- Fun Facts-->
126. <section class="fun-facts-section">
127. <div class="container div_zindex">
128. <div class="row">
129. <div class="col-lg-3 col-xs-6 col-sm-3">
130. <div class="fun-facts-m">
131. <div class="cell">
132. <h2><i class="fa fa-calendar" aria-hidden="true"></i>30+</h2>
133. <p>Godine u biznisu</p>