/
adminPersonInfo.php
81 lines (63 loc) · 3.43 KB
/
adminPersonInfo.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
<?php
require_once('class.authentification.php');
require_once('class.util.php');
require_once('class.demande.php');
$auth = authentification::instance();
$matricule = util::getParam($_POST, 'matricule');
if($auth->estIdentifie() && isset($matricule))
{
$demande = new demande($matricule);
$demande->updateDataFromDB();
$userData = $demande->getUserData();
$tripInfo = $demande->getTripInfo();
print("<div id='rightSideInfoTabs'>
<ul>
<li><a href='#personInfo'><span>Informations</span></a></li>
<li><a href='#otherInfos'><span>Infos additionnelles</span></a></li>
<li><a href='#options'><span>Options</span></a></li>
</ul>
<div id='personInfo' style='height:100%'>
<label class='infoFieldTitleWithBar' ' >Nom</label>
<label class='infoFieldValue' >".$userData->getLastName().", ".$userData->getFirstName()." (".$userData->getMatricule().")"."</label>
<label class='infoFieldTitleWithBar' >Email</label>
<a class='infoFieldValue' href='mailto:".$userData->getEmail()."' target='_blank'>".$userData->getEmail()."</a>
<label class='infoFieldTitleWithBar' >Téléphone</label>
<label class='infoFieldValue'>".$userData->getPhone()."</label>
<label class='infoFieldTitleWithBar' >Adresse</label>
<label class='infoFieldValue'>".$userData->getAddress().", ".$userData->getCity().", ".$userData->getZipCode()."</label>
<img id='googleMap' src=".getMapImageUrl($tripInfo)."></img>
<div class='bottomBorderedElement' style='margin-top:8px'>
<label style='display:inline'>Désire faire du covoiturage</label>
<label class='infoFieldValue' style='float:right; font-weight:bold'>".($demande->isCarpooling() ? 'Oui' : 'Non')."</label>
</div>
<div class='bottomBorderedElement' style='margin-top:4px'>
<label style='display:inline'>Désire faire du covoiturage avec d'autres</label>
<label class='infoFieldValue' style='float:right; font-weight:bold'>".($demande->isCarpoolingOthers() ? 'Oui' : 'Non')."</label>
</div>
</div>
<div id='otherInfos' style='height:100%'>
<label class='infoFieldTitleWithBar' ' >Méthode de paiement</label>
<label class='infoFieldValue' >".util::getPaymentMethodNameFromId(($demande->getPaymentMethod()))."</label>
<label class='infoFieldTitleWithBar' ' >Date de création</label>
<label class='infoFieldValue' >".$demande->getModificationDate()."</label>
<label class='infoFieldTitleWithBar' ' >Date de dernière modification</label>
<label class='infoFieldValue' >".$demande->getCreationDate()."</label>
<label class='infoFieldTitleWithBar' ' >Temps de trajet estimé</label>
<label class='infoFieldValue' >".$demande->getTripInfo()->getDurationInMinutes()." minutes</label>
</div>
<div id='options' style='height:100%'>
</div>
</div>");
}
else
{
exit(0);
}
function getMapImageUrl(tripInfo $tripInfo)
{
$location = $tripInfo->getLatitude().",".$tripInfo->getLongitude();
$location = rawurlencode(mb_convert_encoding($location,"UTF-8"));
$poly = "45.504448,-73.614204";
return "http://maps.googleapis.com/maps/api/staticmap?center=$location&zoom=10&size=375x200&markers=color:red%7Clabel:P%7C".$poly."&markers=color:blue%7Clabel:S%7C".$location."&maptype=roadmap&sensor=false";
}
?>