function syn_deal_match($deal_id) { $deal = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $deal_id); if ($deal) { $deal['name_match'] = ""; $deal['name_match_row'] = ""; $deal['deal_cate_match'] = ""; $deal['deal_cate_match_row'] = ""; $deal['type_match'] = ""; $deal['type_match_row'] = ""; $deal['tag_match'] = ""; $deal['tag_match_row'] = ""; $GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $deal, $mode = 'UPDATE', "id=" . $deal_id, $querymode = 'SILENT'); //同步名称 $name_arr = div_str(trim($deal['name'])); foreach ($name_arr as $name_item) { insert_match_item($name_item, "deal", $deal_id, "name_match"); } //分类类别 $deal_cate = array(); get_all_parent_id(intval($deal['cate_id']), DB_PREFIX . "deal_cate", $deal_cate); if (count($deal_cate) > 0) { $deal_cates = $GLOBALS['db']->getAll("select name from " . DB_PREFIX . "deal_cate where id in (" . implode(",", $deal_cate) . ")"); foreach ($deal_cates as $row) { insert_match_item(trim($row['name']), "deal", $deal_id, "deal_cate_match"); } } $goods_cate = array(); get_all_parent_id(intval($deal['type_id']), DB_PREFIX . "deal_loan_type", $goods_cate); if (count($goods_cate) > 0) { $goods_cates = $GLOBALS['db']->getAll("select name from " . DB_PREFIX . "deal_loan_type where id in (" . implode(",", $goods_cate) . ")"); foreach ($goods_cates as $row) { insert_match_item(trim($row['name']), "deal", $deal_id, "type_match"); } } } }
<?php } ?> <?php } ?> </div> <div class="myModalWrap"> <div class="modalBody"> <div id="close-modal" class="close-m">X</div> <h3>Выберите основной вид деятельности:</h3> <?php $par_id = get_all_parent_id(); echo "<div id='okved'></div>"; foreach ($par_id as $id) { get_tree($id); } ?> <p><a href="#" onclick="return false" id="close-modal">Готово</a></p> </div> </div> <?php wp_footer(); ?> </body> </html>