-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvehicle_list_23-12-2011.php
100 lines (89 loc) · 3.59 KB
/
vehicle_list_23-12-2011.php
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
<?php
//including api_interface file
require_once("api_interface.php");
//$cid will be used as dealer id
$cid=0;
$cid=$_GET['cid'];
//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();
// Fetch vehicles by using interace
$vehicles_json = file_get_contents( $api->getDealerVehicles( $cid /* ID of a Client of ours */ ) );
// Remember the format is returned
//$vehicles = $api->makeCall( $api->getDealerVehicles( $cid , 5 , 10 ));
// Decode json objects
$vehicles = json_decode( $vehicles_json ); // Convert json string into php object
?>
<!DOCTYPE html>
<html>
<head>
<title>Insert Dealer Name Here</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>
</div>
<!-- end info -->
</div>
<!-- end result -->
<?
}
?>
</div>
<!-- end squared / list -->
</div>
<!-- end main-->
</div>
<!-- end container -->
</body>
</html>