Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Admin Applctn


1

package com.example.rabia.adminapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

   
@Override
   
protected Void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);
        setContentView(R.layout.
activity_main);
    }
   
public void MoveChallan(View view)
    {
        Intent intent=
new Intent(this,ChallanFormOfUser.class);
        startActivity(intent);
    }
   
public void userRecord(View view){
        Intent intent=
new Intent(this,StudentRecord.class);
        startActivity(intent);
    }
}


xml version="1.0" encoding="utf-8"?>

LinearLayout 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"

   
tools:context=".MainActivity">

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="vertical"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="match_parent"

           
android:text="Select One Option"

           
android:gravity="center"

           
android:layout_gravity="center"

           
android:textSize="30dp"

           
android:layout_height="wrap_content" />

        Button

           
android:layout_width="200dp"

            
android:layout_marginTop="30dp"

           
android:id="@+id/Challan"

           
android:text="Challan"

           
android:onClick="MoveChallan"

           
android:layout_gravity="center"

           
android:textSize="20dp"



           
android:layout_height="wrap_content" />

        Button

           
android:layout_width="200dp"

           
android:id="@+id/notification"

           
android:textSize="20dp"

           
android:layout_gravity="center"

           
android:text="Notification"

            
android:layout_marginTop="10dp"

           
android:layout_height="wrap_content" />

        Button

           
android:layout_width="200dp"

           
android:id="@+id/block"

           
android:textSize="20dp"

           
android:layout_gravity="center"

           
android:text="Block"

           
android:layout_marginTop="10dp"

           
android:layout_height="wrap_content" />

        Button

           
android:layout_width="200dp"

           
android:id="@+id/record"

           
android:textSize="20dp"

           
android:onClick="userRecord"

           
android:layout_gravity="center"

           
android:text="Record"

           
android:layout_marginTop="10dp"

           
android:layout_height="wrap_content" />





   
LinearLayout>



LinearLayout>


2  ChallanFormForUser

package com.example.rabia.adminapplication;



import android.support.annotation.NonNull;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.EditText;

import android.widget.Toast;



import com.google.android.gms.tasks.OnCompleteListener;

import com.google.android.gms.tasks.Task;

import com.google.firebase.database.DatabaseReference;

import com.google.firebase.database.FirebaseDatabase;



public class ChallanFormOfUser extends AppCompatActivity {

    EditText
month,buss_fee,bus_card_fee,transport_fund,total_of_fund,grand_total,date;

    DatabaseReference
databaseReference;

   
@Override

   
protected void onCreate(Bundle savedInstanceState) {

       
super.onCreate(savedInstanceState);

        setContentView(R.layout.
activity_challan_form_of_user);

       
month=(EditText)findViewById(R.id.month);

       
buss_fee=(EditText)findViewById(R.id.busFee);

       
bus_card_fee=(EditText)findViewById(R.id.busCardFee);

       
transport_fund=(EditText)findViewById(R.id.transportFund);

       
total_of_fund=(EditText)findViewById(R.id.totalFund);

       
grand_total=(EditText)findViewById(R.id.grandTotal);

       
date=(EditText)findViewById(R.id.dated);

       
databaseReference= FirebaseDatabase.getInstance().getReference();



    }

   
public void ChallanForm(View view){



        ChallanUser challanUser;

        challanUser =
new ChallanUser(month.getText().toString(),buss_fee.getText().toString(),bus_card_fee.getText().toString(),

                
transport_fund.getText().toString(),total_of_fund.getText().toString(),grand_total.getText().toString(),

               
date.getText().toString());

       
databaseReference.child("Admin").setValue(challanUser)

                .addOnCompleteListener(
new OnCompleteListener() {

                   
@Override

                   
public void onComplete(@NonNull Task task) {

                       
if(task.isSuccessful())

                        {

                            Toast.makeText(getApplicationContext(),
"done",Toast.LENGTH_SHORT).show();

                        }

                       
else

                       
{

                            Toast.makeText(getApplicationContext(),
"done",Toast.LENGTH_SHORT).show();

                        }

                    }

                });

    }

}


xml version="1.0" encoding="utf-8"?>

LinearLayout 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:orientation="vertical"

   
android:layout_marginTop="10dp"

   
android:layout_marginRight="10dp"

   
android:layout_marginLeft="10dp"

   
android:layout_marginBottom="10dp"

   
android:layout_height="match_parent"

   
tools:context=".ChallanFormOfUser">

    TextView

       
android:layout_width="match_parent"

       
android:text="Challan Form"

       
android:gravity="center"

       
android:textSize="20dp"

       
android:layout_marginBottom="5dp"

       
android:layout_height="wrap_content" />

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="wrap_content"

           
android:text="Dated"

           
android:layout_height="wrap_content" />

        EditText

           
android:layout_width="match_parent"

           
android:hint="Enter Date"

           
android:id="@+id/dated"

            
android:gravity="center"

           
android:layout_height="wrap_content" />

   
LinearLayout>

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="wrap_content"

           
android:text="Enter Month"

           
android:layout_height="wrap_content" />

        EditText

           
android:layout_width="match_parent"

           
android:hint="Enter buss fee"

           
android:id="@+id/month"

           
android:gravity="center"

           
android:layout_height="wrap_content" />

   
LinearLayout>

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="wrap_content"

           
android:text="Bus Fee"

           
android:layout_height="wrap_content" />

        EditText

           
android:layout_width="match_parent"

           
android:hint="Enter buss fee"

           
android:id="@+id/busFee"

           
android:gravity="center"

           
android:layout_height="wrap_content" />

   
LinearLayout>

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="wrap_content"

           
android:text="Bus Card Fee"

           
android:layout_height="wrap_content" />

        EditText

           
android:layout_width="match_parent"

           
android:hint="Enter bus Card Fee"

           
android:id="@+id/busCardFee"

           
android:gravity="center"

           
android:layout_height="wrap_content" />

   
LinearLayout>

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

           
android:layout_width="wrap_content"

           
android:text="Transport Fund"

           
android:layout_height="wrap_content" />

        EditText

           
android:layout_width="match_parent"

           
android:hint="Enter Transport Fund"

           
android:id="@+id/transportFund"

           
android:gravity="center"

           
android:layout_height="wrap_content" />

   
LinearLayout>

    LinearLayout

       
android:layout_width="match_parent"

       
android:orientation="horizontal"

       
android:layout_height="wrap_content">

        TextView

            
android:layout_width="wrap_content"

           
android:text="Total of Fund"

           


This post first appeared on AR Programming, please read the originial post: here

Share the post

Admin Applctn

×

Subscribe to Ar Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×