2020-02-22 00:24:03
package com.xbsaykat.easy24admin.Job;
 
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.TextView;
 
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
 
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.xbsaykat.easy24admin.R;
 
public class JobViewShow extends RecyclerView.ViewHolder{
    public JobViewShow(@NonNull View itemView) {
        super(itemView);
    }
 
    public void setDetails(final Context context,final String CompanyName,final String divition,final String key,final String mobile,final String prodetails,final String proloc,final String protype,final String qualification,final String salary,final String statusname,final String statusnumber,final String time,final String upzila,final String zila) {
        TextView Company_name = itemView.findViewById(R.id.companyname);
        TextView Location = itemView.findViewById(R.id.lo_cation);
        TextView Jobtype = itemView.findViewById(R.id.Job_type);
        TextView Qualification = itemView.findViewById(R.id.qualifi_cation);
        TextView Salary = itemView.findViewById(R.id.Salary_);
        TextView StatusName = itemView.findViewById(R.id.Status_Name);
        TextView ReqiredNumber = itemView.findViewById(R.id.Reqired_Number);
        TextView Time = itemView.findViewById(R.id.Time_);
 
        TextView Call = itemView.findViewById(R.id.call);
        TextView Approve = itemView.findViewById(R.id.approve);
        TextView Reject = itemView.findViewById(R.id.reject);
 
        Company_name.setText("Company name : "+CompanyName);
        Location.setText("Location : "+divition +" , "+zila+" , "+upzila );
        Jobtype.setText("ধরন : "+protype);
        Qualification.setText("যোগ্যতা : "+qualification);
        Salary.setText("বেতন : "+salary);
        StatusName.setText("পদের নাম : "+statusname);
        ReqiredNumber.setText("পদের সংখ্যা : "+statusnumber);
        Time.setText("আবেদনের শেষ সময় : "+time);
 
        final String Convertzila=zila.substring(0, zila.indexOf('('));
        final String ConvertUpzila=upzila.substring(0, upzila.indexOf('('));
        final String ConvertType=protype.substring(0, protype.indexOf('J'));
 
        Call.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+mobile));
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(intent);
            }
        });
 
        Approve.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                    try {
 
                      /*  DatabaseReference JobzilaSearch = FirebaseDatabase.getInstance().getReference().child("JobSearch").child(Convertzila).child(key);
                        JobzilaSearch.child("CompanyName").setValue(CompanyName);
                        JobzilaSearch.child("proloc").setValue(zila + " -এর " + upzila);
                        JobzilaSearch.child("divition").setValue(divition);
                        JobzilaSearch.child("zila").setValue(zila);
                        JobzilaSearch.child("upzila").setValue(upzila);
                        JobzilaSearch.child("mobile").setValue(mobile);
                        JobzilaSearch.child("protype").setValue(protype);
                        JobzilaSearch.child("qualification").setValue(qualification);
                        JobzilaSearch.child("statusname").setValue(statusname);
                        JobzilaSearch.child("statusnumber").setValue(statusnumber);
                        JobzilaSearch.child("salary").setValue(salary);
                        JobzilaSearch.child("time").setValue(time);
                        JobzilaSearch.child("prodetails").setValue(prodetails);
                        JobzilaSearch.child("key").setValue(key);*/
 
                        DatabaseReference JobPlaceSearch = FirebaseDatabase.getInstance().getReference().child("AllJob").child(key);
                        JobPlaceSearch.child("CompanyName").setValue(CompanyName);
                        JobPlaceSearch.child("proloc").setValue(zila + " -এর " + upzila);
                        JobPlaceSearch.child("divition").setValue(divition);
                        JobPlaceSearch.child("zila").setValue(zila);
                        JobPlaceSearch.child("upzila").setValue(upzila);
                        JobPlaceSearch.child("mobile").setValue(mobile);
                        JobPlaceSearch.child("protype").setValue(protype);
                        JobPlaceSearch.child("qualification").setValue(qualification);
                        JobPlaceSearch.child("statusname").setValue(statusname);
                        JobPlaceSearch.child("statusnumber").setValue(statusnumber);
                        JobPlaceSearch.child("salary").setValue(salary);
                        JobPlaceSearch.child("time").setValue(time);
                        JobPlaceSearch.child("prodetails").setValue(prodetails);
                        JobPlaceSearch.child("key").setValue(key);
 
                        DatabaseReference JobPlaceCategortSearch = FirebaseDatabase.getInstance().getReference().child("JobPlaceCatSearch").child(Convertzila).child(ConvertUpzila).child(ConvertType.trim()).child(key);
                        JobPlaceCategortSearch.child("CompanyName").setValue(CompanyName);
                        JobPlaceCategortSearch.child("proloc").setValue(zila + " -এর " + upzila);
                        JobPlaceCategortSearch.child("divition").setValue(divition);
                        JobPlaceCategortSearch.child("zila").setValue(zila);
                        JobPlaceCategortSearch.child("upzila").setValue(upzila);
                        JobPlaceCategortSearch.child("mobile").setValue(mobile);
                        JobPlaceCategortSearch.child("protype").setValue(protype);
                        JobPlaceCategortSearch.child("qualification").setValue(qualification);
                        JobPlaceCategortSearch.child("statusname").setValue(statusname);
                        JobPlaceCategortSearch.child("statusnumber").setValue(statusnumber);
                        JobPlaceCategortSearch.child("salary").setValue(salary);
                        JobPlaceCategortSearch.child("time").setValue(time);
                        JobPlaceCategortSearch.child("prodetails").setValue(prodetails);
                        JobPlaceCategortSearch.child("key").setValue(key);
 
                        DatabaseReference JobCategortSearch = FirebaseDatabase.getInstance().getReference().child("JobCatSearch").child(ConvertType.trim()).child(key);
                        JobCategortSearch.child("CompanyName").setValue(CompanyName);
                        JobCategortSearch.child("proloc").setValue(zila + " -এর " + upzila);
                        JobCategortSearch.child("divition").setValue(divition);
                        JobCategortSearch.child("zila").setValue(zila);
                        JobCategortSearch.child("upzila").setValue(upzila);
                        JobCategortSearch.child("mobile").setValue(mobile);
                        JobCategortSearch.child("protype").setValue(protype);
                        JobCategortSearch.child("qualification").setValue(qualification);
                        JobCategortSearch.child("statusname").setValue(statusname);
                        JobCategortSearch.child("statusnumber").setValue(statusnumber);
                        JobCategortSearch.child("salary").setValue(salary);
                        JobCategortSearch.child("time").setValue(time);
                        JobCategortSearch.child("prodetails").setValue(prodetails);
                        JobCategortSearch.child("key").setValue(key);
 
 
                        DatabaseReference Remove = FirebaseDatabase.getInstance().getReference().child("RevewJob").child(key);
                        Remove.removeValue();
 
                    } catch (Exception IO) {
                    }
                }
        });
 
        Reject.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DatabaseReference Remove = FirebaseDatabase.getInstance().getReference().child("RevewJob").child(key);
                Remove.removeValue();
            }
        });
 
    }
 
}
 
 
Invalid Email or Password