Exemplo n.º 1
0
    $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'];
    if (isset($_POST['manage_type'])) {
        $managetype = implode(",", $_POST['manage_type']);
        $vals['manage_type'] = $managetype;
    }
    if (isset($_POST['FoundDate'])) {
        $vals['found_date'] = Times::dateConvert($_POST['FoundDate']);