VERSION 5.00
Object = "{0C8DE9F2-EAFC-44DF-A13F-B5A9B36ED780}#2.0#0"; "lvButton.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BD0C1912-66C3-49CC-8B12-7B347BF6C846}#13.0#0"; "CODEJO~1.OCX"
Object = "{CB9331C5-4A52-45B1-B34A-36C0DE0F96A5}#1.0#0"; "WelchUserControl.ocx"
Begin VB.Form Home 
   BackColor       =   &H80000009&
   BorderStyle     =   0  'None
   Caption         =   "State Bank Of India - ATM System"
   ClientHeight    =   11010
   ClientLeft      =   60
   ClientTop       =   195
   ClientWidth     =   15240
   ClipControls    =   0   'False
   FillColor       =   &H00FFFFFF&
   LinkTopic       =   "Form1"
   PaletteMode     =   2  'Custom
   ScaleHeight     =   11010
   ScaleWidth      =   15240
   ShowInTaskbar   =   0   'False
   WindowState     =   2  'Maximized
   Begin lvButton.lvButtons_H btnConnect 
      Height          =   375
      Left            =   6120
      TabIndex        =   15
      Top             =   7560
      Width           =   2895
      _ExtentX        =   5106
      _ExtentY        =   661
      Caption         =   "&Connect"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      cGradient       =   0
      Mode            =   0
      Value           =   0   'False
      cBack           =   -2147483633
   End
   Begin VB.TextBox txtPIN 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   7200
      MaxLength       =   4
      TabIndex        =   13
      Top             =   6720
      Width           =   2895
   End
   Begin VB.Timer Timer5 
      Enabled         =   0   'False
      Interval        =   10
      Left            =   4080
      Top             =   8640
   End
   Begin MSComctlLib.ProgressBar PBar 
      Height          =   375
      Left            =   5040
      TabIndex        =   7
      Top             =   8880
      Visible         =   0   'False
      Width           =   5295
      _ExtentX        =   9340
      _ExtentY        =   661
      _Version        =   393216
      Appearance      =   1
   End
   Begin VB.TextBox txtAccount 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   7200
      MaxLength       =   5
      TabIndex        =   0
      Top             =   6000
      Width           =   2895
   End
   Begin lvButton.lvButtons_H cmdCreateAC 
      Height          =   495
      Left            =   11640
      TabIndex        =   1
      Top             =   3000
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   873
      Caption         =   "Create An Account"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      cGradient       =   0
      Mode            =   0
      Value           =   0   'False
      ImgAlign        =   1
      Image           =   "Home.frx":0000
      ImgSize         =   24
      cBack           =   -2147483633
   End
   Begin lvButton.lvButtons_H cmdAbout 
      Height          =   555
      Left            =   11640
      TabIndex        =   4
      Top             =   5160
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   979
      Caption         =   "About"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      cGradient       =   0
      Mode            =   0
      Value           =   0   'False
      ImgAlign        =   3
      Image           =   "Home.frx":106B
      ImgSize         =   24
      cBack           =   -2147483633
   End
   Begin lvButton.lvButtons_H cmdLucky 
      Height          =   555
      Left            =   11640
      TabIndex        =   2
      Top             =   3720
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   979
      Caption         =   "I'm feeling Lucky"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      cGradient       =   0
      Mode            =   0
      Value           =   0   'False
      ImgAlign        =   3
      Image           =   "Home.frx":30EB
      ImgSize         =   32
      cBack           =   -2147483633
   End
   Begin lvButton.lvButtons_H cmdExit 
      Height          =   495
      Left            =   11640
      TabIndex        =   3
      Top             =   4440
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   873
      Caption         =   "I want To Exit!"
      CapAlign        =   2
      BackStyle       =   2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      cGradient       =   0
      Mode            =   0
      Value           =   0   'False
      ImgAlign        =   1
      Image           =   "Home.frx":4644
      ImgSize         =   24
      cBack           =   -2147483633
   End
   Begin vkUserContolsXP.vkLabel vkLabel3 
      Height          =   375
      Left            =   120
      TabIndex        =   9
      Top             =   9000
      Width           =   3015
      _ExtentX        =   5318
      _ExtentY        =   661
      BorderColor     =   33023
      BackColor       =   16711680
      BackStyle       =   0
      Caption         =   "SBI Education Loan"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Lucida Sans Unicode"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   16777215
      Alignment       =   2
   End
   Begin vkUserContolsXP.vkLabel vkLabel1 
      Height          =   375
      Left            =   0
      TabIndex        =   10
      Top             =   6120
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   661
      BackColor       =   16711680
      BackStyle       =   0
      Caption         =   "SBI Home Loan"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Lucida Sans Unicode"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   16777215
      Alignment       =   2
   End
   Begin vkUserContolsXP.vkLabel vkLabel2 
      Height          =   375
      Left            =   120
      TabIndex        =   11
      Top             =   1920
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   661
      BackColor       =   16711680
      BackStyle       =   0
      Caption         =   "SBI Mutual Fund"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Lucida Sans Unicode"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   16777215
      Alignment       =   2
   End
   Begin VB.Label lblPIN 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "PIN"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   4800
      TabIndex        =   14
      Top             =   6720
      Width           =   675
   End
   Begin VB.Label lblAdminAcess 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Administrative Access"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   12840
      MouseIcon       =   "Home.frx":8131
      MousePointer    =   99  'Custom
      TabIndex        =   12
      Top             =   240
      Width           =   2025
   End
   Begin VB.Image Image8 
      Height          =   2250
      Left            =   120
      Picture         =   "Home.frx":843B
      Top             =   6720
      Width           =   3045
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H000080FF&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H000080FF&
      Height          =   495
      Left            =   -600
      Shape           =   4  'Rounded Rectangle
      Top             =   1920
      Width           =   3615
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H000080FF&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H000080FF&
      Height          =   495
      Left            =   -480
      Shape           =   4  'Rounded Rectangle
      Top             =   6120
      Width           =   3615
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H000080FF&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H000080FF&
      Height          =   495
      Left            =   -360
      Shape           =   4  'Rounded Rectangle
      Top             =   9000
      Width           =   3615
   End
   Begin VB.Image SBI_Logo 
      Height          =   990
      Left            =   6000
      Picture         =   "Home.frx":9984
      Top             =   360
      Width           =   3540
   End
   Begin VB.Image Image7 
      Height          =   1560
      Left            =   0
      Picture         =   "Home.frx":B1B9
      Stretch         =   -1  'True
      Top             =   10080
      Width           =   8655
   End
   Begin XtremeSkinFramework.SkinFramework Skin 
      Left            =   4080
      Top             =   360
      _Version        =   851968
      _ExtentX        =   635
      _ExtentY        =   635
      _StockProps     =   0
   End
   Begin VB.Label lblConnecting 
      BackStyle       =   0  'Transparent
      Caption         =   "Connecting To Database...."
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   5040
      TabIndex        =   8
      Top             =   8520
      Visible         =   0   'False
      Width           =   3015
   End
   Begin VB.Image Image6 
      Height          =   2805
      Left            =   3960
      Picture         =   "Home.frx":13458
      Stretch         =   -1  'True
      Top             =   2520
      Width           =   1425
   End
   Begin VB.Image Image1 
      Height          =   2775
      Left            =   5400
      Picture         =   "Home.frx":15F7B
      Stretch         =   -1  'True
      Top             =   2520
      Width           =   5895
   End
   Begin VB.Label lblAccount 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "A/C No."
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   4755
      TabIndex        =   6
      Top             =   6000
      Width           =   1335
   End
   Begin VB.Image Img5 
      Height          =   3285
      Left            =   120
      Picture         =   "Home.frx":243B5
      Stretch         =   -1  'True
      Top             =   2640
      Width           =   3060
   End
   Begin VB.Image Img6 
      Height          =   1515
      Left            =   0
      Picture         =   "Home.frx":2895E
      Top             =   360
      Width           =   3360
   End
   Begin VB.Image Image5 
      Height          =   795
      Left            =   11880
      Picture         =   "Home.frx":2B63B
      Stretch         =   -1  'True
      Top             =   10680
      Width           =   1500
   End
   Begin VB.Image Image4 
      Height          =   795
      Left            =   10320
      Picture         =   "Home.frx":2D5AA
      Stretch         =   -1  'True
      Top             =   10680
      Width           =   1500
   End
   Begin VB.Image Image3 
      Height          =   795
      Left            =   8760
      Picture         =   "Home.frx":2FE23
      Stretch         =   -1  'True
      Top             =   10680
      Width           =   1500
   End
   Begin VB.Image Image2 
      Height          =   795
      Left            =   13440
      Picture         =   "Home.frx":30D33
      Stretch         =   -1  'True
      Top             =   10680
      Width           =   1500
   End
   Begin VB.Label lblLogIn 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Log In To Enter The ATM"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5160
      TabIndex        =   5
      Top             =   1680
      Width           =   5535
   End
End
Attribute VB_Name = "Home"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim SQL                 As String
Dim FieldError          As Boolean


Private Sub btnConnect_Click()
Dim tempPWD As String
Dim VerifyPIN As Boolean

Check_Blank_Fields
Check_DataType
If FieldError = True Then
    txtAccount.SetFocus
    Exit Sub
Else
    Set rsAccount = New ADODB.Recordset
    rsAccount.Open "Select * from tblUser where ACNumber=" & txtAccount.Text, CON, adOpenStatic, adLockOptimistic
    If rsAccount.RecordCount > 0 Then
        tempPWD = rsAccount.Fields("PIN")
        Decrypt (tempPWD)
    Else
        MsgBox "Invalid UserName Or Password1. Try Again!!", vbExclamation, "SBI ATM Msg"
        txtAccount.SetFocus
        Exit Sub
    End If
    If txtPIN.Text = pwdDecrypted Then
        VerifyPIN = True
    Else
        VerifyPIN = False
    End If
    If VerifyPIN = False Then
        MsgBox "Invalid UserName Or Password2. Try Again!!", vbExclamation, "SBI ATM Msg"
        txtAccount.SetFocus
        Exit Sub
    Else
        lblConnecting.Visible = True
        PBar.Visible = True
        Timer5.Enabled = True
    End If
End If
End Sub

Sub Check_Blank_Fields()
If Trim(Val(txtAccount.Text)) = "" Or Trim(txtPIN.Text) = "" Then
    FieldError = True
    MsgBox "Sorry! Please Complete All Fields.", vbExclamation, "SBI ATM Msg"
Else
    FieldError = False
End If
End Sub

Sub Check_DataType()
If FieldError = False Then
    If IsNumeric(txtAccount.Text) = False Then
        MsgBox "Account Number must be Numeric!", vbOKOnly, "SBI LogIn Msg"
        FieldError = True
          ElseIf IsNumeric(txtPIN.Text) = False Then
            MsgBox "PIN Number must be Numeric!", vbOKOnly, "SBI LogIn Msg"
            FieldError = True
    Else
        FieldError = False
    End If
End If
End Sub


Private Sub cmdAbout_Click()
AboutME.Show 1
End Sub

Private Sub cmdCreateAC_Click()
Load CreateAC
CreateAC.Show 1
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdLucky_Click()
Lucky.Show 1
End Sub

Private Sub Form_Load()
LoadTheme
Connection
End Sub

Private Sub lblAdminAcess_Click()
Admin.Show 1
End Sub

Private Sub Timer5_Timer()
If PBar.Value = 100 Then
    lblConnecting.Visible = False
    PBar.Visible = False
    btnConnect.Caption = "Connected"
    Timer5.Enabled = False
    
    Unload Home
    Load ATM
    ATM.Show
    Exit Sub
Else
    PBar.Value = PBar.Value + 1
End If
End Sub

Private Sub txtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    txtAccount.SetFocus
End If
End Sub


Public Sub LoadTheme()
    Skin.LoadSkin App.Path + "\Resources\Theme\blue", ""
    Skin.ApplyWindow Me.hwnd
    Skin.ApplyOptions = Skin.ApplyOptions Or xtpSkinApplyMetrics
End Sub



