<%@ page import="com.jivesoftware.forum.*, com.jivesoftware.forum.util.*, com.atomlink.jive.*, java.text.*, java.math.BigDecimal" errorPage="error.jsp" pageEncoding="koi8-r" %> <%! String initiators(boolean adm_ovr, boolean admin, boolean system, boolean user) { String result = "( "; if(!adm_ovr && !admin) result += "админ "; if(!user) result += "клиент "; if(!system) result += "система "; result += ")"; return result; } %> <%@ include file="global.jsp" %> <% String title = "Страница для пользователей"; %> <% setRedirectURL(request); if ( isGuest ) throw new UnauthorizedException(); %> <%@ include file="header.jsp" %> <%@ include file="dbc.jsp" %> <% if ( !isGuest ) { try { pstmt = con.prepareStatement( "select * from SE join LC on SE.LC_Num=LC.LC_Num where LC.LC_Num=? and ((SE.SVC_ID=4 and SE.DELETED=0) or LC.COMPANY=1)" ); pstmt.setLong(1, pageUser.getLC()); res = pstmt.executeQuery(); if (res.next()) { %> <%--
С 01.12.05 действует акция на подключение по технологии ADSL - Приведи друга.
--%> <% } } catch( Exception ex ) {} } %> <% DecimalFormat timef = new DecimalFormat("00"); boolean blocked = false, frozen = false, has_bills = false, can_change_tp = false; BigDecimal saldo = null; String tp_title = ""; long tc_id = 1; pstmt = con.prepareStatement( "select LC.SALDO, LC.BLOCKED, LC.FROZEN, TC.TITLE, LC.TC_ID from LC join TC on LC.TC_ID=TC.TC_ID where LC.LC_Num=?" ); pstmt.setLong(1, pageUser.getLC()); res = pstmt.executeQuery(); if ( res.next() ) { saldo = res.getBigDecimal("SALDO"); blocked = res.getBoolean("BLOCKED"); frozen = res.getBoolean("FROZEN"); tp_title = res.getString("TITLE"); tc_id = res.getLong("TC_ID"); } if (tc_id != 1) { pstmt = con.prepareStatement( "select VALUE from TC_PROPS where NAME='ALLOW_CHANGE' and VALUE='true' and TC_ID=?" ); pstmt.setLong(1, tc_id); res = pstmt.executeQuery(); can_change_tp = (res.next() && !pageUser.isCompany() && (pageUser.getAuthGroup()==0)); } pstmt = con.prepareStatement( "select count(*) from BILLS where LC_Num=?" ); pstmt.setLong(1, pageUser.getLC()); res = pstmt.executeQuery(); res.next(); has_bills = (res.getInt(1) > 0); java.text.NumberFormat nf = java.text.NumberFormat.getInstance(); nf.setMinimumFractionDigits(2); nf.setMaximumFractionDigits(2); boolean noFreeze = false; pstmt = con.prepareStatement( "select AUTO from BILLCONF where LC_Num=?" ); pstmt.setLong(1, pageUser.getLC()); res = pstmt.executeQuery(); if ( res.next() ) noFreeze = res.getBoolean("AUTO"); %>
Тарифный план: <%= tp_title %> Состояние счета: <% if ( frozen ) out.print("\"Заморожен\""); else if ( blocked ) out.print("Заблокирован"); else out.print("Активен"); %> Остаток на счете: <%= nf.format(saldo) %> руб.

<%if(pageUser.getAuthGroup() == 0){%> <%}%> <%if(!pageUser.isCompany() && frozen && pageUser.getAuthGroup()==0){%> <%}%> <% if(!pageUser.isCompany() && !frozen && pageUser.getAuthGroup()==0 && !noFreeze) { call = con.prepareCall("{call bsDoPeriodicBilling ?, ?, ?}"); call.setLong(1, pageUser.getLC()); call.setString(2, "monthly"); call.registerOutParameter(3, java.sql.Types.DECIMAL, 4); call.execute(); java.math.BigDecimal monthlyAbo = call.getBigDecimal(3); if ( monthlyAbo.compareTo(new java.math.BigDecimal(0))>0 ) { %> <% } } %> <% if( can_change_tp ) { %> <% }%>
ОПЕРАЦИИ
  Оплата по карте
  Журнал потребления услуг
  Финансовая история
  Разморозить счет
  Добровольная заморозка счета
  Смена тарифного плана


<%if(pageUser.getAuthGroup()==0 && false){%> <%}%> <% boolean adm=true, adm_ovr=false, main=true, auto=true, allow=true; String se_id="", uname="", svc_t="", access="", switchAccess=""; int group = 0, i = 0; short svc_id = 0; pstmt = con.prepareStatement( "select SE_ID, SE.SVC_ID, TITLE, LOGIN, GROUPN, ADM, MAIN, AUTO, ADM_OVR from SE, SVC where LC_Num=? and DELETED=0 and SE.SVC_ID=SVC.SVC_ID order by LOGIN, SVC.SVC_ID" ); pstmt.setLong(1, pageUser.getLC()); res = pstmt.executeQuery(); PreparedStatement pstmt2 = con.prepareStatement("select dbo.getResourceCredit(?, ?)"); pstmt2.setTimestamp(2, new java.sql.Timestamp( (new java.util.Date()).getTime() )); String lastUname = ""; while( res.next() ) { boolean show_change_passwd = true; se_id = res.getString("SE_ID"); svc_id = res.getShort("SVC_ID"); svc_t = res.getString("TITLE"); uname = res.getString("LOGIN"); group = res.getInt("GROUPN"); adm = res.getBoolean("ADM"); main = res.getBoolean("MAIN"); auto = res.getBoolean("AUTO"); adm_ovr = res.getBoolean("ADM_OVR"); if ( lastUname.equals(uname) ) show_change_passwd = false; else show_change_passwd = true; allow = adm_ovr || adm && main && auto; access = allow ? "вкл" : "выкл"; switchAccess = main ? "отключить" : "включить"; if(group==pageUser.getAuthGroup() || pageUser.getAuthGroup()==0) { %> " class="main"> <% if (svc_id == 1) { pstmt2.setBigDecimal(1, new java.math.BigDecimal(se_id)); ResultSet rres = pstmt2.executeQuery(); rres.next(); int seconds = rres.getBigDecimal(1).intValue(); int minutes = seconds / 60; seconds = seconds % 60; int hours = minutes / 60; minutes = minutes % 60; %> <%-- --%> <% } else if (svc_id == 3 || svc_id == 4) { pstmt2.setBigDecimal(1, new java.math.BigDecimal(se_id)); ResultSet rres = pstmt2.executeQuery(); rres.next(); BigDecimal mbyte = new BigDecimal("1000000"); BigDecimal mbytes = rres.getBigDecimal(1).divide(mbyte, 1, java.math.BigDecimal.ROUND_FLOOR); %> <%}else{%> <%}%> <%if(show_change_passwd) {%> <%}else{%> <%}%> <%if(pageUser.getAuthGroup()==0 && (svc_id == 1) && false){%> <%}else if(pageUser.getAuthGroup()==0 && false){%> <%}%> <% i++; } lastUname = uname; } // while( res.next() ) %>
> СПИСОК ТОЧЕК ДОСТУПА
  Наименование № группы Кредит Настройки Смена пароляСмена состояния
  <%=uname%>:<%=svc_t%> <%=group%><%=timef.format(hours)%>:<%=timef.format(minutes)%>:<%=timef.format(seconds)%><%=timef.format(hours)%> ч. <%=timef.format(minutes)%> мин. >изменить <%=mbytes%> М  -   >изменить  ><%=switchAccess%> 



<%@ include file="footer.jsp"%>