Sunday, September 15, 2019
Apartment – title
CHAPTER 1 INTRODUCTION Rationale Every individual has the desire to live in a peaceful manner and in a secured way. Apartment is one of the most profitable establishments here in Cebu City for the number of people came from provinces keeps on increasing. Living in an uncertain world, apartmentââ¬â¢s owners want to maintain safety measures in their firms and occupants might as well want to be secured. Encroachment is an issue nowadays. It is an act of illegal entry without any permission from the owners/occupants to a specified area.Furthermore, it often resulted to theft, burglary and intrusion. To get rid of this issue, the group proposes this system which is to maintain the security of the apartments via biometrics. With this system, encroachment issue will be avoided for without the presence of the occupants, no one can enter the apartment. Theoretical Background According to Harbron (1988), one way of attaining security of a certain area is by means of biometrics. Jain et. al. (1999) identified that biometric system can operate verification and identification mode.It is very important to make our place secured in many aspects to prevent from encroachment issues. According to statistics, more than 30% of the burglars have gained access into apartments, through an open door or window. (http://www. buzzle. com/articles/security-alarm-systems-for-apartments. html). Flordelis, Timothy Jake B. et. al. (2005) confirmed that there are problems that occupants and owners experienced these are theft, intrusion, and burglary, which considered being encroachment. Lao, Excio Erving Jr. A. et. al. 2003) explained that by using home automation system, one can make several or all of the systems and devices in home work automatically to provide more security, safety, and convenience. It inspires the group to make this Apartment Security System via Biometrics that will enhance the existing one in securing the Apartments. In Apartment Security System via Biometrics, all roo ms should be networked to the server. According to Clark et. al. (1985), a network is a collection of processors and terminals that serves more than one user at a time by communication.Biometrics Theory Biometric identification technologies (the automatic recognition of individuals based on physical and/or behavioral characteristics) date back over 50 years to the earliest digital computers. Over the last two decades, biometric identification devices have become faster, cheaper, and more reliable, allowing for a variety of applications. This course looks at the history, theory, algorithms, applications, and standards of biometric recognition, including voice, iris, face, hand, and fingerprint identification.Test protocols, system design, and error rate prediction are discussed, along with the implications of the technology for personal privacy. 1. Abstract One of the most critical issues to solve when building multi-accessible systems, such as computer applications, cars or physical buildings, is to determine the identity of a person. A system protecting confidential information, or items of value, puts strong security demands on the identification. Biometry provides us with a user-friendly method for this identification and is becoming a competitor for current identification mechanisms, especially for electronic transactions.However, there are ways to compromise a system based on biometric verification. This article focuses on the drawbacks and risks of biometric verification, specifically verification based on fingerprints. It shows how all currently available fingerprint scanners can be fooled by dummies that are created with very limited means and skills. This article should be read as a warning to those thinking of using new methods of identification without first examining the technical opportunities for compromising the identification mechanism and the associated legal consequences.This is especially true for people working with smart cards since it is quite common to store fingerprints on smart cards and due to the developments in solid state fingerprint scanners, integration of a fingerprint scanner on a smart card is possible. 2. Information Identification systems based on biometrics are capable of identifying persons on the basis either physical or behavioural characteristics. Currently, there are over ten different techniques available to identify a person based on biometrics.The following techniques are applied within the main categories physical and behavioural characteristics: |Behavioral characteristics à à à à à à à |Physical characteristics | |keystrokes dynamics |iris recognition | |voice recognition |retina recognition | |signature dynamics |vein pattern recognition | | |face recognition | | |recognition of hand or finger geometry | | |fingerprint recognition | Before a system is able to verify the specific biometrics of a person, it of course requires something to compare it with. Therefore, a p rofile or template containing the biometrical properties is stored in the system. Recording the characteristics of a person is called enrolment. In order to get a profile that corresponds most with reality, the biometrical. characteristics are scanned several times. In case of fingerprint recognition the finger is scanned three to four times to get a profile that is independent of variations that occur in practice, such as the angle of placement of the finger on the scanner.Since storage capacity for the profiles in these systems is usually limited (for example if used in combination with smart cards), it is common to use data compression before storing the profile. Storing profiles in tokens requires a combination of token and biometry for verification and therefore gives a higher level of security. When a biometrical verification is to occur, a scan of the biometrics of a person is made and compared with the characteristics that are stored in the profile. In general, a certain mar gin of error is allowed between the observed and stored characteristics. If this margin is too small, the system will reject a righteous person more often while if this margin is too large, malicious persons will be accepted by the system.The probabilities that a righteous person will be rejected and that a malicious person will be accepted, are called False Reject Rate (FRR) and False Accept Rate (FAR) respectively. When using a biometric system, one would of course want to minimise both rates, but unfortunately these are not independent. An optimum trade-off between FRR and FAR has to be found with respect to the application. 3. Biometric Identification In this chapter the techniques for fingerprint identification will be explored. After explaining the theory of fingerprint verification, all current scanning technologies are described in more detail. Once it is known how these scanners identify a person by means of a fingerprint, two methods to counterfeit fingerprints are shown.A ll additional methods implemented by scanner manufacturers to prevent counterfeits from being successful are also described together with proposed methods how these systems could also be fooled into accepting dummy fingerprints. The consequences for systems using fingerprint verification are discussed at the end of the chapter. First, an example for fingerprint verification from practice will be given. This example also illustrates how difficult it can be to find an optimum trade-off between FAR and FRR. From a security point of view, one would want to have the FAR as small as possible. However, for acceptance of a biometry system, a large FRR is worse. Case: Within the car industry a biometric verification system is under evaluation.Manufacturers of expensive cars are considering using fingerprint recognition as a requirement for ignition of the engine. To arm against car theft, the FAR should be as small as possible. On the other hand, suppose that the righteous owner of a car can not use his car because his fingerprint is rejected (i. e. FRR is too high). He will consider this to be a much more serious flaw in the system than a technical failure which prevents the car from being started. This is especially true if he compares the advantages of this system with this rejection: the advantages are that the driver does not (necessarily) have to have a key to his car and a perception of higher security with respect to theft of his car. Whether indeed the security improves is questionable.Right now, we do not see car thieves trying to copy the key of your car, instead they try to by-pass the ignition mechanism where the car key is involved. Furthermore, as this article will show, it might decrease security since it is fairly easy and cheap to copy a fingerprint from a person, even without the person knowing this. 3. 1 Theory of Fingerprint Verification The skin on the inside of a finger is covered with a pattern of ridges and valleys. Already centuries ago it was studied whether these patterns were different for every individual, and indeed every person is believed to have unique fingerprints. This makes fingerprints suitable for verification of the identity of their owner.Although some fingerprint recognition systems do the comparison on the basis of actual recognition of the pattern, most systems use only specific characteristics in the pattern of ridges. These characteristics are a consequence from the fact that the papillary ridges in the fingerprint pattern are not continuous lines but lines that end, split into forks (called bifurcation), or form an island. These special points are called minutiae and, although in general a fingerprint contains about a hundred minutiae, the fingerprint area that is scanned by a sensor usually contains about 30 to 40 minutiae. For over hundred years law enforcement agencies all over the world use minutiae to accurately identify persons .For a positive identification that stands in European courts at lea st 12 minutiae have to be identified in the fingerprint. The choice of 12 minutiae is often referred to as ââ¬Å"the 12 point ruleâ⬠. This 12 point rule is not based on statistical calculations but is empirically defined based on the assumption that, even when a population of tens of millions of persons are considered, no two persons will have 12 coinciding minutiae in their fingerprints. Most commercially available fingerprint scanners give a positive match when 8 minutiae are found. Manufacturers claim a FAR of one in a million based on these 8 minutiae, which seems reasonable. 3. 2 Fingerprint Scanning Technologies Technologies for scanning fingerprints have evolved over the past years.The traditional method which is used by law enforcement agencies for over a hundred years now is making a copy of the print that is found at a crime scene or any other location and manually examining it to find minutiae. These minutiae are compared with prints from a database or specific ink prints, which could be taken at a later time. This method is of course based on the fact that the person who left the fingerprints is not co-operating by placing his finger on a fingerprint scanner. For systems that are commercially available (and deployed) people are required to co-operate in order to gain access to whatever is protected by the verification system. The first generation fingerprint scanners appeared on the market in the mid eighties, so the technology is about fifteen years old.Over the past few years the technology for scanning fingerprints for commercial purposes has evolved a lot. While the first generation sensors used optical techniques to scan the finger, current generation sensors are based on a variety of techniques. The following techniques are deployed in commercial products that are currently available: â⬠¢ Optical sensors with CCD or CMOS cameras â⬠¢ Ultrasonic sensors â⬠¢ Solid state electric field sensors â⬠¢ Solid state capacitive sens ors â⬠¢ Solid state temperature sensors The techniques will be described in greater detail in this section. The solid state sensors are so small that they can be built into virtually any machine.Currently a sensor is in development that will be built in a plastic card the size of a credit card, not only with respect to length and width but also with respect to thickness! It is clear that this type of sensor will give a boost to the number of applications using fingerprint technology. (http://cryptome. org/fake-prints. htm) THE PROBLEM Statement of the Problem Encroachment has been an issue in our industry. It could not be resolved unless there are security systems. This study aims to secure every room in any apartment eliminating strangers to get into oneââ¬â¢s room without the presence of any occupant. This study is further concerned with the following issues: 1.What are the existing systems used to maintain security of the apartments? 2. What are the problems encountered by the occupants of the apartments? 3. What are the advantages of this Apartment Security System among the existing systems? 4. What are the technological features in this Apartment Security System? Statistics The number of residential burglaries recorded increased 0. 7% from 27,347 in 2009/2010 to 27,531 in 2010/2011. Burglary (residential) had a clearance rate of 12. 4% during 2010/2011, 1. 6 percentage points lower than that of 2009/2010. Reported Residential Burglary in the Philippines as of 2007 [pic]Figure 1. 1 Burglary (residential) Graph Significance of the StudyTrespassing has been a concern in our society, to put an end this issue, this Apartment Security System must be realized. Apartment is the most profitable business establishment businessmen could ever have. Hence, such establishments must be secured all the time. Security systems are not just luxury in an Apartment, it is a necessity to maintain security and to be able to prevent from encroachment issues such as burgla ry, intrusion, theft, etc. If there is security system in the apartment, then both owners and boarders will benefit the system. The boarders will feel comfortable living in the apartment with such system, and will not encounter encroachment issues, hence the boarders will live peacefully and live longer in that certain apartment.A boarder who stays in the apartment long enough is an indication that he trusted the system that runs in the apartment. So, it is an advantage on the ownerââ¬â¢s side because, aside from the fact that no intruder can get access to his establishment, it is a big income if the boarders stayed longer in his apartment. Scope and Limitation The project focuses more on the security systems. The project identified the occupants of the apartment by means of fingerprint identification through biometrics. This project already exists, the only difference is that the group applied the system in every room which makes the system expensive enough for it requires every apartment a single biometrics. The group pilots only two rooms for demonstration purposes.The system is capable of identifying occupants to the extent that it alarms whenever an intruder reached the maximum tries of fingerprint identifying. The project could not cater occupants who are disabled (do not have fingers). RESEARCH METHODOLOGY Methodology is generally a guideline for solving a problem, with specific components such as phases, tasks, methods, techniques and tools. The group uses applied research and makes use of various techniques and tools in conducting this research. Research Environment The group will conduct the survey in the apartment where there are tenants and an owner. The purpose of our survey is to determine what are their concerned about the security of their apartment. Number of apartments and dormitories surveyed: 21Number of owners interviewed: 3 Number of workers interviewed: 18 Number of boarders interviewed: 100 Example of apartmentââ¬â¢s and dormitori es surveyed: Kim Kathleenââ¬â¢s House for ladies ââ¬â Brgy. Cabancalan, Mandaue City Engr. Bing Momo Europa Apartelle and Dormitory- Brgy. Cabancalan, Mandaue City ââ¬Å"Patoyâ⬠Saint Joseph Dormitory ââ¬â Lopez Jaena St. , Mandaue City ââ¬Å"Maââ¬â¢am Earl Joyâ⬠Pink Dormitory- Brgy. Pitogo Consolacion ââ¬Å"Dioscor Jamisolaâ⬠Research Respondents The people to be conducted by the group are the apartment tenants and the owner for they are the stakeholder of the system. The group will use the simple random sampling technique in getting the number of respondents.Research Instruments The data gathering is employed through the use of the questionnaire and supplemented with some data analysis of published, unpublished thesis and some article Research Procedure Gathering Data The team gathered the data through the formulated questionnaire which was distributed in the apartments, hotel, boarding house and school to identify the views of the respondents. Tre atment of Data Based on the questionnaire, the team construct, analyze, and interpret. The team will use the following formula. n = N 1 + N e Where: n = sample size N = population size e = desire margin of error DEFINITION OF TERMS Project Design A project that is being put into reality by a group of designer. Designers ââ¬â A group of individuals that is tasked to develop the project design. Hardware ââ¬â The physical components of a computer system, including any peripheral equipment such as printers, modem and mouse. Software ââ¬â Computer programs are referred to as software. Feature ââ¬â Is a unique, attractive, or desirable property of a program or of a computer or other hardware. Microcontroller ââ¬â A highly integrated chip contains all the components comprising a controller. Server ââ¬â A computer system that consist of database and other information of it a device that manages network resource. Circuit A combination of electrical or electronics comp onents, interconnected to perform one or more specific functions. Breadboard ââ¬â A fiberboard used by electronic circuit designers to build experimental circuits and prototypes. Relay ââ¬â Is an electrical switch that opens and closes under the control of another electrical circuit. Transistor ââ¬â Is a semiconductor device, commonly used to amplify or switch electronic signals. Serial Communication ââ¬â Is the process of sending data one bit at one time, sequentially, over a communication channel or computer bus. This is in contrast to parallel communication, where all the bits of each symbols are sent together. Flowchart A diagram representing the logical sequence in which a combination of steps or operation is to be perform. Program Flowchart ââ¬â Describes graphically in detail the logical operation and steps with in a program and the sequence in which these steps are to be executed to the transformation of data to produce the needed output. System Flowchart ââ¬â Graphic representation of the procedure involved in converting data or media to data in output form. CHAPTER 2 PRESENTATION, ANALYSIS AND INTERPRETATION OF DATA This chapter focuses more on the data gathered in order for the proponents to further understand the importance of the project. The gathered data is being analyzed so that the group will be aware of the standards or the expectations of the mass.It is then interpreted by making graphs such as pie graph and bar graph to easily visualize the results of the conducted survey. The Figure 2. 1 shows that most of the groupââ¬â¢s research respondents are the Occupant of the Apartment with fifty ââ¬â eight percent (58%). The group conducted this research in the apartmentââ¬â¢s occupant because they are the ones who will be benefiting the project aside from the Apartment owners. Their opinions and suggestions are very significant in making our project a successful one. The Figure 2. 2 shows that sixty four percent ( 64%) of the respondents has security systems in their respective apartments. But there are thirty six percent (36%) of the respondents who are living in an apartment with no security. CHAPTER 3Technical Aspects of the Systems This chapter contains the summary of the software and components used in the project in order for the readers to examine how the project was made. System Flowchart is the interpretation of how the project runs from start to end. The Program Flowchart is the interpretation of how the user interfaces with the users. The Block Diagram is how the project composed of. And the Source Code it is the program used of how the project runs with. [pic] Figure 3. 1 ââ¬â System Flowchart [pic] Figure 3. 2 ââ¬â System Flowchart [pic] Figure 3. 3 ââ¬â Program Flowchart [pic] Figure 3. 4 ââ¬â Program Flowchart [pic] Figure 3. 5 ââ¬â Program Flowchart [pic] Figure 3. ââ¬â Program Flowchart [pic] Figure 3. 7 ââ¬â Program Flowchart System Block Diagram â⬠¢ For Fingerprint Scanner [pic] Figure 3. 8 ââ¬â System Block Diagram For Fingerprint Scanner â⬠¢ For the whole system [pic] Figure 3. 9 ââ¬â System Block Diagram For the whole System Schematic Diagram The schematic diagram is the design which shows how the desired components are being connected to each other. Figure shows the schematic diagram of our design. [pic] Figure 3. 10 ââ¬â Schematic Diagram Design Components Software Design Proteus 7 ISIS Professional The Proteus Professional demonstration is intended for prospective customers who wish to evaluate our professional level products.It differs from Proteus Lite in that it does not allow you to save, print or design your own microcontroller based designs (you can however write your own software programs to run on the existing sample design suite for evaluation), but does include all features offered by the professional system including netlist based PCB design with auto-placement, auto-routing and graph b ased simulation .[pic] Figure 3. 11 ââ¬â Proteus 7 ISIS Professional MikroC The group decided to use MicroC Compiler because it is a C complier for PIC. It is designed to provide the customer with the easiest possible solution for developing applications for embedded system without compromising performance or control. MikroC allows quickly develop and deploy complex applications. [pic] Figure 3. 12 ââ¬â MikroC VB6. 0 [pic] Figure 3. 3 ââ¬â VB6. 0 Visual Basic (VB) is a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Visual Basic is designed to be relatively easy to learn and use. Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Script ing languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations. Though the program has received criticism for its perceived faults, from version 3 Visual Basic was a runaway commercial success,and many companies offered third party controls greatly extending its functionality. The final release was version 6 in 1998. Microsoft's extended support ended in March 2008 and the designated successor was Visual Basic . NET (now known simply as Visual Basic). Hardware Components PIC 16F877A Microcontroller [pic] Figure 3. 14 ââ¬â PIC 16F877AA PIC (Peripheral Interface Controller) microcontroller is an IC manufactured by Microchip. These ICs are complete computers in a single package. The only external components necessary are whate ver is required by the I/O devices that are connected to the PIC. A microcontroller is a small computer and it can only perform simple task. Microcontroller consists of: â⬠¢ Processor that executes the program â⬠¢ Program memory to store the program that has been compiled successfully by the programmer. â⬠¢ Ram (random-access memory) to store ââ¬Å"variables. â⬠â⬠¢ IO Port to connect sensor, keypad, LED and so on. Crystal Oscillator [pic] Figure 3. 15 ââ¬â Crystal OscillatorAà crystal oscillatorà is anà electronic oscillatorà circuit that uses the mechanicalà resonanceà of a vibratingà crystalà ofà piezoelectric materialà to create an electrical signal with a very preciseà frequency. This frequency is commonly used to keep track of time (as inà quartz wristwatches), to provide a stableà clock signalà for digitalà integrated circuits, and to stabilize frequencies forà radio transmittersà andà receivers. The most common ty pe of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them became known as ââ¬Å"crystal oscillators. â⬠Relay [pic] Figure 3. 16 ââ¬â Relay Aà relayà is anà electricallyà operatedà switch. Many relays use anà electromagnetà to operate a switching mechanism mechanically, but other operating principles are also used.Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. Resistor [pic] Figure 3. 17 ââ¬â Resistor Typical 10K ohm, 1/4 watt resistor that can be used with various circuits. The color band on the r esistor is Brown, Black, Orange, Gold. Diode [pic] Figure 3. 18 ââ¬â DiodeDiodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the direction in which the current can flow. Diodes are the electrical version of a valve and early diodes were actually called valves. Regulator [pic] Figure 3. 19 ââ¬â Regulator Encapsulated in a single chip/package (IC), theà 7805à is a positive voltage DCà regulatorà that has only 3 terminals. They are: Input voltage, Ground, Output Voltage. Transistor [pic] Figure 3. 20 ââ¬â Transistor Transistor is a ââ¬Å"CURRENTâ⬠operated device which has a very large amount of current (Ic) which flows without restraint through the device between theà collectorà and emitter terminals.But this is only possible if a small amount of biasing current (Ib) isà presentà in the base terminal of the transistor making the base to act as a current control input. LED (Light Emitting Diode) [pic] Figure 3 . 21 ââ¬â LED A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices, and are increasingly used for lighting. Introduced as a practical electronic component in 1962,[2] early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness. DCU 11 [pic] Figure 3. 22 ââ¬â DCU 11 The cable incorporates a charger port to charge the phone while the cable is in use, and your phoneââ¬â¢s built-in modem brings the Web and email to your PC.The widely accepted USB standard and high-speed data transfer make this cable the ideal link from your phone to your PC. â⬠¢ USB connector Fingerprint Scanner [pic] Figure 3. 23 ââ¬â Fingerprint Scanner Fingerprint recognitionà orà fingerprint authenticationà refers to theà automatedà method of verifying a match between two humanà fingerprints. Fingerprints are one of many forms o fà biometricsà used toà identifyà individuals andà verifyà theirà identity. This article touches on two major classes ofà algorithmsà (minutia and pattern) and fourà sensorà designs (optical, ultrasonic, passive capacitance, and active capacitance). Power Supply [pic] Figure 3. 24 ââ¬â Power Supply Aà power supplyà is a device that suppliesà electricalà energyà to one or moreà electric loads.The term is most commonly applied to devices that convert one form of electrical energy to another, though it may also refer to devices that convert another form of energy (e. g. , mechanical, chemical, solar) to electrical energy. Aà regulated power supplyà is one that controls the output voltage or current to a specific value; the controlled value is held nearly constant despite variations in either load current or the voltage supplied by the power supply's energy source. Program Source Code MikroC char ch; void main() { PORTB = 0x00; TRISB = 0x00; TRI SC = 0x80; PORTC = 0; Usart_Init(9600); delay_ms(100); while(1) { if(Usart_Data_Ready()) { ch = Usart_Read(); if(ch == ââ¬Ë1') { PORTC. F0 = 1; elay_ms(5000); PORTC. F0 = 0; ch=''; } if(ch == ââ¬Ë2') { PORTC. F1 = 1; delay_ms(8000); PORTC. F1 = 0; ch=''; } } PORTB = 0x00; } VB6. 0 ââ¬Å"Enrollmentâ⬠Dim WithEvents Capture As DPFPCapture Dim CreateFtrs As DPFPFeatureExtraction Dim CreateTempl As DPFPEnrollment Dim ConvertSample As DPFPSampleConversion Private Sub DrawPicture(ByVal Pict As IPictureDisp) ââ¬Ë Must use hidden PictureBox to easily resize picture. Set HiddenPict. Picture = Pict Picture1. PaintPicture HiddenPict. Picture, _ 0, 0, Picture1. ScaleWidth, _ Picture1. ScaleHeight, _ 0, 0, HiddenPict. ScaleWidth, _ HiddenPict. ScaleHeight, vbSrcCopy Picture1. Picture = Picture1. Image End SubPrivate Sub ReportStatus(ByVal str As String) Status. AddItem (str) ââ¬Ë Add string to list box. Status. ListIndex = Status. NewIndex ââ¬Ë Move list box selection down. End Sub Private Sub Close_Click() Capture. StopCapture ââ¬Ë Stop capture operation. Unload Me End Sub Private Sub Form_Load() Set Capture = New DPFPCapture ââ¬Ë Create capture operation. Capture. StartCapture ââ¬Ë Start capture operation. Set CreateFtrs = New DPFPFeatureExtraction ââ¬Ë Create DPFPFeatureExtraction object. Set CreateTempl = New DPFPEnrollment ââ¬Ë Create DPFPEnrollment object. Samples. Caption = CreateTempl.FeaturesNeeded ââ¬Ë Show number of samples needed. Set ConvertSample = New DPFPSampleConversion ââ¬Ë Create DPFPSampleConversion object. End Sub Private Sub Capture_OnReaderConnect(ByVal ReaderSerNum As String) ReportStatus (ââ¬Å"The fingerprint reader was connected. ââ¬Å") End Sub Private Sub Capture_OnReaderDisconnect(ByVal ReaderSerNum As String) ReportStatus (ââ¬Å"The fingerprint reader was disconnected. ââ¬Å") End Sub Private Sub Capture_OnFingerTouch(ByVal ReaderSerNum As String) ReportStatus (ââ¬Å"The fingerprint reader was to uched. ââ¬Å") End Sub Private Sub Capture_OnFingerGone(ByVal ReaderSerNum As String) ReportStatus (ââ¬Å"The finger was removed from the fingerprint reader. ââ¬Å") End SubPrivate Sub Capture_OnSampleQuality(ByVal ReaderSerNum As String, ByVal Feedback As DPFPCaptureFeedbackEnum) If Feedback = CaptureFeedbackGood Then ReportStatus (ââ¬Å"The quality of the fingerprint sample is good. ââ¬Å") Else ReportStatus (ââ¬Å"The quality of the fingerprint sample is poor. ââ¬Å") End If End Sub Private Sub Capture_OnComplete(ByVal ReaderSerNum As String, ByVal Sample As Object) Dim Feedback As DPFPCaptureFeedbackEnum ReportStatus (ââ¬Å"The fingerprint sample was captured. ââ¬Å") ââ¬Ë Draw fingerprint image. DrawPicture ConvertSample. ConvertToPicture(Sample) ââ¬Ë Process sample and create feature set for purpose of enrollment. Feedback = CreateFtrs.CreateFeatureSet(Sample, DataPurposeEnrollment) ââ¬Ë Quality of sample is not good enough to produce feature set. If Feedback = CaptureFeedbackGood Then ReportStatus (ââ¬Å"The fingerprint feature set was created. ââ¬Å") Prompt. Caption = ââ¬Å"Touch the fingerprint reader again with the same finger. â⬠ââ¬Ë Add feature set to template. CreateTempl. AddFeatures CreateFtrs. FeatureSet ââ¬Ë Show number of samples needed to complete template. Samples. Caption = CreateTempl. FeaturesNeeded If Val(Samples. Caption) = 0 Then MainFrame. Picture1. Visible = True Else MainFrame. Picture1. Visible = False End If ââ¬Ë Check if template has been created. If CreateTempl.TemplateStatus = TemplateStatusTemplateReady Then MainFrame. SetTemplete CreateTempl. Template ââ¬Ë Template has been created, so stop capturing samples. Capture. StopCapture Prompt. Caption = ââ¬Å"Click Close, and then click Fingerprint Verification. â⬠MsgBox ââ¬Å"The fingerprint template was created. â⬠End If End If End Sub Private Sub Form_Unload(Cancel As Integer) Capture. StopCapture ââ¬Ë Stop capture operat ion End Sub ââ¬Å"frmFlashâ⬠Option Explicit Dim i As Integer Private Declare Sub Sleep Lib ââ¬Å"kernel32â⬠(ByVal dwMilliseconds As Long) Private Sub Form_Activate() For i = 0 To 10 i = i + 1 Sleep (500) Me. Refresh Next Unload Me frmStandbyMode. Show End Sub ââ¬Å"frmInventoryâ⬠Private Function ConnectDB() As String ConnectDB = ââ¬Å"DRIVER={MySQL ODBC 5. 1 Driver}; SERVER = localhost; DATABASE = db_AMASS; USER = root; PASSWORD = â⬠;â⬠End Function Private Sub cmdPayDue_Click() Set rsPay = New ADODB. Recordset rsPay. CursorLocation = adUseClient rsPay. CursorType = adOpenDynamic rsPay. LockType = adLockOptimistic ââ¬ËrsPay. Open ââ¬Å"SELECT * FROM tbl_registrationâ⬠, ConnectDB rsPay. Open ââ¬Å"select * from tbl_registration where FullName = ââ¬Ëâ⬠& txtPay. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB If rsPay. EOF = False Then ââ¬ËWith rsPay ââ¬ËrsPay. MoveFirst ââ¬Ë While rsPay. EOF = False ââ¬Ë If txtPay. Text = rsPay! Fu llName Then If MsgBox(ââ¬Å"Continue paying his due? , vbInformation + vbYesNo, ââ¬Å"Apartment Monitoring and Security System ââ¬â Paying Dueâ⬠) = vbYes Then rsPay! ToPay = rsPay! ToPay + rsPay! Payment rsPay. Update List_Unpaid. Clear Call query_list ââ¬Ë rsPay. MoveNext ââ¬Ë Else: rsPay. MoveNext End If ââ¬Ë Else: rsPay. MoveNext ââ¬Ë End If ââ¬Ë Wend ââ¬ËEnd With End If End Sub Private Sub cmdPrint_Click() Set rst = New ADODB. Recordset rst. CursorLocation = adUseClient rst. CursorType = adOpenDynamic rst. LockType = adLockOptimistic rst. Open ââ¬Å"select * from tbl_registrationâ⬠, ConnectDB Set GuestReport. DataSource = rst. DataSource GuestReport. ReportWidth = 6000 GuestReport. Show End SubPrivate Sub cmdPrintLogs_Click() Set rst = New ADODB. Recordset rst. CursorLocation = adUseClient rst. CursorType = adOpenDynamic rst. LockType = adLockOptimistic rst. Open ââ¬Å"select * from tbl_logs where FullName = ââ¬Ëâ⬠& txtPay. Text & â⠬Å"ââ¬Ëâ⬠, ConnectDB If rst. EOF = False Then Set GuestLogs. DataSource = rst. DataSource GuestLogs. ReportWidth = 5000 GuestLogs. Show End If End Sub Private Sub Command1_Click() Unload Me Load MainFrame End Sub Private Sub Form_Load() txtPay. Text = ââ¬Å"â⬠Set rsViewInventory = New ADODB. Recordset rsViewInventory. CursorLocation = adUseClient rsViewInventory. CursorType = adOpenDynamic rsViewInventory. LockType = adLockOptimistic rsViewInventory.Open ââ¬Å"SELECT * FROM tbl_registration ORDER BY RoomNumber ASCâ⬠, ConnectDB Set dgGuestInventory. DataSource = rsViewInventory frmInventory. dgGuestInventory. Columns(0). Visible = False frmInventory. dgGuestInventory. Columns(2). Visible = False frmInventory. dgGuestInventory. Columns(5). Visible = False frmInventory. dgGuestInventory. Columns(7). Visible = False frmInventory. dgGuestInventory. Columns(8). Visible = False frmInventory. dgGuestInventory. Columns(1). Width = 2200 frmInventory. dgGuestInventory. Co lumns(3). Width = 1900 frmInventory. dgGuestInventory. Columns(4). Width = 1600 frmInventory. dgGuestInventory. Columns(6). Width = 1200 If rsViewInventory.EOF = False Then With rsViewInventory rsViewInventory. MoveFirst While rsViewInventory. EOF = False If rsViewInventory. EOF = False Then txtBayadHolder. Text = rsViewInventory! ToPay txtBayadUtang. Text = Val(txtBayadUtang. Text) + Val(txtBayadHolder. Text) ââ¬ËrsViewInventory! ToPay rsViewInventory. MoveNext End If Wend End With Dim rsUpdateNah As New ADODB. Recordset rsUpdateNah. CursorLocation = adUseClient rsUpdateNah. CursorType = adOpenDynamic rsUpdateNah. LockType = adLockOptimistic rsUpdateNah. Open ââ¬Å"SELECT * FROM tbl_inventoryâ⬠, ConnectDB If txtBayadUtang. Text = rsUpdateNah! Total Then txtBayadUtang.Text = ââ¬Å"Php â⬠& FormatNumber(rsUpdateNah! Total) Else Dim rsUpdateNahh As New ADODB. Recordset rsUpdateNahh. CursorLocation = adUseClient rsUpdateNahh. CursorType = adOpenDynamic rsUpdateNahh. Lock Type = adLockOptimistic rsUpdateNahh. Open ââ¬Å"SELECT * FROM tbl_inventoryâ⬠, ConnectDB rsUpdateNahh! Total = txtBayadUtang. Text rsUpdateNahh. Update rsUpdateNahh. Close txtBayadUtang. Text = ââ¬Å"Php â⬠& FormatNumber(txtBayadUtang. Text) End If End If Call query_list End Sub Private Sub txtPay_Change() If txtPay. Text ââ¬Å"â⬠Then cmdPayDue. Enabled = True cmdPrintLogs. Enabled = True End If End Sub Public Function query_list() Dim rsViewUnpaid As New ADODB. Recordset rsViewUnpaid.CursorLocation = adUseClient rsViewUnpaid. CursorType = adOpenDynamic rsViewUnpaid. LockType = adLockOptimistic rsViewUnpaid. Open ââ¬Å"SELECT * FROM tbl_registrationâ⬠, ConnectDB If rsViewUnpaid. EOF = False Then With rsViewUnpaid List_Unpaid. AddItem ââ¬Å"Name'sâ⬠& vbTab & vbTab & vbTab & ââ¬Å"To Payâ⬠List_Unpaid. AddItem ââ¬Å"â⬠rsViewUnpaid. MoveFirst While rsViewUnpaid. EOF = False If rsViewUnpaid! ToPay = 0 Then txtBayadHolder. Text = rsViewUnpai d! FirstName & â⬠â⬠& rsViewUnpaid! LastName & vbTab & vbTab & ââ¬Å"Php â⬠& FormatNumber(rsViewUnpaid! Payment) List_Unpaid. AddItem txtBayadHolder. Text rsViewUnpaid. MoveNext Else: rsViewUnpaid.MoveNext End If Wend End With End If End Function ââ¬Å"frmLoginâ⬠Private Declare Function sndPlaySound Lib ââ¬Å"winmm. dllâ⬠Alias ââ¬Å"sndPlaySoundAâ⬠_ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Const SND_SYNC = &H0 Const SND_NODEFAULT = &H2 Private Function ConnectDB() As String ConnectDB = ââ¬Å"DRIVER={MySQL ODBC 5. 1 Driver}; SERVER = localhost; DATABASE = db_AMASS; USER = root; PASSWORD = â⬠;â⬠End Function Private Sub cmdCancel_Click() Unload Me frmStandbyMode. Enabled = True frmStandbyMode. Show End Sub Private Sub Form_Load() frmStandbyMode. Enabled = False End Sub Private Sub cmdOK_Click() Set recordSetAccount = New ADODB. Recordset ecordSetAccount. CursorLocation = adUseClient recordSetAccount. CursorType = a dOpenDynamic recordSetAccount. LockType = adLockOptimistic recordSetAccount. Open ââ¬Å"tbl_accountâ⬠, ConnectDB If (frmLogin. txtUserName. Text = ââ¬Å"â⬠And frmLogin. txtPassword. Text = ââ¬Å"â⬠) Then Unload frmLogin Unload frmStandbyMode MainFrame. mnuSearchGuest. Enabled = False MainFrame. mnuAddGuest. Enabled = False MainFrame. Show ElseIf recordSetAccount. EOF = False Then If frmLogin. txtPassword. Text = ââ¬Å"â⬠Then soundfile$ = ââ¬Å"C:Program FilesTitaniumTimekeepersoundsaccess_denied. wavâ⬠wFlags% = SND_ASYNC Or SND_NODEFAULT sound = sndPlaySound(soundfile$, wFlags%)MsgBox ââ¬Å"Please input your password. Try again! ââ¬Å", , ââ¬Å"Loginâ⬠frmLogin. txtPassword. SetFocus ElseIf Not frmLogin. txtPassword. Text = recordSetAccount! Password Then soundfile$ = ââ¬Å"C:Program FilesTitaniumTimekeepersoundsaccess_denied. wavâ⬠wFlags% = SND_ASYNC Or SND_NODEFAULT sound = sndPlaySound(soundfile$, wFlags%) MsgBox ââ¬Å"Incorrect pa ssword. Try again! ââ¬Å", , ââ¬Å"Loginâ⬠frmLogin. txtPassword. SetFocus frmLogin. txtPassword. SelStart = 0 frmLogin. txtPassword. SelLength = Len(frmLogin. txtPassword. Text) ElseIf (frmLogin. txtUserName. Text = recordSetAccount! UserName And frmLogin. txtPassword. Text = recordSetAccount!Password) Then Unload frmLogin Unload frmStandbyMode MainFrame. Show End If Else soundfile$ = ââ¬Å"C:Program FilesTitaniumTimekeepersoundsaccess_denied. wavâ⬠wFlags% = SND_ASYNC Or SND_NODEFAULT sound = sndPlaySound(soundfile$, wFlags%) MsgBox ââ¬Å"Not a valid account. Try again! ââ¬Å", , ââ¬Å"Loginâ⬠frmLogin. txtUserName. SetFocus frmLogin. txtUserName. SelStart = 0 frmLogin. txtUserName. SelLength = Len(frmLogin. txtUserName. Text) End If End Sub ââ¬Å"frmStanbyModeâ⬠Private Sub mnuExit_Click() If MsgBox(ââ¬Å"Are you sure you want to exit program? ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠) = vbYes Then Timer1. Enabled = True End IfEnd Sub Private Sub mnuLogin_Click() frmLogin. Show End Sub Private Sub Timer1_Timer() Label1. Visible = True ProgressBar1. Visible = True If ProgressBar1. Value >= ProgressBar1. Max Then End End If ProgressBar1. Value = ProgressBar1. Value + 1 End Sub ââ¬Å"MainFrameâ⬠Dim Templ As DPFPTemplate Private Function ConnectDB() As String ConnectDB = ââ¬Å"DRIVER={MySQL ODBC 5. 1 Driver}; SERVER = localhost; DATABASE = db_AMASS; USER = root; PASSWORD = â⬠;â⬠End Function Private Sub cboRoomChoice_Click() If cboRoomChoice. Text = ââ¬Å"Economyâ⬠Then txtIdHolder. Text = 1500 ElseIf cboRoomChoice. Text = ââ¬Å"Standardâ⬠Then txtIdHolder. Text = 2000 ElseIf cboRoomChoice.Text = ââ¬Å"Familyâ⬠Then txtIdHolder. Text = 2500 End If End Sub Private Sub cboRoomNumberDel_Click() dgGuestDelete. Visible = True Set recordSetDelete = New ADODB. Recordset recordSetDelete. CursorLocation = adUseClient recordSetDelete. CursorType = adOpenDynamic recordSetDelete. LockType = adLockOptimistic recordSetDelete. Open ââ¬Å"SELECT * FROM tbl_registration WHERE RoomNumber = ââ¬Ëâ⬠& cboRoomNumberDel. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB Set dgGuestDelete. DataSource = recordSetDelete MainFrame. dgGuestDelete. Columns(0). Visible = False MainFrame. dgGuestDelete. Columns(2). Visible = False MainFrame. dgGuestDelete. Columns(7). Visible = False MainFrame. dgGuestDelete.Columns(8). Visible = False MainFrame. dgGuestDelete. Columns(1). Width = 2200 MainFrame. dgGuestDelete. Columns(3). Width = 1800 MainFrame. dgGuestDelete. Columns(4). Width = 1800 MainFrame. dgGuestDelete. Columns(6). Width = 1600 MainFrame. dgGuestDelete. Columns(8). Width = 3200 If recordSetDelete. EOF True Then img_box_del. Visible = True img_box_del. Picture = LoadPicture(recordSetDelete! Picture) cmdDeletee. Visible = True cmdEditt. Visible = True cmdOpenSesame. Visible = True Else MsgBox ââ¬Å"This room has no guest yet. ââ¬Å", vbInformation, â⠬Å"Apartment Monitoring and Security Systemâ⬠img_box_del. Visible = False cmdOpenSesame.Visible = False End If If recordSetDelete. EOF True Then MainFrame. txtIdHolder. Text = recordSetDelete! RoomNumber End If End Sub Private Sub cmdBrowse_Click() CommonDialog1. ShowOpen txtFilePathPic. Text = CommonDialog1. FileName imgbox. Picture = LoadPicture(txtFilePathPic. Text) imgbox. Visible = True End Sub Private Sub cmdClear_Click() Call Clear End Sub Private Sub cmdDeletee_Click() Set rsDelete = New ADODB. Recordset rsDelete. CursorLocation = adUseClient rsDelete. CursorType = adOpenDynamic rsDelete. LockType = adLockOptimistic rsDelete. Open ââ¬Å"SELECT * FROM tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDBIf MsgBox(ââ¬Å"Are you sure you want to delete this Guest?. ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Delete Verificationâ⬠) = vbYes Then rsDelete. Delete MsgBox ââ¬Å"Guest has been successfully deleted. ââ¬Å", vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Set dgGuestDelete. DataSource = Nothing Call Clear End If End Sub Private Sub cmdEditt_Click() Call Clear frameSearchGuest. Visible = False frameRegisterGuest. Visible = True frameRegisterGuest. Caption = ââ¬Å"Edit hereâ⬠¦ â⬠save. Visible = False Dim rsEditGuestt As New ADODB. Recordset rsEditGuestt. CursorLocation = adUseClient rsEditGuestt. CursorType = adOpenDynamic rsEditGuestt. LockType = adLockOptimistic rsEditGuestt.Open ââ¬Å"SELECT * FROM tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB txtFirstName. Text = rsEditGuestt! FirstName txtLastName. Text = rsEditGuestt! LastName cboGender. Text = rsEditGuestt! Gender cboRoomChoice. Text = rsEditGuestt! RoomChoice cboRoomNumber. Text = rsEditGuestt! RoomNumber txtFilePathPic. Text = rsEditGuestt! Picture cmdUpdateNah. Visible = True End Sub Private Sub cmdOpenSesame_Click() Se t rsOpen = New ADODB. Recordset rsOpen. CursorLocation = adUseClient rsOpen. CursorType = adOpenDynamic rsOpen. LockType = adLockOptimistic rsOpen. Open ââ¬Å"SELECT * FROM tbl_registration WHERE RoomNumber = ââ¬Ëâ⬠& MainFrame. txtIdHolder. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB ritePort rsOpen! RoomNumber End Sub Private Sub cmdUpdateNah_Click() Dim rsUpdateNah As New ADODB. Recordset rsUpdateNah. CursorLocation = adUseClient rsUpdateNah. CursorType = adOpenDynamic rsUpdateNah. LockType = adLockOptimistic rsUpdateNah. Open ââ¬Å"tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB If MsgBox(ââ¬Å"Are you sure you want to update this Guest?. ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Update Verificationâ⬠) = vbYes Then rsUpdateNah! templates = Templ. Serialize rsUpdateNah! FirstName = txtFirstName. Text rsUpdateNah! LastName = txtLastName. Text rsUpdateNah! Fullname = txtFirstName. Text & â⬠â⬠& t xtLastName.Text rsUpdateNah! Gender = cboGender. Text rsUpdateNah! RoomChoice = cboRoomChoice. Text rsUpdateNah! RoomNumber = cboRoomNumber. Text rsUpdateNah! Picture = txtFilePathPic. Text rsUpdateNah! CompleteDateStarted = Format(cboMonthStarted. Text & ââ¬Å"/â⬠& cboDateStarted & ââ¬Å"/â⬠& cboYearStarted. Text, ââ¬Å"mm/dd/yyyyâ⬠) rsUpdateNah! CompleteDueDate = Format(cboDueMonth. Text & ââ¬Å"/â⬠& cboDueDate. Text & ââ¬Å"/â⬠& cboDueYear. Text, ââ¬Å"mm/dd/yyyyâ⬠) rsUpdateNah. Update rsUpdateNah. Close MsgBox ââ¬Å"Guest has successfully Updated. ââ¬Å", vbOnly, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Call Clear End If End Sub Private Sub cmeExitAdd_Click() frameRegisterGuest.Visible = False End Sub Private Sub Command2_Click() Dim rsguestview As New ADODB. Recordset If mskDateStarted. Text ââ¬Å"â⬠Then Set rsguestview = New ADODB. Recordset rsguestview. CursorLocation = adUseClient rsguestview. LockType = adLockOp timistic rsguestview. CursorType = adOpenDynamic rsguestview. Open ââ¬Å"Select * from tbl_logs where Date= ââ¬Ëâ⬠& mskDateStarted & ââ¬Å"ââ¬Ëâ⬠, ConnectDB Set DataGrid1. DataSource = rsguestview MainFrame. DataGrid1. Columns(0). Width = 2200 Set rsguestview = Nothing End If End Sub Private Sub Enroll_Click() Enrollment. Show vbModal, Me End Sub Public Function GetTemplate() As Object ââ¬Ë Template can be empty. If so, then returns Nothing.If Templ Is Nothing Then Else: Set GetTemplate = Templ End If End Function Public Sub SetTemplete(ByVal Template As Object) Set Templ = Template End Sub Private Sub Form_Load() Call Clear Call View Dim blob() As Byte Dim rs As New ADODB. Recordset rs. CursorLocation = adUseClient rs. CursorType = adOpenDynamic rs. LockType = adLockOptimistic rs. Open ââ¬Å"Select * from tbl_registrationâ⬠, ConnectDB blob = rs! templates ââ¬Ëset raw image from MySQL database If Templ Is Nothing Then ââ¬Ëconvert raw image to pictur e Set Templ = New DPFPTemplate Templ. Deserialize blob End If End SubPrivate Sub mnuAddGuest_Click() Call Clear flag = 1 save. Visible = True frameRegisterGuest. Caption = ââ¬Å"Register hereâ⬠¦ â⬠frameRegisterGuest. Visible = True frameSearchGuest. Visible = False frameViewGuest. Visible = False cmdUpdateNah. Visible = False End Sub Private Sub mnuChangeUser_Click() If MsgBox(ââ¬Å"Are you sure you want to logout and change user? ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠) = vbYes Then Unload Me frmStandbyMode. Show frmLogin. Show End If End Sub Private Sub mnuEditGuest_Click() frameEditGuest. Show End Sub Private Sub mnuInventory_Click() frmInventory. Show End Sub Private Sub mnuLogout_Click()If MsgBox(ââ¬Å"Are you sure you want to exit program? ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠) = vbYes Then closePort Unload Me frmStandbyMode. Show End If End Sub Private Sub mnuSearc hGuest_Click() frameSearchGuest. Visible = True frameRegisterGuest. Visible = False frameViewGuest. Visible = False txtSearch. Text = ââ¬Å"â⬠cboRoomNumberDel. Text = ââ¬Å"â⬠cmdEditt. Visible = False cmdDeletee. Visible = False cmdOpenSesame. Visible = False img_box_del. Visible = False dgGuestDelete. Visible = False End Sub Private Sub mnuViewGuest_Click() Call View End Sub Private Sub ReadTemplate_Click() Dim blob() As Byte CommonDialog1.Filter = ââ¬Å"Fingerprint Template File|*. fptâ⬠ââ¬Ë Set dialog box so an error occurs if dialog box is cancelled. CommonDialog1. CancelError = True On Error Resume Next ââ¬Ë Show Open dialog box. CommonDialog1. ShowOpen If Err Then ââ¬Ë This code runs if dialog box was cancelled. Exit Sub End If ââ¬Ë Read binary data from file. Open CommonDialog1. FileName For Binary As #1 ReDim blob(LOF(1)) Get #1, , blob() Close #1 ââ¬Ë Template can be empty, it must be created first. If Templ Is Nothing Then Set Templ = Ne w DPFPTemplate ââ¬Ë Import binary data to template. Templ. Deserialize blob End Sub Private Sub save_Click() Dim rsAddGuest As New ADODB. Recordset rsAddGuest.CursorLocation = adUseClient rsAddGuest. CursorType = adOpenDynamic rsAddGuest. LockType = adLockOptimistic rsAddGuest. Open ââ¬Å"tbl_registrationâ⬠, ConnectDB If txtFirstName. Text = ââ¬Å"â⬠Or txtLastName. Text = ââ¬Å"â⬠Or cboGender. Text = ââ¬Å"â⬠Or cboRoomChoice. Text = ââ¬Å"â⬠Or cboRoomNumber. Text = ââ¬Å"â⬠Or txtFilePathPic. Text = ââ¬Å"â⬠Or cboMonthStarted. Text = ââ¬Å"â⬠Or cboDateStarted. Text = ââ¬Å"â⬠Or cboYearStarted. Text = ââ¬Å"â⬠Or cboDueMonth. Text = ââ¬Å"â⬠Or cboDueDate. Text = ââ¬Å"â⬠Or cboDueYear. Text = ââ¬Å"â⬠Then MsgBox ââ¬Å"Missing Fields. ââ¬Å", vbCritical + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Else If MsgBox(ââ¬Å"Are you sure you want to add this Guest?. , vbYes No + vbInformation, ââ¬Å"Delete Verificationâ⬠) = vbYes Then rsAddGuest. AddNew rsAddGuest! templates = Templ. Serialize rsAddGuest! FirstName = txtFirstName. Text rsAddGuest! LastName = txtLastName. Text rsAddGuest! Fullname = txtFirstName. Text & â⬠â⬠& txtLastName. Text rsAddGuest! Gender = cboGender. Text rsAddGuest! RoomChoice = cboRoomChoice. Text rsAddGuest! RoomNumber = cboRoomNumber. Text rsAddGuest! Picture = txtFilePathPic. Text rsAddGuest! CompleteDateStarted = Format(cboMonthStarted. Text & ââ¬Å"/â⬠& cboDateStarted. Text & ââ¬Å"/â⬠& cboYearStarted. Text, ââ¬Å"mm/dd/yyyyâ⬠) rsAddGuest! CompleteDueDate = Format(cboDueMonth. Text & ââ¬Å"/â⬠& cboDueDate. Text & ââ¬Å"/â⬠& cboDueYear.Text, ââ¬Å"mm/dd/yyyyâ⬠) rsAddGuest! Payment = txtIdHolder. Text rsAddGuest. Update rsAddGuest. Close Call Clear MsgBox ââ¬Å"Guest has successfully Added. ââ¬Å", vbOnly, ââ¬Å"Apartment Monitoring and Security Systemâ⬠End If End If End Sub Private Sub SaveTemplate_Click() Dim blob() As Byte ââ¬Ë First verify that template is not empty. If Templ Is Nothing Then MsgBox ââ¬Å"You must create a fingerprint template before you can save it. â⬠Exit Sub End If CommonDialog1. Filter = ââ¬Å"Fingerprint Template File|*. fptâ⬠ââ¬Ë Set dialog box so an error occurs if dialog box is cancelled. CommonDialog1. CancelError = True On Error Resume Next ââ¬Ë Show Save As dialog box. CommonDialog1. ShowSaveIf Err Then ââ¬Ë This code runs if the dialog box was cancelled. Exit Sub End If ââ¬Ë Export template to binary data. blob = Templ. Serialize ââ¬Ë Save binary data to file. Open CommonDialog1. FileName For Binary As #1 Put #1, , blob Close #1 End Sub Private Sub Timer1_Timer() lblDate. Caption = Format(Date, ââ¬Å"Long Dateâ⬠) lblTime. Caption = Format(Time, ââ¬Å"Long Timeâ⬠) End Sub Private Sub Verify_Click() ââ¬Ë First verify that template is not empty. If Templ Is Not hing Then MsgBox ââ¬Å"You must create fingerprint template before you can perform verification. â⬠Exit Sub End If ââ¬Ë Show Fingerprint Verification dialog box. Verification. Show vbModal, Me End SubPublic Function Clear() txtFirstName. Text = ââ¬Å"â⬠txtLastName. Text = ââ¬Å"â⬠txtFilePathPic. Text = ââ¬Å"â⬠cboGender. Text = ââ¬Å"â⬠cboRoomChoice. Text = ââ¬Å"â⬠cboRoomNumber. Text = ââ¬Å"â⬠cboMonthStarted. Text = ââ¬Å"â⬠cboDateStarted. Text = ââ¬Å"â⬠cboYearStarted. Text = ââ¬Å"â⬠cboDueMonth. Text = ââ¬Å"â⬠cboDueDate. Text = ââ¬Å"â⬠cboDueYear. Text = ââ¬Å"â⬠cboRoomNumberDel. Text = ââ¬Å"â⬠imgbox. Visible = False img_box_del. Visible = False frameRegisterGuest. Visible = False frameSearchGuest. Visible = False End Function Public Function View() frameRegisterGuest. Visible = False frameSearchGuest. Visible = False frameViewGuest. Visible = True Set rsViewGuest = New ADODB. Recordset rsViewGuest.CursorLocation = adUseClient rsViewGuest. CursorType = adOpenDynamic rsViewGuest. LockType = adLockOptimistic rsViewGuest. Open ââ¬Å"SELECT * FROM tbl_registration ORDER BY RoomNumber ASCâ⬠, ConnectDB Set dgGuestView. DataSource = rsViewGuest MainFrame. dgGuestView. Columns(0). Visible = False MainFrame. dgGuestView. Columns(2). Visible = False MainFrame. dgGuestView. Columns(5). Visible = False MainFrame. dgGuestView. Columns(7). Visible = False MainFrame. dgGuestView. Columns(8). Visible = False MainFrame. dgGuestView. Columns(1). Width = 2200 MainFrame. dgGuestView. Columns(3). Width = 1900 MainFrame. dgGuestView. Columns(4). Width = 1600 MainFrame. dgGuestView.Columns(6). Width = 1200 Set rsViewGuest = Nothing End Function ââ¬Å"Verificationâ⬠Dim Templ As DPFPTemplate Private Function ConnectDB() As String ConnectDB = ââ¬Å"DRIVER={MySQL ODBC 5. 1 Driver}; SERVER = localhost; DATABASE = db_AMASS; USER = root; PASSWORD = â⬠;â⬠End Fu nction Private Sub cboRoomChoice_Click() If cboRoomChoice. Text = ââ¬Å"Economyâ⬠Then txtIdHolder. Text = 1500 ElseIf cboRoomChoice. Text = ââ¬Å"Standardâ⬠Then txtIdHolder. Text = 2000 ElseIf cboRoomChoice. Text = ââ¬Å"Familyâ⬠Then txtIdHolder. Text = 2500 End If End Sub Private Sub cboRoomNumberDel_Click() dgGuestDelete. Visible = True Set recordSetDelete = New ADODB. Recordset recordSetDelete.CursorLocation = adUseClient recordSetDelete. CursorType = adOpenDynamic recordSetDelete. LockType = adLockOptimistic recordSetDelete. Open ââ¬Å"SELECT * FROM tbl_registration WHERE RoomNumber = ââ¬Ëâ⬠& cboRoomNumberDel. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB Set dgGuestDelete. DataSource = recordSetDelete MainFrame. dgGuestDelete. Columns(0). Visible = False MainFrame. dgGuestDelete. Columns(2). Visible = False MainFrame. dgGuestDelete. Columns(7). Visible = False MainFrame. dgGuestDelete. Columns(8). Visible = False MainFrame. dgGuestDelete. Columns(1). Wi dth = 2200 MainFrame. dgGuestDelete. Columns(3). Width = 1800 MainFrame. dgGuestDelete. Columns(4). Width = 1800MainFrame. dgGuestDelete. Columns(6). Width = 1600 MainFrame. dgGuestDelete. Columns(8). Width = 3200 If recordSetDelete. EOF True Then img_box_del. Visible = True img_box_del. Picture = LoadPicture(recordSetDelete! Picture) cmdDeletee. Visible = True cmdEditt. Visible = True cmdOpenSesame. Visible = True Else MsgBox ââ¬Å"This room has no guest yet. ââ¬Å", vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠img_box_del. Visible = False cmdOpenSesame. Visible = False End If If recordSetDelete. EOF True Then MainFrame. txtIdHolder. Text = recordSetDelete! RoomNumber End If End Sub Private Sub cmdBrowse_Click() CommonDialog1. ShowOpen xtFilePathPic. Text = CommonDialog1. FileName imgbox. Picture = LoadPicture(txtFilePathPic. Text) imgbox. Visible = True End Sub Private Sub cmdClear_Click() Call Clear End Sub Private Sub cmdDeletee_Click() Set rsDelete = New ADODB. Recordset rsDelete. CursorLocation = adUseClient rsDelete. CursorType = adOpenDynamic rsDelete. LockType = adLockOptimistic rsDelete. Open ââ¬Å"SELECT * FROM tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB If MsgBox(ââ¬Å"Are you sure you want to delete this Guest?. ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Delete Verificationâ⬠) = vbYes Then rsDelete. Delete MsgBox ââ¬Å"Guest has been successfully deleted. , vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Set dgGuestDelete. DataSource = Nothing Call Clear End If End Sub Private Sub cmdEditt_Click() Call Clear frameSearchGuest. Visible = False frameRegisterGuest. Visible = True frameRegisterGuest. Caption = ââ¬Å"Edit hereâ⬠¦ â⬠save. Visible = False Dim rsEditGuestt As New ADODB. Recordset rsEditGuestt. CursorLocation = adUseClient rsEditGuestt. CursorType = adOpenDynamic rsEditGuestt. LockType = adLockOptimistic rsE ditGuestt. Open ââ¬Å"SELECT * FROM tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB txtFirstName. Text = rsEditGuestt! FirstName txtLastName. Text = rsEditGuestt! LastName cboGender.Text = rsEditGuestt! Gender cboRoomChoice. Text = rsEditGuestt! RoomChoice cboRoomNumber. Text = rsEditGuestt! RoomNumber txtFilePathPic. Text = rsEditGuestt! Picture cmdUpdateNah. Visible = True End Sub Private Sub cmdOpenSesame_Click() Set rsOpen = New ADODB. Recordset rsOpen. CursorLocation = adUseClient rsOpen. CursorType = adOpenDynamic rsOpen. LockType = adLockOptimistic rsOpen. Open ââ¬Å"SELECT * FROM tbl_registration WHERE RoomNumber = ââ¬Ëâ⬠& MainFrame. txtIdHolder. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB writePort rsOpen! RoomNumber End Sub Private Sub cmdUpdateNah_Click() Dim rsUpdateNah As New ADODB. Recordset rsUpdateNah. CursorLocation = adUseClient rsUpdateNah.CursorType = adOpenDynamic rsUpdateNah. LockType = adL ockOptimistic rsUpdateNah. Open ââ¬Å"tbl_registration WHERE FullName = ââ¬Ëâ⬠& MainFrame. txtSearch. Text & ââ¬Å"ââ¬Ëâ⬠, ConnectDB If MsgBox(ââ¬Å"Are you sure you want to update this Guest?. ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Update Verificationâ⬠) = vbYes Then rsUpdateNah! templates = Templ. Serialize rsUpdateNah! FirstName = txtFirstName. Text rsUpdateNah! LastName = txtLastName. Text rsUpdateNah! Fullname = txtFirstName. Text & â⬠â⬠& txtLastName. Text rsUpdateNah! Gender = cboGender. Text rsUpdateNah! RoomChoice = cboRoomChoice. Text rsUpdateNah! RoomNumber = cboRoomNumber. Text rsUpdateNah! Picture = txtFilePathPic. Text sUpdateNah! CompleteDateStarted = Format(cboMonthStarted. Text & ââ¬Å"/â⬠& cboDateStarted & ââ¬Å"/â⬠& cboYearStarted. Text, ââ¬Å"mm/dd/yyyyâ⬠) rsUpdateNah! CompleteDueDate = Format(cboDueMonth. Text & ââ¬Å"/â⬠& cboDueDate. Text & ââ¬Å"/â⬠& cboDueYear. Text, ââ¬Å"mm/dd/yyyyâ⠬ ) rsUpdateNah. Update rsUpdateNah. Close MsgBox ââ¬Å"Guest has successfully Updated. ââ¬Å", vbOnly, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Call Clear End If End Sub Private Sub cmeExitAdd_Click() frameRegisterGuest. Visible = False End Sub Private Sub Command2_Click() Dim rsguestview As New ADODB. Recordset If mskDateStarted. Text ââ¬Å"â⬠Then Set rsguestview = New ADODB. Recordset sguestview. CursorLocation = adUseClient rsguestview. LockType = adLockOptimistic rsguestview. CursorType = adOpenDynamic rsguestview. Open ââ¬Å"Select * from tbl_logs where Date= ââ¬Ëâ⬠& mskDateStarted & ââ¬Å"ââ¬Ëâ⬠, ConnectDB Set DataGrid1. DataSource = rsguestview MainFrame. DataGrid1. Columns(0). Width = 2200 Set rsguestview = Nothing End If End Sub Private Sub Enroll_Click() Enrollment. Show vbModal, Me End Sub Public Function GetTemplate() As Object ââ¬Ë Template can be empty. If so, then returns Nothing. If Templ Is Nothing Then Else: Set GetTem plate = Templ End If End Function Public Sub SetTemplete(ByVal Template As Object) Set Templ = Template End SubPrivate Sub Form_Load() Call Clear Call View Dim blob() As Byte Dim rs As New ADODB. Recordset rs. CursorLocation = adUseClient rs. CursorType = adOpenDynamic rs. LockType = adLockOptimistic rs. Open ââ¬Å"Select * from tbl_registrationâ⬠, ConnectDB blob = rs! templates ââ¬Ëset raw image from MySQL database If Templ Is Nothing Then ââ¬Ëconvert raw image to picture Set Templ = New DPFPTemplate Templ. Deserialize blob End If End Sub Private Sub mnuAddGuest_Click() Call Clear flag = 1 save. Visible = True frameRegisterGuest. Caption = ââ¬Å"Register hereâ⬠¦ â⬠frameRegisterGuest. Visible = True rameSearchGuest. Visible = False frameViewGuest. Visible = False cmdUpdateNah. Visible = False End Sub Private Sub mnuChangeUser_Click() If MsgBox(ââ¬Å"Are you sure you want to logout and change user? ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠) = vbYes Then Unload Me frmStandbyMode. Show frmLogin. Show End If End Sub Private Sub mnuEditGuest_Click() frameEditGuest. Show End Sub Private Sub mnuInventory_Click() frmInventory. Show End Sub Private Sub mnuLogout_Click() If MsgBox(ââ¬Å"Are you sure you want to exit program? ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠) = vbYes Then closePort Unload Me rmStandbyMode. Show End If End Sub Private Sub mnuSearchGuest_Click() frameSearchGuest. Visible = True frameRegisterGuest. Visible = False frameViewGuest. Visible = False txtSearch. Text = ââ¬Å"â⬠cboRoomNumberDel. Text = ââ¬Å"â⬠cmdEditt. Visible = False cmdDeletee. Visible = False cmdOpenSesame. Visible = False img_box_del. Visible = False dgGuestDelete. Visible = False End Sub Private Sub mnuViewGuest_Click() Call View End Sub Private Sub ReadTemplate_Click() Dim blob() As Byte CommonDialog1. Filter = ââ¬Å"Fingerprint Template File|*. fptà ¢â¬ ââ¬Ë Set dialog box so an error occurs if dialog box is cancelled. CommonDialog1. CancelError = True On Error Resume Next Show Open dialog box. CommonDialog1. ShowOpen If Err Then ââ¬Ë This code runs if dialog box was cancelled. Exit Sub End If ââ¬Ë Read binary data from file. Open CommonDialog1. FileName For Binary As #1 ReDim blob(LOF(1)) Get #1, , blob() Close #1 ââ¬Ë Template can be empty, it must be created first. If Templ Is Nothing Then Set Templ = New DPFPTemplate ââ¬Ë Import binary data to template. Templ. Deserialize blob End Sub Private Sub save_Click() Dim rsAddGuest As New ADODB. Recordset rsAddGuest. CursorLocation = adUseClient rsAddGuest. CursorType = adOpenDynamic rsAddGuest. LockType = adLockOptimistic rsAddGuest. Open ââ¬Å"tbl_registrationâ⬠, ConnectDB If txtFirstName.Text = ââ¬Å"â⬠Or txtLastName. Text = ââ¬Å"â⬠Or cboGender. Text = ââ¬Å"â⬠Or cboRoomChoice. Text = ââ¬Å"â⬠Or cboRoomNumber. Text = ââ¬Å"â ⬠Or txtFilePathPic. Text = ââ¬Å"â⬠Or cboMonthStarted. Text = ââ¬Å"â⬠Or cboDateStarted. Text = ââ¬Å"â⬠Or cboYearStarted. Text = ââ¬Å"â⬠Or cboDueMonth. Text = ââ¬Å"â⬠Or cboDueDate. Text = ââ¬Å"â⬠Or cboDueYear. Text = ââ¬Å"â⬠Then MsgBox ââ¬Å"Missing Fields. ââ¬Å", vbCritical + vbInformation, ââ¬Å"Apartment Monitoring and Security Systemâ⬠Else If MsgBox(ââ¬Å"Are you sure you want to add this Guest?. ââ¬Å", vbYesNo + vbInformation, ââ¬Å"Delete Verificationâ⬠) = vbYes Then rsAddGuest. AddNew rsAddGuest! templates = Templ. Serialize rsAddGuest! FirstName = txtFirstName. Text
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.