This tag can be used in tandem with the rp_datemenu and rp_timemenu cTags. It concatenates date, time and/or datetime values from html select menus for input into MySQL date, time or datetime columns.
Parameters
-dayvalue
string, optional
This optional parameter takes the day value from the html select menus generated by the DateMenu cTag.
-monthvalue
string, optional
This optional parameter takes the month value from the html select menus generated by the DateMenu cTag.
-yearvalue
string, optional
This optional parameter takes the year value from the html select menus generated by the DateMenu cTag.
-hourvalue
string, optional
This optional parameter takes the hour value from the html select menus generated by the TimeMenu cTag.
-minutevalue
string, optional
This optional parameter takes the minute value from the html select menus generated by the TimeMenu cTag.
-secondvalue
string, optional
This optional parameter takes the second value from the html select menus generated by the TimeMenu cTag.
-ampm
string, optional
This optional parameter takes the AM/PM value from the html radio buttons generated by the TimeMenu cTag.
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
<?LassoScript
/* Author: Randy Phillips
Company: phillipsIT
Date: 11/21/2005
LP8 Version
This tag can be used in tandem with the DateMenu and TimeMenu cTags.
It concatenates date, time and/or datetime values for input into MySQL date, time or datetime columns.
The optional -dayvalue, -monthvalue and -yearvalue parameters accept values from the
html select menus generated by the DateMenu cTag for input into a MySQL date column.
The optional -hourvalue, -minutevalue, -secondvalue, and -ampm parameters accept values from the
html select menus generated by the TimeMenu cTag for input into MySQL time or datetime columns.
*/
define_tag:'mysqldatetime', -namespace='RP_',
-optional='dayvalue',
-optional='monthvalue',
-optional='yearvalue',
-optional='hourvalue',
-optional='minutevalue',
-optional='secondvalue',
-optional='ampm';
local:'dateconcat' = (string);
// if month text name are used in DateMenu convert to number
if: (local_defined:'monthvalue');
select: #monthvalue;
case:'January';
local:'mv' = '01';
case:'February';
local:'mv' = '02';
case:'March';
local:'mv' = '03';
case:'April';
local:'mv' = '04';
case:'May';
local:'mv' = '05';
case:'June';
local:'mv' = '06';
case:'July';
local:'mv' = '07';
case:'August';
local:'mv' = '08';
case:'September';
local:'mv' = '09';
case:'October';
local:'mv' = '10';
case:'November';
local:'mv' = '11';
case:'December';
local:'mv' = '12';
case;
local:'mv' = #monthvalue;
/select;
/if;
// if date is in use format and concatenate date string
if:(local_defined:'yearvalue') && (local_defined:'dayvalue') && (local_defined:'monthvalue');
#dateconcat += #yearvalue + '-' + #mv + '-' + #dayvalue;
/if;
//if time is in use format and concatenate time string
if: (local_defined:'hourvalue') && (local_defined:'minutevalue');
if: (local_defined:'ampm') && #ampm == 'pm';
select: #hourvalue;
case:12;
local: 'hv' = 00;
case;
local: 'hv' = (integer:#hourvalue) + 12;
/select;
else;
local: 'hv' = #hourvalue;
/if;
if: !(local_defined:'secondvalue');
local: 'secondvalue' = 00;
// if month text name are used in DateMenu convert to number
if: (local_defined:'monthvalue');
select: #monthvalue;
case:'January';
local:'mv' = '01';
case:'February';
local:'mv' = '02';
case:'March';
local:'mv' = '03';
case:'April';
local:'mv' = '04';
case:'May';
local:'mv' = '05';
case:'June';
local:'mv' = '06';
case:'July';
local:'mv' = '07';
case:'August';
local:'mv' = '08';
case:'September';
local:'mv' = '09';
case:'October';
local:'mv' = '10';
case:'November';
local:'mv' = '11';
case:'December';
local:'mv' = '12';
case;
local:'mv' = #monthvalue;
/select;
/if;
// if date is in use format and concatenate date string
if:(local_defined:'yearvalue') && (local_defined:'dayvalue') && (local_defined:'monthvalue');
#dateconcat += #yearvalue + '-' + #mv + '-' + #dayvalue;
/if;
//if time is in use format and concatenate time string
if: (local_defined:'hourvalue') && (local_defined:'minutevalue');
if: (local_defined:'ampm') && #ampm == 'pm';
select: #hourvalue;
case:12;
local: 'hv' = 00;
case;
local: 'hv' = (integer:#hourvalue) + 12;
/select;
else;
local: 'hv' = #hourvalue;
/if;
if: !(local_defined:'secondvalue');
local: 'secondvalue' = 00;
/if;
if:(local_defined:'yearvalue') && (local_defined:'dayvalue') && (local_defined:'monthvalue');
#dateconcat += ' ' + #hv + ':' + #minutevalue + ':' + #secondvalue;
else;
#dateconcat += #hv + ':' + #minutevalue + ':' + #secondvalue;
/if;
/if;
return: #dateconcat;
/define_tag;
?>