diff --git a/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php b/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php index 0ea4c060..5a792927 100644 --- a/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php +++ b/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Michael Cargile LICENSE: AGPLv2 # # CHANGES # 131016-1948 - Initial Build based upon lead_tools.php @@ -10,10 +10,11 @@ # 141007-2036 - Finalized adding QXZ translation to all admin files # 141229-2028 - Added code for on-the-fly language translations display # 150312-1508 - Allow for single quotes in vicidial_list data fields +# 170225-1436 - Added date/time range options # -$version = '2.12-6'; -$build = '150312-1508'; +$version = '2.14-7'; +$build = '170225-1436'; # This limit is to prevent data inconsistancies. # If there are too many leads in a list this @@ -72,8 +73,10 @@ $confirm_delete = preg_replace('/[^-_0-9a-zA-Z]/','',$confirm_delete); $confirm_callback = preg_replace('/[^-_0-9a-zA-Z]/','',$confirm_callback); $delete_status = preg_replace('/[^-_0-9a-zA-Z]/','',$delete_status); +$DBlink=''; if ($DB) { + $DBlink="?DB=$DB"; echo "

DB = $DB | "._QXZ("move_submit")." = $move_submit | "._QXZ("update_submit")." = $update_submit | "._QXZ("delete_submit")." = $delete_submit | "._QXZ("callback_submit")." = $callback_submit | "._QXZ("confirm_move")." = $confirm_move | "._QXZ("confirm_update")." = $confirm_update | "._QXZ("confirm_delete")." = $confirm_delete | "._QXZ("confirm_callback")." = $confirm_callback

"; } @@ -185,7 +188,8 @@ echo "\n"; echo "\n"; ?> ADMINISTRATION: Lead Tools\n"; +echo ""._QXZ("ADMINISTRATION").": "._QXZ("Advanced Lead Tools")."\n"; ##### BEGIN Set variables to make header show properly ##### $ADD = '999998'; @@ -480,8 +635,8 @@ $hh = 'admin'; $LOGast_admin_access = '1'; $SSoutbound_autodial_active = '1'; $ADMIN = 'admin.php'; -$page_width='770'; -$section_width='750'; +$page_width='870'; +$section_width='850'; $header_font_size='3'; $subheader_font_size='2'; $subcamp_font_size='2'; @@ -509,6 +664,7 @@ echo "\n"; echo "   \n"; +##### BEGIN move functions ##### # move confirmation page if ($move_submit == "move" ) { @@ -529,7 +685,11 @@ if ($move_submit == "move" ) $move_owner=""; $move_state=""; $move_entry_date=""; + $move_entry_date_end=""; + $move_entry_date_op=""; $move_modify_date=""; + $move_modify_date_end=""; + $move_modify_date_op=""; $move_security_phrase=""; $move_from_list=""; $move_to_list=""; @@ -570,8 +730,16 @@ if ($move_submit == "move" ) elseif (isset($_POST["move_state"])) {$move_state=$_POST["move_state"];} if (isset($_GET["move_entry_date"])) {$move_entry_date=$_GET["move_entry_date"];} elseif (isset($_POST["move_entry_date"])) {$move_entry_date=$_POST["move_entry_date"];} + if (isset($_GET["move_entry_date_end"])) {$move_entry_date_end=$_GET["move_entry_date_end"];} + elseif (isset($_POST["move_entry_date_end"])) {$move_entry_date_end=$_POST["move_entry_date_end"];} + if (isset($_GET["move_entry_date_op"])) {$move_entry_date_op=$_GET["move_entry_date_op"];} + elseif (isset($_POST["move_entry_date_op"])) {$move_entry_date_op=$_POST["move_entry_date_op"];} if (isset($_GET["move_modify_date"])) {$move_modify_date=$_GET["move_modify_date"];} elseif (isset($_POST["move_modify_date"])) {$move_modify_date=$_POST["move_modify_date"];} + if (isset($_GET["move_modify_date_end"])) {$move_modify_date_end=$_GET["move_modify_date_end"];} + elseif (isset($_POST["move_modify_date_end"])) {$move_modify_date_end=$_POST["move_modify_date_end"];} + if (isset($_GET["move_modify_date_op"])) {$move_modify_date_op=$_GET["move_modify_date_op"];} + elseif (isset($_POST["move_modify_date_op"])) {$move_modify_date_op=$_POST["move_modify_date_op"];} if (isset($_GET["move_security_phrase"])) {$move_security_phrase=$_GET["move_security_phrase"];} elseif (isset($_POST["move_security_phrase"])) {$move_security_phrase=$_POST["move_security_phrase"];} if (isset($_GET["move_from_list"])) {$move_from_list=$_GET["move_from_list"];} @@ -587,7 +755,7 @@ if ($move_submit == "move" ) if ($DB) { - echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; + echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_entry_date_end")." = $move_entry_date_end | "._QXZ("move_entry_date_op")." = $move_entry_date_op | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_modify_date_end")." = $move_modify_date_end | "._QXZ("move_modify_date_op")." = $move_modify_date_op | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; } # filter out anything bad @@ -606,8 +774,12 @@ if ($move_submit == "move" ) $move_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_source_id); $move_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_owner); $move_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_state); - $move_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_entry_date); - $move_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_modify_date); + $move_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_entry_date); + $move_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_entry_date_end); + $move_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$move_entry_date_op); + $move_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_modify_date); + $move_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_modify_date_end); + $move_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$move_modify_date_op); $move_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_security_phrase); $move_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_status); $move_from_list = preg_replace('/[^0-9]/','',$move_from_list); @@ -615,11 +787,6 @@ if ($move_submit == "move" ) $move_count_num = preg_replace('/[^0-9]/','',$move_count_num); $move_count_op = preg_replace('/[^<>=]/','',$move_count_op); - if ($DB) - { - echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; - } - # build the count operation phrase $move_count_op_phrase=""; if ( $move_count_op == "<" ) @@ -639,6 +806,91 @@ if ($move_submit == "move" ) $move_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the move_entry_date operation phrase + $move_entry_date_op_phrase=""; + $move_entry_operator_a = '>='; $move_entry_operator_b = '<='; + if ( $move_entry_date_op == "<" ) + { + $move_entry_operator_a = '>='; $move_entry_operator_b = '<'; + $move_entry_date_end = $move_entry_date; + $move_entry_date = '0000-00-00 00:00:00'; + $move_entry_date_op_phrase= _QXZ("less than")." "; + } + elseif ( $move_entry_date_op == "<=" ) + { + $move_entry_date_end = $move_entry_date; + $move_entry_date = '0000-00-00 00:00:00'; + $move_entry_date_op_phrase= _QXZ("less than or equal to")." "; + } + elseif ( $move_entry_date_op == ">" ) + { + $move_entry_operator_a = '>'; $move_entry_operator_b = '<'; + $move_entry_date_end = '2100-00-00 00:00:00'; + $move_entry_date_op_phrase= _QXZ("greater than")." "; + } + elseif ( $move_entry_date_op == ">=" ) + { + $move_entry_date_end = '2100-00-00 00:00:00'; + $move_entry_date_op_phrase= _QXZ("greater than or equal to")." "; + } + elseif ( $move_entry_date_op == "range" ) + { + $move_entry_date_op_phrase= _QXZ("range")." "; + } + elseif ( $move_entry_date_op == "=" ) + { + $move_entry_date_end = $move_entry_date; + $move_entry_date_op_phrase= _QXZ("equal to")." "; + } + + # build the move_modify_date operation phrase + $move_modify_date_op_phrase=""; + $move_modify_operator_a = '>='; $move_modify_operator_b = '<='; + if ( $move_modify_date_op == "<" ) + { + $move_modify_operator_a = '>='; $move_modify_operator_b = '<'; + $move_entry_date_end = $move_entry_date; + $move_entry_date = '0000-00-00 00:00:00'; + $move_modify_date_op_phrase= _QXZ("less than")." "; + } + elseif ( $move_modify_date_op == "<=" ) + { + $move_entry_date_end = $move_entry_date; + $move_entry_date = '0000-00-00 00:00:00'; + $move_modify_date_op_phrase= _QXZ("less than or equal to")." "; + } + elseif ( $move_modify_date_op == ">" ) + { + $move_modify_operator_a = '>'; $move_modify_operator_b = '<'; + $move_entry_date_end = '2100-00-00 00:00:00'; + $move_modify_date_op_phrase= _QXZ("greater than")." "; + } + elseif ( $move_modify_date_op == ">=" ) + { + $move_entry_date_end = '2100-00-00 00:00:00'; + $move_modify_date_op_phrase= _QXZ("greater than or equal to")." "; + } + elseif ( $move_modify_date_op == "range" ) + { + $move_modify_date_op_phrase= _QXZ("range")." "; + } + elseif ( $move_modify_date_op == "=" ) + { + $move_entry_date_end = $move_entry_date; + $move_modify_date_op_phrase= _QXZ("equal to")." "; + } + + if (strlen($move_entry_date) == 10) {$move_entry_date .= " 00:00:00";} + if (strlen($move_entry_date_end) == 10) {$move_entry_date_end .= " 23:59:59";} + if (strlen($move_modify_date) == 10) {$move_modify_date .= " 00:00:00";} + if (strlen($move_modify_date_end) == 10) {$move_modify_date_end .= " 23:59:59";} + + + if ($DB) + { + echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_entry_date_end")." = $move_entry_date_end | "._QXZ("move_entry_date_op")." = $move_entry_date_op | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_modify_date_end")." = $move_modify_date_end | "._QXZ("move_modify_date_op")." = $move_modify_date_op | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; + } + # make sure the required fields are set if ($move_from_list == '') { missing_required_field('From List'); } if ($move_to_list == '') { missing_required_field('To List'); } @@ -733,8 +985,8 @@ if ($move_submit == "move" ) } else { - $sql_where = $sql_where . " and entry_date >= '$move_entry_date 00:00:00' and entry_date <= '$move_entry_date 23:59:59' "; - $move_parm = $move_parm . "    "._QXZ("entry date was on")." $move_entry_date
"; + $sql_where = $sql_where . " and entry_date $move_entry_operator_a '$move_entry_date' and entry_date $move_entry_operator_b '$move_entry_date_end' "; + $move_parm = $move_parm . "    "._QXZ("entry date was on")." $move_entry_date - $move_entry_date_end
"; } } elseif ($enable_move_entry_date == "enabled") @@ -750,8 +1002,8 @@ if ($move_submit == "move" ) } else { - $sql_where = $sql_where . " and modify_date >= '$move_modify_date 00:00:00' and modify_date <= '$move_modify_date 23:59:59' "; - $move_parm = $move_parm . "    "._QXZ("last modify date was on")." $move_modify_date
"; + $sql_where = $sql_where . " and modify_date $move_modify_operator_a '$move_modify_date' and modify_date $move_modify_operator_b '$move_modify_date_end' "; + $move_parm = $move_parm . "    "._QXZ("last modify date was on")." $move_modify_date - $move_modify_date_end
"; } } elseif ($enable_move_modify_date == "enabled") @@ -797,7 +1049,7 @@ if ($move_submit == "move" ) echo "\n"; echo "\n"; echo "

"._QXZ("Sorry. This operation will cause list")." $move_to_list "._QXZ("to exceed")." $list_lead_limit "._QXZ("leads which is not allowed").".

\n"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; echo "\n\n"; } else @@ -820,7 +1072,11 @@ if ($move_submit == "move" ) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -830,7 +1086,7 @@ if ($move_submit == "move" ) echo "\n"; echo "\n"; echo "\n"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; echo "\n\n"; } } @@ -855,7 +1111,11 @@ if ($confirm_move == "confirm") $move_owner=""; $move_state=""; $move_entry_date=""; + $move_entry_date_end=""; + $move_entry_date_op=""; $move_modify_date=""; + $move_modify_date_end=""; + $move_modify_date_op=""; $move_security_phrase=""; $move_from_list=""; $move_to_list=""; @@ -896,8 +1156,16 @@ if ($confirm_move == "confirm") elseif (isset($_POST["move_state"])) {$move_state=$_POST["move_state"];} if (isset($_GET["move_entry_date"])) {$move_entry_date=$_GET["move_entry_date"];} elseif (isset($_POST["move_entry_date"])) {$move_entry_date=$_POST["move_entry_date"];} + if (isset($_GET["move_entry_date_end"])) {$move_entry_date_end=$_GET["move_entry_date_end"];} + elseif (isset($_POST["move_entry_date_end"])) {$move_entry_date_end=$_POST["move_entry_date_end"];} + if (isset($_GET["move_entry_date_op"])) {$move_entry_date_op=$_GET["move_entry_date_op"];} + elseif (isset($_POST["move_entry_date_op"])) {$move_entry_date_op=$_POST["move_entry_date_op"];} if (isset($_GET["move_modify_date"])) {$move_modify_date=$_GET["move_modify_date"];} elseif (isset($_POST["move_modify_date"])) {$move_modify_date=$_POST["move_modify_date"];} + if (isset($_GET["move_modify_date_end"])) {$move_modify_date_end=$_GET["move_modify_date_end"];} + elseif (isset($_POST["move_modify_date_end"])) {$move_modify_date_end=$_POST["move_modify_date_end"];} + if (isset($_GET["move_modify_date_op"])) {$move_modify_date_op=$_GET["move_modify_date_op"];} + elseif (isset($_POST["move_modify_date_op"])) {$move_modify_date_op=$_POST["move_modify_date_op"];} if (isset($_GET["move_security_phrase"])) {$move_security_phrase=$_GET["move_security_phrase"];} elseif (isset($_POST["move_security_phrase"])) {$move_security_phrase=$_POST["move_security_phrase"];} if (isset($_GET["move_from_list"])) {$move_from_list=$_GET["move_from_list"];} @@ -913,7 +1181,7 @@ if ($confirm_move == "confirm") if ($DB) { - echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; + echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_entry_date_end")." = $move_entry_date_end | "._QXZ("move_entry_date_op")." = $move_entry_date_op | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_modify_date_end")." = $move_modify_date_end | "._QXZ("move_modify_date_op")." = $move_modify_date_op | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; } # filter out anything bad @@ -932,8 +1200,12 @@ if ($confirm_move == "confirm") $move_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_source_id); $move_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_owner); $move_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_state); - $move_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_entry_date); - $move_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_modify_date); + $move_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_entry_date); + $move_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_entry_date_end); + $move_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$move_entry_date_op); + $move_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_modify_date); + $move_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$move_modify_date_end); + $move_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$move_modify_date_op); $move_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$move_security_phrase); $move_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$move_status); $move_from_list = preg_replace('/[^0-9]/','',$move_from_list); @@ -941,11 +1213,7 @@ if ($confirm_move == "confirm") $move_count_num = preg_replace('/[^0-9]/','',$move_count_num); $move_count_op = preg_replace('/[^<>=]/','',$move_count_op); - if ($DB) - { - echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; - } - + # count operator $move_count_op_phrase=""; if ( $move_count_op == "<" ) { @@ -964,6 +1232,78 @@ if ($confirm_move == "confirm") $move_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the move_entry_date operation phrase + $move_entry_date_op_phrase=""; + $move_entry_operator_a = '>='; $move_entry_operator_b = '<='; + if ( $move_entry_date_op == "<" ) + { + $move_entry_operator_a = '>='; $move_entry_operator_b = '<'; + $move_entry_date_op_phrase= _QXZ("less than")." "; + } + elseif ( $move_entry_date_op == "<=" ) + { + $move_entry_date_op_phrase= _QXZ("less than or equal to")." "; + } + elseif ( $move_entry_date_op == ">" ) + { + $move_entry_operator_a = '>'; $move_entry_operator_b = '<'; + $move_entry_date_op_phrase= _QXZ("greater than")." "; + } + elseif ( $move_entry_date_op == ">=" ) + { + $move_entry_date_op_phrase= _QXZ("greater than or equal to")." "; + } + elseif ( $move_entry_date_op == "range" ) + { + $move_entry_date_op_phrase= _QXZ("range")." "; + } + elseif ( $move_entry_date_op == "=" ) + { + $move_entry_date_op_phrase= _QXZ("equal to")." "; + } + + # build the move_modify_date operation phrase + $move_modify_date_op_phrase=""; + $move_modify_operator_a = '>='; $move_modify_operator_b = '<='; + if ( $move_modify_date_op == "<" ) + { + $move_modify_operator_a = '>='; $move_modify_operator_b = '<'; + $move_modify_date_op_phrase= _QXZ("less than")." "; + } + elseif ( $move_modify_date_op == "<=" ) + { + $move_modify_date_op_phrase= _QXZ("less than or equal to")." "; + } + elseif ( $move_modify_date_op == ">" ) + { + $move_modify_operator_a = '>'; $move_modify_operator_b = '<'; + $move_modify_date_op_phrase= _QXZ("greater than")." "; + } + elseif ( $move_modify_date_op == ">=" ) + { + $move_modify_date_op_phrase= _QXZ("greater than or equal to")." "; + } + elseif ( $move_modify_date_op == "range" ) + { + $move_modify_date_op_phrase= _QXZ("range")." "; + } + elseif ( $move_modify_date_op == "=" ) + { + $move_modify_date_op_phrase= _QXZ("equal to")." "; + } + + if (strlen($move_entry_date) == 10) {$move_entry_date .= " 00:00:00";} + if (strlen($move_entry_date_end) == 10) {$move_entry_date_end .= " 23:59:59";} + if (strlen($move_modify_date) == 10) {$move_modify_date .= " 00:00:00";} + if (strlen($move_modify_date_end) == 10) {$move_modify_date_end .= " 23:59:59";} + + + if ($DB) + { + echo "

"._QXZ("enable_move_status")." = $enable_move_status | "._QXZ("enable_move_country_code")." = $enable_move_country_code | "._QXZ("enable_move_vendor_lead_code")." = $enable_move_vendor_lead_code | "._QXZ("enable_move_source_id")." = $enable_move_source_id | "._QXZ("enable_move_owner")." = $enable_move_owner | "._QXZ("enable_move_state")." = $enable_move_state | "._QXZ("enable_move_entry_date")." = $enable_move_entry_date | "._QXZ("enable_move_modify_date")." = $enable_move_modify_date | "._QXZ("enable_move_security_phrase")." = $enable_move_security_phrase | "._QXZ("enable_move_count")." = $enable_move_count | "._QXZ("move_country_code")." = $move_country_code | "._QXZ("move_vendor_lead_code")." = $move_vendor_lead_code | "._QXZ("move_source_id")." = $move_source_id | "._QXZ("move_owner")." = $move_owner | "._QXZ("move_state")." = $move_state | "._QXZ("move_entry_date")." = $move_entry_date | "._QXZ("move_entry_date_end")." = $move_entry_date_end | "._QXZ("move_entry_date_op")." = $move_entry_date_op | "._QXZ("move_modify_date")." = $move_modify_date | "._QXZ("move_modify_date_end")." = $move_modify_date_end | "._QXZ("move_modify_date_op")." = $move_modify_date_op | "._QXZ("move_security_phrase")." = $move_security_phrase | "._QXZ("move_from_list")." = $move_from_list | "._QXZ("move_to_list")." = $move_to_list | "._QXZ("move_status")." = $move_status | "._QXZ("move_count_op")." = $move_count_op | "._QXZ("move_count_num")." = $move_count_num

"; + } + + # make sure the required fields are set if ($move_from_list == '') { missing_required_field('From List'); } if ($move_to_list == '') { missing_required_field('To List'); } @@ -1057,8 +1397,8 @@ if ($confirm_move == "confirm") } else { - $sql_where = $sql_where . " and entry_date >= '$move_entry_date 00:00:00' and entry_date <= '$move_entry_date 23:59:59' "; - $move_parm = $move_parm . "    "._QXZ("entry date was on")." $move_entry_date
"; + $sql_where = $sql_where . " and entry_date $move_entry_operator_a '$move_entry_date' and entry_date $move_entry_operator_b '$move_entry_date_end' "; + $move_parm = $move_parm . "    "._QXZ("entry date was on")." $move_entry_date - $move_entry_date_end
"; } } elseif ($enable_move_entry_date == "enabled") @@ -1074,8 +1414,8 @@ if ($confirm_move == "confirm") } else { - $sql_where = $sql_where . " and modify_date >= '$move_modify_date 00:00:00' and modify_date <= '$move_modify_date 23:59:59' "; - $move_parm = $move_parm . "    "._QXZ("last modify date was on")." $move_modify_date
"; + $sql_where = $sql_where . " and modify_date $move_modify_operator_a '$move_modify_date' and modify_date $move_modify_operator_b '$move_modify_date_end' "; + $move_parm = $move_parm . "    "._QXZ("last modify date was on")." $move_modify_date - $move_modify_date_end
"; } } elseif ($enable_move_modify_date == "enabled") @@ -1111,11 +1451,12 @@ if ($confirm_move == "confirm") $admin_log_rslt=mysql_to_mysqli($admin_log_stmt, $link); echo "

$move_sentence

"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; } +##### END move process ##### -# update confirmation page +##### BEGIN update confirmation page ##### if ($update_submit == "update" ) { # get the variables @@ -1135,7 +1476,11 @@ if ($update_submit == "update" ) $update_owner=""; $update_state=""; $update_entry_date=""; + $update_entry_date_end=""; + $update_entry_date_op=""; $update_modify_date=""; + $update_modify_date_end=""; + $update_modify_date_op=""; $update_security_phrase=""; $update_list=""; $update_to_status=""; @@ -1176,8 +1521,16 @@ if ($update_submit == "update" ) elseif (isset($_POST["update_state"])) {$update_state=$_POST["update_state"];} if (isset($_GET["update_entry_date"])) {$update_entry_date=$_GET["update_entry_date"];} elseif (isset($_POST["update_entry_date"])) {$update_entry_date=$_POST["update_entry_date"];} + if (isset($_GET["update_entry_date_end"])) {$update_entry_date_end=$_GET["update_entry_date_end"];} + elseif (isset($_POST["update_entry_date_end"])) {$update_entry_date_end=$_POST["update_entry_date_end"];} + if (isset($_GET["update_entry_date_op"])) {$update_entry_date_op=$_GET["update_entry_date_op"];} + elseif (isset($_POST["update_entry_date_op"])) {$update_entry_date_op=$_POST["update_entry_date_op"];} if (isset($_GET["update_modify_date"])) {$update_modify_date=$_GET["update_modify_date"];} elseif (isset($_POST["update_modify_date"])) {$update_modify_date=$_POST["update_modify_date"];} + if (isset($_GET["update_modify_date_end"])) {$update_modify_date_end=$_GET["update_modify_date_end"];} + elseif (isset($_POST["update_modify_date_end"])) {$update_modify_date_end=$_POST["update_modify_date_end"];} + if (isset($_GET["update_modify_date_op"])) {$update_modify_date_op=$_GET["update_modify_date_op"];} + elseif (isset($_POST["update_modify_date_op"])) {$update_modify_date_op=$_POST["update_modify_date_op"];} if (isset($_GET["update_security_phrase"])) {$update_security_phrase=$_GET["update_security_phrase"];} elseif (isset($_POST["update_security_phrase"])) {$update_security_phrase=$_POST["update_security_phrase"];} if (isset($_GET["update_list"])) {$update_list=$_GET["update_list"];} @@ -1193,7 +1546,7 @@ if ($update_submit == "update" ) if ($DB) { - echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; + echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_entry_date_end")." = $update_entry_date_end | "._QXZ("update_entry_date_op")." = $update_entry_date_op | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_modify_date_end")." = $update_modify_date_end | "._QXZ("update_modify_date_op")." = $update_modify_date_op | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; } # filter out anything bad @@ -1212,8 +1565,12 @@ if ($update_submit == "update" ) $update_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_source_id); $update_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_owner); $update_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_state); - $update_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_entry_date); - $update_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_modify_date); + $update_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_entry_date); + $update_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_entry_date_end); + $update_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$update_entry_date_op); + $update_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_modify_date); + $update_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_modify_date_end); + $update_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$update_modify_date_op); $update_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_security_phrase); $update_to_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_to_status); $update_from_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_from_status); @@ -1221,11 +1578,6 @@ if ($update_submit == "update" ) $update_count_num = preg_replace('/[^0-9]/','',$update_count_num); $update_count_op = preg_replace('/[^<>=]/','',$update_count_op); - if ($DB) - { - echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_state")." = $update_entry_date | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; - } - $update_count_op_phrase=""; if ( $update_count_op == "<" ) { @@ -1244,6 +1596,90 @@ if ($update_submit == "update" ) $update_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the update_entry_date operation phrase + $update_entry_date_op_phrase=""; + $update_entry_operator_a = '>='; $update_entry_operator_b = '<='; + if ( $update_entry_date_op == "<" ) + { + $update_entry_operator_a = '>='; $update_entry_operator_b = '<'; + $update_entry_date_end = $update_entry_date; + $update_entry_date = '0000-00-00 00:00:00'; + $update_entry_date_op_phrase= _QXZ("less than")." $update_entry_date_end"; + } + elseif ( $update_entry_date_op == "<=" ) + { + $update_entry_date_end = $update_entry_date; + $update_entry_date = '0000-00-00 00:00:00'; + $update_entry_date_op_phrase= _QXZ("less than or equal to")." $update_entry_date_end"; + } + elseif ( $update_entry_date_op == ">" ) + { + $update_entry_operator_a = '>'; $update_entry_operator_b = '<'; + $update_entry_date_end = '2100-00-00 00:00:00'; + $update_entry_date_op_phrase= _QXZ("greater than")." $update_entry_date"; + } + elseif ( $update_entry_date_op == ">=" ) + { + $update_entry_date_end = '2100-00-00 00:00:00'; + $update_entry_date_op_phrase= _QXZ("greater than or equal to")." $update_entry_date"; + } + elseif ( $update_entry_date_op == "range" ) + { + $update_entry_date_op_phrase= _QXZ("range")." $update_entry_date - $update_entry_date_end"; + } + elseif ( $update_entry_date_op == "=" ) + { + $update_entry_date_end = $update_entry_date; + $update_entry_date_op_phrase= _QXZ("equal to")." $update_entry_date"; + } + + # build the update_modify_date operation phrase + $update_modify_date_op_phrase=""; + $update_modify_operator_a = '>='; $update_modify_operator_b = '<='; + if ( $update_modify_date_op == "<" ) + { + $update_modify_operator_a = '>='; $update_modify_operator_b = '<'; + $update_modify_date_end = $update_modify_date; + $update_modify_date = '0000-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("less than")." $update_modify_date_end"; + } + elseif ( $update_modify_date_op == "<=" ) + { + $update_modify_date_end = $update_modify_date; + $update_modify_date = '0000-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("less than or equal to")." $update_modify_date_end"; + } + elseif ( $update_modify_date_op == ">" ) + { + $update_modify_operator_a = '>'; $update_modify_operator_b = '<'; + $update_modify_date_end = '2100-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("greater than")." $update_modify_date"; + } + elseif ( $update_modify_date_op == ">=" ) + { + $update_modify_date_end = '2100-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("greater than or equal to")." $update_modify_date"; + } + elseif ( $update_modify_date_op == "range" ) + { + $update_modify_date_op_phrase= _QXZ("range")." $update_modify_date - $update_modify_date_end"; + } + elseif ( $update_modify_date_op == "=" ) + { + $update_modify_date_end = $update_modify_date; + $update_modify_date_op_phrase= _QXZ("equal to")." $update_modify_date"; + } + + if (strlen($update_entry_date) == 10) {$update_entry_date .= " 00:00:00";} + if (strlen($update_entry_date_end) == 10) {$update_entry_date_end .= " 23:59:59";} + if (strlen($update_modify_date) == 10) {$update_modify_date .= " 00:00:00";} + if (strlen($update_modify_date_end) == 10) {$update_modify_date_end .= " 23:59:59";} + + if ($DB) + { + echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_entry_date_end")." = $update_entry_date_end | "._QXZ("update_entry_date_op")." = $update_entry_date_op | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_modify_date_end")." = $update_modify_date_end | "._QXZ("update_modify_date_op")." = $update_modify_date_op | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; + } + # make sure the required fields are set if ($update_to_status == '') { missing_required_field('To Status'); } if ($update_list == '') { missing_required_field('List ID'); } @@ -1337,8 +1773,8 @@ if ($update_submit == "update" ) } else { - $sql_where = $sql_where . " and entry_date >= '$update_entry_date 00:00:00' and entry_date <= '$update_entry_date 23:59:59' "; - $update_parm = $update_parm . "    "._QXZ("entry date was on")." $update_entry_date
"; + $sql_where = $sql_where . " and entry_date $update_entry_operator_a '$update_entry_date' and entry_date $update_entry_operator_b '$update_entry_date_end' "; + $update_parm = $update_parm . "    "._QXZ("entry date was")." $update_entry_date_op_phrase
"; } } elseif ($enable_update_entry_date == "enabled") @@ -1354,8 +1790,8 @@ if ($update_submit == "update" ) } else { - $sql_where = $sql_where . " and modify_date >= '$update_modify_date 00:00:00' and modify_date <= '$update_modify_date 23:59:59' "; - $update_parm = $update_parm . "    "._QXZ("last modify date was on")." $update_modify_date
"; + $sql_where = $sql_where . " and modify_date $update_modify_operator_a '$update_modify_date' and modify_date $update_modify_operator_b '$update_modify_date_end' "; + $update_parm = $update_parm . "    "._QXZ("last modify date was")." $update_modify_date_op_phrase
"; } } elseif ($enable_update_modify_date == "enabled") @@ -1402,7 +1838,11 @@ if ($update_submit == "update" ) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1412,7 +1852,7 @@ if ($update_submit == "update" ) echo "\n"; echo "\n"; echo "\n"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; echo "\n\n"; } @@ -1437,7 +1877,11 @@ if ($confirm_update == "confirm") $update_owner=""; $update_state=""; $update_entry_date=""; + $update_entry_date_end=""; + $update_entry_date_op=""; $update_modify_date=""; + $update_modify_date_end=""; + $update_modify_date_op=""; $update_security_phrase=""; $update_list=""; $update_to_status=""; @@ -1478,8 +1922,16 @@ if ($confirm_update == "confirm") elseif (isset($_POST["update_state"])) {$update_state=$_POST["update_state"];} if (isset($_GET["update_entry_date"])) {$update_entry_date=$_GET["update_entry_date"];} elseif (isset($_POST["update_entry_date"])) {$update_entry_date=$_POST["update_entry_date"];} + if (isset($_GET["update_entry_date_end"])) {$update_entry_date_end=$_GET["update_entry_date_end"];} + elseif (isset($_POST["update_entry_date_end"])) {$update_entry_date_end=$_POST["update_entry_date_end"];} + if (isset($_GET["update_entry_date_op"])) {$update_entry_date_op=$_GET["update_entry_date_op"];} + elseif (isset($_POST["update_entry_date_op"])) {$update_entry_date_op=$_POST["update_entry_date_op"];} if (isset($_GET["update_modify_date"])) {$update_modify_date=$_GET["update_modify_date"];} elseif (isset($_POST["update_modify_date"])) {$update_modify_date=$_POST["update_modify_date"];} + if (isset($_GET["update_modify_date_end"])) {$update_modify_date_end=$_GET["update_modify_date_end"];} + elseif (isset($_POST["update_modify_date_end"])) {$update_modify_date_end=$_POST["update_modify_date_end"];} + if (isset($_GET["update_modify_date_op"])) {$update_modify_date_op=$_GET["update_modify_date_op"];} + elseif (isset($_POST["update_modify_date_op"])) {$update_modify_date_op=$_POST["update_modify_date_op"];} if (isset($_GET["update_security_phrase"])) {$update_security_phrase=$_GET["update_security_phrase"];} elseif (isset($_POST["update_security_phrase"])) {$update_security_phrase=$_POST["update_security_phrase"];} if (isset($_GET["update_list"])) {$update_list=$_GET["update_list"];} @@ -1495,7 +1947,7 @@ if ($confirm_update == "confirm") if ($DB) { - echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; + echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_state")." = $update_state | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_entry_date_end")." = $update_entry_date_end | "._QXZ("update_entry_date_op")." = $update_entry_date_op | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_modify_date_end")." = $update_modify_date_end | "._QXZ("update_modify_date_op")." = $update_modify_date_op | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; } # filter out anything bad @@ -1514,8 +1966,12 @@ if ($confirm_update == "confirm") $update_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_source_id); $update_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_owner); $update_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_state); - $update_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_entry_date); - $update_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_modify_date); + $update_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_entry_date); + $update_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_entry_date_end); + $update_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$update_entry_date_op); + $update_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_modify_date); + $update_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$update_modify_date_end); + $update_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$update_modify_date_op); $update_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$update_security_phrase); $update_to_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_to_status); $update_from_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$update_from_status); @@ -1523,11 +1979,6 @@ if ($confirm_update == "confirm") $update_count_num = preg_replace('/[^0-9]/','',$update_count_num); $update_count_op = preg_replace('/[^<>=]/','',$update_count_op); - if ($DB) - { - echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_owner")." = $update_entry_date | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; - } - $update_count_op_phrase=""; if ( $update_count_op == "<" ) { @@ -1546,6 +1997,83 @@ if ($confirm_update == "confirm") $update_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the update_entry_date operation phrase + $update_entry_date_op_phrase=""; + $update_entry_operator_a = '>='; $update_entry_operator_b = '<='; + if ( $update_entry_date_op == "<" ) + { + $update_entry_operator_a = '>='; $update_entry_operator_b = '<'; + $update_entry_date_op_phrase= _QXZ("less than")." $update_entry_date_end"; + } + elseif ( $update_entry_date_op == "<=" ) + { + $update_entry_date_op_phrase= _QXZ("less than or equal to")." $update_entry_date_end"; + } + elseif ( $update_entry_date_op == ">" ) + { + $update_entry_operator_a = '>'; $update_entry_operator_b = '<'; + $update_entry_date_op_phrase= _QXZ("greater than")." $update_entry_date"; + } + elseif ( $update_entry_date_op == ">=" ) + { + $update_entry_date_op_phrase= _QXZ("greater than or equal to")." $update_entry_date"; + } + elseif ( $update_entry_date_op == "range" ) + { + $update_entry_date_op_phrase= _QXZ("range")." $update_entry_date - $update_entry_date_end"; + } + elseif ( $update_entry_date_op == "=" ) + { + $update_entry_date_op_phrase= _QXZ("equal to")." $update_entry_date_end"; + } + + # build the update_modify_date operation phrase + $update_modify_date_op_phrase=""; + $update_modify_operator_a = '>='; $update_modify_operator_b = '<='; + if ( $update_modify_date_op == "<" ) + { + $update_modify_operator_a = '>='; $update_modify_operator_b = '<'; + $update_modify_date_end = $update_modify_date; + $update_modify_date = '0000-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("less than")." $update_modify_date_end"; + } + elseif ( $update_modify_date_op == "<=" ) + { + $update_modify_date_end = $update_modify_date; + $update_modify_date = '0000-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("less than or equal to")." $update_modify_date_end"; + } + elseif ( $update_modify_date_op == ">" ) + { + $update_modify_operator_a = '>'; $update_modify_operator_b = '<'; + $update_modify_date_end = '2100-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("greater than")." $update_modify_date"; + } + elseif ( $update_modify_date_op == ">=" ) + { + $update_modify_date_end = '2100-00-00 00:00:00'; + $update_modify_date_op_phrase= _QXZ("greater than or equal to")." $update_modify_date"; + } + elseif ( $update_modify_date_op == "range" ) + { + $update_modify_date_op_phrase= _QXZ("range")." $update_modify_date - $update_modify_date_end"; + } + elseif ( $update_modify_date_op == "=" ) + { + $update_modify_date_end = $update_modify_date; + $update_modify_date_op_phrase= _QXZ("equal to")." $update_modify_date"; + } + + if (strlen($update_entry_date) == 10) {$update_entry_date .= " 00:00:00";} + if (strlen($update_entry_date_end) == 10) {$update_entry_date_end .= " 23:59:59";} + if (strlen($update_modify_date) == 10) {$update_modify_date .= " 00:00:00";} + if (strlen($update_modify_date_end) == 10) {$update_modify_date_end .= " 23:59:59";} + + if ($DB) + { + echo "

"._QXZ("enable_update_from_status")." = $enable_update_from_status | "._QXZ("enable_update_country_code")." = $enable_update_country_code | "._QXZ("enable_update_vendor_lead_code")." = $enable_update_vendor_lead_code | "._QXZ("enable_update_source_id")." = $enable_update_source_id | "._QXZ("enable_update_owner")." = $enable_update_owner | "._QXZ("enable_update_state")." = $enable_update_state | "._QXZ("enable_update_entry_date")." = $enable_update_entry_date | "._QXZ("enable_update_modify_date")." = $enable_update_modify_date | "._QXZ("enable_update_security_phrase")." = $enable_update_security_phrase | "._QXZ("enable_update_count")." = $enable_update_count | "._QXZ("update_country_code")." = $update_country_code | "._QXZ("update_vendor_lead_code")." = $update_vendor_lead_code | "._QXZ("update_source_id")." = $update_source_id | "._QXZ("update_owner")." = $update_owner | "._QXZ("update_entry_date")." = $update_entry_date | "._QXZ("update_entry_date_end")." = $update_entry_date_end | "._QXZ("update_entry_date_op")." = $update_entry_date_op | "._QXZ("update_modify_date")." = $update_modify_date | "._QXZ("update_modify_date_end")." = $update_modify_date_end | "._QXZ("update_modify_date_op")." = $update_modify_date_op | "._QXZ("update_security_phrase")." = $update_security_phrase | "._QXZ("update_list")." = $update_list | "._QXZ("update_to_status")." = $ update_to_status | "._QXZ("update_from_status")." = $update_from_status | "._QXZ("update_count_op")." = $update_count_op | "._QXZ("update_count_num")." = $update_count_num

"; + } + # make sure the required fields are set if ($update_to_status == '') { missing_required_field('To Status'); } if ($update_list == '') { missing_required_field('List ID'); } @@ -1639,8 +2167,8 @@ if ($confirm_update == "confirm") } else { - $sql_where = $sql_where . " and entry_date >= '$update_entry_date 00:00:00' and entry_date <= '$update_entry_date 23:59:59' "; - $update_parm = $update_parm . "    "._QXZ("entry date was on")." $update_entry_date
"; + $sql_where = $sql_where . " and entry_date $update_entry_operator_a '$update_entry_date' and entry_date $update_entry_operator_b '$update_entry_date_end' "; + $update_parm = $update_parm . "    "._QXZ("entry date was")." $update_entry_date_op_phrase
"; } } elseif ($enable_update_entry_date == "enabled") @@ -1656,8 +2184,8 @@ if ($confirm_update == "confirm") } else { - $sql_where = $sql_where . " and modify_date >= '$update_modify_date 00:00:00' and modify_date <= '$update_modify_date 23:59:59' "; - $update_parm = $update_parm . "    "._QXZ("last modify date was on")." $update_modify_date
"; + $sql_where = $sql_where . " and modify_date $update_modify_operator_a '$update_modify_date' and modify_date $update_modify_operator_b '$update_modify_date_end' "; + $update_parm = $update_parm . "    "._QXZ("last modify date was")." $update_modify_date_op_phrase
"; } } elseif ($enable_update_modify_date == "enabled") @@ -1693,10 +2221,12 @@ if ($confirm_update == "confirm") $admin_log_rslt=mysql_to_mysqli($admin_log_stmt, $link); echo "

$update_sentence

"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; } +##### END update process ##### +##### BEGIN delete process ##### # delete confirmation page if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) { @@ -1717,7 +2247,11 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) $delete_owner=""; $delete_state=""; $delete_entry_date=""; + $delete_entry_date_end=""; + $delete_entry_date_op=""; $delete_modify_date=""; + $delete_modify_date_end=""; + $delete_modify_date_op=""; $delete_security_phrase=""; $delete_list=""; $delete_status=""; @@ -1758,8 +2292,16 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) elseif (isset($_POST["delete_state"])) {$delete_state=$_POST["delete_state"];} if (isset($_GET["delete_entry_date"])) {$delete_entry_date=$_GET["delete_entry_date"];} elseif (isset($_POST["delete_entry_date"])) {$delete_entry_date=$_POST["delete_entry_date"];} + if (isset($_GET["delete_entry_date_end"])) {$delete_entry_date_end=$_GET["delete_entry_date_end"];} + elseif (isset($_POST["delete_entry_date_end"])) {$delete_entry_date_end=$_POST["delete_entry_date_end"];} + if (isset($_GET["delete_entry_date_op"])) {$delete_entry_date_op=$_GET["delete_entry_date_op"];} + elseif (isset($_POST["delete_entry_date_op"])) {$delete_entry_date_op=$_POST["delete_entry_date_op"];} if (isset($_GET["delete_modify_date"])) {$delete_modify_date=$_GET["delete_modify_date"];} elseif (isset($_POST["delete_modify_date"])) {$delete_modify_date=$_POST["delete_modify_date"];} + if (isset($_GET["delete_modify_date_end"])) {$delete_modify_date_end=$_GET["delete_modify_date_end"];} + elseif (isset($_POST["delete_modify_date_end"])) {$delete_modify_date_end=$_POST["delete_modify_date_end"];} + if (isset($_GET["delete_modify_date_op"])) {$delete_modify_date_op=$_GET["delete_modify_date_op"];} + elseif (isset($_POST["delete_modify_date_op"])) {$delete_modify_date_op=$_POST["delete_modify_date_op"];} if (isset($_GET["delete_security_phrase"])) {$delete_security_phrase=$_GET["delete_security_phrase"];} elseif (isset($_POST["delete_security_phrase"])) {$delete_security_phrase=$_POST["delete_security_phrase"];} if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} @@ -1775,7 +2317,7 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) if ($DB) { - echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; + echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_entry_date_end")." = $delete_entry_date_end | "._QXZ("delete_entry_date_op")." = $delete_entry_date_op | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_modify_date_end")." = $delete_modify_date_end | "._QXZ("delete_modify_date_op")." = $delete_modify_date_op | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; } # filter out anything bad @@ -1794,8 +2336,12 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) $delete_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_source_id); $delete_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_owner); $delete_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_state); - $delete_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_entry_date); - $delete_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_modify_date); + $delete_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_entry_date); + $delete_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_entry_date_end); + $delete_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$delete_entry_date_op); + $delete_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_modify_date); + $delete_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_modify_date_end); + $delete_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$delete_modify_date_op); $delete_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_security_phrase); $delete_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_status); $delete_lead_id = preg_replace('/[^0-9]/','',$delete_lead_id); @@ -1803,11 +2349,6 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) $delete_count_num = preg_replace('/[^0-9]/','',$delete_count_num); $delete_count_op = preg_replace('/[^<>=]/','',$delete_count_op); - if ($DB) - { - echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; - } - $delete_count_op_phrase=""; if ( $delete_count_op == "<" ) { @@ -1826,13 +2367,98 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) $delete_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the delete_entry_date operation phrase + $delete_entry_date_op_phrase=""; + $delete_entry_operator_a = '>='; $delete_entry_operator_b = '<='; + if ( $delete_entry_date_op == "<" ) + { + $delete_entry_operator_a = '>='; $delete_entry_operator_b = '<'; + $delete_entry_date_end = $delete_entry_date; + $delete_entry_date = '0000-00-00 00:00:00'; + $delete_entry_date_op_phrase= _QXZ("less than")." $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == "<=" ) + { + $delete_entry_date_end = $delete_entry_date; + $delete_entry_date = '0000-00-00 00:00:00'; + $delete_entry_date_op_phrase= _QXZ("less than or equal to")." $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == ">" ) + { + $delete_entry_operator_a = '>'; $delete_entry_operator_b = '<'; + $delete_entry_date_end = '2100-00-00 00:00:00'; + $delete_entry_date_op_phrase= _QXZ("greater than")." $delete_entry_date"; + } + elseif ( $delete_entry_date_op == ">=" ) + { + $delete_entry_date_end = '2100-00-00 00:00:00'; + $delete_entry_date_op_phrase= _QXZ("greater than or equal to")." $delete_entry_date"; + } + elseif ( $delete_entry_date_op == "range" ) + { + $delete_entry_date_op_phrase= _QXZ("range")." $delete_entry_date - $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == "=" ) + { + $delete_entry_date_end = $delete_entry_date; + $delete_entry_date_op_phrase= _QXZ("equal to")." $delete_entry_date"; + } + + # build the delete_modify_date operation phrase + $delete_modify_date_op_phrase=""; + $delete_modify_operator_a = '>='; $delete_modify_operator_b = '<='; + if ( $delete_modify_date_op == "<" ) + { + $delete_modify_operator_a = '>='; $delete_modify_operator_b = '<'; + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date = '0000-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("less than")." $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == "<=" ) + { + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date = '0000-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("less than or equal to")." $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == ">" ) + { + $delete_modify_operator_a = '>'; $delete_modify_operator_b = '<'; + $delete_modify_date_end = '2100-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("greater than")." $delete_modify_date"; + } + elseif ( $delete_modify_date_op == ">=" ) + { + $delete_modify_date_end = '2100-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("greater than or equal to")." $delete_modify_date"; + } + elseif ( $delete_modify_date_op == "range" ) + { + $delete_modify_date_op_phrase= _QXZ("range")." $delete_modify_date - $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == "=" ) + { + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date_op_phrase= _QXZ("equal to")." $delete_modify_date"; + } + + if (strlen($delete_entry_date) == 10) {$delete_entry_date .= " 00:00:00";} + if (strlen($delete_entry_date_end) == 10) {$delete_entry_date_end .= " 23:59:59";} + if (strlen($delete_modify_date) == 10) {$delete_modify_date .= " 00:00:00";} + if (strlen($delete_modify_date_end) == 10) {$delete_modify_date_end .= " 23:59:59";} + + if ($DB) + { + echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_entry_date_end")." = $delete_entry_date_end | "._QXZ("delete_entry_date_op")." = $delete_entry_date_op | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_modify_date_end")." = $delete_modify_date_end | "._QXZ("delete_modify_date_op")." = $delete_modify_date_op | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; + } + # make sure the required fields are set if ($delete_status == '') { missing_required_field('Status'); } if ($delete_list == '') { missing_required_field('List ID'); } # build the sql query's where phrase and the delete phrase $sql_where = ""; - $sql_where = $sql_where . " and status like '$delete_status' "; + if ($delete_status != '---ALL---') + {$sql_where = $sql_where . " and status like '$delete_status' ";} $delete_parm = ""; $delete_parm = $delete_parm . "    "._QXZ("status is like")." $delete_status
"; if (($enable_delete_lead_id == "enabled") && ($delete_lead_id != '')) @@ -1921,8 +2547,8 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) } else { - $sql_where = $sql_where . " and entry_date >= '$delete_entry_date 00:00:00' and entry_date <= '$delete_entry_date 23:59:59' "; - $delete_parm = $delete_parm . "    "._QXZ("entry date was on")." $delete_entry_date
"; + $sql_where = $sql_where . " and entry_date $delete_entry_operator_a '$delete_entry_date' and entry_date $delete_entry_operator_b '$delete_entry_date_end' "; + $delete_parm = $delete_parm . "    "._QXZ("entry date was")." $delete_entry_date_op_phrase
"; } } elseif ($enable_delete_entry_date == "enabled") @@ -1938,8 +2564,8 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) } else { - $sql_where = $sql_where . " and modify_date >= '$delete_modify_date 00:00:00' and modify_date <= '$delete_modify_date 23:59:59' "; - $delete_parm = $delete_parm . "    "._QXZ("last modify date was on")." $delete_modify_date
"; + $sql_where = $sql_where . " and modify_date $delete_modify_operator_a '$delete_modify_date' and modify_date $delete_modify_operator_b '$delete_modify_date_end' "; + $delete_parm = $delete_parm . "    "._QXZ("last modify date was")." $delete_modify_date_op_phrase
"; } } elseif ($enable_delete_modify_date == "enabled") @@ -1951,7 +2577,7 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) if ($delete_count_op == '---BLANK---') {$delete_count_op = '';} if ($delete_count_num == '---BLANK---') {$delete_count_num = '';} $sql_where = $sql_where . " and called_count $delete_count_op $delete_count_num"; - $delete_parm = $delete_parm . "    "._QXZ("called count is")." $update_count_op_phrase $delete_count_num
"; + $delete_parm = $delete_parm . "    "._QXZ("called count is")." $delete_count_op_phrase $delete_count_num
"; if ($delete_count_op == '') {$delete_count_op = '---BLANK---';} if ($delete_count_num == '') {$delete_count_num = '---BLANK---';} } @@ -1986,7 +2612,11 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1996,9 +2626,8 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) ) echo "\n"; echo "\n"; echo "\n"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; echo "\n\n"; - } # actually do the delete @@ -2021,7 +2650,11 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) $delete_owner=""; $delete_state=""; $delete_entry_date=""; + $delete_entry_date_end=""; + $delete_entry_date_op=""; $delete_modify_date=""; + $delete_modify_date_end=""; + $delete_modify_date_op=""; $delete_security_phrase=""; $delete_list=""; $delete_status=""; @@ -2062,8 +2695,16 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) elseif (isset($_POST["delete_state"])) {$delete_state=$_POST["delete_state"];} if (isset($_GET["delete_entry_date"])) {$delete_entry_date=$_GET["delete_entry_date"];} elseif (isset($_POST["delete_entry_date"])) {$delete_entry_date=$_POST["delete_entry_date"];} + if (isset($_GET["delete_entry_date_end"])) {$delete_entry_date_end=$_GET["delete_entry_date_end"];} + elseif (isset($_POST["delete_entry_date_end"])) {$delete_entry_date_end=$_POST["delete_entry_date_end"];} + if (isset($_GET["delete_entry_date_op"])) {$delete_entry_date_op=$_GET["delete_entry_date_op"];} + elseif (isset($_POST["delete_entry_date_op"])) {$delete_entry_date_op=$_POST["delete_entry_date_op"];} if (isset($_GET["delete_modify_date"])) {$delete_modify_date=$_GET["delete_modify_date"];} elseif (isset($_POST["delete_modify_date"])) {$delete_modify_date=$_POST["delete_modify_date"];} + if (isset($_GET["delete_modify_date_end"])) {$delete_modify_date_end=$_GET["delete_modify_date_end"];} + elseif (isset($_POST["delete_modify_date_end"])) {$delete_modify_date_end=$_POST["delete_modify_date_end"];} + if (isset($_GET["delete_modify_date_op"])) {$delete_modify_date_op=$_GET["delete_modify_date_op"];} + elseif (isset($_POST["delete_modify_date_op"])) {$delete_modify_date_op=$_POST["delete_modify_date_op"];} if (isset($_GET["delete_security_phrase"])) {$delete_security_phrase=$_GET["delete_security_phrase"];} elseif (isset($_POST["delete_security_phrase"])) {$delete_security_phrase=$_POST["delete_security_phrase"];} if (isset($_GET["delete_list"])) {$delete_list=$_GET["delete_list"];} @@ -2079,7 +2720,7 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) if ($DB) { - echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; + echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_entry_date_end")." = $delete_entry_date_end | "._QXZ("delete_entry_date_op")." = $delete_entry_date_op | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_modify_date_end")." = $delete_modify_date_end | "._QXZ("delete_modify_date_op")." = $delete_modify_date_op | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; } # filter out anything bad @@ -2098,8 +2739,12 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) $delete_source_id = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_source_id); $delete_owner = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_owner); $delete_state = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_state); - $delete_entry_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_entry_date); - $delete_modify_date = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_modify_date); + $delete_entry_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_entry_date); + $delete_entry_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_entry_date_end); + $delete_entry_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$delete_entry_date_op); + $delete_modify_date = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_modify_date); + $delete_modify_date_end = preg_replace('/[^- \:_%0-9a-zA-Z]/','',$delete_modify_date_end); + $delete_modify_date_op = preg_replace('/[^<>=_0-9a-zA-Z]/','',$delete_modify_date_op); $delete_security_phrase = preg_replace('/[^- _\'%0-9a-zA-Z]/','',$delete_security_phrase); $delete_status = preg_replace('/[^-_%0-9a-zA-Z]/','',$delete_status); $delete_lead_id = preg_replace('/[^0-9]/','',$delete_lead_id); @@ -2107,11 +2752,6 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) $delete_count_num = preg_replace('/[^0-9]/','',$delete_count_num); $delete_count_op = preg_replace('/[^<>=]/','',$delete_count_op); - if ($DB) - { - echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; - } - $delete_count_op_phrase=""; if ( $delete_count_op == "<" ) { @@ -2130,13 +2770,91 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) $delete_count_op_phrase= _QXZ("greater than or equal to")." "; } + # build the delete_entry_date operation phrase + $delete_entry_date_op_phrase=""; + $delete_entry_operator_a = '>='; $delete_entry_operator_b = '<='; + if ( $delete_entry_date_op == "<" ) + { + $delete_entry_operator_a = '>='; $delete_entry_operator_b = '<'; + $delete_entry_date_op_phrase= _QXZ("less than")." $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == "<=" ) + { + $delete_entry_date_op_phrase= _QXZ("less than or equal to")." $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == ">" ) + { + $delete_entry_operator_a = '>'; $delete_entry_operator_b = '<'; + $delete_entry_date_op_phrase= _QXZ("greater than")." $delete_entry_date"; + } + elseif ( $delete_entry_date_op == ">=" ) + { + $delete_entry_date_op_phrase= _QXZ("greater than or equal to")." $delete_entry_date"; + } + elseif ( $delete_entry_date_op == "range" ) + { + $delete_entry_date_op_phrase= _QXZ("range")." $delete_entry_date - $delete_entry_date_end"; + } + elseif ( $delete_entry_date_op == "=" ) + { + $delete_entry_date_op_phrase= _QXZ("equal to")." $delete_entry_date_end"; + } + + # build the delete_modify_date operation phrase + $delete_modify_date_op_phrase=""; + $delete_modify_operator_a = '>='; $delete_modify_operator_b = '<='; + if ( $delete_modify_date_op == "<" ) + { + $delete_modify_operator_a = '>='; $delete_modify_operator_b = '<'; + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date = '0000-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("less than")." $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == "<=" ) + { + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date = '0000-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("less than or equal to")." $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == ">" ) + { + $delete_modify_operator_a = '>'; $delete_modify_operator_b = '<'; + $delete_modify_date_end = '2100-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("greater than")." $delete_modify_date"; + } + elseif ( $delete_modify_date_op == ">=" ) + { + $delete_modify_date_end = '2100-00-00 00:00:00'; + $delete_modify_date_op_phrase= _QXZ("greater than or equal to")." $delete_modify_date"; + } + elseif ( $delete_modify_date_op == "range" ) + { + $delete_modify_date_op_phrase= _QXZ("range")." $delete_modify_date - $delete_modify_date_end"; + } + elseif ( $delete_modify_date_op == "=" ) + { + $delete_modify_date_end = $delete_modify_date; + $delete_modify_date_op_phrase= _QXZ("equal to")." $delete_modify_date"; + } + + if (strlen($delete_entry_date) == 10) {$delete_entry_date .= " 00:00:00";} + if (strlen($delete_entry_date_end) == 10) {$delete_entry_date_end .= " 23:59:59";} + if (strlen($delete_modify_date) == 10) {$delete_modify_date .= " 00:00:00";} + if (strlen($delete_modify_date_end) == 10) {$delete_modify_date_end .= " 23:59:59";} + + if ($DB) + { + echo "

"._QXZ("enable_delete_country_code")." = $enable_delete_country_code | "._QXZ("enable_delete_vendor_lead_code")." = $enable_delete_vendor_lead_code | "._QXZ("enable_delete_source_id")." = $enable_delete_source_id | "._QXZ("enable_delete_owner")." = $enable_delete_owner | "._QXZ("enable_delete_state")." = $enable_delete_state | "._QXZ("enable_delete_entry_date")." = $enable_delete_entry_date | "._QXZ("enable_delete_modify_date")." = $enable_delete_modify_date | "._QXZ("enable_delete_security_phrase")." = $enable_delete_security_phrase | "._QXZ("enable_delete_count")." = $enable_delete_count | "._QXZ("delete_country_code")." = $delete_country_code | "._QXZ("delete_vendor_lead_code")." = $delete_vendor_lead_code | "._QXZ("delete_source_id")." = $delete_source_id | "._QXZ("delete_owner")." = $delete_owner | "._QXZ("delete_state")." = $delete_state | "._QXZ("delete_entry_date")." = $delete_entry_date | "._QXZ("delete_entry_date_end")." = $delete_entry_date_end | "._QXZ("delete_entry_date_op")." = $delete_entry_date_op | "._QXZ("delete_modify_date")." = $delete_modify_date | "._QXZ("delete_modify_date_end")." = $delete_modify_date_end | "._QXZ("delete_modify_date_op")." = $delete_modify_date_op | "._QXZ("delete_security_phrase")." = $delete_security_phrase | "._QXZ("delete_list")." = $delete_list | "._QXZ("delete_status")." = $delete_status | "._QXZ("delete_count_op")." = $delete_count_op | "._QXZ("delete_count_num")." = $delete_count_num | "._QXZ("delete_lead_id")." = $delete_lead_id

"; + } + # make sure the required fields are set if ($delete_status == '') { missing_required_field('Status'); } if ($delete_list == '') { missing_required_field('List ID'); } # build the sql query's where phrase and the delete phrase $sql_where = ""; - $sql_where = $sql_where . " and status like '$delete_status' "; + if ($delete_status != '---ALL---') + {$sql_where = $sql_where . " and status like '$delete_status' ";} $delete_parm = ""; $delete_parm = $delete_parm . "    "._QXZ("status is like")." $delete_status
"; if (($enable_delete_lead_id == "enabled") && ($delete_lead_id != '')) @@ -2225,8 +2943,8 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) } else { - $sql_where = $sql_where . " and entry_date >= '$delete_entry_date 00:00:00' and entry_date <= '$delete_entry_date 23:59:59' "; - $delete_parm = $delete_parm . "    "._QXZ("entry date was on")." $delete_entry_date
"; + $sql_where = $sql_where . " and entry_date $delete_entry_operator_a '$delete_entry_date' and entry_date $delete_entry_operator_b '$delete_entry_date_end' "; + $delete_parm = $delete_parm . "    "._QXZ("entry date was")." $delete_entry_date_op_phrase
"; } } elseif ($enable_delete_entry_date == "enabled") @@ -2242,8 +2960,8 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) } else { - $sql_where = $sql_where . " and modify_date >= '$delete_modify_date 00:00:00' and modify_date <= '$delete_modify_date 23:59:59' "; - $delete_parm = $delete_parm . "    "._QXZ("last modify date was on")." $delete_modify_date
"; + $sql_where = $sql_where . " and modify_date $delete_modify_operator_a '$delete_modify_date' and modify_date $delete_modify_operator_b '$delete_modify_date_end' "; + $delete_parm = $delete_parm . "    "._QXZ("last modify date was")." $delete_modify_date_op_phrase
"; } } elseif ($enable_delete_modify_date == "enabled") @@ -2255,7 +2973,7 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) if ($delete_count_op == '---BLANK---') {$delete_count_op = '';} if ($delete_count_num == '---BLANK---') {$delete_count_num = '';} $sql_where = $sql_where . " and called_count $delete_count_op $delete_count_num"; - $delete_parm = $delete_parm . "    "._QXZ("called count is")." $update_count_op_phrase $delete_count_num
"; + $delete_parm = $delete_parm . "    "._QXZ("called count is")." $delete_count_op_phrase $delete_count_num
"; if ($delete_count_op == '') {$delete_count_op = '---BLANK---';} if ($delete_count_num == '') {$delete_count_num = '---BLANK---';} } @@ -2279,11 +2997,12 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) ) $admin_log_rslt=mysql_to_mysqli($admin_log_stmt, $link); echo "

$delete_sentence

"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; } +##### END delete process ##### - +##### BEGIN callback process ##### # callback confirmation page if ($callback_submit == "switchcallbacks" ) { @@ -2401,7 +3120,7 @@ if ($callback_submit == "switchcallbacks" ) echo "\n"; echo "\n"; echo "\n"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; echo "\n\n"; } @@ -2516,13 +3235,14 @@ if ($confirm_callback == "confirm") $admin_log_rslt=mysql_to_mysqli($admin_log_stmt, $link); echo "

$callback_sentence

"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; } +##### END callback process ##### - +##### BEGIN main page display ##### # main page display if ( ($move_submit != "move" ) && ($update_submit != "update") && ($delete_submit != "delete") && ($callback_submit != "switchcallbacks") && @@ -2703,11 +3423,27 @@ if ( echo "\n"; echo ""._QXZ("Entry Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Modify Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Security Phrase")."\n"; echo "\n"; @@ -2796,11 +3532,27 @@ if ( echo "\n"; echo ""._QXZ("Entry Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Modify Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Security Phrase")."\n"; echo "\n"; @@ -2855,6 +3607,7 @@ if ( $i++; } + echo "\n"; echo "\n"; echo ""._QXZ("Country Code")."\n"; echo "\n"; @@ -2878,11 +3631,27 @@ if ( echo "\n"; echo ""._QXZ("Entry Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Modify Date")."\n"; echo "\n"; - echo " (YYYY-MM-DD)\n"; + echo "\n"; + echo " "._QXZ("to")." (YYYY-MM-DD) or (YYYY-MM-DD HH:MM:SS)\n"; echo "\n"; echo ""._QXZ("Security Phrase")."\n"; echo "\n"; @@ -2932,13 +3701,13 @@ if ( echo "\n"; echo ""._QXZ("Entry Date")."\n"; echo "\n"; - echo " "._QXZ("to")." "; - echo " (YYYY-MM-DD)\n"; + echo " "._QXZ("to")." "; + echo " (YYYY-MM-DD)\n"; echo "\n"; echo ""._QXZ("Callback Date")."\n"; echo "\n"; - echo " "._QXZ("to")." "; - echo " (YYYY-MM-DD)\n"; + echo " "._QXZ("to")." "; + echo " (YYYY-MM-DD)\n"; echo "\n"; echo "\n"; # END Callback Convert @@ -2950,7 +3719,10 @@ if ( } echo "\n"; +##### END main page display ##### + +##### BEGIN functions ##### function blank_field($field_name, $allow_blank) { echo "

$field_name "._QXZ("cannot be blank").". "; @@ -2958,15 +3730,16 @@ function blank_field($field_name, $allow_blank) { echo _QXZ("If you wish to search for an empty field use ---BLANK--- instead").".

"; } - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; exit(); } function missing_required_field($field_name) { echo "

"._QXZ("The field")." '$field_name' "._QXZ("must have a value").".

"; - echo "

"._QXZ("Click here to start over").".

\n"; + echo "

"._QXZ("Click here to start over").".

\n"; exit(); } +##### END functions ##### ?>