Exemple #1
0
require "../libraries/common.inc.php";
require LIB_PATH . 'page.class.php';
require "session_cp.inc.php";
$_PB_CACHE['industry'] = cache_read("industry");
$_PB_CACHE['area'] = cache_read("area");
uses("market", "attachment", "typeoption", "area", "industry");
$attachment = new Attachment('pic');
$area = new Areas();
$industry = new Industries();
$market = new Markets();
$typeoption = new Typeoption();
$page = new Pages();
$conditions = null;
$tpl_file = "market";
if (isset($_POST['del']) && !empty($_POST['id'])) {
    $market->del($_POST['id']);
}
if (isset($_POST['check']) && !empty($_POST['id'])) {
    $ids = implode(",", $_POST['id']);
    $condition = " id in (" . $ids . ")";
    $sql = "update {$tb_prefix}markets set status=1 where " . $condition;
    $result = $pdb->Execute($sql);
}
if (isset($_POST['uncheck']) && !empty($_POST['id'])) {
    $ids = implode(",", $_POST['id']);
    $condition = " id IN (" . $ids . ")";
    $sql = "UPDATE {$tb_prefix}markets SET status=0 WHERE " . $condition;
    $result = $pdb->Execute($sql);
}
if (isset($_POST['recommend'])) {
    foreach ($_POST['id'] as $val) {