Example #1
0
function edit_nonprofit_detail()
{
    global $SERVER_PATH, $SignIN;
    $R = DIN_ALL($_REQUEST);
    if (($_SESSION['UserID'] <= 0 || $_SESSION['UserID'] == "") && $_SESSION['http_agent'] != $_SERVER['HTTP_USER_AGENT']) {
        header("Location:" . $SignIN);
        die;
    }
    $NonProfitDetail = array();
    if (intval($R['NPID']) > 0) {
        $sqlQuery = "SELECT * FROM nonprofit WHERE NonProfitID=" . $R[NPID] . " LIMIT 0,1;";
        eqi($sqlQuery, $rs);
        $NonProfitDetail = mfai($rs);
    }
    get_array_list("vcc_iemployee", "ILatitude,ILongitude", "WHERE IEmployeeID = " . $R['EmployeeID'], $Location);
    get_new_option_list("vcc_states", "StateID", "State", "{$NonProfitDetail['NPState']}", $StateList, 0, "ORDER BY State ASC", "", 0);
    get_non_profit_list("nonprofit", $Location, "{$R['NPID']}", $NonProfitList, "WHERE NonProfit <> '' AND longitude Between '" . strval($Location['ILongitude'] - 1) . "' AND '" . strval($Location['ILongitude'] + 1) . "' AND latitude Between '" . strval($Location['ILatitude'] - 1) . "' AND '" . strval($Location['ILatitude'] + 1) . "' ORDER BY NonProfit ASC");
    #-------------------------------------------- Smarty Templates to Display ----------------------------------------------#
    $SMARTY = new Smarty();
    $SMARTY->assign($NonProfitDetail);
    $SMARTY->assign(array("emplyr_active" => "active", "title" => "Edit/Update Employer Detail", "NPList" => $NonProfitList, "Statelist" => $StateList, "EmployeeID" => $R['EmployeeID'], "SERVER_ACTUAL_PATH" => $SERVER_PATH, "action" => "update_npdetails", "LoginID" => $_SESSION['UserID'], "Name" => $_SESSION['Name']));
    echo $SMARTY->display('editAjaxNPDetails.tpl');
}
function the_array_list($array)
{
    echo get_array_list($array);
}