- . '/' . $platal->ns . "payment/paypal_return/".S::v('uid')."?comment=".urlencode(Env::v('comment'));
-
- $this->infos = Array();
-
- $this->infos['commercant'] = Array(
- 'business' => $globals->money->paypal_compte,
- 'rm' => 2,
- 'return' => $roboturl,
- 'cn' => 'Commentaires',
- 'no_shipping' => 1,
- 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ?
- 'Revenir sur polytechnique.org' :
- 'Revenir sur polytechnique.net');
-
- $info_client = Array(
- 'first_name' => S::v('prenom'),
- 'last_name' => $name,
- 'email' => S::user()->bestEmail());
-
- $res = XDB::query(
- "SELECT a.adr1 AS address1, a.adr2 AS address2,
- a.city, a.postcode AS zip, a.country,
- IF(t.tel, t.tel, q.profile_mobile) AS night_phone_b
- FROM auth_user_quick AS q
- LEFT JOIN adresses AS a ON (q.user_id = a.uid AND FIND_IN_SET('active', a.statut))
- LEFT JOIN tels AS t ON (t.uid = a.uid AND t.adrid = a.adrid)
- WHERE q.user_id = {?}
- LIMIT 1", S::v('uid'));
+ . '/' . $platal->ns . "payment/paypal_return/" . S::v('uid')
+ . "?comment=" . urlencode(Env::v('comment'));
+
+ $this->infos = array(
+ 'commercant' => array(
+ 'business' => $globals->money->paypal_compte,
+ 'rm' => 2,
+ 'return' => $roboturl,
+ 'cn' => 'Commentaires',
+ 'no_shipping' => 1,
+ 'cbt' => empty($GLOBALS['IS_XNET_SITE']) ? 'Revenir sur polytechnique.org.' : 'Revenir sur polytechnique.net.'
+ )
+ );
+
+ $info_client = array(
+ 'first_name' => $user->firstName(),
+ 'last_name' => $user->lastName(),
+ 'email' => $user->bestEmail()
+ );
+
+ $res = XDB::query("SELECT pa.text, gl.name AS city, pa.postalCode AS zip, pa.countryId AS country,
+ IF(pp1.display_tel != '', pp1.display_tel, pp2.display_tel) AS night_phone_b
+ FROM profile_addresses AS pa
+ LEFT JOIN profile_phones AS pp1 ON (pp1.pid = pa.pid AND pp1.link_type = 'address'
+ AND pp1.link_id = pa.id)
+ LEFT JOIN profile_phones AS pp2 ON (pp2.pid = pa.pid AND pp2.link_type = 'user'
+ AND pp2.link_id = 0)
+ LEFT JOIN geoloc_localities AS gl ON (gl.id = pa.localityId)
+ WHERE pa.pid = {?} AND FIND_IN_SET('current', pa.flags)
+ LIMIT 1",
+ $user->profile()->id());