$toz = '«' . $q[0]['tozihat'] . '»'; } return $toz; } if ($firstVisit) { //echo "+++++++first+++++++"; $is_modir = FALSE; $mysql->ex_sql("select * from user where user = '******'", $q); if (isset($q[0])) { $r_u = $q[0]; if ($pass == $r_u["pass"]) { $_SESSION[$conf->app . "_typ"] = (int) $r_u["typ"]; $_SESSION[$conf->app . "_user_id"] = (int) $r_u["id"]; $_SESSION[$conf->app . "_app"] = $conf->app; $user = new user_class((int) $r_u['id']); $user->setOnline(session_id()); $user->sabt_vorood(); $cust = new customer_class((int) $r_u["customer_id"]); if (($_SESSION[$conf->app . "_typ"] == 0 || $_SESSION[$conf->app . "_typ"] == 2) && $cust->typ == 2) { $_SESSION[$conf->app . "_customer_typ"] = $cust->typ; } else { $_SESSION[$conf->app . "_customer_typ"] = 1; } $_SESSION[$conf->app . "_customer_id"] = (int) $r_u["customer_id"]; } else { die("<script>window.location = 'login.php?stat=wrong_pass&';</script>"); } } else { die("<script>window.location = 'login.php?stat=wrong_user&';</script>"); } }