{
$myrow = db_fetch($Auth_Result);
- $this->access = $myrow["full_access"];
- $this->name = $myrow["real_name"];
- $this->loginname = $loginname;
- $this->username = $this->loginname;
- $this->prefs = new user_prefs($myrow);
-
- update_user_visitdate($loginname);
- $this->logged = true;
+ $this->access = $myrow["full_access"];
+ $this->name = $myrow["real_name"];
+ $this->loginname = $loginname;
+ $this->username = $this->loginname;
+ $this->prefs = new user_prefs($myrow);
+
+ update_user_visitdate($loginname);
+ $this->logged = true;
+
}
else
{
return number_format($number, $decimals, $dsep, $tsep);
}
+function price_format($number) {
+ return number_format2($number,
+ $_SESSION["wa_current_user"]->prefs->price_dec());
+}
+
+function qty_format($number) {
+ return number_format2($number,
+ $_SESSION["wa_current_user"]->prefs->qty_dec());
+}
+
+function exrate_format($number) {
+ return number_format2($number,
+ $_SESSION["wa_current_user"]->prefs->exrate_dec());
+}
+
+function percent_format($number) {
+ return number_format2($number,
+ $_SESSION["wa_current_user"]->prefs->percent_dec());
+}
+
+function user_numeric($input) {
+ global $decseps, $thoseps;
+
+ $num = trim($input);
+ $sep = $thoseps[user_tho_sep()];
+ if($sep!='') $num = str_replace( $sep, '', $num);
+ str_replace($sep, '', $num);
+ $sep = $decseps[user_dec_sep()];
+ if($sep!='.') $num = str_replace( $sep, '.', $num);
+
+ if (!is_numeric($num))
+ return false;
+ $num = (float)$num;
+ if ($num == (int)$num)
+ return (int)$num;
+ else
+ return $num;
+}
+
function user_company()
{
return $_SESSION["wa_current_user"]->company;
$date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize);
}
+function add_user_js_data() {
+ global $path_to_root, $thoseps, $decseps;
+
+ $ts = $thoseps[user_tho_sep()];
+ $ds = $decseps[user_dec_sep()];
+
+ $js = "\n<script type=\"text/javascript\">\n"
+ . "<!--\n"
+ . "var user = {\n"
+ . "theme: '". $path_to_root . '/themes/'. 'default' /*user_theme()*/.'/'."',\n"
+ . "loadtxt: '"._('Requesting data...')."',\n"
+ . "ts: '$ts',\n"
+ . "ds: '$ds',\n"
+ . "pdec : " . user_price_dec() . "}\n--></script>";
+
+ add_js_source($js);
+}
+
//--------------------------------------------------------------------------
?>
\ No newline at end of file