Address Management'; if ($err != '') $pg .= "$err

"; $pg .= makeForm('addrmgt'); $pg .= "\n"; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; # new row template for '+' $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= "\n"; $ans = userSettings($user); $offset = 0; $count = 0; if ($ans['STATUS'] == 'ok') { $pg .= ''; if (isset($ans['limit'])) $limit = $ans['limit']; else $limit = 1; $count = $ans['rows']; # this will output any DB rows > limit but DB update will ignore extras for ($i = 0; $i < $count; $i++) { if ((($offset) % 2) == 0) $row = 'even'; else $row = 'odd'; $pg .= ""; $addr = $ans['addr:'.$i]; $pg .= ''; $pg .= ''; $nam = htmlspecialchars($ans['payname:'.$i]); $pg .= ''; $ratio = intval($ans['ratio:'.$i]); $pg .= ''; $pg .= ''; $pg .= "\n"; $offset++; } if ($offset < $limit) { if ((($offset++) % 2) == 0) $row = 'even'; else $row = 'odd'; $pg .= ""; } $pg .= ''; if ((($offset++) % 2) == 0) $row = 'even'; else $row = 'odd'; $pg .= ""; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; if ((($offset++) % 2) == 0) $row = 'even'; else $row = 'odd'; $pg .= ""; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; $pg .= ''; } $pg .= "
#AddressIDRatio%
'; $pg .= ""; $pg .= ''; $pg .= ""; $pg .= ''; $pg .= ""; $pg .= ''; $pg .= "0.00%"; $pg .= '
'.($i+1).''; $pg .= ""; $pg .= ''; $pg .= ""; $pg .= ''; $pg .= ""; $pg .= ''; $pg .= "%"; $pg .= '
"; $pg .= ""; $pg .= "limit $limit
 Password: 
 *2nd Authentication:'; $pg .= '  
'; $pg .= "*Leave blank if you haven't enabled it
"; $pg .= 'You must enter your password to save changes
'; $pg .= 'A ratio of 0, will remove the address from the payouts
\n"; # TODO - adrw() update the odd/even class for the new row and rows below it # TODO - move the js functions into inc.php $pg .= ""; return $pg; } # function doaddrmgt($data, $user) { $err = ''; $OK = getparam('OK', false); $count = getparam('rows', false); $pass = getparam('pass', false); $twofa = getparam('2fa', false); $mfail = false; if ($OK == 'Save' && !nuem($count) && !nuem($pass)) { if ($count > 0 && $count < 1000) { $mfail = true; $addrarr = array(); for ($i = 0; $i < $count; $i++) { $addr = getparam('addr:'.$i, false); $nam = getparam('payname:'.$i, false); if (nuem($nam)) $nam = ''; $ratio = getparam('ratio:'.$i, false); if (!nuem($addr) && !nuem($ratio)) $addrarr[] = array('addr' => trim($addr), 'payname' => trim($nam), 'ratio' => $ratio); } $ans = userSettings($user, null, $addrarr, $pass, $twofa); if ($ans['STATUS'] != 'ok') $err = $ans['ERROR']; else { $ans = userSettings($user); if ($ans['STATUS'] != 'ok') goto meh; if (isset($ans['email'])) $email = $ans['email']; else goto meh; $emailinfo = getOpts($user, emailOptList()); if ($emailinfo['STATUS'] != 'ok') goto meh; else payoutAddressChanged($email, zeip(), $emailinfo); } $mfail = false; } } meh: if ($mfail == true) { if ($err != '') $err .= '
'; $err .= 'An error occurred, check your details below'; } $pg = addrmgtuser($data, $user, $err); return $pg; } # function show_addrmgt($info, $page, $menu, $name, $user) { gopage($info, NULL, 'doaddrmgt', $page, $menu, $name, $user); } # ?>