-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
132 lines (115 loc) · 4.76 KB
/
index.php
File metadata and controls
132 lines (115 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
//including api_interface file
require_once("api_interface.php");
//including functions file
require_once("functions.php");
//$cid will be used as dealer id
$cid=0;
$cid=$_GET['cid'];
//$page is the current page number, if no page is selected it will be 1.
$page=$_GET['page'];
if(!isset($_GET['page']))
{
$page=1;
}
//if no dealer id is set, dealer id 5 will be used as default
if ($cid==0)
{
$cid=5;
}
//Api object declaration
$api = new api_call();
// Getting total number of vehicles
$total_vehicles=$api->makeCall( $api->getDealerCount($cid));
// Call to pagination function to set values (Total pages, Next Page, Previous page)
$total_pages=paginationStart($total_vehicles,10);
$NextPage=$next_page;
$PreviousPage=$prev_page;
// Call to api to load vehicles for selected page number
$vehicles = $api->makeCall( $api->getDealerVehicles( $cid , $page*10 , 10 ));
//$vehicles = $api->makeCall( $api->getDealerVehicles( 5 , 7 , 10 ) );
//Getting Delaer name
$dealer=$api->makeCall( $api->getDealer($cid));
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $dealer->DISPLAY_NAME;?></title>
<link type="text/css" rel="stylesheet" href="vehicles.css" />
</head>
<body>
<!-- start container -->
<div id="container">
<!-- start main -->
<div id="main">
<!-- start squared / list -->
<div class="squared clearfix" id="jq_inventory_view">
<?
// Fields available: VEH_ID, CLIENT_ID, CATEGORY, PRICE, PRICE_STRING, HIDE_PRICE, BASE_PRICE, NEGOTIABLE, TYPE, CONDITION, KEYWORDS, DESCRIPTION, FEATURES, MAKE, MODEL, TRIM, YEAR, MILEAGE, VIN, TRANSMISSION, COLOR, VIDEO_EMBED_CODE, PAUSED, SOLD, DELETED, VIEWS, TELEPHONE_VIEWS, IOL_EDIT_STATUS, IOL_IMAGE, EDIT_DATE, CREATED_DATE, IMAGE, TELEPHONE
// Loop thru results
foreach( $vehicles as $v )
{
?>
<!-- start result -->
<div class="box_result clearfix">
<!-- start thumb -->
<div class="thumbs">
<?php
// checking if IOL_IMAGE is set to 1. To set the image pagth
if($v->IOL_IMAGE=='1')
{
$imgPath="http://www.midealervirtual.com/vpics/iol_imports/thumb/thumb_";
}
else
{
$imgPath="http://www.midealervirtual.com/vpics/thumb/thumb_";
}
?>
<a href="vehicle_detail.php?cid=<?php echo $cid;?>&vid=<?php echo $v->VEH_ID;?>" title="<?php echo $v->MAKE." ".$v->MODEL;?>" ><img src=<?php echo $imgPath.$v->IMAGE; ?> alt="<?php echo $v->MAKE." ".$v->MODEL;?>" title="<?php echo $v->MAKE." ".$v->MODEL;?>" /></a>
</div>
<!-- end thumb -->
<!-- start info -->
<div class="info">
<div class="result_title">
<a href="vehicle_detail.php?cid=<?php echo $cid;?>&vid=<?php echo $v->VEH_ID;?>" title="<?php echo $v->MAKE." ".$v->MODEL;?>"><?php echo $v->MAKE." ".$v->MODEL;?></a>
</div>
<ul>
<li><strong>Año:</strong> <?php echo $v->YEAR;?></li>
<li><strong>Color:</strong> <?php echo $v->COLOR;?></li>
</ul>
<ul>
<li><strong>Condición:</strong> <?php echo $v->CONDITION;?></li>
<li><strong>Transmisión: </strong> <?php echo $v->TRANSMISSION;?></li>
</ul>
<ul>
<li><strong>VIN:</strong><?php echo $v->VIN;?></li>
<li> </li>
</ul>
<ul><li> </li><li>
<a name="fb_share" type="button" share_url="www.isoft-tech.com/midealervirtual/vehicle_detail.php?cid=<?php echo $cid;?>&vid=<?php echo $v->VEH_ID;?>">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
type="text/javascript">
</script>
</li>
</ul>
</div>
<!-- end info -->
</div>
<!-- end result -->
<?
}
?>
</div>
<!-- end squared / list -->
<!-- pagination footer div -->
<div class="squared clearfix" id="pagination_footer">
<?php paginationFooter("cid=".$cid,"vehicle_list.php",$total_pages,$NextPage,$PreviousPage);
?>
</div>
<!-- end pagination footer div -->
</div>
<!-- end main-->
</div>
<!-- end container -->
</body>
</html>