api.usersearch.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <?php
  2. /**
  3. * Returns user profile fileds search form
  4. *
  5. * @return string
  6. */
  7. function web_UserSearchFieldsForm() {
  8. global $ubillingConfig;
  9. $altCfg = $ubillingConfig->getAlter();
  10. $fieldinputs = wf_TextInput('searchquery', 'Search by', '', true, '40');
  11. $fieldinputs .= wf_RadioInput('searchtype', 'All fields', 'full', true, true);
  12. $fieldinputs .= wf_RadioInput('searchtype', 'Real Name', 'realname', true);
  13. $fieldinputs .= wf_RadioInput('searchtype', 'Login', 'login', true);
  14. $fieldinputs .= wf_RadioInput('searchtype', 'Phone', 'phone', true);
  15. $fieldinputs .= wf_RadioInput('searchtype', 'Mobile', 'mobile', true);
  16. $fieldinputs .= wf_RadioInput('searchtype', 'Email', 'email', true);
  17. $fieldinputs .= wf_RadioInput('searchtype', 'Notes', 'note', true);
  18. $fieldinputs .= wf_RadioInput('searchtype', 'Contract', 'contract', true);
  19. if ($altCfg['OPENPAYZ_SUPPORT']) {
  20. $fieldinputs .= wf_RadioInput('searchtype', 'Payment ID', 'payid', true);
  21. }
  22. $fieldinputs .= wf_RadioInput('searchtype', 'IP', 'ip', true);
  23. $fieldinputs .= wf_RadioInput('searchtype', 'MAC', 'mac', true);
  24. if ($altCfg['SWITCHPORT_IN_PROFILE']) {
  25. $fieldinputs .= wf_RadioInput('searchtype', 'Switch binding (SwIP/SwID/SwLocation)', 'switchassign', true);
  26. }
  27. if ($altCfg['PON_ENABLED']) {
  28. $fieldinputs .= wf_RadioInput('searchtype', 'ONU MAC', 'onumac', true);
  29. $fieldinputs .= wf_RadioInput('searchtype', 'ONU Serial', 'onuserial', true);
  30. }
  31. if ($altCfg['SWITCHES_EXTENDED']) {
  32. $fieldinputs .= wf_RadioInput('searchtype', 'Switch ID', 'swid', true);
  33. }
  34. $fieldinputs .= wf_tag('br');
  35. $fieldinputs .= wf_Submit('Search');
  36. $form = wf_Form('', 'POST', $fieldinputs);
  37. return ($form);
  38. }
  39. /**
  40. * Returns user profile search results
  41. *
  42. * @global object $ubillingConfig
  43. * @param string $query
  44. * @param string $searchtype
  45. * @return string
  46. */
  47. function zb_UserSearchFields($query, $searchtype) {
  48. global $ubillingConfig;
  49. $query = mysql_real_escape_string(trim($query));
  50. $searchtype = vf($searchtype);
  51. $altercfg = $ubillingConfig->getAlter();
  52. //check strict mode for our searchtype
  53. $strictsearch = array();
  54. if (isset($altercfg['SEARCH_STRICT'])) {
  55. if (!empty($altercfg['SEARCH_STRICT'])) {
  56. $strictsearch = explode(',', $altercfg['SEARCH_STRICT']);
  57. $strictsearch = array_flip($strictsearch);
  58. }
  59. }
  60. //construct query
  61. if ($searchtype == 'realname') {
  62. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  63. $query = "SELECT `login` from `realname` WHERE `realname` LIKE '" . $mask . $query . $mask . "'";
  64. }
  65. if ($searchtype == 'login') {
  66. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  67. $query = "SELECT `login` from `users` WHERE `login` LIKE '" . $mask . $query . $mask . "'";
  68. }
  69. if ($searchtype == 'phone') {
  70. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  71. $query = "SELECT `login` from `phones` WHERE `phone` LIKE '" . $mask . $query . $mask . "'";
  72. }
  73. if ($searchtype == 'mobile') {
  74. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  75. $query = "SELECT `login` from `phones` WHERE `mobile` LIKE '" . $mask . $query . $mask . "'";
  76. }
  77. if ($searchtype == 'email') {
  78. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  79. $query = "SELECT `login` from `emails` WHERE `email` LIKE '" . $mask . $query . $mask . "'";
  80. }
  81. if ($searchtype == 'note') {
  82. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  83. $query = "SELECT `login` from `notes` WHERE `note` LIKE '" . $mask . $query . $mask . "'";
  84. }
  85. if ($searchtype == 'contract') {
  86. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  87. $query = "SELECT `login` from `contracts` WHERE `contract` LIKE '" . $mask . $query . $mask . "'";
  88. }
  89. if ($searchtype == 'ip') {
  90. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  91. $query = "SELECT `login` from `users` WHERE `IP` LIKE '" . $mask . $query . $mask . "'";
  92. }
  93. if ($searchtype == 'seal') {
  94. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  95. $query = "SELECT `login` from `condet` WHERE `seal` LIKE '" . $mask . $query . $mask . "'";
  96. }
  97. if ($searchtype == 'swid') {
  98. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  99. $query = "SELECT `login` from `users` WHERE `ip` IN (SELECT `ip` FROM `nethosts` WHERE `option` LIKE '" . $mask . $query . $mask . "')";
  100. }
  101. if ($altercfg['SWITCHPORT_IN_PROFILE']) {
  102. if ($searchtype == 'switchassign') {
  103. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  104. $whereType = 'location';
  105. // Change type for search on switch
  106. $extractedIpAddr = zb_ExtractIpAddress($query);
  107. if ($extractedIpAddr) {
  108. $query = $extractedIpAddr;
  109. $whereType = 'ip';
  110. }
  111. $macExtracted = zb_ExtractMacAddress($query);
  112. if (!empty($macExtracted)) {
  113. $query = $macExtracted;
  114. $whereType = 'swid';
  115. }
  116. $query = "
  117. SELECT `login` from `users`
  118. INNER JOIN `switchportassign` USING (`login`)
  119. INNER JOIN `switches` ON (`switchportassign`.`switchid`=`switches`.`id`)
  120. WHERE `switches`.`" . $whereType . "` LIKE '" . $mask . $query . $mask . "'";
  121. }
  122. }
  123. if ($altercfg['PON_ENABLED'] and $searchtype == 'onumac') {
  124. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  125. $query = "SELECT `login` from `pononu` WHERE `mac` LIKE '" . $mask . $query . $mask . "'";
  126. }
  127. if ($altercfg['PON_ENABLED'] and $searchtype == 'onuserial') {
  128. $mask = (isset($strictsearch[$searchtype]) ? '' : '%');
  129. $query = "SELECT `login` from `pononu` WHERE `serial` LIKE '" . $mask . $query . $mask . "'";
  130. }
  131. //mac-address search
  132. if ($searchtype == 'mac') {
  133. $allfoundlogins = array();
  134. $allMacs = zb_UserGetAllMACs();
  135. $searchMacPart = strtolower($query);
  136. $searchMacPart = RemoveMacAddressSeparator($searchMacPart);
  137. $searchMacPart = AddMacSeparator($searchMacPart);
  138. if (!empty($allMacs)) {
  139. $allMacs = array_flip($allMacs);
  140. foreach ($allMacs as $eachMac => $macLogin) {
  141. if (ispos($eachMac, $searchMacPart)) {
  142. $allfoundlogins[] = $macLogin;
  143. }
  144. }
  145. }
  146. }
  147. if ($searchtype == 'apt') {
  148. $query = "SELECT `login` from `address` WHERE `aptid` = '" . $query . "'";
  149. }
  150. if ($searchtype == 'payid') {
  151. if ($altercfg['OPENPAYZ_SUPPORT']) {
  152. if ($altercfg['OPENPAYZ_REALID']) {
  153. $query = "SELECT `realid` AS `login` from `op_customers` WHERE `virtualid`='" . $query . "'";
  154. } else {
  155. $query = "SELECT `login` from `users` WHERE `IP` = '" . int2ip($query) . "'";
  156. }
  157. }
  158. }
  159. // пытаемся изобразить результат
  160. if ($searchtype != 'mac') {
  161. $allresults = simple_queryall($query);
  162. $allfoundlogins = array();
  163. if (!empty($allresults)) {
  164. foreach ($allresults as $io => $eachresult) {
  165. $allfoundlogins[] = $eachresult['login'];
  166. }
  167. //если таки по четкому адресу искали - давайте уж в профиль со старта
  168. if ($searchtype == 'apt') {
  169. rcms_redirect("?module=userprofile&username=" . $eachresult['login']);
  170. }
  171. }
  172. }
  173. $result = web_UserArrayShower($allfoundlogins);
  174. return ($result);
  175. }
  176. /**
  177. * Returns user profile search results by all fields
  178. *
  179. * @param string $query, $render
  180. * @return string
  181. */
  182. function zb_UserSearchAllFields($query, $render = true) {
  183. global $ubillingConfig;
  184. $notesSearchFlag = $ubillingConfig->getAlterParam('SEARCH_NOTES');
  185. $allfoundlogins = array();
  186. if (strlen($query) >= 3) {
  187. $searh_data_array = zb_UserGetAllDataCache();
  188. if ($notesSearchFlag) {
  189. $allUserNotes = zb_UserGetAllNotes();
  190. if (!empty($allUserNotes)) {
  191. foreach ($allUserNotes as $noteLogin => $noteText) {
  192. if (isset($searh_data_array[$noteLogin])) {
  193. $searh_data_array[$noteLogin]['note'] = $noteText;
  194. }
  195. }
  196. }
  197. }
  198. $searh_part = trim($query);
  199. $searh_part = preg_quote($searh_part, '/');
  200. foreach ($searh_data_array as $login => $data) {
  201. if (preg_grep('/' . $searh_part . '/iu', $data)) {
  202. $allfoundlogins[] = $login;
  203. }
  204. }
  205. if ($render) {
  206. $result = web_UserArrayShower($allfoundlogins);
  207. } else {
  208. $result = $allfoundlogins;
  209. }
  210. } else {
  211. $messages = new UbillingMessageHelper();
  212. $result = $messages->getStyledMessage(__('At least 3 characters are required for search'), 'info');
  213. }
  214. return ($result);
  215. }
  216. /**
  217. * Returns custom fields search form
  218. *
  219. * @return string
  220. */
  221. function web_UserSearchCFForm() {
  222. $cf = new CustomFields();
  223. $allCfTypes = $cf->getTypesAll();
  224. $cfsearchform = wf_tag('h3') . __('Additional profile fields') . wf_tag('h3', true);
  225. if (!empty($allCfTypes)) {
  226. foreach ($allCfTypes as $io => $eachtype) {
  227. $searchControl = $cf->getTypeSearchControl($eachtype['type'], $eachtype['id']);
  228. //is this type searchable?
  229. if (!empty($searchControl)) {
  230. $cfsearchform .= $cf->renderTypeName($eachtype['id']) . ' ' . $searchControl;
  231. }
  232. }
  233. } else {
  234. $cfsearchform = '';
  235. }
  236. return ($cfsearchform);
  237. }
  238. /**
  239. * Returns custom field search results
  240. *
  241. * @param int $typeid existing custom field database id
  242. * @param string $query search term
  243. * @return array
  244. */
  245. function zb_UserSearchCF($typeid, $query) {
  246. $typeid = vf($typeid);
  247. $query = mysql_real_escape_string($query);
  248. $result = array();
  249. $dataquery = "SELECT `login` from `cfitems` WHERE `typeid`='" . $typeid . "' AND `content`LIKE '%" . $query . "%'";
  250. $allusers = simple_queryall($dataquery);
  251. if (!empty($allusers)) {
  252. foreach ($allusers as $io => $eachuser) {
  253. $result[] = $eachuser['login'];
  254. }
  255. }
  256. return ($result);
  257. }
  258. /**
  259. * Returns custom contract search form
  260. *
  261. * @global object $ubillingConfig
  262. * @return string
  263. */
  264. function web_UserSearchContractForm() {
  265. $result = '';
  266. global $ubillingConfig;
  267. $altercfg = $ubillingConfig->getAlter();
  268. if (isset($altercfg['SEARCH_CUSTOM_CONTRACT'])) {
  269. if ($altercfg['SEARCH_CUSTOM_CONTRACT']) {
  270. $result .= wf_tag('h3') . __('Contract search') . wf_tag('h3', true);
  271. $inputs = wf_TextInput('searchquery', '', '', false);
  272. $inputs .= wf_HiddenInput('searchtype', 'contract');
  273. $inputs .= wf_Submit(__('Search'));
  274. $result .= wf_Form("", 'POST', $inputs, '');
  275. $result .= wf_delimiter();
  276. }
  277. }
  278. return ($result);
  279. }
  280. /**
  281. * Returns partial address search form
  282. *
  283. * @global object $ubillingConfig
  284. * @return string
  285. */
  286. function web_UserSearchAddressPartialForm() {
  287. global $ubillingConfig;
  288. $alterconf = $ubillingConfig->getAlter();
  289. if ($alterconf['SEARCHADDR_AUTOCOMPLETE']) {
  290. $alladdress = zb_AddressGetFulladdresslistCached();
  291. natsort($alladdress);
  292. $inputs = wf_AutocompleteTextInput('partialaddr', $alladdress, '', '', false, 30);
  293. } else {
  294. $inputs = wf_TextInput('partialaddr', '', '', false, 30);
  295. }
  296. $inputs .= wf_Submit('Search');
  297. $result = wf_Form('', 'POST', $inputs, '', '');
  298. return ($result);
  299. }
  300. /**
  301. * Returns user full address search form
  302. *
  303. * @return string
  304. */
  305. function web_UserSearchAddressForm() {
  306. $form = wf_tag('form', false, '', 'action="" method="POST"');
  307. $form .= wf_tag('table', false, '', 'width="100%" border="0"');
  308. if (!isset($_POST['citysel'])) {
  309. $cells = wf_TableCell(__('City'), '40%');
  310. $cells .= wf_TableCell(web_CitySelectorAc());
  311. $form .= wf_TableRow($cells, 'row3');
  312. } else {
  313. // if city selected
  314. $cityname = zb_AddressGetCityData($_POST['citysel']);
  315. $cityname = $cityname['cityname'];
  316. $cells = wf_TableCell(__('City'), '40%');
  317. $cells .= wf_TableCell(web_ok_icon() . ' ' . $cityname . wf_HiddenInput('citysel', $_POST['citysel']));
  318. $form .= wf_TableRow($cells, 'row3');
  319. if (!isset($_POST['streetsel'])) {
  320. $cells = wf_TableCell(__('Street'), '40%');
  321. $cells .= wf_TableCell(web_StreetSelectorAc($_POST['citysel']));
  322. $form .= wf_TableRow($cells, 'row3');
  323. } else {
  324. // if street selected
  325. $streetname = zb_AddressGetStreetData($_POST['streetsel']);
  326. $streetname = $streetname['streetname'];
  327. $cells = wf_TableCell(__('Street'), '40%');
  328. $cells .= wf_TableCell(web_ok_icon() . ' ' . $streetname . wf_HiddenInput('streetsel', $_POST['streetsel']));
  329. $form .= wf_TableRow($cells, 'row3');
  330. if (!isset($_POST['buildsel'])) {
  331. $cells = wf_TableCell(__('Build'), '40%');
  332. $cells .= wf_TableCell(web_BuildSelectorAc($_POST['streetsel']));
  333. $form .= wf_TableRow($cells, 'row3');
  334. } else {
  335. //if build selected
  336. $buildnum = zb_AddressGetBuildData($_POST['buildsel']);
  337. $buildnum = $buildnum['buildnum'];
  338. $cells = wf_TableCell(__('Build'), '40%');
  339. $cells .= wf_TableCell(web_ok_icon() . ' ' . $buildnum . wf_HiddenInput('buildsel', $_POST['buildsel']));
  340. $form .= wf_TableRow($cells, 'row3');
  341. if (!isset($_POST['aptsel'])) {
  342. $cells = wf_TableCell(__('Apartment'), '40%');
  343. $cells .= wf_TableCell(web_AptSelectorAc($_POST['buildsel']));
  344. $form .= wf_TableRow($cells, 'row3');
  345. } else {
  346. //if apt selected
  347. $aptnum = zb_AddressGetAptDataById($_POST['aptsel']);
  348. $aptnum = $aptnum['apt'];
  349. $cells = wf_TableCell(__('Apartment'), '40%');
  350. $cells .= wf_TableCell(web_ok_icon() . ' ' . $aptnum . wf_HiddenInput('aptsel', $_POST['aptsel']));
  351. $form .= wf_TableRow($cells, 'row3');
  352. $cells = wf_TableCell(wf_HiddenInput('aptsearch', $_POST['aptsel']));
  353. $cells .= wf_TableCell(wf_Submit(__('Find')));
  354. $form .= wf_TableRow($cells, 'row3');
  355. }
  356. }
  357. }
  358. }
  359. $form .= wf_tag('table', true);
  360. $form .= wf_tag('form', true);
  361. return ($form);
  362. }
  363. /**
  364. * Returns corporate users search form
  365. *
  366. * @global object $ubillingConfig
  367. * @return string
  368. */
  369. function web_CorpsSearchForm() {
  370. global $ubillingConfig;
  371. $alterCfg = $ubillingConfig->getAlter();
  372. $result = '';
  373. if ($alterCfg['CORPS_ENABLED']) {
  374. $result .= wf_tag('h3') . __('Corporate users') . wf_tag('h3', true);
  375. if ($alterCfg['SEARCHADDR_AUTOCOMPLETE']) {
  376. $corps = new Corps();
  377. $corpsDataRaw = $corps->getCorps();
  378. $corpsNames = array();
  379. if (!empty($corpsDataRaw)) {
  380. foreach ($corpsDataRaw as $io => $each) {
  381. $corpsNames[] = $each['corpname'];
  382. }
  383. }
  384. $inputs = wf_AutocompleteTextInput('searchcorpname', $corpsNames, '', '', false, '30');
  385. } else {
  386. $inputs = wf_TextInput('searchcorpname', '', '', false, '30');
  387. }
  388. $inputs .= wf_Submit(__('Search'));
  389. $result .= wf_Form('?module=corps&show=search', 'POST', $inputs, '');
  390. }
  391. return ($result);
  392. }
  393. /**
  394. * Performs login search by partial address or extended address
  395. *
  396. * @global object $ubillingConfig
  397. * @param string $query
  398. * @param bool $searchExtenAddr
  399. *
  400. * @return array
  401. */
  402. function zb_UserSearchAddressPartial($query, $searchExtenAddr = false) {
  403. global $ubillingConfig;
  404. $altercfg = $ubillingConfig->getAlter();
  405. $query = mysql_real_escape_string($query);
  406. if (!$altercfg['SEARCHADDR_AUTOCOMPLETE']) {
  407. $query = strtolower_utf8($query);
  408. }
  409. if ($searchExtenAddr) {
  410. $alluseraddress = zb_AddressExtenGetList();
  411. } else {
  412. $alluseraddress = zb_AddressGetFulladdresslist();
  413. }
  414. $result = array();
  415. if (!empty($alluseraddress)) {
  416. if (!$altercfg['SEARCHADDR_AUTOCOMPLETE']) {
  417. foreach ($alluseraddress as $login => $address) {
  418. if (ispos(strtolower_utf8($address), $query)) {
  419. $result[] = $login;
  420. }
  421. }
  422. } else {
  423. foreach ($alluseraddress as $login => $address) {
  424. if (ispos($address, $query)) {
  425. $result[] = $login;
  426. }
  427. }
  428. }
  429. }
  430. return ($result);
  431. }
  432. /**
  433. * Try to apply localte to searctype
  434. *
  435. * @param string $searchtype
  436. * @return string
  437. */
  438. function zb_UserSearchTypeLocalize($searchtype, $query = '') {
  439. $result = __('Search by') . ' ';
  440. switch ($searchtype) {
  441. case 'full':
  442. $result .= __('All fields');
  443. break;
  444. case 'realname':
  445. $result .= __('Real Name');
  446. break;
  447. case 'login':
  448. $result .= __('Login');
  449. break;
  450. case 'phone':
  451. $result .= __('Phone');
  452. break;
  453. case 'mobile':
  454. $result .= __('Mobile');
  455. break;
  456. case 'email':
  457. $result .= __('Email');
  458. break;
  459. case 'Note':
  460. $result .= __('Note');
  461. break;
  462. case 'contract':
  463. $result .= __('Contract');
  464. break;
  465. case 'payid':
  466. $result .= __('Payment ID');
  467. break;
  468. case 'ip':
  469. $result .= __('IP');
  470. break;
  471. case 'mac':
  472. $result .= __('MAC');
  473. break;
  474. case 'partialaddr':
  475. $result .= __('Partial address');
  476. break;
  477. case 'extenaddr':
  478. $result .= __('Extended address');
  479. break;
  480. case 'seal':
  481. $result .= __('Cable seal');
  482. break;
  483. case 'swid':
  484. $result .= __('Switch ID');
  485. break;
  486. default:
  487. $result .= '';
  488. break;
  489. }
  490. if (!empty($query)) {
  491. $result .= ' "' . $query . '"';
  492. }
  493. return ($result);
  494. }
  495. /**
  496. * Generates a user search elements with optional title and content.
  497. *
  498. * @param string $title The title of the user search grid.
  499. * @param string $content The content of the user search grid.
  500. *
  501. * @return string
  502. */
  503. function web_UserSearchElement($title = '', $content = '') {
  504. $result = '';
  505. if (!empty($content)) {
  506. $style = 'style="flex: 500px; padding: 5px; margin: 5px; border: 1px solid #d4d4d4; background-color: #fafafa;"';
  507. $result .= wf_tag('div', false, '', $style);
  508. if (!empty($title)) {
  509. $result .= wf_tag('h3', false, 'row3') . $title . wf_tag('h3', true);
  510. }
  511. $result .= $content;
  512. $result .= wf_tag('div', true);
  513. }
  514. return ($result);
  515. }
  516. /**
  517. * Generates the User Search Grid.
  518. *
  519. * This function generates the HTML markup for the User Search Grid,
  520. * which includes various search forms for different search criteria.
  521. *
  522. * @return string
  523. */
  524. function web_UserSearchGrid() {
  525. $result = '';
  526. $result = wf_tag('div', false, '', 'style="display: flex; flex-direction: row; flex-wrap: wrap;"');
  527. $result .= web_UserSearchElement(__('Full address'), web_UserSearchAddressForm());
  528. $result .= web_UserSearchElement(__('Partial address'), web_UserSearchAddressPartialForm());
  529. $result .= web_UserSearchElement(__('Profile fields search'), web_UserSearchFieldsForm());
  530. $result .= web_UserSearchElement(__('Other'), web_CorpsSearchForm() . web_UserSearchContractForm() . web_UserSearchCFForm());
  531. $result .= wf_tag('div', true);
  532. $result .= wf_CleanDiv();
  533. return ($result);
  534. }