Exemplo n.º 1
0
        } else {
            flash();
        }
    } else {
        flash("no_data_deleted");
    }
}
if (isset($_POST['save'])) {
    $record = array();
    $vals = $_POST['spacelink'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!empty($id)) {
        unset($vals['created']);
        $updated = $spacelink->add($vals, "update", $id, "{$tb_prefix}spacelinks", "member_id=" . $the_memberid . " AND company_id=" . $companyinfo['id']);
    } else {
        if ($pdb->GetOne("SELECT id FROM {$tb_prefix}spacelinks WHERE member_id=" . $the_memberid . " AND url='" . $vals['url'] . "'")) {
            if (isset($_POST['is_ajax'])) {
                die(L("companyname_has_exists", 'msg', L('company_name')));
            }
        } else {
            $vals['created'] = $time_stamp;
            $vals['company_id'] = $companyinfo['id'];
            $vals['member_id'] = $the_memberid;
            if (strstr($vals['url'], 'http://') || strstr($vals['url'], 'www')) {
                $vals['is_outlink'] = 1;
            }
            $updated = $spacelink->save($vals, '', '', "{$tb_prefix}spacelinks");
        }
    }
Exemplo n.º 2
0
            flash("success");
        } else {
            flash();
        }
    } else {
        flash("no_data_deleted");
    }
}
if (isset($_POST['save'])) {
    $record = array();
    $vals = $_POST['spacelink'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!empty($id)) {
        $updated = $spacelink->add($vals, "update", $id, "{$tb_prefix}spacelinks", "member_id=" . $_SESSION['MemberID'] . " AND company_id=" . $companyinfo['id']);
    } else {
        $vals['created'] = $time_stamp;
        $vals['company_id'] = $companyinfo['id'];
        $vals['member_id'] = $_SESSION['MemberID'];
        if (strstr($vals['url'], 'http://') || strstr($vals['url'], 'www')) {
            $vals['is_outlink'] = 1;
        }
        $updated = $spacelink->save($vals, '', '', "{$tb_prefix}spacelinks");
    }
    if (!$updated) {
        flash("action_failed");
    } else {
        flash("success", '', 0);
    }
}