jeff halper
Založený: 14.01.2017
Príspevky: 1
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)
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
|
|
|