コード例 #1
0
ファイル: company.php プロジェクト: renduples/alibtob
    }
    if (!$result) {
        flash();
    }
}
if (isset($_POST['set_group']) && !empty($_POST['id']) && !empty($_POST['set_group'])) {
    $ids = "IN (" . implode(",", array_unique($_POST['id'])) . ")";
    $member_ids = "IN (" . implode(",", array_unique($_POST['member_id'])) . ")";
    $sql = "UPDATE {$tb_prefix}members m,{$tb_prefix}companies c SET c.cache_membergroupid='{$_POST['set_group']}',m.membergroup_id='{$_POST['set_group']}' WHERE c.member_id=m.id AND c.id " . $ids . " AND m.id " . $member_ids;
    $pdb->Execute($sql);
}
if (isset($_POST['recommend'])) {
    foreach ($_POST['id'] as $val) {
        $commend_now = $company->field("if_commend", "id=" . $val);
        if ($commend_now == "0") {
            $result = $company->saveField("if_commend", "1", intval($val));
        } else {
            $result = $company->saveField("if_commend", "0", intval($val));
        }
    }
    $company_ids = implode(",", $_POST['id']);
    $result = $pdb->Execute("update " . $company->getTable() . " set status='1' where id in (" . $company_ids . ")");
    if ($result) {
        flash("success");
    } else {
        flash();
    }
}
if (isset($_POST['save'])) {
    $company_id = $_POST['id'];
    $vals = $_POST['data']['company'];