Saturday, 11 June 2016

MAX HealthCare using ASP.NET and Bootstrap

MAX Health Care using ASP.NET and Bootstrap

Max Health care is an online hospital management system using Asp.net and bootstrap which has the following management features:

User Roles Login i.e Admin and user authentication log in page.
User registration/signup page
Admin user management and database modification page.


This Project was developed using Asp.Net (html and css) and bootstrap for it FRONT END and
C# with MSSQL for its BACK END.

full source code for the project will be give upon request but below are some code snippet with print screen of the system

Below is the default homepage of Max Healthcare using ASP.NET and Bootstrap FRONT END.






The above screen shots and code snippet only shows the front end of the web site including the HTML code show.. The addition of bootstrap and CSS styling was used to give the rich design of the website making it responsive to all devices sizes as shown below.



The second part is the login page which redirects users based on user roles.. can be admin or the patients who registered to make a booking for the service of the doctor.


As seen from the above screen to every page being navigated the page nav button is being highlighted to identify and allow users to know the exact page they are navigating at that point in time.

So simple and easy to understand.. the login page has its own security measure to allow or reject unauthorized users and also allow users to remember username and password in the case of users who like to make it easy for login on navigation to the log in page.



C# BACK END CODE FOR LOGIN PAGE.



as show above is the login page authenticating users based on their roles.. the full source code will be given on request and maybe some suggestions will be high appreciated and accepted.


Wednesday, 25 May 2016

SIMPLE LETTER COUNTING IN ANDROID STUDIO Complete Part

This part completes the letter counting game showing the user interaction and results as seen in the images shown below.


STEPS: As shown in the images below, a user needs to enter his/her name to be able to play this game and only with the use of the menu bar will the game start by creating another page where alphabetical values (array of names) are shown for counting.

ACTIVITY_MAIN.XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#4ba9f5"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="Game Central"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/player_name"
        android:layout_width="100dp"
        android:layout_height="70dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/textView"
        android:layout_marginTop="50dp"
        android:gravity="center"
        android:text="Player Name" />

    <EditText
        android:id="@+id/Pname"
        android:layout_width="100dp"
        android:layout_height="60dp"
        android:layout_alignEnd="@+id/textView"
        android:layout_alignRight="@+id/textView"
        android:layout_alignTop="@+id/player_name"
        android:layout_toRightOf="@+id/player_name" />

    <TextView
        android:id="@+id/current_score"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Current Score"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/score"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/current_score"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="48dp"
        android:text="0/0" />

</RelativeLayout>

MAIN_ACTIVITY.JAVA

package com.example.jeffery.BJ1616939Task3;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        //EditText et = (EditText) findViewById(R.id.Pname);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        EditText et = (EditText) findViewById(R.id.Pname);

        //noinspection SimplifiableIfStatement
        if (id == R.id.Letter_counting) {
            Intent intent = new Intent(MainActivity.this, Counting_Game.class);
            intent.putExtra("Welcome", et.getText().toString());
            startActivity(intent);
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

COUNTING_GAME.XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#4ba9f5">

    <TextView
        android:id="@+id/users"
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="43dp"
        android:text="User"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/textView3"
        android:layout_alignRight="@+id/textView5"
        android:layout_alignEnd="@+id/textView5" />

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/users"
        android:layout_centerHorizontal="true"
        android:text="I will choose a random number"
        android:textSize="20dp"/>

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView4"
        android:layout_centerHorizontal="true"
        android:text="how many letters are in it?"
        android:textSize="20dp"/>

    <TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="VALUES"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_above="@+id/editText2"
        android:layout_centerHorizontal="true" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="175dp" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="130dp"
        android:layout_height="wrap_content"
        android:src="@drawable/counting"
        android:layout_below="@+id/textView5"
        android:layout_centerHorizontal="true" />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/editText2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="66dp"
        android:text="Check" />

    <TextView
        android:id="@+id/textView7"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/button"
        android:layout_centerHorizontal="true"
        android:text="No Value" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:text="Welcome"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_above="@+id/textView4"
        android:layout_toLeftOf="@+id/editText2"
        android:layout_alignLeft="@+id/textView5"
        android:layout_alignStart="@+id/textView5" />
</RelativeLayout>


COUNTING_GAME.JAVA

package com.example.jeffery.BJ1616939Task3;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

/**
 * Created by JEFFERY on 4/27/2016.
 */
public class Counting_Game extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.counting_game);

        TextView userView = (TextView)findViewById(R.id.users);
        userView.setText(getIntent().getExtras().getString("Welcome"));


        final EditText userguess = (EditText) findViewById(R.id.editText2);
        final TextView tvInput = (TextView) findViewById(R.id.textView6);
        final TextView tvOutput = (TextView) findViewById(R.id.textView7);
        Button btcheck = (Button)findViewById(R.id.button);

        String[] myNames ={"emmanuel", "Mary", "Patrick", "Janet"};
        int rando = (int)(Math.random()*4);
        tvInput.setText(myNames[rando]);

        btcheck.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                int rando;
                rando = Integer.parseInt(userguess.getText().toString());
                if (tvInput.length() == rando) {
                    tvOutput.setText("Correct Value");
                }else if (tvInput.length()!= rando){
                    tvOutput.setText("Wrong Value");
                }else {
                    tvOutput.setText(null);
                }
            }
        });


    }
}

MENU_MAIN.XML

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.example.jeffery.BJ1616939Task3.MainActivity">
    <item
        android:id="@+id/Letter_counting"
        android:orderInCategory="100"
        android:title="@string/Letter_Counting"
        app:showAsAction="never" />
    <item
        android:id="@+id/Game_Holder_2"
        android:orderInCategory="101"
        android:title="@string/Game_Holder_2"
        app:showAsAction="never"/>

    <item
        android:id="@+id/Game_Holder_3"
        android:orderInCategory="101"
        android:title="@string/Game_Holder_3"
        app:showAsAction="never"/>

    <item
        android:id="@+id/Game_Holder_4"
        android:orderInCategory="101"
        android:title="@string/Game_Holder_4"
        app:showAsAction="never"/>
</menu>

MANIFEST.XML

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jeffery.BJ1616939Task3">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="com.example.jeffery.BJ1616939Task3.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.example.jeffery.BJ1616939Task3.Counting_Game">

        </activity>
    </application>

</manifest>


As shown above in the above code of the counting game comprises of two pages connected with menu intent. so once the player name is input with the help of the menu bar, the game can be started . below are the image views of the game accordingly.





Note: This is a simple counting game...!!!

















Monday, 25 April 2016

HOSPITAL BILLING SYSTEM (Using ECLIPSE JFRAME AND MYSQL)

This is an overview of a Hospital billing system with few functionalities.


Above is he GUI for the Login Page.

GUI Admin Page as shown

GUI Main Page

GUI for Manage Patient

GUI for Doctor prescription

GUI for Billing

As seen above are the screen shots of the systems Graphical user interface.. Below you can dowload the source code to this system.








Wednesday, 9 March 2016

SIMPLE LETTER COUNTING IN ANDROID STUDIO

Name counting Game in Android Studio.



The above images shows a name name PATRICK picked at launch of application using geny motion emulator.



As show is another name which required input of correct number to identify the number of letters as given. when the wrong value is given, it indicated below as wrong value since it didnt match the amount of letters given.


As seen when correct value is given, it shows the correct Value.


Tuesday, 26 January 2016

Fanduel Affliate Webpage using PHP Part 2

FANDUEL WEBPAGE LOGIN AND REGISTRATION USING PHP AND MYSQL DATABASE.

Part 11 CREATING OF REGISTRATION PAGE AND CONNECTION TO DATABASE



As per the PART 1 of this project, understanding how to create a database by simple downloading the Xampp server and access PHPMYADMIN page is very vital. But firstly below is the basic HTML design for the registration form. 


The above shows the design of the registration form using tables and giving the input and names as require.

Note: The form would be properly designed and arrange with the help of CSS styling.

Connecting form to the Database.
once value is input it records in the database create with the database named TEST and table name reg_details.

CREATING OF LOGIN PAGE AND CONNECTION TO DATABASE


Above is the overview of the Login Page and below is the code snippet showing hot to create the login tables and retrieving data stored from the registration form in the database.



As seen above is the snippet showing how the username and password can be retrieved from the database. This is just a sample project on inserting and retrieving data from the database using PHP.

Tuesday, 19 January 2016

Fanduel Affliate Webpage using PHP

CREATING FANDUEL WEBPAGE USING PHP AND MYSQL DATABASE

PART 1 Creating Home Page




STEPS:


  1. Download an Apache Server from link to suit your PC specification (i.e x86 or x64).
  2.  Install desired Apache Server on PC and and you are ready to go.
  3. At the time of this project, i download 32bit Xampp 7.0.2 server.
  4. After installation, run the application, then click start on Apache and MYSQl to run the application as shown below in FIG 1. ( it is also important to make sure MYSQL is running properly by opening an internet explore and typing localhost/PHPMYADMIN as seen in FIG 11)
FIG 1

FIG 11

Note: In order to View Pages on the web explorer, all files need to be saved in the server directory named htdocs. you can find this by simply following this step. C:\xampp\htdocs and there you can save files with .PHP ending file name.

Below are the Code Snippet for the HomeScreen of Fanduel Affiliate page.

INDEX.php


The Home page is divided intro three section and with the index.php page, i could used the include function to call the overview page which will run the hope page on start up using localhost/project where project is the name of the folder where the php files are being saved.

HEADER.php


This section is basically HTML and CSS scripting 


OVERVIEW.php


If you can see the right side of the image above is cut short, but it doesn't affect the code in anyway because it is just a descriptive text

Conclusion:

This is just a simple view for a homepage using PHP and i would appreciate any correction or comments on this project.. Thanks

Saturday, 16 May 2015

A research on auto teller machine (ATM) with Vdm


1.0       INTRODUCTION
In this 21st century, industries are faced with the challenges of releasing commercial software projects of high quality and within the budget. Some software is delivered with errors, lack of complete functionality and overrun cost. Formal method has been introduced to be an effective way of helping developers to understand the users’ requirements by specifically defining functions, data resources, and basic limitations in a well-organized structure. In this paper, an in-depth analysis on the auto teller machine (ATM) system with vdm and its user specification and requirements will give a better understanding of formal methods in software development.
1.1    Proposal
  1. CIMB Bank Malaysia 
76 Jalan Cerdas
Taman Connaught, Cheras
56000 Kuala Lumpur 

Wilayah Persekutuan

  1. Front view of CIMB bank taman Connaught
  1. ATM view of CIMB taman Connaught.
  1. The machines as shown in view [3] has the following
·         3 ATM withdrawal machine
·         2 ATM deposit machine
·         1 cheque deposit/self service (SST) machine
  1. With a picture view we would see the features in on selected ATM withdrawal machine.
·         1 is the ATM card slot in port.
·         2 is the ATM keypad input platform
·         3 is the ATM service screen
·         4 is the list of cards accepted by the ATM system
·         5 is the ATM cash dispenser slot.
·         6 is the ATM receipt dispenser slot.

  1. From the above view in [3] the ATM machine can only process one request at a time making it a total of six active users in the bank branch.
  2. The machine operates from 5 am to 12 pm daily
  3. This paper will focus more on the CIMB withdrawal ATM, showing its constraints and functionality.
1.1.1   Software development life cycle (SDLC)
The Software development life cycle (SDLC) is a general term used to define the technique and procedure used in software development process.

FIG I.
As shown in the figure above is an SDLC process and without this process a software development is likely to face the following challenges:
·         Low Quality
·         Risk to time management
·         High cost of development, etc.

1.2       Formal Method
Formal methods are mathematics based languages, techniques and tools that can be applied at any part of a software program lifecycle (Pandey et al 2013). This simply defines the application of the Mathematical based approach in software development which uses filtration techniques at any stage to ensure the accuracy, completeness and stability of the specification.
            Another name used for formal methods is called formal specification languages, which are built on set theory and first order predicate calculus. The language has a formal semantics which are used to define express specifications in a clear and plain manner. A formal specification language can be used to model the most difficult systems using a simple mathematical approach, such as sets, relations and functions.

1.3       Uses of Formal method in SDLC
In SDLC, formal methods are used in various ways, but the two basic uses of formal method in SDLC are as below;
·         Specification (Requirement Analysis)
·         Verification (Testing).

1.3.1   Specification (Requirement Analysis): Requirement Analysis is a major process in the software development life cycle (SDLC) because it defines the system properties completely (i.e. Functional behavior, timing behavior, internal configuration, and performance features etc.). It also specifies the behavior of sequential and concurrent systems in formal methods such as (Z, VDM, Larch) and (CSP, CCS, State charts, Temporal Logic, Lamport and I/O automata) respectively.
1.3.2 Verification (Testing): This is a process of verifying or proving a system meets the correct formal method specification. And just like requirement analysis is important in software development life cycle (SDLC), verification is also very important because it helps to determine the quality, reliability and eliminate error in software development.

2.0       Constraint of ATM systems
To identify the necessary constraints of an ATM system based on the operation and safety, it is important to understand the operational base properly which then elaborate more on the safety. In the transition diagram below is an ATM operational behavior.


FIG II.                                                                                                            (Wang et al 2010)

As seen in the diagram above is an ATM operational behavior and with this a look at some of the operation and safety constraint are as below:
·         High Level Description Constraints
·         Functional Constraints
·         Data Constraints
·         Design and Interface Constraints
·         Quality Constraints

2.1       High Level Description Constraints:
1.    A client must make a cash withdrawal from any account connected to a card and authorization must be acquired from the bank before money is dispensed.
2.    A client can only have the capacity to make a balance request of any account connected to the card.

2.2       Functional Constraints:
1.    An ATM machine only acknowledges a card from a client when the client inputs a Personal Identification Number (PIN) to validate the client's identity.

2.    The ATM only follows up on the request as per the response got from the Bank framework for identity validation. Possible activities for granted requests include the following:
·         Dispense cash
·         Acknowledge deposit
·         Show or print account balance
·         Pay a bill
·         Perform an Electronic Funds Transfer (EFT)

2.3       Data Constraints:
1.    PINs are four digits long.
2.    Each card has its unique card number
3.    Non-sufficient funds in an account ought to bring about the dismissal of a withdrawal demand or cash advance exchange.
4.    ATM cards may connect to more than one account.
5.    PINs and account numbers are issued by the appropriate financial institutions.

2.4       Design and interface Constraints:
1.    The card reader ought to be the "swipe" type which shouldn’t be withheld by the machine in any transaction, and the interface must match with the bank's current financial system.
2.    The ATM machines won't correspond with each other, but the bank's financial system will handle the correspondence with other financial systems.

2.5       Quality Constraint:

1.    The system ought to react to requests in under five seconds and should be accessible for communication 97% of the time on a 24/7/365 basis.
2.    An individual ATM ought to process requests not involving dispensing funds when the cash hampers are empty.
3.    Cash hampers ought to be routinely serviced to keep up the comfort of bank clients
4.    Displays should be easy to read and touch pads simple to utilize.

3.0       Mind Map

The above is a mind map of Cimb banking showing all the departments, offices and facilities in the banking branch and services they offer.
The above is a Mind map of an ATM machine showing all the functionalities and features of the machine.

4.0    Class Diagram
As shown above is a class diagram showing the main attributes and operation of an auto teller machine (ATM) system and as per above mind map and class diagram below is a more elaborate diagram for the who auto teller machine (ATM) system.
ATM
+Bank
+Customer
+Account
+Transcations
+Getbankname()
+getcustomername()
+depostcash()
+withdrawcash()
+insertcard()
+getpin()
+getbalance()


4.1       Class Diagram and relationship of the Bank.




4.2 Class Diagram of a cash withdrawal ATM


5.0    VDM Specification
The fundamental thoughts on this approach is first to formalize the requirements and afterward to complete a testing. At the point when formalizing the requirements, we abstract the program under testing into an arrangement of operations, each characterizing an autonomous administration, for example, Withdraw or Deposit in an automated teller machine (ATM) programming. The objective of the formalization is in this manner to compose a formal specification for every operation. To this end, we have to focus the signature of every operation, including the input variables, output variables, and the related outer variables (or state variables)

Functional Senario of ATM
A software system for a simplified Automated Teller Machine (ATM) needs to give two services to customers. The services incorporate withdrawing money from the customer's ledger and request for the account balance. To withdraw money, the customer's card and password as well as the requested sum are needed. The bank strategy does not permit overdraft when the service for withdrawal is used. For a request about the customer's account balance, the system should give the current balance of the customer's account.

5.1    Specification
5.1.1   Process Withdraw (Cardln: cardnumber,  numberIn : AccNum, amountIn: Amount)
ext wr accounts: AccNumAccount
pre exists! [acc: accounts]
            Ù (accounts(numberIn)).balance - amountIn  ≥ - (accounts(numberIn)).limit
post let  bal = (acount(numberIn)).balance
in
let trans = ( account (numberIn)).transactions
in
let newTrans = make-Transaction(dateIn, amountIn,< withdrawal>)
in
accounts  =  account  † {numberIn a
                                    m(account (numberIn),
balance a bal - amountIntransactions  a trans ^ [newTrans])}

5.1.2   Change limit (numberIn : AccNum, limit :amountln)
Ext wr Account: AccNum Account
Pre numberIn Î accounts Ù limitIn ³ 0
Ù accounts(numberIn).balance ³ - limitIn
Post accounts =  account † {number In a
m(account (numberIn), limit a limitIn)}

5.1.3   Check Balance (numberIn : AccNum, Balanceln)
Ext wr Account: AccNum Account
Pre numberIn Î accounts Ù balanceln ³ 0
            Ù accounts(numberIn).balance
Post accounts =  account † {numberIn a
            m(account (numberIn), Balance a balanceln)}

5.1.4   Change Pin (numberIn : AccNum, ChangePin :pinln)
Ext wr Account: AccNum Account
Pre numberIn Î accounts Ù pinln
            Ù accounts(numberIn).balance ³ - pinln
Post accounts =  account † {numberIn a
            m(account (numberIn), ChangePin a pinln)}

6.0    Conclusion
Formal method plays a very important role in software development because it monitors the whole software process and in the case of this project topic, it monitors all sessions on the software development ranging from design to the implementation. With the help of the formal method, future error is systems are being eliminated, giving a more standard and quality software.

7.0    References
Pandey, S. K., & Batra, M. (2013). Formal Methods in Requirements Phase of SDLC. International Journal of Computer Applications. Published by Foundation of Computer Science. New York. USA.

Wang, Y., Zhang, Y., Sheu, P. C., Li, X., & Guo, H. (2010). The Formal Design Model of an Automatic Teller Machine (ATM). International Journal of Software Science and Computational Intelligence (IJSSCI)

Liu, S., & Shen, W. (2012, May). A formal approach to testing programs in practice. In Systems and Informatics (ICSAI), 2012 International Conference on (pp. 2509-2515). IEEE.