Ejemplo n.º 1
0
    $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']);
    }
    if (isset($_POST['company']['main_market'])) {
        $mainmarket = implode(",", $_POST['company']['main_market']);
        $vals['main_market'] = $mainmarket;
    }
    if (isset($_POST['data']['username'])) {
        $username = trim($_POST['data']['username']);
        $user_info = $member->checkUserExist($username, true);
        if ($user_info) {
            $vals['member_id'] = $member->info['id'];
        }
    }
    if (!empty($company_id)) {
        $vals['modified'] = $time_stamp;
        $result = $company->save($vals, "update", $company_id);
    } else {
        $vals['created'] = $vals['modified'] = $time_stamp;
        $result = $company->save($vals);
    }
    if (!$result) {
        flash();
    }
}
Ejemplo n.º 2
0
 *      @version $Revision: 2098 $
 */
define('CURSCRIPT', 'getpasswd');
require "libraries/common.inc.php";
require "share.inc.php";
require "libraries/sendmail.inc.php";
uses("member");
$member = new Members();
if (isset($_POST['do'])) {
    pb_submit_check('data');
    $do = trim($_POST['do']);
    if ($do == "reset") {
        $username = trim($_POST['data']['username']);
        $userpass = trim($_POST['data']['password1']);
        if (!empty($userpass) && !empty($username)) {
            $user_exists = $member->checkUserExist($username, true);
            if (!$user_exists) {
                flash("member_not_exists");
            } else {
                $result = $pdb->Execute("UPDATE {$tb_prefix}members SET userpass='******' WHERE id=" . $member->info['id'] . " AND status='1'");
                if ($result) {
                    flash("reset_and_login", "logging.php");
                }
            }
        }
    }
}
if (isset($_POST['action'])) {
    pb_submit_check("data");
    $checked = true;
    $login_name = trim($_POST['data']['username']);