Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Štvrtok, 18. apríl 2024
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  if/then clause to control URL display in array

phpMyEdit Configuration     if/then clause to control URL display in array
Odoslať novú tému   Odpovedať na tému    
 
jeff halper     Založený: 14.01.2017   Príspevky: 1  
Príspevok Zaslal: 2017-01-14 21:13
Návrat hore  Odpovedať s citátom     

My database has a field called 'tracking' which has a shipping tracking number. I've made it clickable and it opens in new window and tracks the shipment just fine.

Problem is - most tracking number begin with 1 and are UPS - but sometimes we use FEDEX or USPS - so I want to make the URL portion of ewach record change based on what the firest character of teh field 'tracking' contains -

Something like this - this does not work -

Any ideas on how to accomplish this?

if substr $opts['fdd']['tracking,0,1'] === 1 {

$opts['fdd']['tracking'] = array(
'name' => 'Tracking',
'select' => 'T',
'maxlen' => 100,
'URLtarget' => '_blank',
'URL' => 'https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=$link',

'sort' => true

);
}
else
{
$opts['fdd']['tracking'] = array(
'name' => 'Tracking',
'select' => 'T',
'maxlen' => 100,
'URLtarget' => '_blank',
'URL' => 'https://fedex.com/WebTracking/track?track=yes&trackNums=$link',

'sort' => true

);
}

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2017-01-15 20:42
Návrat hore  Odpovedať s citátom     

Abandon the built in URL option and refer to CONCAT examples where you can use IF statements and create the HTML for the A HREF tag.

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov