Posted by Poul
2016-05-28

Hi, Tom

I'm implementing Address Book Script to do something you probably don't expect :) I'm try to use it for CDR viewer. I'm almost done but I have problem witch search.

I need to do search for date grader than (>) and lower than (<).

I found http://www.phpkobo.com/address_book.php#Article_3042 but it's only half of way :/

Can You show me the way how to do that ?

Best regards,
Poul
Posted by Tom
2016-05-30

>I need to do search for date grader than (>) and lower than (<).

Hi, the following example is for the 'rlog_edit_date_time' field.
In web/codelib/asc/dl.fl.address.inc.php, find 'rlog_edit_date_time' array, shown below:
'rlog_edit_date_time'=>array(
XA_CLASS=>'cls_rlog_date_time',
XA_CAPTION=>RSTR_EDIT_DATE_TIME,
XA_FORMAT=>'Y-m-d H:i:s',
XA_LIST=>'(sr)(rlog)(edit_save)'
),
Add the following two arrays after.
'rlog_edit_date_time_s'=>array(
XA_CLASS=>'cls_rlog_date_time',
XA_NAME_RS=>'rlog_edit_date_time',
XA_FORMAT=>'Y-m-d H:i:s',
XA_SEARCH_OP=>'s>',
XA_LIST=>'(sp)'
),

'rlog_edit_date_time_e'=>array(
XA_CLASS=>'cls_rlog_date_time',
XA_NAME_RS=>'rlog_edit_date_time',
XA_FORMAT=>'Y-m-d H:i:s',
XA_SEARCH_OP=>'s<',
XA_LIST=>'(sp)'
),
In web/staff/tpl.address.search.inc.php, you can create the greater-than and lower-than criteria input box with the following code:
<?php echo $hm->Zb( 'sp:def:rlog_edit_date_time_s' ); ?>
<?php echo $hm->Zb( 'sp:def:rlog_edit_date_time_e' ); ?>