diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..1046d98
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+MyApplication
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..61a9130
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..b617266
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..bcc4135
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..d5d35ec
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/.idea/.gitignore b/app/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/app/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/app/.idea/encodings.xml b/app/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/app/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/gradle.xml b/app/.idea/gradle.xml
new file mode 100644
index 0000000..0cb0e08
--- /dev/null
+++ b/app/.idea/gradle.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/misc.xml b/app/.idea/misc.xml
new file mode 100644
index 0000000..f845854
--- /dev/null
+++ b/app/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/modules.xml b/app/.idea/modules.xml
new file mode 100644
index 0000000..e1f9e1c
--- /dev/null
+++ b/app/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..65fcd6d
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,120 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "30.0.2"
+
+ defaultConfig {
+ applicationId "com.leadcampusapp"
+ minSdkVersion 18
+ targetSdkVersion 29
+ versionCode 51
+ versionName "4.6"
+
+ multiDexEnabled true
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ lintOptions {
+ checkReleaseBuilds false
+ // Or, if you prefer, you can continue to check for errors in release builds,
+ // but continue the build even when errors are found:
+ abortOnError false
+ }
+
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ packagingOptions{
+ exclude 'META-INF/rxjava.properties'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.3.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+
+
+
+
+
+
+ // implementation 'com.google.android.gms:play-services-tagmanager:11.6.0'
+
+ implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
+ implementation 'androidx.exifinterface:exifinterface:1.0.0'
+ implementation 'androidx.cardview:cardview:1.0.0'
+ implementation 'androidx.browser:browser:1.0.0'
+ implementation 'androidx.media:media:1.0.0'
+ //implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'androidx.multidex:multidex:2.0.0'
+ implementation 'com.android.support:multidex:1.0.3'
+
+
+ implementation 'com.google.android.material:material:1.0.0'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation "androidx.recyclerview:recyclerview:1.1.0"
+ implementation 'com.kofigyan.stateprogressbar:stateprogressbar:1.0.0'
+
+ implementation 'com.github.bumptech.glide:glide:3.7.0'
+ implementation 'com.codesgood:justifiedtextview:1.0.2'
+ implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
+ implementation 'de.hdodenhof:circleimageview:2.2.0'
+ implementation 'pl.bclogic:pulsator4droid:1.0.3'
+ implementation 'net.danlew:android.joda:2.9.9'
+
+ implementation 'com.facebook.shimmer:shimmer:0.4.0'
+ implementation files('libs/YouTubeAndroidPlayerApi.jar')
+ implementation 'com.github.k0shk0sh:PermissionHelper:1.0.7'
+ implementation 'com.cocosw:bottomsheet:1.+@aar'
+
+
+
+ implementation 'com.google.android.material:material:1.0.0-rc01'
+ implementation 'com.google.android.material:material:1.1.0-alpha07'
+
+
+ implementation 'com.squareup.retrofit2:retrofit:2.3.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
+ implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
+
+
+
+
+ //implementation 'com.paytm.appinvokesdk:appinvokesdk:1.2'
+ implementation 'com.paytm.appinvokesdk:appinvokesdk:1.5.4'
+
+
+
+
+ implementation 'com.google.android.gms:play-services-auth:18.1.0'
+ implementation 'com.google.firebase:firebase-auth:16.0.1'
+ implementation 'com.google.firebase:firebase-messaging:17.0.0'
+ implementation 'com.google.firebase:firebase-core:16.0.0'
+ implementation 'com.google.android.gms:play-services-tagmanager:16.0.0'
+
+
+ implementation files('libs/rxjava-1.0.2.jar')
+ implementation files('libs/additionnal.jar')
+ implementation files('libs/ftp4j-1.6.jar')
+ implementation files('libs/commons-net-3.3.jar')
+ implementation files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
+}
+apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 0000000..62d692a
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,56 @@
+{
+ "project_info": {
+ "project_number": "830064162862",
+ "firebase_url": "https://df-leadcampus.firebaseio.com",
+ "project_id": "df-leadcampus",
+ "storage_bucket": "df-leadcampus.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:830064162862:android:55ef121e7473d84b",
+ "android_client_info": {
+ "package_name": "com.leadcampusapp"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "830064162862-5vh60pec1mctjus7eo7donicdl7fif6g.apps.googleusercontent.com",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "com.leadcampusapp",
+ "certificate_hash": "8a7cfff8d13816f1e754b1012a3fd235a199de06"
+ }
+ },
+ {
+ "client_id": "830064162862-ctn3l98e2igqoom1t7lk1lenapskvmic.apps.googleusercontent.com",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "com.leadcampusapp",
+ "certificate_hash": "6a22b9f289d8a4cc8899dc224ff931ee034380b0"
+ }
+ },
+ {
+ "client_id": "830064162862-nohid6fk5j27f2g6fvc0qdrn81pumdkg.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyAl6P7is4pIcI5BkkxHwbDrnMojAw9VkrQ"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "830064162862-nohid6fk5j27f2g6fvc0qdrn81pumdkg.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/app/libs/YouTubeAndroidPlayerApi.jar b/app/libs/YouTubeAndroidPlayerApi.jar
new file mode 100644
index 0000000..0acbebd
Binary files /dev/null and b/app/libs/YouTubeAndroidPlayerApi.jar differ
diff --git a/app/libs/activation.jar b/app/libs/activation.jar
new file mode 100644
index 0000000..614a03c
Binary files /dev/null and b/app/libs/activation.jar differ
diff --git a/app/libs/additionnal.jar b/app/libs/additionnal.jar
new file mode 100644
index 0000000..aeb9611
Binary files /dev/null and b/app/libs/additionnal.jar differ
diff --git a/app/libs/commons-net-3.3.jar b/app/libs/commons-net-3.3.jar
new file mode 100644
index 0000000..f4f19a9
Binary files /dev/null and b/app/libs/commons-net-3.3.jar differ
diff --git a/app/libs/ftp4j-1.6.jar b/app/libs/ftp4j-1.6.jar
new file mode 100644
index 0000000..8097d58
Binary files /dev/null and b/app/libs/ftp4j-1.6.jar differ
diff --git a/app/libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar b/app/libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar
new file mode 100644
index 0000000..33ef6e8
Binary files /dev/null and b/app/libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar differ
diff --git a/app/libs/mail.jar b/app/libs/mail.jar
new file mode 100644
index 0000000..ea594fd
Binary files /dev/null and b/app/libs/mail.jar differ
diff --git a/app/libs/rxjava-1.0.2.jar b/app/libs/rxjava-1.0.2.jar
new file mode 100644
index 0000000..4362a9f
Binary files /dev/null and b/app/libs/rxjava-1.0.2.jar differ
diff --git a/app/libs/session.jar b/app/libs/session.jar
new file mode 100644
index 0000000..b3d74c3
Binary files /dev/null and b/app/libs/session.jar differ
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
new file mode 100644
index 0000000..ce68c23
Binary files /dev/null and b/app/release/app-release.apk differ
diff --git a/app/release/leadcampus_Ver4.6.apk b/app/release/leadcampus_Ver4.6.apk
new file mode 100644
index 0000000..ce68c23
Binary files /dev/null and b/app/release/leadcampus_Ver4.6.apk differ
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
new file mode 100644
index 0000000..cbe6afc
--- /dev/null
+++ b/app/release/output-metadata.json
@@ -0,0 +1,18 @@
+{
+ "version": 2,
+ "artifactType": {
+ "type": "APK",
+ "kind": "Directory"
+ },
+ "applicationId": "com.leadcampusapp",
+ "variantName": "processReleaseResources",
+ "elements": [
+ {
+ "type": "SINGLE",
+ "filters": [],
+ "versionCode": 51,
+ "versionName": "4.6",
+ "outputFile": "app-release.apk"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/leadcampusapp/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/leadcampusapp/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..2ad61c2
--- /dev/null
+++ b/app/src/androidTest/java/com/leadcampusapp/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.leadcampusapp", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ee2e6b8
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,305 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/assets/Testing.txt b/app/src/main/assets/Testing.txt
new file mode 100644
index 0000000..0a90125
--- /dev/null
+++ b/app/src/main/assets/Testing.txt
@@ -0,0 +1 @@
+Testing
\ No newline at end of file
diff --git a/app/src/main/assets/lead4_14mb.gif b/app/src/main/assets/lead4_14mb.gif
new file mode 100644
index 0000000..9d135a1
Binary files /dev/null and b/app/src/main/assets/lead4_14mb.gif differ
diff --git a/app/src/main/java/com/leadcampusapp/AboutUsActivity.java b/app/src/main/java/com/leadcampusapp/AboutUsActivity.java
new file mode 100644
index 0000000..c674f86
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AboutUsActivity.java
@@ -0,0 +1,281 @@
+package com.leadcampusapp;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+
+import androidx.appcompat.app.AppCompatActivity;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.MeasureSpec;
+import android.view.ViewGroup;
+import android.widget.ExpandableListAdapter;
+import android.widget.ExpandableListView;
+import android.widget.ExpandableListView.OnGroupClickListener;
+import android.widget.ExpandableListView.OnGroupExpandListener;
+import android.widget.ListAdapter;
+import android.widget.ScrollView;
+import android.widget.TextView;
+import androidx.annotation.RequiresApi;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+
+public class AboutUsActivity extends AppCompatActivity {
+
+
+ ExpandableListView expandableListView;
+ ExpandableListAdapter expandableListAdapter;
+ List expandableListTitle;
+ HashMap> expandableListDetail;
+ ScrollView scrollView;
+
+ @RequiresApi(api = Build.VERSION_CODES.M)
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_about_us);
+
+ //Added by Sripad
+ getSupportActionBar().setDisplayShowCustomEnabled(true);
+ getSupportActionBar().setCustomView(R.layout.actionbar_layout);
+ // getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
+
+ View actionBarView = getSupportActionBar().getCustomView();
+ TextView actionBarTV = (TextView) actionBarView.findViewById(R.id.txt_actionBar);
+ actionBarTV.setText("About LEAD");
+
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+
+
+
+ scrollView = (ScrollView) findViewById(R.id.scrollViewDrawer);
+
+ expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
+ expandableListDetail = ExpandableListDataPump.getData(AboutUsActivity.this);
+ expandableListTitle = new ArrayList(expandableListDetail.keySet());
+ expandableListAdapter = new CustomExpandableListAdapter(this, expandableListTitle, expandableListDetail);
+ expandableListView.setAdapter(expandableListAdapter);
+
+ /* LinearLayout.LayoutParams param = (LinearLayout.LayoutParams) expandableListView.getLayoutParams();
+ param.height = (3 * expandableListView.getHeight());
+ expandableListView.setLayoutParams(param);
+ expandableListView.refreshDrawableState();
+ scrollView.refreshDrawableState();*/
+
+ setListViewHeight(expandableListView);
+
+ expandableListView.setOnGroupClickListener(new OnGroupClickListener() {
+
+ @Override
+ public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
+ setListViewHeight(parent, groupPosition);
+ return false;
+ }
+ });
+
+ expandableListView.setOnGroupExpandListener(new OnGroupExpandListener() {
+ int previousGroup = -1;
+
+ @Override
+ public void onGroupExpand(int groupPosition) {
+ if(groupPosition != previousGroup)
+ expandableListView.collapseGroup(previousGroup);
+ previousGroup = groupPosition;
+ }
+ });
+ /* expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
+
+ @Override
+ public void onGroupExpand(int groupPosition) {
+
+ /* Toast.makeText(getApplicationContext(),
+ expandableListTitle.get(groupPosition) + " List Expanded.",
+ Toast.LENGTH_SHORT).show();*/
+
+ /* LinearLayout.LayoutParams param = (LinearLayout.LayoutParams) expandableListView.getLayoutParams();
+ param.height = (3 * expandableListView.getHeight());
+ expandableListView.setLayoutParams(param);
+ expandableListView.refreshDrawableState();
+ scrollView.refreshDrawableState();*/
+ /* }
+ });*/
+
+ expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
+
+ @Override
+ public void onGroupCollapse(int groupPosition) {
+ /* LinearLayout.LayoutParams param = (LinearLayout.LayoutParams) expandableListView.getLayoutParams();
+ param.height = LinearLayout.LayoutParams.WRAP_CONTENT;
+ expandableListView.setLayoutParams(param);
+ expandableListView.refreshDrawableState();
+ scrollView.refreshDrawableState();*/
+
+ }
+ });
+
+ /* expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
+ @Override
+ public boolean onChildClick(ExpandableListView parent, View v,
+ int groupPosition, int childPosition, long id) {
+ Toast.makeText(
+ getApplicationContext(),
+ expandableListTitle.get(groupPosition)
+ + " -> "
+ + expandableListDetail.get(
+ expandableListTitle.get(groupPosition)).get(
+ childPosition), Toast.LENGTH_SHORT
+ ).show();
+ return false;
+ }
+ });*/
+
+
+ }
+
+ private void setListViewHeight(ExpandableListView listView) {
+ ListAdapter listAdapter = listView.getAdapter();
+ int totalHeight = 0;
+ for (int i = 0; i < listAdapter.getCount(); i++) {
+ View listItem = listAdapter.getView(i, null, listView);
+ listItem.measure(0, 0);
+ totalHeight += listItem.getMeasuredHeight();
+ }
+
+ ViewGroup.LayoutParams params = listView.getLayoutParams();
+ params.height = totalHeight
+ + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
+ listView.setLayoutParams(params);
+ listView.requestLayout();
+ }
+
+ private void setListViewHeight(ExpandableListView listView,
+ int group) {
+ ExpandableListAdapter listAdapter = listView.getExpandableListAdapter();
+ int totalHeight = 0;
+ int desiredWidth = MeasureSpec.makeMeasureSpec(listView.getWidth(),
+ MeasureSpec.AT_MOST);
+ for (int i = 0; i < listAdapter.getGroupCount(); i++) {
+ View groupItem = listAdapter.getGroupView(i, false, null, listView);
+ groupItem.measure(desiredWidth, MeasureSpec.UNSPECIFIED);
+ totalHeight += groupItem.getMeasuredHeight();
+
+ if (((listView.isGroupExpanded(i)) && (i != group))
+ || ((!listView.isGroupExpanded(i)) && (i == group))) {
+ for (int j = 0; j < listAdapter.getChildrenCount(i); j++) {
+ View listItem = listAdapter.getChildView(i, j, false, null,
+ listView);
+ listItem.measure(desiredWidth, MeasureSpec.UNSPECIFIED);
+
+ totalHeight += listItem.getMeasuredHeight();
+ }
+ }
+ }
+
+ ViewGroup.LayoutParams params = listView.getLayoutParams();
+ int height = totalHeight
+ + (listView.getDividerHeight() * (listAdapter.getGroupCount() - 1));
+ if (height < 10)
+ height = 200;
+ params.height = height;
+ listView.setLayoutParams(params);
+ listView.requestLayout();
+
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+
+ if (id == android.R.id.home) {
+ String fromwhere = getIntent().getStringExtra("From");
+ if(fromwhere.equalsIgnoreCase("student")) {
+ Intent ittAboutToHome = new Intent(AboutUsActivity.this, HomeActivity.class);
+ startActivity(ittAboutToHome);
+ } else if(fromwhere.equalsIgnoreCase("Principle")) {
+ Intent ittAboutToHome = new Intent(AboutUsActivity.this, PrincipleHomeActivity.class);
+ startActivity(ittAboutToHome);
+ }else{
+ Intent ittAboutToHome = new Intent(AboutUsActivity.this, PMHomeActivity.class);
+ startActivity(ittAboutToHome);
+ }
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+
+ /* @Override
+ protected void onResume() {
+ super.onResume();
+
+ // register connection status listener
+ MyApplication.getInstance().setConnectivityListener(this);
+ }
+
+ @Override
+ public void onNetworkConnectionChanged(boolean isConnected) {
+ showSnack(isConnected);
+ }
+
+ private void showSnack(boolean isConnected) {
+
+ if (!isConnected) {
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(AboutUsActivity.this);
+
+
+ //adb.setView(alertDialogView);
+
+
+ adb.setTitle("Sorry! Not connected to Internet");
+
+
+ adb.setIcon(android.R.drawable.ic_dialog_alert);
+
+
+ adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+
+ adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+ adb.setCancelable(true);
+ adb.show();
+ }
+
+*//* String message;
+ int color;
+ if (isConnected) {
+ message = "Good! Connected to Internet";
+ color = Color.WHITE;
+ } else {
+ message = "Sorry! Not connected to internet";
+ color = Color.RED;
+ }
+
+ Snackbar snackbar = Snackbar
+ .make(findViewById(R.id.coordinator_layout), message, Snackbar.LENGTH_LONG);
+
+ View sbView = snackbar.getView();
+ TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text);
+ textView.setTextColor(color);
+ snackbar.show();*//*
+ }*/
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Activity_confirmoldpin.java b/app/src/main/java/com/leadcampusapp/Activity_confirmoldpin.java
new file mode 100644
index 0000000..b231512
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Activity_confirmoldpin.java
@@ -0,0 +1,763 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+//import com.covid.R;
+
+public class Activity_confirmoldpin extends AppCompatActivity {
+
+
+ Button verfiy_oldpin_bt;
+ TextView forgotpin_tv;
+ EditText otp1_et,otp2_et,otp3_et,otp4_et;
+
+ public static final String sharedpreference_usercredential = "sharedpreferencebook_usercredential";
+ public static final String KeyValue_userid = "KeyValue_userid";
+ public static final String KeyValue_username = "KeyValue_username";
+ public static final String KeyValue_user_mailid = "KeyValue_user_mailid";
+ public static final String KeyValue_usercategory = "KeyValue_usercategory";
+ public static final String KeyValue_usercellno = "KeyValue_usercellno";
+ public static final String KeyValue_isuser_setpin = "KeyValue_isuser_setpin";
+ public static final String KeyValue_isuser_changepin = "KeyValue_isuser_changepin";
+ public static final String KeyValue_loggedfromgoogle = "KeyValue_loggedfromgoogle";
+
+
+ SharedPreferences sharedpreference_usercredential_Obj;
+ SharedPreferences.Editor editor_obj;
+
+ public static final String sharedpreference_setpincredential = "sharedpreference_pincredential";
+ public static final String KeyValue_setpin = "KeyValue_setpin";
+ SharedPreferences sharedpreference_setpin_Obj;
+ String str_username,str_userID;
+
+
+ Class_InternetDectector internetDectector;
+ Boolean isInternetPresent = false;
+ String str_confirmoldpin,str_isuser_loggedfromgoogle;
+ EditText pin1masked_et,pin2masked_et,pin3masked_et,pin4masked_et;
+
+ public static final String PREFBook_PM = "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_pm_username = "prefid_pm_username"; //
+
+ SharedPreferences shardprefPM_obj;
+
+ SharedPreferences shardpref_S_obj;
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefId_S_Username = "prefid_susername";
+ public static final String PrefID_Role = "prefid_role";
+
+ String str_role;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_confirmoldpin);
+
+ verfiy_oldpin_bt =(Button) findViewById(R.id.verfiy_oldpin_bt);
+ forgotpin_tv=(TextView)findViewById(R.id.forgotpin_tv);
+
+ otp1_et=(EditText) findViewById(R.id.otp1_et);
+ otp2_et=(EditText) findViewById(R.id.otp2_et);
+ otp3_et=(EditText) findViewById(R.id.otp3_et);
+ otp4_et=(EditText) findViewById(R.id.otp4_et);
+
+ pin1masked_et=(EditText)findViewById(R.id.pin1masked_et);
+ pin2masked_et=(EditText)findViewById(R.id.pin2masked_et);
+ pin3masked_et=(EditText)findViewById(R.id.pin3masked_et);
+ pin4masked_et=(EditText)findViewById(R.id.pin4masked_et);
+
+ otp1_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp2_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp3_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp4_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+
+ sharedpreference_setpin_Obj=getSharedPreferences(sharedpreference_setpincredential, Context.MODE_PRIVATE);
+ // str_setpin = sharedpreference_setpin_Obj.getString(KeyValue_setpin, "").trim();
+
+ /* sharedpreference_usercredential_Obj=getSharedPreferences(sharedpreference_usercredential, Context.MODE_PRIVATE);
+ str_username= sharedpreference_usercredential_Obj.getString(KeyValue_username, "").trim();
+ str_isuser_loggedfromgoogle=sharedpreference_usercredential_Obj.getString(KeyValue_loggedfromgoogle, "").trim();
+
+
+ sharedpreference_usercredential_Obj=getSharedPreferences(sharedpreference_usercredential, Context.MODE_PRIVATE);
+ str_userID= sharedpreference_usercredential_Obj.getString(KeyValue_userid, "").trim();
+ Log.e("confirmpinuserid",str_userID);*/
+ shardpref_S_obj= getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+
+ shardpref_S_obj.getString(PrefID_Role, "").trim();
+ str_role = shardpref_S_obj.getString(PrefID_Role, "").trim();
+ Log.e("str_role:", str_role);
+
+ if(str_role.equalsIgnoreCase("Student")) {
+
+ //otp4_et
+ shardpref_S_obj = getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+
+ shardpref_S_obj.getString(PrefId_S_Username, "").trim();
+ str_username = shardpref_S_obj.getString(PrefId_S_Username, "").trim();
+ Log.d("str_username", str_username);
+ }else {
+ shardprefPM_obj = getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+ str_username = shardprefPM_obj.getString(PrefID_pm_username, "").trim();
+ Log.e("str_pm_username:", str_username);
+
+ }
+
+ otp1_et.requestFocus();
+
+ otp1_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp1_et.getText().toString().length()>=1)
+ {
+ pin1masked_et.setVisibility(View.VISIBLE);
+ otp1_et.setVisibility(View.GONE);
+ pin1masked_et.setText("*");
+
+ otp2_et.requestFocus();
+
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin1masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin1masked_et.getText().toString().length()==0)
+ {
+ pin1masked_et.setVisibility(View.GONE);
+ otp1_et.setVisibility(View.VISIBLE);
+ otp1_et.setText("");
+ otp1_et.requestFocus();
+ }
+ }
+ });
+
+
+
+ otp2_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp2_et.getText().toString().length()>=1)
+ {
+ pin2masked_et.setVisibility(View.VISIBLE);
+ otp2_et.setVisibility(View.GONE);
+ pin2masked_et.setText("*");
+ otp3_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin2masked_et.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin2masked_et.getText().toString().length()==0)
+ {
+ pin2masked_et.setVisibility(View.GONE);
+ otp2_et.setVisibility(View.VISIBLE);
+ otp2_et.setText("");
+ otp2_et.requestFocus();
+ }
+ }
+ });
+
+
+ otp3_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp3_et.getText().toString().length()>=1)
+ {
+ pin3masked_et.setVisibility(View.VISIBLE);
+ otp3_et.setVisibility(View.GONE);
+ pin3masked_et.setText("*");
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+ pin3masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin3masked_et.getText().toString().length()==0)
+ {
+ pin3masked_et.setVisibility(View.GONE);
+ otp3_et.setVisibility(View.VISIBLE);
+ otp3_et.setText("");
+ otp3_et.requestFocus();
+ }
+ }
+ });
+
+
+
+ otp4_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp4_et.getText().toString().length()>=1)
+ {
+
+ pin4masked_et.setVisibility(View.VISIBLE);
+ otp4_et.setVisibility(View.GONE);
+ pin4masked_et.setText("*");
+
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ }
+ });
+
+
+
+ pin4masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin4masked_et.getText().toString().length()==0)
+ {
+ pin4masked_et.setVisibility(View.GONE);
+ otp4_et.setVisibility(View.VISIBLE);
+ otp4_et.setText("");
+ otp4_et.requestFocus();
+ }
+ }
+ });
+
+
+
+ verfiy_oldpin_bt.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ if(validation()) {
+
+ str_confirmoldpin = otp1_et.getText().toString() +
+ otp2_et.getText().toString() +
+ otp3_et.getText().toString() +
+ otp4_et.getText().toString();
+
+ if (2>1)
+ {
+
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+ if (isInternetPresent) {
+
+ UpdatePinPassword updatePinPassword=new UpdatePinPassword(Activity_confirmoldpin.this);
+ updatePinPassword.execute();
+ // AsyncTask_ValidateUserPIN();
+ }
+
+
+ } else{
+ Toast.makeText(getApplicationContext(),"PIN doesn't match", Toast.LENGTH_LONG).show();
+ }
+
+ }
+ }
+ });
+
+
+
+
+ forgotpin_tv.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_confirmoldpin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.forgotpin);
+ dialog.setMessage("You need to relogin to the application for set new PIN.\n" +
+ "Do you want to proceed");
+
+ dialog.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+ if (isInternetPresent) {
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "");
+ editor_obj.commit();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_changepin, "");
+ editor_obj.commit();
+
+
+ if(str_isuser_loggedfromgoogle.isEmpty())
+ {
+
+ }else{
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_loggedfromgoogle, "yes");
+ editor_obj.commit();
+ }
+
+
+ Intent i = new Intent(Activity_confirmoldpin.this, MainActivity.class);
+ startActivity(i);
+ finish();
+
+ }
+ else
+ {
+ Toast.makeText(Activity_confirmoldpin.this, "Kindly connect to internet", Toast.LENGTH_SHORT).show();
+ }
+ }
+ })
+ .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+ }
+ });
+
+
+
+
+ }//On create()
+
+
+
+
+ public boolean validation()
+ {
+ boolean b_otp1, b_otp2, b_otp3, b_otp4;
+ b_otp1=b_otp2=b_otp3=b_otp4=true;
+
+
+
+ if (otp1_et.getText().toString().trim().length() == 0) {
+ otp1_et.setError("Enter PIN");
+ otp1_et.requestFocus();
+ b_otp1 = false;
+ }
+
+ if (otp2_et.getText().toString().trim().length() == 0) {
+ otp2_et.setError("Enter PIN");
+ otp2_et.requestFocus();
+ b_otp2 = false;
+ }
+
+ if (otp3_et.getText().toString().trim().length() == 0) {
+ otp3_et.setError("Enter PIN");
+ otp3_et.requestFocus();
+ b_otp3 = false;
+ }
+ if(otp4_et.getText().toString().trim().length()==0)
+ {
+ otp4_et.setError("Enter PIN");
+ otp4_et.requestFocus();
+ b_otp4=false;
+ }
+
+ return (b_otp1 && b_otp2 && b_otp3&& b_otp4);
+ }
+
+
+
+ @Override
+ public void onBackPressed()
+ {
+
+ /*AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_confirmoldpin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure want to go back");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ finish();
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();*/
+ Intent startMain = new Intent(Intent.ACTION_MAIN);
+ startMain.addCategory(Intent.CATEGORY_HOME);
+ startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(startMain);
+ }
+
+
+
+
+
+
+ public class UpdatePinPassword extends AsyncTask {
+
+ Context context;
+ //AlertDialog alertDialog;
+
+ //private ProgressBar progressBar;
+
+ private ProgressDialog progressDialog;
+
+ UpdatePinPassword(Context ctx) {
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(String... params) {
+
+ SoapObject response = UpdatePinPassword();
+
+ //Log.d("ResponseCommitsss", response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+
+
+ String str_result=result.getProperty("Status").toString();
+
+ if(str_result.equals("Success")){
+ // dialog.dismiss();
+ // Toast.makeText(context,"Your Request sent to the manager",Toast.LENGTH_LONG).show();
+ Intent i = new Intent(Activity_confirmoldpin.this, Activity_setpin.class);
+ i.putExtra("Key_confirmoldpin", "yes");
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ startActivity(i);
+ finish();
+ }else{
+
+ Toast toast = Toast.makeText(getApplicationContext(), "Wrong PIN", Toast.LENGTH_LONG);
+ TextView toastMessage = (TextView) toast.getView().findViewById(android.R.id.message);
+ toastMessage.setTextColor(Color.RED);
+ toast.show();
+ }
+
+ progressDialog.dismiss();
+ }
+
+ }
+
+
+ private SoapObject UpdatePinPassword()
+ {
+
+ String METHOD_NAME = "ValidateLogin_PIN";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/ValidateLogin_PIN";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("Username", str_username);//string
+ //request.addProperty("StudentName",edt_studName.getText().toString());
+ request.addProperty("PIN",str_confirmoldpin);//string
+
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Login.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ // SendStudentRequestforManager{Lead_Id=MF00993; Email_id=testing; Student_MobileNo=9689240475; Message=testing; }
+
+ Log.d("tag","Request UpdatePinPassword="+request.toString());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ // Log.d("soapResponseyyyyyyy",envelope.getResponse().toString());
+
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("tag","soapRespons UpdatePinPassword="+response.toString());
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+
+ }
+
+ /* public void AsyncTask_ValidateUserPIN()
+ {
+
+ final ProgressDialog progressDialog;
+ progressDialog = new ProgressDialog(com.dfcovid.Activity_confirmoldpin.this);
+ progressDialog.setMessage("Loading....");
+ progressDialog.setTitle("Please wait fetching Details....");
+ progressDialog.setCancelable(false);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.show();
+
+
+
+ Class_loginPinrequest request = new Class_loginPinrequest();
+ request.setUsername(str_username);
+ request.setPIN(str_confirmoldpin);
+
+
+ Interface_userservice userService;
+ userService = Class_ApiUtils.getUserService();
+ Call call = userService.Post_ValidateUserPIN(request);
+
+ Log.e("TAG", "pinreq : " + new Gson().toJson(request));
+
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response)
+ {
+ Log.e("response", response.toString());
+
+ Log.e("TAG", "pinRes: " + new Gson().toJson(response));
+ Log.e("tag","PinResponse body"+ String.valueOf(response.body()));
+ // DefaultResponse error1 = ErrorUtils.parseError(response);
+ *//* Log.e("response new:",error1.getMsg());
+ Log.e("response new status:", String.valueOf(error1.getstatus()));*//*
+
+ Class_normalloginresponse user_object;
+ user_object = (Class_normalloginresponse) response.body();
+
+ if (response.isSuccessful())
+ {
+
+ progressDialog.dismiss();
+
+ String str_userstatus=user_object.getMessage().trim().toString();
+ if(str_userstatus.equalsIgnoreCase("Success"))
+ {
+
+ Intent i = new Intent(com.dfcovid.Activity_confirmoldpin.this, com.dfcovid.Activity_setpin.class);
+ i.putExtra("Key_confirmoldpin", "yes");
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ startActivity(i);
+ finish();
+
+
+ }
+ else{
+
+ Toast toast = Toast.makeText(getApplicationContext(), "Wrong PIN", Toast.LENGTH_LONG);
+ TextView toastMessage = (TextView) toast.getView().findViewById(android.R.id.message);
+ toastMessage.setTextColor(Color.RED);
+ toast.show();
+ }
+
+
+
+ } else {
+
+
+ DefaultResponse error = ErrorUtils.parseError(response);
+ // … and use it to show error information
+
+ // … or just log the issue like we’re doing :)
+ Log.d("responseerror", error.getMsg());
+
+ Toast.makeText(com.dfcovid.Activity_confirmoldpin.this, "Wrong PIN", Toast.LENGTH_SHORT).show();
+ progressDialog.dismiss();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t)
+ {
+
+ Log.d("retrofiteerror", t.toString());
+ Toast.makeText(com.dfcovid.Activity_confirmoldpin.this, t.getMessage(), Toast.LENGTH_SHORT).show();
+ }
+ });// end of call
+
+ }*/
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Activity_confirmpin.java b/app/src/main/java/com/leadcampusapp/Activity_confirmpin.java
new file mode 100644
index 0000000..20a9db3
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Activity_confirmpin.java
@@ -0,0 +1,705 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+import com.leadcampusapp.remote.Interface_userservice;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+//import com.covid.R;
+
+public class Activity_confirmpin extends AppCompatActivity {
+
+
+ Button submit_pin_bt,reset_pin_bt;
+ EditText otp1_et,otp2_et,otp3_et,otp4_et;
+
+
+
+ public static final String sharedpreference_usercredential = "sharedpreferencebook_usercredential";
+ public static final String KeyValue_userid = "KeyValue_userid";
+ public static final String KeyValue_username = "KeyValue_username";
+ public static final String KeyValue_user_mailid = "KeyValue_user_mailid";
+ public static final String KeyValue_usercategory = "KeyValue_usercategory";
+ public static final String KeyValue_usercellno = "KeyValue_usercellno";
+ public static final String KeyValue_isuser_setpin = "KeyValue_isuser_setpin";
+
+
+ SharedPreferences sharedpreference_usercredential_Obj;
+ SharedPreferences.Editor editor_obj;
+
+ public static final String sharedpreference_setpincredential = "sharedpreference_pincredential";
+ public static final String KeyValue_setpin = "KeyValue_setpin";
+ SharedPreferences sharedpreference_setpin_Obj;
+ String str_setpin,str_userID;
+
+
+ Class_InternetDectector internetDectector;
+ Boolean isInternetPresent = false;
+ EditText pin1masked_et,pin2masked_et,pin3masked_et,pin4masked_et;
+
+ SharedPreferences shardpref_S_obj;
+ SharedPreferences.Editor editor_S;
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefID_RegID = "prefid_regid"; //
+ public static final String PrefID_Role = "prefid_role";
+
+ String str_RegID,str_role;
+
+ public static final String PREFBook_PM = "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_pm_username = "prefid_pm_username"; //
+
+ SharedPreferences shardprefPM_obj;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_confirmpin);
+
+ submit_pin_bt =(Button) findViewById(R.id.submit_pin_bt);
+ reset_pin_bt =(Button) findViewById(R.id.reset_pin_bt);
+ otp1_et=(EditText) findViewById(R.id.otp1_et);
+ otp2_et=(EditText) findViewById(R.id.otp2_et);
+ otp3_et=(EditText) findViewById(R.id.otp3_et);
+ otp4_et=(EditText) findViewById(R.id.otp4_et);
+
+ pin1masked_et=(EditText)findViewById(R.id.pin1masked_et);
+ pin2masked_et=(EditText)findViewById(R.id.pin2masked_et);
+ pin3masked_et=(EditText)findViewById(R.id.pin3masked_et);
+ pin4masked_et=(EditText)findViewById(R.id.pin4masked_et);
+
+
+ otp1_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp2_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp3_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp4_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+
+ sharedpreference_setpin_Obj=getSharedPreferences(sharedpreference_setpincredential, Context.MODE_PRIVATE);
+ str_setpin = sharedpreference_setpin_Obj.getString(KeyValue_setpin, "").trim();
+
+
+ sharedpreference_usercredential_Obj=getSharedPreferences(sharedpreference_usercredential, Context.MODE_PRIVATE);
+ /* str_userID= sharedpreference_usercredential_Obj.getString(KeyValue_userid, "").trim();
+ Log.e("confirmpinuserid",str_userID);*/
+
+ shardpref_S_obj= getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ shardpref_S_obj.getString(PrefID_Role, "").trim();
+ str_role = shardpref_S_obj.getString(PrefID_Role, "").trim();
+ Log.e("tag","str_role="+str_role);
+ shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ str_RegID = shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ Log.e("tag","str_RegID="+str_RegID);
+
+
+
+ otp1_et.requestFocus();
+
+ otp1_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp1_et.getText().toString().length()>=1)
+ {
+ pin1masked_et.setVisibility(View.VISIBLE);
+ otp1_et.setVisibility(View.GONE);
+ pin1masked_et.setText("*");
+
+ otp2_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin1masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin1masked_et.getText().toString().length()==0)
+ {
+ pin1masked_et.setVisibility(View.GONE);
+ otp1_et.setVisibility(View.VISIBLE);
+ otp1_et.setText("");
+ otp1_et.requestFocus();
+ }
+
+ }
+ });
+
+
+
+
+
+ otp2_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp2_et.getText().toString().length()>=1)
+ {
+
+ pin2masked_et.setVisibility(View.VISIBLE);
+ otp2_et.setVisibility(View.GONE);
+ pin2masked_et.setText("*");
+
+
+ otp3_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin2masked_et.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin2masked_et.getText().toString().length()==0)
+ {
+ pin2masked_et.setVisibility(View.GONE);
+ otp2_et.setVisibility(View.VISIBLE);
+ otp2_et.setText("");
+ otp2_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+ otp3_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp3_et.getText().toString().length()>=1)
+ {
+ pin3masked_et.setVisibility(View.VISIBLE);
+ otp3_et.setVisibility(View.GONE);
+ pin3masked_et.setText("*");
+
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+ pin3masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin3masked_et.getText().toString().length()==0)
+ {
+ pin3masked_et.setVisibility(View.GONE);
+ otp3_et.setVisibility(View.VISIBLE);
+ otp3_et.setText("");
+ otp3_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+ otp4_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp4_et.getText().toString().length()>=1)
+ {
+
+ pin4masked_et.setVisibility(View.VISIBLE);
+ otp4_et.setVisibility(View.GONE);
+ pin4masked_et.setText("*");
+
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ }
+ });
+
+
+
+ pin4masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin4masked_et.getText().toString().length()==0)
+ {
+ pin4masked_et.setVisibility(View.GONE);
+ otp4_et.setVisibility(View.VISIBLE);
+ otp4_et.setText("");
+ otp4_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+
+
+ submit_pin_bt.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ if(validation()) {
+
+ String str_confirmpin = otp1_et.getText().toString() +
+ otp2_et.getText().toString() +
+ otp3_et.getText().toString() +
+ otp4_et.getText().toString();
+
+ if (str_setpin.equals(str_confirmpin))
+ {
+
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+ if (isInternetPresent) {
+
+ //AsyncTask_setthepin();
+ UpdatePinPassword updatePinPassword = new UpdatePinPassword(Activity_confirmpin.this);
+ updatePinPassword.execute();
+ }
+
+
+ } else{
+ Toast.makeText(getApplicationContext(),"PIN doesn't match", Toast.LENGTH_LONG).show();
+ }
+
+ }
+ }
+ });
+
+
+ reset_pin_bt.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+ onBackPressed();
+ }
+ });
+
+
+ }//On create()
+
+
+
+
+ public boolean validation()
+ {
+ boolean b_otp1, b_otp2, b_otp3, b_otp4;
+ b_otp1=b_otp2=b_otp3=b_otp4=true;
+
+
+
+ if (otp1_et.getText().toString().trim().length() == 0) {
+ otp1_et.setError("Enter OTP");
+ otp1_et.requestFocus();
+ b_otp1 = false;
+ }
+
+ if (otp2_et.getText().toString().trim().length() == 0) {
+ otp2_et.setError("Enter OTP");
+ otp2_et.requestFocus();
+ b_otp2 = false;
+ }
+
+ if (otp3_et.getText().toString().trim().length() == 0) {
+ otp3_et.setError("Enter OTP");
+ otp3_et.requestFocus();
+ b_otp3 = false;
+ }
+ if(otp4_et.getText().toString().trim().length()==0)
+ {
+ otp4_et.setError("Enter OTP");
+ otp4_et.requestFocus();
+ b_otp4=false;
+ }
+
+ return (b_otp1 && b_otp2 && b_otp3&& b_otp4);
+ }
+
+
+
+ @Override
+ public void onBackPressed()
+ {
+
+ /*AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_confirmpin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure want to go back");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+ Intent i = new Intent(Activity_confirmpin.this, Activity_setpin.class);
+ startActivity(i);
+ finish();
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();*/
+ Intent startMain = new Intent(Intent.ACTION_MAIN);
+ startMain.addCategory(Intent.CATEGORY_HOME);
+ startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(startMain);
+ }
+
+
+ public class UpdatePinPassword extends AsyncTask {
+
+ Context context;
+ //AlertDialog alertDialog;
+
+ //private ProgressBar progressBar;
+
+ private ProgressDialog progressDialog;
+
+ UpdatePinPassword(Context ctx) {
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapPrimitive doInBackground(String... params) {
+
+ SoapPrimitive response = UpdatePinPassword();
+
+ //Log.d("ResponseCommitsss", response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+
+
+
+ if(result.toString().equalsIgnoreCase("Updated.")){
+ // dialog.dismiss();
+ Toast.makeText(Activity_confirmpin.this, "PIN Updated Successfully", Toast.LENGTH_SHORT).show();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "yes");
+ editor_obj.commit();
+
+ if(str_role.equalsIgnoreCase("Student")) {
+ Intent i = new Intent(Activity_confirmpin.this, HomeActivity.class);
+ startActivity(i);
+ finish();
+ }else if(str_role.equalsIgnoreCase("Manager")){
+ Intent i = new Intent(Activity_confirmpin.this, PMHomeActivity.class);
+ startActivity(i);
+ finish();
+ }else if(str_role.equalsIgnoreCase("Principal")){
+ Intent i = new Intent(Activity_confirmpin.this, PrincipleHomeActivity.class);
+ startActivity(i);
+ finish();
+ }
+ }else{
+
+ progressDialog.dismiss();
+ Toast.makeText(Activity_confirmpin.this, "WS:Error", Toast.LENGTH_SHORT).show();
+
+ }
+
+ progressDialog.dismiss();
+ }
+
+ }
+
+
+ private SoapPrimitive UpdatePinPassword()
+ {
+
+ String METHOD_NAME = "UpdatePinPassword";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/UpdatePinPassword";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("User_Id", str_RegID);//string
+ //request.addProperty("StudentName",edt_studName.getText().toString());
+ request.addProperty("PIN",str_setpin);//string
+ request.addProperty("User_Type",str_role);//string
+ request.addProperty("Set_Type","");// string
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Login.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ // SendStudentRequestforManager{Lead_Id=MF00993; Email_id=testing; Student_MobileNo=9689240475; Message=testing; }
+
+ Log.d("tag","Request UpdatePinPassword="+request.toString());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ // Log.d("soapResponseyyyyyyy",envelope.getResponse().toString());
+
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+ Log.d("tag","soapRespons UpdatePinPassword="+response.toString());
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+
+ }
+
+ /*public void AsyncTask_setthepin()
+ {
+
+ final ProgressDialog progressDialog;
+ progressDialog = new ProgressDialog(Activity_confirmpin.this);
+ progressDialog.setMessage("Loading....");
+ progressDialog.setTitle("Please wait Updating PIN....");
+ progressDialog.setCancelable(false);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.show();
+
+
+
+ Class_pinrequest request = new Class_pinrequest();
+ request.setUser_Id(str_userID);
+ request.setPIN(str_setpin);
+
+
+ Interface_userservice userService;
+ userService = Class_ApiUtils.getUserService();
+ Call call = userService.Post_UpdateUserPIN(request);
+
+ Log.e("TAG", "pinreq : " + new Gson().toJson(request));
+
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response)
+ {
+ Log.e("response", response.toString());
+
+ Log.e("TAG", "pinRes: " + new Gson().toJson(response));
+ Log.e("tag","PinResponse body"+ String.valueOf(response.body()));
+
+ // "Status": true,
+ // "Message": "Success",
+ *//*"Status": false,
+ "Message": "Invalid Username"*//*
+
+ Class_normalloginresponse user_object;
+ user_object = (Class_normalloginresponse) response.body();
+
+ if (response.isSuccessful()) {
+
+ if (user_object.getMessage().equalsIgnoreCase("Success"))
+ {
+
+ progressDialog.dismiss();
+
+ Toast.makeText(Activity_confirmpin.this, "PIN Updated Successfully", Toast.LENGTH_SHORT).show();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "yes");
+ editor_obj.commit();
+
+ Intent i = new Intent(Activity_confirmpin.this, Dashboard_Activity.class);
+ startActivity(i);
+ finish();
+
+ }else{
+
+ progressDialog.dismiss();
+ Toast.makeText(Activity_confirmpin.this, "WS:Error", Toast.LENGTH_SHORT).show();
+
+ }
+ } else {
+
+
+ DefaultResponse error = ErrorUtils.parseError(response);
+ // … and use it to show error information
+
+ // … or just log the issue like we’re doing :)
+ Log.d("responseerror", error.getMsg());
+
+ Toast.makeText(Activity_confirmpin.this, error.getMsg(), Toast.LENGTH_SHORT).show();
+ progressDialog.dismiss();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t)
+ {
+
+ Log.d("retrofiteerror", t.toString());
+ Toast.makeText(Activity_confirmpin.this, t.getMessage(), Toast.LENGTH_SHORT).show();
+ }
+ });// end of call
+
+ }*/
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Activity_pinlogin.java b/app/src/main/java/com/leadcampusapp/Activity_pinlogin.java
new file mode 100644
index 0000000..25b3738
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Activity_pinlogin.java
@@ -0,0 +1,988 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+//import br.com.sapereaude.maskedEditText.MaskedEditText;
+
+//import com.covid.R;
+
+public class Activity_pinlogin extends AppCompatActivity
+{
+
+
+ public static final String sharedpreference_usercredential = "sharedpreferencebook_usercredential";
+ public static final String KeyValue_userid = "KeyValue_userid";
+ public static final String KeyValue_username = "KeyValue_username";
+ public static final String KeyValue_user_mailid = "KeyValue_user_mailid";
+ public static final String KeyValue_usercategory = "KeyValue_usercategory";
+ public static final String KeyValue_usercellno = "KeyValue_usercellno";
+ public static final String KeyValue_isuser_setpin = "KeyValue_isuser_setpin";
+ public static final String KeyValue_isuser_changepin = "KeyValue_isuser_changepin";
+ public static final String KeyValue_loggedfromgoogle = "KeyValue_loggedfromgoogle";
+
+
+ SharedPreferences sharedpreference_usercredential_Obj;
+ SharedPreferences.Editor editor_obj;
+
+ TextView forgotpin_tv;
+ //EditText otp1_et,otp2_et,otp3_et,otp4_et;
+ EditText otp1_et,otp2_et,otp3_et,otp4_et;
+ EditText pin1masked_et,pin2masked_et,pin3masked_et,pin4masked_et;
+
+ Class_InternetDectector internetDectector;
+ Boolean isInternetPresent = false;
+
+ String str_userID,str_username,str_loginpin,str_isuser_loggedfromgoogle="";
+ String str_pin1,str_pin2,str_pin3,str_pin4;
+
+ public static final String PREFBook_PM = "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_pm_username = "prefid_pm_username"; //
+
+ SharedPreferences shardprefPM_obj;
+
+ SharedPreferences shardpref_S_obj;
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefId_S_Username = "prefid_susername";
+ public static final String PrefID_Role = "prefid_role";
+
+ String str_role;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_otp);
+ forgotpin_tv=(TextView)findViewById(R.id.forgotpin_tv);
+ otp1_et= (EditText) findViewById(R.id.otp1_et);
+ otp2_et=(EditText) findViewById(R.id.otp2_et);
+ otp3_et=(EditText) findViewById(R.id.otp3_et);
+ otp4_et=(EditText) findViewById(R.id.otp4_et);
+ pin1masked_et=(EditText)findViewById(R.id.pin1masked_et);
+ pin2masked_et=(EditText)findViewById(R.id.pin2masked_et);
+ pin3masked_et=(EditText)findViewById(R.id.pin3masked_et);
+ pin4masked_et=(EditText)findViewById(R.id.pin4masked_et);
+
+
+ otp1_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp2_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp3_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp4_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
+
+ str_pin1=str_pin2=str_pin3=str_pin4="";
+
+ sharedpreference_usercredential_Obj=getSharedPreferences(sharedpreference_usercredential, Context.MODE_PRIVATE);
+ /* str_userID= sharedpreference_usercredential_Obj.getString(KeyValue_userid, "").trim();
+ str_username= sharedpreference_usercredential_Obj.getString(KeyValue_username, "").trim();
+ str_isuser_loggedfromgoogle=sharedpreference_usercredential_Obj.getString(KeyValue_loggedfromgoogle, "").trim();
+*/
+ // shardprefPM_obj_count = getSharedPreferences(PREFBook_PM_Count, Context.MODE_PRIVATE);
+
+ shardpref_S_obj= getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ shardpref_S_obj.getString(PrefID_Role, "").trim();
+ str_role = shardpref_S_obj.getString(PrefID_Role, "").trim();
+ Log.e("str_role:", str_role);
+
+ if(str_role.equalsIgnoreCase("Student")) {
+
+ //otp4_et
+ shardpref_S_obj = getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+
+ shardpref_S_obj.getString(PrefId_S_Username, "").trim();
+ str_username = shardpref_S_obj.getString(PrefId_S_Username, "").trim();
+ Log.d("str_username", str_username);
+ }else {
+ shardprefPM_obj = getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+ str_username = shardprefPM_obj.getString(PrefID_pm_username, "").trim();
+ Log.e("str_pm_username:", str_username);
+
+ }
+
+ otp1_et.requestFocus();
+
+ otp1_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp1_et.getText().toString().length()>=1)
+ {
+
+
+ pin1masked_et.setVisibility(View.VISIBLE);
+ otp1_et.setVisibility(View.GONE);
+ pin1masked_et.setText("*");
+
+
+ otp2_et.requestFocus();
+ otp4_et.setText("");
+ }
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+ // Toast.makeText(getApplicationContext(),"afterTextchanged",Toast.LENGTH_SHORT).show();
+
+ }
+ });
+
+
+
+
+
+ pin1masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin1masked_et.getText().toString().length()==0)
+ {
+
+ pin1masked_et.setVisibility(View.GONE);
+ otp1_et.setVisibility(View.VISIBLE);
+ otp1_et.setText("");
+ otp4_et.setText("");
+ otp1_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+
+ otp2_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp2_et.getText().toString().length()>=1)
+ {
+ pin2masked_et.setVisibility(View.VISIBLE);
+ otp2_et.setVisibility(View.GONE);
+ pin2masked_et.setText("*");
+
+ otp3_et.requestFocus();
+ otp4_et.setText("");
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+
+
+
+ pin2masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin2masked_et.getText().toString().length()==0)
+ {
+
+ pin2masked_et.setVisibility(View.GONE);
+ otp2_et.setVisibility(View.VISIBLE);
+ otp2_et.setText("");
+ otp4_et.setText("");
+ otp2_et.requestFocus();
+ }
+
+ }
+ });
+
+
+
+
+
+
+
+
+
+ otp3_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp3_et.getText().toString().length()>=1)
+ {
+
+
+ pin3masked_et.setVisibility(View.VISIBLE);
+ otp3_et.setVisibility(View.GONE);
+ pin3masked_et.setText("*");
+
+
+
+
+ otp4_et.requestFocus();
+ otp4_et.setText("");
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin3masked_et.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin3masked_et.getText().toString().length()==0)
+ {
+
+ pin3masked_et.setVisibility(View.GONE);
+ otp3_et.setVisibility(View.VISIBLE);
+ otp3_et.setText("");
+ otp4_et.setText("");
+ otp3_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+ otp4_et.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count)
+ {
+
+ if(s.toString().trim().isEmpty())
+ {
+
+
+ }
+ else
+ {
+
+ if(validation())
+ {
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+ if (isInternetPresent)
+ {
+
+ str_loginpin=otp1_et.getText().toString()+
+ otp2_et.getText().toString()+
+ otp3_et.getText().toString()+
+ otp4_et.getText().toString();
+
+
+ pin4masked_et.setVisibility(View.VISIBLE);
+ otp4_et.setVisibility(View.GONE);
+ pin4masked_et.setText("*");
+
+
+
+
+ /*str_loginpin=str_pin1.trim()+
+ str_pin2.trim()+
+ str_pin3.trim()+
+ otp4_et.getText().toString();*/
+
+ UpdatePinPassword updatePinPassword=new UpdatePinPassword(Activity_pinlogin.this);
+ updatePinPassword.execute();
+ // AsyncTask_ValidateUserPIN();
+
+ }
+
+
+ }
+
+
+ }
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+
+ }
+ });
+
+
+
+
+ pin4masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin4masked_et.getText().toString().length()==0)
+ {
+
+ pin4masked_et.setVisibility(View.GONE);
+ otp4_et.setVisibility(View.VISIBLE);
+ otp4_et.setText("");
+ otp4_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ forgotpin_tv.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_pinlogin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.forgotpin);
+ dialog.setMessage("You need to relogin to the application for set new PIN.\n" +
+ "Do you want to proceed");
+
+ dialog.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+ if (isInternetPresent)
+ {
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "");
+ editor_obj.commit();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_changepin, "");
+ editor_obj.commit();
+
+ if(str_isuser_loggedfromgoogle.isEmpty())
+ {
+
+ }else{
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_loggedfromgoogle, "yes");
+ editor_obj.commit();
+ }
+
+ Intent i = new Intent(Activity_pinlogin.this, LoginActivity.class);
+ startActivity(i);
+ finish();
+
+ }
+ else{
+
+ Toast.makeText(Activity_pinlogin.this, "Kindly connect to internet", Toast.LENGTH_SHORT).show();
+ }
+ }
+ })
+ .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+ }
+ });
+
+ }//On create
+
+
+
+
+ public boolean validation()
+ {
+ boolean b_otp1, b_otp2, b_otp3, b_otp4;
+ b_otp1=b_otp2=b_otp3=b_otp4=true;
+
+
+
+ if (otp1_et.getText().toString().trim().length() == 0) {
+ otp1_et.setError("Enter OTP");
+ otp1_et.requestFocus();
+ b_otp1 = false;
+ }
+
+ if (otp2_et.getText().toString().trim().length() == 0) {
+ otp2_et.setError("Enter OTP");
+ otp2_et.requestFocus();
+ b_otp2 = false;
+ }
+
+ if (otp3_et.getText().toString().trim().length() == 0) {
+ otp3_et.setError("Enter OTP");
+ otp3_et.requestFocus();
+ b_otp3 = false;
+ }
+
+
+ return (b_otp1 && b_otp2 && b_otp3 );
+ }
+
+
+
+
+ public class UpdatePinPassword extends AsyncTask {
+
+ Context context;
+ //AlertDialog alertDialog;
+
+ //private ProgressBar progressBar;
+
+ private ProgressDialog progressDialog;
+
+ UpdatePinPassword(Context ctx) {
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(String... params) {
+
+ SoapObject response = UpdatePinPassword();
+
+ //Log.d("ResponseCommitsss", response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+
+
+
+ String str_result=result.getProperty("Status").toString();
+ if(str_result.equalsIgnoreCase("Success")){
+ // dialog.dismiss();
+ // Toast.makeText(context,"Your Request sent to the manager",Toast.LENGTH_LONG).show();
+ Toast.makeText(Activity_pinlogin.this, "PIN Success", Toast.LENGTH_SHORT).show();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "yes");
+ editor_obj.commit();
+
+ if(str_role.equalsIgnoreCase("Student")) {
+ Intent i = new Intent(Activity_pinlogin.this, HomeActivity.class);
+ startActivity(i);
+ finish();
+ }else if(str_role.equalsIgnoreCase("Manager")){
+ Intent i = new Intent(Activity_pinlogin.this, PMHomeActivity.class);
+ startActivity(i);
+ finish();
+ }else if(str_role.equalsIgnoreCase("Principal")){
+ Intent i = new Intent(Activity_pinlogin.this, PrincipleHomeActivity.class);
+ startActivity(i);
+ finish();
+ }
+ }
+ else{
+
+ Toast toast = Toast.makeText(getApplicationContext(), "Wrong PIN", Toast.LENGTH_LONG);
+ TextView toastMessage = (TextView) toast.getView().findViewById(android.R.id.message);
+ toastMessage.setTextColor(Color.RED);
+ toast.show();
+ }
+
+ progressDialog.dismiss();
+ }
+
+ }
+
+
+ private SoapObject UpdatePinPassword()
+ {
+
+ String METHOD_NAME = "ValidateLogin_PIN";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/ValidateLogin_PIN";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("Username", str_username);//string
+ //request.addProperty("StudentName",edt_studName.getText().toString());
+ request.addProperty("PIN",str_loginpin);//string
+
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Login.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ // SendStudentRequestforManager{Lead_Id=MF00993; Email_id=testing; Student_MobileNo=9689240475; Message=testing; }
+
+ Log.e("tag","Request ValidateLogin_PIN="+request.toString());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ // Log.d("soapResponseyyyyyyy",envelope.getResponse().toString());
+
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("tag","soapRespons ValidateLogin_PIN="+response.toString());
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+
+ }
+
+ /*public void AsyncTask_ValidateUserPIN()
+ {
+
+ final ProgressDialog progressDialog;
+ progressDialog = new ProgressDialog(com.dfcovid.Activity_pinlogin.this);
+ progressDialog.setMessage("Loading....");
+ progressDialog.setTitle("Please wait fetching Details....");
+ progressDialog.setCancelable(false);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.show();
+
+
+
+ Class_loginPinrequest request = new Class_loginPinrequest();
+ request.setUsername(str_username);
+ request.setPIN(str_loginpin);
+
+
+ Interface_userservice userService;
+ userService = Class_ApiUtils.getUserService();
+ Call call = userService.Post_ValidateUserPIN(request);
+
+ Log.e("TAG", "pinreq : " + new Gson().toJson(request));
+
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response)
+ {
+ Log.e("response", response.toString());
+
+ Log.e("TAG", "pinRes: " + new Gson().toJson(response));
+ Log.e("tag","PinResponse body"+ String.valueOf(response.body()));
+ // DefaultResponse error1 = ErrorUtils.parseError(response);
+ *//* Log.e("response new:",error1.getMsg());
+ Log.e("response new status:", String.valueOf(error1.getstatus()));*//*
+
+ Class_normalloginresponse user_object;
+ user_object = (Class_normalloginresponse) response.body();
+
+ if (response.isSuccessful())
+ {
+
+ progressDialog.dismiss();
+
+ String str_userstatus=user_object.getMessage().trim().toString();
+ if(str_userstatus.equalsIgnoreCase("Success"))
+ {
+ Toast.makeText(com.dfcovid.Activity_pinlogin.this, "PIN Success", Toast.LENGTH_SHORT).show();
+
+ Intent i = new Intent(com.dfcovid.Activity_pinlogin.this, Dashboard_Activity.class);
+ startActivity(i);
+ finish();
+ }
+ else{
+
+ Toast toast = Toast.makeText(getApplicationContext(), "Wrong PIN", Toast.LENGTH_LONG);
+ TextView toastMessage = (TextView) toast.getView().findViewById(android.R.id.message);
+ toastMessage.setTextColor(Color.RED);
+ toast.show();
+ }
+
+
+
+ } else {
+
+
+ DefaultResponse error = ErrorUtils.parseError(response);
+ // … and use it to show error information
+
+ // … or just log the issue like we’re doing :)
+ Log.d("responseerror", error.getMsg());
+
+ Toast.makeText(com.dfcovid.Activity_pinlogin.this, "Wrong PIN", Toast.LENGTH_SHORT).show();
+ progressDialog.dismiss();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t)
+ {
+
+ Log.d("retrofiteerror", t.toString());
+ Toast.makeText(com.dfcovid.Activity_pinlogin.this, t.getMessage(), Toast.LENGTH_SHORT).show();
+ }
+ });// end of call
+
+ }*/
+
+
+
+
+ @Override
+ public void onBackPressed()
+ {
+ Intent startMain = new Intent(Intent.ACTION_MAIN);
+ startMain.addCategory(Intent.CATEGORY_HOME);
+ startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(startMain);
+
+ /*AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_pinlogin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure want to Exit");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ Intent i = new Intent(getApplicationContext(), LoginActivity.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ startActivity(i);
+ finish();
+
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.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.home_menu, menu);
+ getMenuInflater().inflate(R.menu.dashboard_menu, 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();
+ //noinspection SimplifiableIfStatement
+
+ if(id==R.id.changepin)
+ {
+
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_pinlogin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure you want to Change PIN?");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_setpin, "");
+ editor_obj.commit();
+
+ editor_obj = sharedpreference_usercredential_Obj.edit();
+ editor_obj.putString(KeyValue_isuser_changepin, "yes");
+ editor_obj.commit();
+
+ Intent i = new Intent(getApplicationContext(), Activity_confirmoldpin.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ startActivity(i);
+ finish();
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+ return true;
+ }
+ /*else if(id==R.id.aboutus)
+ {
+
+
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+
+ if (isInternetPresent)
+ {
+ Intent i = new Intent(Activity_pinlogin.this, Activity_HelpLineCenter.class);
+ i.putExtra("flag","from_Activity_pinlogin");
+ i.putExtra("loggedinflag","loggegdin");
+ startActivity(i);
+ finish();
+ return true;
+ }
+ else{
+ Toast.makeText(getApplicationContext(), "No Internet", Toast.LENGTH_SHORT).show();
+ }
+ }*//*
+
+
+
+
+
+
+
+
+ *//*if (id == R.id.logout)
+ {
+ // Toast.makeText(CalenderActivity.this, "Action clicked", Toast.LENGTH_LONG).show();
+ internetDectector = new Class_InternetDectector(getApplicationContext());
+ isInternetPresent = internetDectector.isConnectingToInternet();
+
+ if (isInternetPresent)
+ {
+
+
+
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_pinlogin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure want to Logout?");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ *//**//* SaveSharedPreference.setUserName(Activity_HomeScreen.this, "");
+
+ Intent i = new Intent(getApplicationContext(), MainActivity.class);
+ i.putExtra("Key_Logout", "yes");
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ startActivity(i);
+ finish();*//**//*
+
+
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+
+ //}
+ } else {
+ Toast.makeText(getApplicationContext(), "No Internet", Toast.LENGTH_SHORT).show();
+ }
+ return true;
+ }*/
+
+
+ return super.onOptionsItemSelected(item);
+ }
+
+
+
+
+
+
+}//end of class
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Activity_setpin.java b/app/src/main/java/com/leadcampusapp/Activity_setpin.java
new file mode 100644
index 0000000..1332f3a
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Activity_setpin.java
@@ -0,0 +1,429 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.InputType;
+import android.text.TextWatcher;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+//import com.covid.R;
+
+public class Activity_setpin extends AppCompatActivity {
+
+
+ public static final String sharedpreference_usercredential = "sharedpreferencebook_usercredential";
+ public static final String KeyValue_userid = "KeyValue_userid";
+ public static final String KeyValue_username = "KeyValue_username";
+ public static final String KeyValue_user_mailid = "KeyValue_user_mailid";
+ public static final String KeyValue_usercategory = "KeyValue_usercategory";
+ public static final String KeyValue_usercellno = "KeyValue_usercellno";
+ public static final String KeyValue_isuser_setpin = "KeyValue_isuser_setpin";
+
+
+ SharedPreferences sharedpreference_usercredential_Obj;
+
+
+ public static final String sharedpreference_setpincredential = "sharedpreference_pincredential";
+ public static final String KeyValue_setpin = "KeyValue_setpin";
+ SharedPreferences sharedpreference_setpin_Obj;
+ SharedPreferences.Editor editor_obj;
+
+ Button confirm_pin_bt;
+ EditText otp1_et,otp2_et,otp3_et,otp4_et;
+ TextView title_tv;
+ EditText pin1masked_et,pin2masked_et,pin3masked_et,pin4masked_et;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_setpin);
+
+ confirm_pin_bt =(Button) findViewById(R.id.confirm_pin_bt);
+ otp1_et=(EditText) findViewById(R.id.otp1_et);
+ otp2_et=(EditText) findViewById(R.id.otp2_et);
+ otp3_et=(EditText) findViewById(R.id.otp3_et);
+ otp4_et=(EditText) findViewById(R.id.otp4_et);
+ title_tv=(TextView)findViewById(R.id.title_tv);
+
+ pin1masked_et=(EditText)findViewById(R.id.pin1masked_et);
+ pin2masked_et=(EditText)findViewById(R.id.pin2masked_et);
+ pin3masked_et=(EditText)findViewById(R.id.pin3masked_et);
+ pin4masked_et=(EditText)findViewById(R.id.pin4masked_et);
+
+ otp1_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp2_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp3_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+ otp4_et.setInputType(InputType.TYPE_CLASS_NUMBER);
+
+ sharedpreference_setpin_Obj=getSharedPreferences(sharedpreference_setpincredential, Context.MODE_PRIVATE);
+
+
+
+
+ Intent myIntent = getIntent();
+
+ if(myIntent!=null)
+ {
+
+ String str_fromconfirmoldpin="no";
+ str_fromconfirmoldpin = myIntent.getStringExtra("Key_confirmoldpin");
+ if(str_fromconfirmoldpin!=null && (str_fromconfirmoldpin.equalsIgnoreCase("yes")))
+ {
+ title_tv.setText("Set new PIN");
+ }
+ }
+
+
+
+
+ otp1_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp1_et.getText().toString().length()>=1)
+ {
+
+ pin1masked_et.setVisibility(View.VISIBLE);
+ otp1_et.setVisibility(View.GONE);
+ pin1masked_et.setText("*");
+
+ otp2_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+
+ pin1masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin1masked_et.getText().toString().length()==0)
+ {
+ pin1masked_et.setVisibility(View.GONE);
+ otp1_et.setVisibility(View.VISIBLE);
+ otp1_et.setText("");
+ otp1_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+ otp2_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp2_et.getText().toString().length()>=1)
+ {
+ pin2masked_et.setVisibility(View.VISIBLE);
+ otp2_et.setVisibility(View.GONE);
+ pin2masked_et.setText("*");
+
+ otp3_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+
+
+ pin2masked_et.addTextChangedListener(new TextWatcher()
+ {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin2masked_et.getText().toString().length()==0)
+ {
+ pin2masked_et.setVisibility(View.GONE);
+ otp2_et.setVisibility(View.VISIBLE);
+ otp2_et.setText("");
+ otp2_et.requestFocus();
+ }
+ }
+ });
+
+
+
+ otp3_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp3_et.getText().toString().length()>=1)
+ {
+
+ pin3masked_et.setVisibility(View.VISIBLE);
+ otp3_et.setVisibility(View.GONE);
+ pin3masked_et.setText("*");
+
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+
+ }
+ });
+
+ pin3masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+ if(pin3masked_et.getText().toString().length()==0)
+ {
+ pin3masked_et.setVisibility(View.GONE);
+ otp3_et.setVisibility(View.VISIBLE);
+ otp3_et.setText("");
+ otp3_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+ otp4_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2)
+ {
+
+ if(otp4_et.getText().toString().length()>=1)
+ {
+
+ pin4masked_et.setVisibility(View.VISIBLE);
+ otp4_et.setVisibility(View.GONE);
+ pin4masked_et.setText("*");
+
+ otp4_et.requestFocus();
+ }
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ }
+ });
+
+
+
+ pin4masked_et.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable)
+ {
+
+ if(pin4masked_et.getText().toString().length()==0)
+ {
+ pin4masked_et.setVisibility(View.GONE);
+ otp4_et.setVisibility(View.VISIBLE);
+ otp4_et.setText("");
+ otp4_et.requestFocus();
+ }
+ }
+ });
+
+
+
+
+
+ confirm_pin_bt.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+
+ if(validation())
+ {
+
+ String str_setpin=otp1_et.getText().toString()+
+ otp2_et.getText().toString()+
+ otp3_et.getText().toString()+
+ otp4_et.getText().toString();
+
+
+ editor_obj = sharedpreference_setpin_Obj.edit();
+ editor_obj.putString(KeyValue_setpin,str_setpin);
+ editor_obj.commit();
+
+ Intent i = new Intent(Activity_setpin.this, Activity_confirmpin.class);
+ startActivity(i);
+ finish();
+ }
+ }
+ });
+
+
+ }
+
+
+ public boolean validation()
+ {
+ boolean b_otp1, b_otp2, b_otp3, b_otp4;
+ b_otp1=b_otp2=b_otp3=b_otp4=true;
+
+
+
+ if (otp1_et.getText().toString().trim().length() == 0) {
+ otp1_et.setError("Enter PIN");
+ otp1_et.requestFocus();
+ b_otp1 = false;
+ }
+
+ if (otp2_et.getText().toString().trim().length() == 0) {
+ otp2_et.setError("Enter PIN");
+ otp2_et.requestFocus();
+ b_otp2 = false;
+ }
+
+ if (otp3_et.getText().toString().trim().length() == 0) {
+ otp3_et.setError("Enter PIN");
+ otp3_et.requestFocus();
+ b_otp3 = false;
+ }
+ if(otp4_et.getText().toString().trim().length()==0)
+ {
+ otp4_et.setError("Enter PIN");
+ otp4_et.requestFocus();
+ b_otp4=false;
+ }
+
+ return (b_otp1 && b_otp2 && b_otp3&& b_otp4);
+ }
+
+
+
+ @Override
+ public void onBackPressed()
+ {
+
+ /*AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_setpin.this);
+ dialog.setCancelable(false);
+ dialog.setTitle(R.string.alert);
+ dialog.setMessage("Are you sure want to Exit");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+ finish();
+ System.exit(0);
+
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();*/
+ Intent startMain = new Intent(Intent.ACTION_MAIN);
+ startMain.addCategory(Intent.CATEGORY_HOME);
+ startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(startMain);
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Activity_studentUPI.java b/app/src/main/java/com/leadcampusapp/Activity_studentUPI.java
new file mode 100644
index 0000000..beaab8b
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Activity_studentUPI.java
@@ -0,0 +1,1458 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.gson.Gson;
+import com.leadcampusapp.remote.Class_ApiUtils;
+import com.leadcampusapp.remote.Interface_userservice;
+import com.paytm.pgsdk.PaytmOrder;
+import com.paytm.pgsdk.PaytmPaymentTransactionCallback;
+import com.paytm.pgsdk.TransactionManager;
+
+import org.json.JSONObject;
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Random;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class Activity_studentUPI extends AppCompatActivity {
+ EditText upi;
+ Button payment_bt,summarydetails_bt;
+ String upiId,str_amount,str_vendorname;
+ TextView amount_tv,vendorname_tv;
+
+
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefID_RegID = "prefid_regid"; //
+ public static final String PrefID_SName = "prefid_sname"; //
+ public static final String PrefID_PM_SName = "prefid_pmsname"; //
+ public static final String PrefID_SLeadID = "prefid_sleadid"; //
+ public static final String PrefID_PM_SEmailID = "prefid_pm_semailid"; //
+ public static final String PrefID_SCellNo = "prefid_scellno"; //
+ public static final String PrefID_S_isprofileEdited = "prefid_isprofileEdited";
+ public static final String PrefID_SStudentType = "prefid_sstudentType";
+ public static final String PrefId_S_Gender = "prefid_sgender";
+ public static final String PrefId_S_AcademicId = "prefid_sacademicid";
+
+ SharedPreferences shardpref_S_obj;
+ String str_sname,str_studentregistrationID,str_academicID;
+
+ String str_detailspayment_response,str_feesmaster_response;
+ private ListView summarylist_listview;
+
+ Class_studentpayment_summary[] studentpayment_summary_arryObj;
+ Class_studentpayment_summary studentpayment_summary_obj;
+
+ Class_FeesCatMaster[] feesCatMasters_arryObj;
+ Class_FeesCatMaster feesCatMasters_Obj;
+ String str_feesID,str_feescatID;
+
+ Spinner paymentfor_sp;
+ String str_orderid,str_checksumtoken,str_transcation_token,str_savedpayment_response,str_yyyy_mm_dd;
+ TransactionManager transactionManager;
+ Integer ActivityRequestCode = 2;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_studentupi);
+
+ getSupportActionBar().setDisplayShowCustomEnabled(true);
+ getSupportActionBar().setCustomView(R.layout.actionbar_layout);
+ //getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
+
+ View actionBarView = getSupportActionBar().getCustomView();
+ TextView actionBarTV = (TextView) actionBarView.findViewById(R.id.txt_actionBar);
+ actionBarTV.setText("Lead Payment");
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+ upi = findViewById(R.id.upi);
+ vendorname_tv=findViewById(R.id.vendorname_tv);
+ amount_tv=findViewById(R.id.amount_tv);
+ payment_bt = findViewById(R.id.payment_bt);
+ summarydetails_bt=findViewById(R.id.summarydetails_bt);
+ summarylist_listview=findViewById(R.id.summarylist_listview);
+ paymentfor_sp=findViewById(R.id.paymentfor_sp);
+
+
+ shardpref_S_obj = getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ str_sname = shardpref_S_obj.getString(PrefID_SName, "").trim();
+ vendorname_tv.setText(str_sname);
+
+ str_studentregistrationID=shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ str_academicID=shardpref_S_obj.getString(PrefId_S_AcademicId, "").trim();
+
+ Log.e("academic",shardpref_S_obj.getString(PrefId_S_AcademicId, "").trim());
+ Log.e("studentregID",shardpref_S_obj.getString(PrefID_RegID, "").trim());
+// 41275 7
+
+ // https://mis.leadcampus.org:8084/leadws/Login.asmx/GetstateList?stateid=0&Manager_Id=0
+ //https://mis.leadcampus.org:8084/leadws/managerws.asmx/Get_Fees_Category_Master?Registration_Id=41275&College_ID=0
+ // https://mis.leadcampus.org:8084/leadws/Login.asmx/GetstateList?stateid=0&Manager_Id=0
+
+ //https://mis.leadcampus.org:8084/leadws/managerws.asmx/Get_Fees_Category_Master?Registration_Id=41275&College_ID=0
+ /*int int_feespaid= Integer.parseInt("1.0");
+ Log.e("amount", String.valueOf(int_feespaid));*/
+
+
+// start click
+
+
+ Get_Fees_Category_Master_AsynTask task_fees=new Get_Fees_Category_Master_AsynTask(Activity_studentUPI.this);
+ task_fees.execute();
+
+
+ StudentSummaryDetails_AsynTask task = new StudentSummaryDetails_AsynTask(Activity_studentUPI.this);
+ task.execute();
+
+
+ payment_bt.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+ upiId = upi.getText().toString();
+ str_vendorname=vendorname_tv.getText().toString();
+ str_amount=amount_tv.getText().toString();
+ if (TextUtils.isEmpty(upiId)) {
+ upi.setError("Required");
+ return;
+ }
+
+ //Intent intent = new Intent(getApplicationContext(), StudentUPIPayment.class);
+
+ /*Intent intent = new Intent(getApplicationContext(), StudentUPIPayment.class);
+ intent.putExtra("upi", upiId);
+ intent.putExtra("amount", str_amount);
+ intent.putExtra("vendorname",str_vendorname);
+ intent.putExtra("studentregistrationID",str_studentregistrationID);
+ intent.putExtra("studentfeesID",str_feesID);
+ intent.putExtra("studentfeescatID",str_feescatID);
+ startActivity(intent);*/
+
+ str_orderid=str_checksumtoken=str_transcation_token=str_yyyy_mm_dd="0";
+ fetch_token();
+
+ }
+ });
+
+
+
+
+
+ paymentfor_sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id)
+ {
+ feesCatMasters_Obj = (Class_FeesCatMaster) paymentfor_sp.getSelectedItem();
+ str_feesID = feesCatMasters_Obj.getFees_ID().toString();
+ str_feescatID=feesCatMasters_Obj.getFees_Category_Slno().toString();
+
+
+
+
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+
+
+
+ summarydetails_bt.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+
+ }
+ });
+
+
+ }
+
+
+ @Override
+ public void onBackPressed() {
+
+ {
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_studentUPI.this);
+ dialog.setCancelable(false);
+ dialog.setTitle("LEADCampus");
+ dialog.setMessage("Are you sure want to Exit Payment Module");
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ Intent i = new Intent(Activity_studentUPI.this, HomeActivity.class);
+ startActivity(i);
+ finish();
+ }
+ })
+ .setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ //Action for "Cancel".
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+ //alert.getWindow().setBackgroundDrawableResource(android.R.color.background_dark);
+ }
+ }
+
+
+
+
+ private class Get_Fees_Category_Master_AsynTask extends AsyncTask {
+ ProgressDialog dialog;
+ Context context;
+
+ protected void onPreExecute() {
+ // Log.i(TAG, "onPreExecute---tab2");
+ dialog.setMessage("Please wait,Fetching Fees Details..");
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.show();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ //Log.i(TAG, "onProgressUpdate---tab2");
+ }
+
+
+ @Override
+ protected Void doInBackground(String... params) {
+ Log.i("df", "doInBackground");
+
+ Get_Fees_Category_Master(); //
+ return null;
+ }
+
+ public Get_Fees_Category_Master_AsynTask(Activity_studentUPI activity) {
+ context = activity;
+ dialog = new ProgressDialog(activity);
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+
+ /* if ((this.dialog != null) && this.dialog.isShowing()) {
+ dialog.dismiss();
+
+ }*/
+
+ dialog.dismiss();
+
+
+
+
+ if(str_feesmaster_response.equalsIgnoreCase("Success"))
+ {
+
+
+ ArrayAdapter dataAdapter = new ArrayAdapter(getApplicationContext(), R.layout.spinnercustomstyle,feesCatMasters_arryObj);
+ dataAdapter.setDropDownViewResource(R.layout.spinnercustomstyle);
+ paymentfor_sp.setAdapter(dataAdapter);
+
+
+
+ }else{
+ //alert();
+ }
+
+ }
+
+ }
+
+
+
+
+
+ public void Get_Fees_Category_Master()
+ {
+
+ String URL = Class_URL.URL_Manager.toString().trim();
+
+
+ String METHOD_NAME = "Get_Fees_Category_Master";
+ String Namespace="http://mis.leadcampus.org/", SOAPACTION="http://mis.leadcampus.org/Get_Fees_Category_Master";
+
+//int
+// int
+
+
+ int int_regID= Integer.parseInt(str_studentregistrationID);
+
+ try {
+ str_feesmaster_response="x";
+
+ SoapObject request = new SoapObject(Namespace, METHOD_NAME);
+ request.addProperty("Registration_Id",int_regID );//int
+ request.addProperty("College_ID",0 );//int
+
+//https://mis.leadcampus.org:8084/leadws/managerws.asmx/Get_Fees_Category_Master?Registration_Id=41275&College_ID=0
+ //
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
+
+ try {
+
+ androidHttpTransport.call(SOAPACTION, envelope);
+
+
+ //SoapPrimitive response = (SoapPrimitive ) envelope.getResponse();
+ SoapObject response = (SoapObject) envelope.getResponse();
+ SoapObject response_SO = (SoapObject) response.getProperty(0);
+ Log.e("Feestatus",response_SO.getProperty("Status").toString());
+
+ str_feesmaster_response=response_SO.getProperty("Status").toString();
+ //Log.e("fees", String.valueOf(response.getPropertyCount()));
+ int count =response.getPropertyCount();
+
+ feesCatMasters_arryObj=new Class_FeesCatMaster[count];
+
+ /*anyType{vmGET_FeeCategory_Master=anyType{Fees_Category_Slno=1; fees_category_code=RG;
+Fees_category_description=Registration; Fees=1; Fees_ID=486; academic_year=0; Status=Success; }; }*/
+
+ //Action means my doing
+
+ for(int i=0;i " + t.getMessage());
+ //internet_issue1 = "savepayment";
+ // Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+
+ }
+ } catch (Throwable t) {
+ //Toast.makeText(context, "UnRegister Receiver Error " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("UnRegister Error", "> " + t.getMessage());
+ Toast.makeText(getApplicationContext(), "Fees Details: " + t.toString(),Toast.LENGTH_LONG).show();
+ }
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private class StudentSummaryDetails_AsynTask extends AsyncTask {
+ ProgressDialog dialog;
+ Context context;
+
+ protected void onPreExecute() {
+ // Log.i(TAG, "onPreExecute---tab2");
+ dialog.setMessage("Please wait,Fetching Payment Details..");
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.show();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ //Log.i(TAG, "onProgressUpdate---tab2");
+ }
+
+
+ @Override
+ protected Void doInBackground(String... params) {
+ Log.i("df", "doInBackground");
+
+ Get_Payment_Details(); //
+ return null;
+ }
+
+ public StudentSummaryDetails_AsynTask(Activity_studentUPI activity) {
+ context = activity;
+ dialog = new ProgressDialog(activity);
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+
+ /* if ((this.dialog != null) && this.dialog.isShowing()) {
+ dialog.dismiss();
+
+ }*/
+
+ dialog.dismiss();
+
+ if(str_detailspayment_response.equalsIgnoreCase("Success"))
+ {
+
+
+ if (studentpayment_summary_arryObj != null)
+ {
+ CustomAdapter_paymentdetails adapter = new CustomAdapter_paymentdetails();
+ summarylist_listview.setAdapter(adapter);
+
+ int y = studentpayment_summary_arryObj.length;
+
+ Log.e("length adapter", "" + y);
+ } else {
+ Log.d("length adapter", "zero");
+ }
+
+ }else{
+ //alert();
+ }
+
+ }
+
+ }
+
+
+
+
+
+
+ public void Get_Payment_Details()
+ {
+//https://mis.leadcampus.org:8084/leadws/managerws.asmx/Get_Payment_Details?Registration_ID=41275&Manager_Id=0&Academic_Id=7
+ /*
+
+ */
+ String URL = Class_URL.URL_Manager.toString().trim();
+
+
+ String METHOD_NAME = "Get_Payment_Details";
+ String Namespace="http://mis.leadcampus.org/", SOAPACTION="http://mis.leadcampus.org/Get_Payment_Details";
+
+
+ int int_regID= Integer.parseInt(str_studentregistrationID);
+ int int_mangerID=0;
+ int int_academicID= Integer.parseInt(str_academicID);
+ try {
+ str_detailspayment_response="x";
+
+ SoapObject request = new SoapObject(Namespace, METHOD_NAME);
+ request.addProperty("Registration_ID",int_regID );//int
+ request.addProperty("Manager_Id", int_mangerID);//int
+ request.addProperty("Academic_Id",int_academicID );//int
+
+//
+ //
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
+
+ try {
+
+ androidHttpTransport.call(SOAPACTION, envelope);
+
+
+ //SoapPrimitive response = (SoapPrimitive ) envelope.getResponse();
+ SoapObject response = (SoapObject) envelope.getResponse();
+ SoapObject response_SO = (SoapObject) response.getProperty(0);
+ Log.e("status",response_SO.getProperty("Status").toString());
+
+ str_detailspayment_response=response_SO.getProperty("Status").toString();
+ // Log.e("status", String.valueOf(response.getPropertyCount()));
+ int count =response.getPropertyCount();
+
+ studentpayment_summary_arryObj=new Class_studentpayment_summary[count];
+
+ for(int i=0;i1612960865
+ studentpayment_summary_innerObj.setStr_Auto_Receipt_No(responses_SO.getProperty("Auto_Receipt_No").toString());//19
+ studentpayment_summary_innerObj.setStr_Created_Date(responses_SO.getProperty("Created_Date").toString());//10-02-2021 06:02;30 06:11:30 PM
+
+ Log.e("payresp",responses_SO.getProperty("reference_id").toString());
+
+
+
+ studentpayment_summary_arryObj[i]=studentpayment_summary_innerObj;
+
+ }
+
+
+
+
+ Log.e("resp_details",response.toString());
+
+
+
+ } catch (Throwable t) {
+ //Toast.makeText(context, "Request failed: " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("saved payment fail", "> " + t.getMessage());
+ //internet_issue1 = "savepayment";
+ // Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+
+ }
+ } catch (Throwable t) {
+ //Toast.makeText(context, "UnRegister Receiver Error " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("UnRegister Error", "> " + t.getMessage());
+ Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+ }
+
+ }//End of uploaddetails
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private class Holder_offline {
+ TextView holder_paymentstatus_tv;
+ TextView holder_payment_tranID_tv;
+ TextView holder_date_tv;
+ TextView holder_receipt_no_tv;
+
+ }
+
+
+
+ public class CustomAdapter_paymentdetails extends BaseAdapter
+ {
+
+
+ public CustomAdapter_paymentdetails() {
+
+ super();
+ Log.d("Inside CustomAdapter()", "Inside CustomAdapter()");
+ }
+
+ @Override
+ public int getCount() {
+
+ String x = Integer.toString(studentpayment_summary_arryObj.length);
+ System.out.println("studentpayment_summary_arryObj.length" + x);
+ return studentpayment_summary_arryObj.length;
+ }
+
+ @Override
+ public Object getItem(int position) {
+ String x = Integer.toString(position);
+ Log.d("getItem position", "x");
+ return studentpayment_summary_arryObj[position];
+ }
+
+
+ @Override
+ public long getItemId(int position) {
+ String x = Integer.toString(position);
+
+ Log.d("getItemId position", x);
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView1, ViewGroup parent)
+ {
+
+ final Holder_offline holder;
+
+ Log.d("CustomAdapter", "position: " + position);
+
+ if (convertView1 == null) {
+ holder = new Holder_offline();
+ convertView1 = LayoutInflater.from(getApplicationContext()).inflate(R.layout.listview_row_item_student_paymentdetails, parent, false);
+
+
+
+ // holder.holder_paymentstatus_tv = (TextView) convertView1.findViewById(R.id.payment_status_tv);
+ holder.holder_payment_tranID_tv = (TextView) convertView1.findViewById(R.id.payment_tranID_tv);
+ holder.holder_receipt_no_tv = (TextView) convertView1.findViewById(R.id.receipt_no_tv);
+ holder.holder_date_tv= (TextView) convertView1.findViewById(R.id.date_tv);
+
+ Log.d("Inside If convertView1", "Inside If convertView1");
+
+ convertView1.setTag(holder);
+
+ } else {
+ holder = (Holder_offline) convertView1.getTag();
+ Log.d("else convertView1", "else convertView1");
+ }
+
+ // Class_farmponddetails_offline farmponddetails_obj;
+ studentpayment_summary_obj = (Class_studentpayment_summary) getItem(position);
+
+
+ if (studentpayment_summary_obj != null) {
+ if ((studentpayment_summary_obj.getStr_Status().equalsIgnoreCase("Success"))) {
+
+
+ Log.e("payment",studentpayment_summary_obj.getStr_reference_id().toString());
+ //holder.holder_paymentstatus_tv.setText(studentpayment_summary_obj.getStr_Status().toString());
+ holder.holder_payment_tranID_tv.setText(studentpayment_summary_obj.getStr_reference_id().toString());
+ holder.holder_date_tv.setText(studentpayment_summary_obj.getStr_Created_Date().toString());
+ holder.holder_receipt_no_tv.setText(studentpayment_summary_obj.getStr_Auto_Receipt_No().toString());
+
+
+ }
+
+
+ }
+
+
+
+ return convertView1;
+
+ }//End of custom getView
+ }//End of CustomAdapter
+
+
+
+//--------------------Paytm-------------------------------------------------
+
+ public void fetch_token()
+ {
+
+
+ Calendar c = Calendar.getInstance();
+ SimpleDateFormat df = new SimpleDateFormat("ddMMyyyy");
+ String date = df.format(c.getTime());
+ Random rand = new Random();
+ int min =1000, max= 9999;
+// nextInt as provided by Random is exclusive of the top value so you need to add 1
+ int randomNum = rand.nextInt((max - min) + 1) + min;
+ str_orderid = date+String.valueOf(randomNum);
+ Log.e("orderid",str_orderid);
+
+
+
+ final ProgressDialog progressDialog;
+ progressDialog = new ProgressDialog(Activity_studentUPI.this);
+ progressDialog.setMessage("Fetching CheckSum Token....");
+ progressDialog.setTitle("Please wait....");
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.show();
+
+ Interface_userservice userService;
+ userService = Class_ApiUtils.getUserService();
+
+
+ // String MID = "Deshpa57179173206691";//Staging
+ String MID="DesFou64628105401332";//Production
+ String order_id = str_orderid;
+ String Website = "WEBSTAGING";
+
+
+ String Amount = "1";
+
+ //String callback="https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID="+order_id;
+ String callback="https://securegw.paytm.in/theia/paytmCallback?ORDER_ID="+order_id;
+
+
+ String Str_checksum1 = "{\"requestType\":\"Payment\",\"mid\":\"" + MID + "\",\"orderId\":\"" + order_id + "\"," +
+ "\"websiteName\":\"" + Website + "\",\"txnAmount\":{\"value\":\"" + Amount + "\",\"currency\":\"INR\"}," +
+ "\"userInfo\":{\"custId\":\"WE25622\"},\"enablePaymentMode\":[{\"mode\":\"UPI\", \"channels\":[\"UPIPUSH\",\"UPIPUSHEXPRESS\"]}]," +
+ "\"callbackUrl\":\"" + callback + "\"}";
+
+ String Str_checksum = "{\"requestType\":\"Payment\",\"mid\":\""+MID+"\",\"orderId\":\""+order_id+"\"," +
+ "\"websiteName\":\""+Website+"\",\"txnAmount\":{\"value\":\""+Amount+"\",\"currency\":\"INR\"}," +
+ "\"userInfo\":{\"custId\":\"WE25622\"},\"callbackUrl\":\""+callback+"\"}";
+
+ // Call call = userService.getpaytmchecksumkey(orderIdString);
+ Call call = userService.getpaytmchecksumkey(Str_checksum);
+ // Call call = userService.getpaytmchecksumkey("jkk12345678912345612123");
+ //jkk12345678912345612123
+
+ Log.e("checksum_url","https://www.dfindia.org:82/api/Authentication/getpaytmchecksumkey?OrderId="+str_orderid);
+
+
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response)
+ {
+ // Log.e("token_response", "token_response: " + new Gson().toJson(response));
+
+
+
+ try{
+
+
+
+ if(response.isSuccessful())
+ {
+
+ Class_token_response loc_obj = response.body();
+ Log.e("response.body", response.body().getMessage().toString());
+
+ Log.e("checksum_token",loc_obj.getTokenresp().getPaytmChecksum().toString());
+
+ Log.e("checksum :","Validation");
+ Log.e("checksum_validateion",loc_obj.getTokenresp().getVerifySignature());
+
+ str_checksumtoken=loc_obj.getTokenresp().getPaytmChecksum().toString().trim();
+
+ // checksumtoken_et.setText(loc_obj.getTokenresp().getPaytmChecksum().toString());
+ // txnToken.setText(loc_obj.getTokenresp().getPaytmChecksumNew().toString());
+
+ // Log.e("response.body", response.body().size);
+ progressDialog.dismiss();
+
+ Log.e("call", "PayTM Transcation API");
+ Transactiontoken_AsynTask task= new Transactiontoken_AsynTask(Activity_studentUPI.this);
+ task.execute();
+
+
+ }
+
+ }catch(Exception ex)
+ {
+ Log.e("error", String.valueOf(ex));
+ progressDialog.dismiss();
+ }
+
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ progressDialog.dismiss();
+ Log.e("WS", "error" + t.getMessage());
+ Toast.makeText(Activity_studentUPI.this, "WS:" + t.getMessage(), Toast.LENGTH_LONG).show();
+ }
+ });
+
+
+
+ }
+
+
+ private class Transactiontoken_AsynTask extends AsyncTask {
+ ProgressDialog dialog;
+ Context context;
+
+ protected void onPreExecute() {
+ // Log.i(TAG, "onPreExecute---tab2");
+ dialog.setMessage("Please wait,fetching transcation token...");
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.show();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ //Log.i(TAG, "onProgressUpdate---tab2");
+ }
+
+
+ @Override
+ protected Void doInBackground(String... params) {
+ Log.i("df", "doInBackground");
+
+ get_transcationtoken(); //
+ return null;
+ }
+
+ public Transactiontoken_AsynTask(Activity_studentUPI activity) {
+ context = activity;
+ dialog = new ProgressDialog(activity);
+ }
+
+ @Override
+ protected void onPostExecute(Void result)
+ {
+ dialog.dismiss();
+ if(str_transcation_token.equalsIgnoreCase("0"))
+ {
+
+ }else{
+ do_paytm_transcation();
+ }
+ }
+
+ }
+
+
+
+
+ public void get_transcationtoken()
+ {
+
+ //String MID = "Deshpa57179173206691";//Staging
+ String MID="DesFou64628105401332";//Production
+ String order_id = str_orderid;
+ String Website = "WEBSTAGING";
+ String Merchant_key = "kYCILDoti4a8hb5f";
+
+
+ String Amount = "1";
+ //String value = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=Deshpa57179173206691&orderId="+order_id;
+ String value = "https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid=DesFou64628105401332&orderId="+order_id; //Production
+
+ String callback="https://securegw.paytm.in/theia/paytmCallback?ORDER_ID="+order_id;
+
+
+ String json_for_checksum1 = "{\"requestType\":\"Payment\",\"mid\":\"" + MID + "\",\"orderId\":\"" + order_id + "\"," +
+ "\"websiteName\":\"" + Website + "\",\"txnAmount\":{\"value\":\"" + Amount + "\",\"currency\":\"INR\"}," +
+ "\"userInfo\":{\"custId\":\"WE25622\"},\"enablePaymentMode\":[{\"mode\":\"UPI\", \"channels\":[\"UPIPUSH\",\"UPIPUSHEXPRESS\"]}]," +
+ "\"callbackUrl\":\"" + callback + "\"}";
+
+
+ //"enablePaymentMode" : [{ "mode":"UPI", "channels":["UPIPUSH","UPIPUSHEXPRESS"] }]
+
+ String json_for_checksum = "{\"requestType\":\"Payment\",\"mid\":\""+MID+"\",\"orderId\":\""+order_id+"\"," +
+ "\"websiteName\":\""+Website+"\",\"txnAmount\":{\"value\":\""+Amount+"\",\"currency\":\"INR\"}," +
+ "\"userInfo\":{\"custId\":\"WE25622\"},\"callbackUrl\":\""+callback+"\"}";
+
+ Log.e("json_for_checksum",json_for_checksum);
+
+
+
+ //String checksum = PaytmChecksum.generateSignature(body.toString(), "YOUR_MERCHANT_KEY");
+
+
+ //String Second_jason = "{\"head\":{\"signature\":\"" + str_checksumtoken + "\"},\"body\":" + json_for_checksum + "}";
+
+ String Second_jason = "{\"head\":{\"signature\":\"" + str_checksumtoken + "\"},\"body\":"+json_for_checksum+"}";
+
+
+ String post_data = Second_jason.toString();
+
+
+
+ /* for Staging */
+ URL url = null;
+ try {
+ //url = new URL("https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
+ String str_staging_url=value;
+ Log.e("str_staging_url",str_staging_url);
+ url = new URL(str_staging_url);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+
+ /* for Production */
+// URL url = new URL("https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid=YOUR_MID_HERE&orderId=ORDERID_98765");
+
+ Log.e("parameters","of Head & Body");
+ Log.e("parameter_passed",post_data);
+
+ try {
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("POST");
+ connection.setRequestProperty("Content-Type", "application/json");
+ connection.setDoOutput(true);
+
+ DataOutputStream requestWriter = new DataOutputStream(connection.getOutputStream());
+ requestWriter.writeBytes(post_data);
+ requestWriter.close();
+ String responseData = "";
+ InputStream is = connection.getInputStream();
+ BufferedReader responseReader = new BufferedReader(new InputStreamReader(is));
+ if ((responseData = responseReader.readLine()) != null)
+ {
+ System.out.append("TransResponse: " + responseData);
+ Log.e("response", String.valueOf(responseData));
+
+ /*JSONObject jsonObject = new JSONObject(responseData);
+
+ JSONObject myResponse = jsonObject.getJSONObject("body");
+ JSONArray tsmresponse = (JSONArray) myResponse.get("body");
+
+ Log.e("length", String.valueOf(tsmresponse.length()));*/
+
+
+ // tsmresponse.getJSONObject(0).getString("name");
+
+ JSONObject jsonObject = new JSONObject(responseData);
+ JSONObject myResponse = jsonObject.getJSONObject("body");
+ str_transcation_token=myResponse.getString("txnToken").toString();
+ //txnToken_et.setText(str_transcation_token);
+ Log.e("transcationToken",myResponse.getString("txnToken").toString());
+
+ }
+ responseReader.close();
+ } catch (Exception exception)
+ {
+ exception.printStackTrace();
+ Log.e("error", String.valueOf(exception));
+ }
+
+
+ }
+
+
+
+
+ public void do_paytm_transcation()
+ {
+
+
+ final ProgressDialog progressDialog;
+ progressDialog = new ProgressDialog(Activity_studentUPI.this);
+ progressDialog.setMessage("PayTM Transcation....");
+ progressDialog.setTitle("Please wait....");
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.show();
+
+
+
+
+ String str_txnAmount = "1";
+ //txnAmountString = "1.00";
+ // String str_txnmid ="Deshpa57179173206691";//Staging
+ String str_txnmid="DesFou64628105401332";// production
+ String str_txnorderId =str_orderid;
+ String str_txnToken= str_transcation_token;
+
+ String host = "https://securegw-stage.paytm.in/";
+ /*if(environment.isChecked()){
+ host = "https://securegw.paytm.in/";
+ }*/
+
+ progressDialog.dismiss();
+ if(2>1)
+ {
+ String orderDetails = "MID: " + str_txnmid + ", OrderId: " + str_txnorderId + ", TxnToken: " + str_txnToken + ", Amount: " + str_txnAmount;
+ Toast.makeText(this, orderDetails, Toast.LENGTH_SHORT).show();
+
+
+
+ // String callBackUrl = host + "theia/paytmCallback?ORDER_ID="+orderIdString;
+
+ String callBackUrl="http://localhost:50559/callbackRes.aspx";
+
+ //String callBackUrl="https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=PYTM_ORDR_"+orderIdString;
+
+
+ // https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=PYTM_ORDR_1618228030"
+ //https://securegw-stage.paytm.in/theia/paytmCallback?
+
+ Log.e("callbackurl : ",callBackUrl);
+
+
+ PaytmOrder paytmOrder = new PaytmOrder(str_txnorderId, str_txnmid, str_txnToken, str_txnAmount, callBackUrl);
+
+ //Log.e("callbackurl : ", String.valueOf(paytmOrder));
+ Log.e("paytmOrder : ", new Gson().toJson(paytmOrder));
+
+ transactionManager = new TransactionManager(paytmOrder, new PaytmPaymentTransactionCallback()
+ {
+
+ @Override
+ public void onTransactionResponse(Bundle bundle)
+ {
+ Log.e("transactionManager : ", new Gson().toJson(transactionManager));
+
+ Log.e("onTransactionResp : ", bundle.toString());
+
+ String str_bundle=bundle.toString();
+ Log.e("onTransactionResp : ", str_bundle);
+
+ // Toast.makeText(Activity_studentUPI.this, "Response (onTransactionResponse) : "+bundle.toString(), Toast.LENGTH_SHORT).show();
+ /* SaveStudentPaymentDetails_AsynTask task = new SaveStudentPaymentDetails_AsynTask(Activity_studentUPI.this);
+ task.execute();*/
+
+
+ savepaymentdetails();
+ }
+
+ @Override
+ public void networkNotAvailable()
+ {
+
+ }
+
+ @Override
+ public void onErrorProceed(String s) {
+ Log.e("onErrorProceed : ", s.toString());
+ }
+
+ @Override
+ public void clientAuthenticationFailed(String s) {
+ Log.e("clientAuthenFailed: ", s.toString());
+ }
+
+ @Override
+ public void someUIErrorOccurred(String s) {
+ Log.e("someUIErrorOccur: ", s.toString());
+ }
+
+ @Override
+ public void onErrorLoadingWebPage(int i, String s, String s1) {
+ Log.e("ErrorLoadingWebPage: ", s.toString());
+ }
+
+ @Override
+ public void onBackPressedCancelTransaction() {
+
+ }
+
+ @Override
+ public void onTransactionCancel(String s, Bundle bundle) {
+
+ }
+ });
+
+ transactionManager.setShowPaymentUrl(host + "theia/api/v1/showPaymentPage");
+ Log.e("ShowPaymentUrl: ", host + "theia/api/v1/showPaymentPage");
+ transactionManager.startTransaction(this, ActivityRequestCode);
+
+ Log.e("transcation","completed1");
+ }
+
+
+ Log.e("transcation","completed2");
+
+ }
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ if (requestCode == ActivityRequestCode && data != null)
+ {
+
+ Bundle bundle = data.getExtras();
+ if (bundle != null) {
+ for (String key : bundle.keySet()) {
+ Log.e("tag", key + " : " + (bundle.get(key) != null ? bundle.get(key) : "NULL"));
+ }
+ }
+
+ Log.e("nativeSdkForMerchMsg:",data.getStringExtra("nativeSdkForMerchantMessage"));
+ Log.e("onActivityRes:", data.getStringExtra("response"));
+ Toast.makeText(this, "Response: "+data.getStringExtra("nativeSdkForMerchantMessage") + data.getStringExtra("response"), Toast.LENGTH_SHORT).show();
+
+ Log.e("transcation","completed3");
+ }
+ }
+
+
+
+
+ public void savepaymentdetails()
+ {
+ SaveStudentPaymentDetails_AsynTask task = new SaveStudentPaymentDetails_AsynTask(Activity_studentUPI.this);
+ task.execute();
+ }
+
+
+
+ private class SaveStudentPaymentDetails_AsynTask extends AsyncTask
+ {
+ ProgressDialog dialog_savepayment;
+ Context context;
+
+ protected void onPreExecute()
+ {
+ // Log.i(TAG, "onPreExecute---tab2");
+ dialog_savepayment.setMessage("Please wait,Updating Payment Details..");
+ dialog_savepayment.setCanceledOnTouchOutside(false);
+ dialog_savepayment.show();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ //Log.i(TAG, "onProgressUpdate---tab2");
+ }
+
+
+ @Override
+ protected Void doInBackground(String... params) {
+ Log.i("df", "doInBackground");
+
+ SaveStudentPaymentDetails(); //
+ return null;
+ }
+
+ public SaveStudentPaymentDetails_AsynTask(Activity_studentUPI activity) {
+ context = activity;
+ dialog_savepayment = new ProgressDialog(activity);
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+
+ /* if ((this.dialog != null) && this.dialog.isShowing()) {
+ dialog.dismiss();
+
+ }*/
+
+ dialog_savepayment.dismiss();
+
+ if(str_savedpayment_response.equalsIgnoreCase("Success"))
+ {
+ // finish();
+ Payment_alertdialog("Success");
+
+ }else{
+ //alert();
+ }
+
+ }
+
+ }
+
+
+
+
+ public void SaveStudentPaymentDetails()
+ {
+
+ Calendar c = Calendar.getInstance();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+ str_yyyy_mm_dd = df.format(c.getTime());
+ // formattedDate have current date/time
+ Log.e("date", str_yyyy_mm_dd);
+
+ String URL = Class_URL.URL_Projects.toString().trim();
+
+ String METHOD_NAME = "Save_Student_PaymentDetails";
+ String Namespace="http://mis.leadcampus.org/", SOAPACTION="http://mis.leadcampus.org/Save_Student_PaymentDetails";
+
+
+
+ try {
+ str_savedpayment_response="false";
+
+ int int_studentregID= Integer.parseInt(str_studentregistrationID);
+
+ int int_feesID= Integer.parseInt(str_feesID);
+ // int int_feespaid= Integer.parseInt(str_amount);
+ // int int_referenceID= Integer.parseInt("12345678");
+ String str_referenceID="123456";
+
+ // BigInteger int_referenceID=new BigInteger(str_orderid);
+
+
+ SoapObject request = new SoapObject(Namespace, METHOD_NAME);
+ request.addProperty("Fees_Category_ID",str_feescatID );//string
+ request.addProperty("Programe_ID", 1);//int
+ request.addProperty("Registration_ID",int_studentregID );//int
+ request.addProperty("Paid_fees", 1);//int
+ request.addProperty("Paid_date", str_yyyy_mm_dd);//string
+ request.addProperty("Payment_Type", "UPI");//string
+ request.addProperty("Payeer_Id", " ");//string
+ request.addProperty("Transaction_ID", "0");//int
+ request.addProperty("Reference_ID", str_referenceID);//int
+ request.addProperty("Transaction_Status", "Success");//string
+ request.addProperty("Created_User_Type", "Student");// string
+ request.addProperty("User_Id", int_studentregID);//int
+ request.addProperty("Fees_ID", int_feesID);// int
+
+
+
+//
+ //
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
+
+ try {
+
+ androidHttpTransport.call(SOAPACTION, envelope);
+
+
+ //SoapPrimitive response = (SoapPrimitive ) envelope.getResponse();
+ SoapObject response = (SoapObject) envelope.getResponse();
+
+ SoapObject payment_response = (SoapObject) response.getProperty(0);
+ Log.e("status",payment_response.getProperty("Status").toString());
+
+ str_savedpayment_response = payment_response.getProperty("Status").toString();
+ Log.e("resp_savepayment",response.toString());
+
+
+
+
+
+ } catch (Throwable t) {
+ //Toast.makeText(context, "Request failed: " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("saved payment fail", "> " + t.getMessage());
+ //internet_issue1 = "savepayment";
+ // Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+
+ }
+ } catch (Throwable t) {
+ //Toast.makeText(context, "UnRegister Receiver Error " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("UnRegister Error", "> " + t.getMessage());
+ Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+ }
+
+ }//End of uploaddetails
+
+
+
+
+
+
+ public void Payment_alertdialog(String Success)
+ {
+
+ {
+ AlertDialog.Builder dialog = new AlertDialog.Builder(Activity_studentUPI.this);
+ dialog.setCancelable(false);
+ dialog.setTitle("Alert");
+ if(Success.equalsIgnoreCase("Success")) {
+ dialog.setMessage("Congrants Payment is Successfull");
+ }
+ else if (Success.equalsIgnoreCase("cancelled"))
+ {
+ dialog.setMessage("Payment is cancelled!");
+ }else{
+ dialog.setMessage("Kindy install digital wallet application");
+ }
+
+ dialog.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ /* SaveStudentPaymentDetails_AsynTask task = new SaveStudentPaymentDetails_AsynTask(StudentUPIPayment.this);
+ task.execute();*/
+ Intent i = new Intent(Activity_studentUPI.this, Activity_studentUPI.class);
+ startActivity(i);
+ finish();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+ //alert.getWindow().setBackgroundDrawableResource(android.R.color.background_dark);
+ }
+ }
+
+
+
+
+
+
+
+}//end of class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /*public void SaveStudentPaymentDetails()
+ {
+
+ String URL = Class_URL.URL_Manager.toString().trim();
+ *//*String METHOD_NAME = "UpdateStudentProfilewithstring";
+ String Namespace="http://mis.leadcampus.org/", SOAPACTION="http://mis.leadcampus.org/UpdateStudentProfilewithstring";
+*//*
+
+ String METHOD_NAME = "Save_Student_PaymentDetails";
+ String Namespace="http://mis.leadcampus.org/", SOAPACTION="http://mis.leadcampus.org/Save_Student_PaymentDetails";
+
+
+
+ try {
+ str_savedpayment_response="x";
+
+ SoapObject request = new SoapObject(Namespace, METHOD_NAME);
+ request.addProperty("Fees_Category_ID","1" );//string
+ request.addProperty("Programe_ID", 1);//int
+ request.addProperty("Registration_ID",43676 );//int
+ request.addProperty("Paid_fees", 100);//int
+ request.addProperty("Paid_date", "2020-01-21");//string
+ request.addProperty("Payment_Type", "UPI");//string
+ request.addProperty("Payeer_Id", "empty");//string
+ request.addProperty("Transaction_ID", 123567);//int
+ request.addProperty("Reference_ID", 1234567);//int
+ request.addProperty("Transaction_Status", "Success");//string
+ request.addProperty("Created_User_Type", "Student");// string
+ request.addProperty("User_Id", 43676);//int
+
+
+
+//
+ //
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
+
+ try {
+
+ androidHttpTransport.call(SOAPACTION, envelope);
+
+
+ //SoapPrimitive response = (SoapPrimitive ) envelope.getResponse();
+ SoapObject response = (SoapObject) envelope.getResponse();
+ SoapObject root = (SoapObject) response.getProperty(0);
+ Log.e("status",root.getProperty("Status").toString());
+
+ //str_savedpayment_response = response.toString();
+ Log.e("resp editprofile",response.toString());
+
+
+
+ } catch (Throwable t) {
+ //Toast.makeText(context, "Request failed: " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("saved payment fail", "> " + t.getMessage());
+ //internet_issue1 = "savepayment";
+ // Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+
+ }
+ } catch (Throwable t) {
+ //Toast.makeText(context, "UnRegister Receiver Error " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("UnRegister Error", "> " + t.getMessage());
+ Toast.makeText(getApplicationContext(), "Request failed: " + t.toString(),Toast.LENGTH_LONG).show();
+ }
+
+ }//End of uploaddetails*/
+
+
+ /* anyType{vmPayment_Details=anyType{Payment_Id=12; Lead_Id=MI00001;
+ StudentName=Sharad Noolvi; Registration_Id=43676; Paid_Fees=100;
+ paid_date=21-January-20; Created_Date=10-02-2021 04:02;13 04:34:13 PM;
+ Auto_Receipt_No=12; transanction_Id=123567; reference_id=1234567;
+ Fees_Category_description=Registration; transactionStatus=success;
+ YearCode=2020-21; Payment_Type=UPI; Payeer_Id=empty; Status=Success; }; }*/
+
diff --git a/app/src/main/java/com/leadcampusapp/AddProjectFragment.java b/app/src/main/java/com/leadcampusapp/AddProjectFragment.java
new file mode 100644
index 0000000..0c5095e
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AddProjectFragment.java
@@ -0,0 +1,1802 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 22-06-2018.
+ */
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.DatePickerDialog;
+import android.app.Dialog;
+import android.app.DialogFragment;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import androidx.core.content.ContextCompat;
+import androidx.appcompat.widget.AppCompatSpinner;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+
+import org.json.JSONObject;
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.joda.time.Days;
+import org.joda.time.LocalDate;
+
+public class AddProjectFragment extends Fragment {
+ Context context;
+ AppCompatSpinner spin_projectType;
+
+ ImageButton imgBtn_addMaterial;
+ LinearLayout lnrlyt_material;
+ private LinearLayout parentLinearLayout;
+ private LinearLayout parentLinearLayoutTM;
+
+ //Button btn_addMaterial;
+ Button delete_button;
+ EditText edt_materialcost;
+
+ double grandSum=0;
+
+ int childLayoutId;
+
+ ImageButton btn_addMaterial;
+
+ ImageButton btn_addMember;
+
+
+ List listEdMaterialCost = new ArrayList();
+ List listEdMaterialName = new ArrayList();
+
+
+ List listEdMemberName = new ArrayList();
+ List listEdMemberMailId = new ArrayList();
+
+ /* List listEdMemb = new ArrayList();
+ List listEdMemberMailId = new ArrayList();*/
+
+
+ ArrayList listMaterialName = new ArrayList();
+ ArrayList listMaterialCost = new ArrayList();
+
+ ArrayList listMaterialName_newdup = new ArrayList();
+ ArrayList listMaterialCost_newdup = new ArrayList();
+
+ ArrayList listMemberName = new ArrayList();
+ ArrayList listMemberMailId = new ArrayList();
+
+
+
+ EditText mainEdt_Material;
+ EditText mainEdt_Cost;
+
+
+ EditText mainEdt_MemberName;
+ EditText mainEdt_MemberMailId;
+
+
+ EditText edt_projTitle;
+ EditText edt_beneficiaries;
+ EditText edt_beneficiaries_name;
+
+ EditText edt_objective;
+ EditText edt_actionPlan;
+
+ String str_Title;
+ String str_projectType;
+ String str_beneficiaries;
+ String str_objectives;
+ String str_actionPlan;
+ private HashMap hashProjTypeId = new HashMap();
+ private AddProjectObject addProjectObject = new AddProjectObject();
+
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefID_RegID = "prefid_regid"; //
+ public static final String PrefID_SName = "prefid_sname"; //
+ public static final String PrefID_PM_SName = "prefid_pmsname"; //
+ public static final String PrefID_SLeadID = "prefid_sleadid"; //
+ public static final String PrefID_PM_SEmailID = "prefid_pm_semailid"; //
+ public static final String PrefID_SCellNo = "prefid_scellno"; //
+
+
+ public static final String PrefId_S_AcademicId = "prefid_sacademicid";
+
+
+ private SharedPreferences shardpref_S_obj;
+ private String str_leadId,str_RegistrationId,str_academicCode;
+
+ private ProgressDialog progressDialog;
+
+ View view;
+
+ Button btn_projsubmit;
+
+ int count=0;
+
+ private EditText edt_placeOfImpl;
+ private EditText edt_currentSituation;
+
+ private String memberMailId;
+ private String mainMemberMailId;
+ private String mainMemberMailIdCheckMandatory;
+ //private String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
+ final String emailPattern = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
+ Pattern pattern;
+ Matcher matcher;
+ int countEmailIds=0;
+
+
+ static TextView clickstartprojectdate_tv;
+ static TextView clickendprojectdate_tv;
+ static String yyyyMMdd_startdate = "";
+ static String yyyyMMdd_enddate = "";
+
+
+
+ private LinearLayout parent_linear_layout1;
+ private ImageButton add_field_button;
+
+
+ private LinearLayout parent_linearlayout_material;
+ private ImageButton addmaterial_ib;
+
+ private static TextView numberofdays_tv;
+
+ static Class_alert_msg obj_class_alert_msg;
+ static Context static_context1;
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+
+ context = getActivity().getBaseContext();
+
+ view = inflater.inflate(R.layout.addproject_fragment, container, false);
+
+
+
+ static_context1=view.getContext();
+ obj_class_alert_msg = new Class_alert_msg(static_context1);
+ edt_currentSituation = (EditText) view.findViewById(R.id.edt_currentSituation);
+
+ parentLinearLayout = (LinearLayout) view.findViewById(R.id.parent_linear_layout);
+ parentLinearLayoutTM = (LinearLayout) view.findViewById(R.id.parent_linear_layout_TM);
+
+
+
+ parent_linear_layout1= (LinearLayout) view.findViewById(R.id.parent_linear_layout1);
+ parent_linearlayout_material=(LinearLayout) view.findViewById(R.id.parent_linearlayout_material);
+
+
+ spin_projectType = (AppCompatSpinner) view.findViewById(R.id.spin_projectType);
+ getProjectType();
+ //setProjectTypeSpinner();
+
+ clickstartprojectdate_tv = (TextView) view.findViewById(R.id.clickstartprojectdate_TV);
+ clickendprojectdate_tv = (TextView) view.findViewById(R.id.clickendprojectdate_TV);
+ numberofdays_tv=(TextView)view.findViewById(R.id.numberofdays_tv);
+ clickendprojectdate_tv.setVisibility(View.INVISIBLE);
+
+ add_field_button=(ImageButton) view.findViewById(R.id.add_field_button);
+ addmaterial_ib=(ImageButton)view.findViewById(R.id.addmaterial_ib);
+
+
+
+ shardpref_S_obj=getActivity().getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+
+
+ shardpref_S_obj.getString(PrefId_S_AcademicId, "").trim();
+ str_academicCode = shardpref_S_obj.getString(PrefId_S_AcademicId, "").trim();
+ Log.d("str_academicCode:",str_academicCode);
+
+
+
+
+
+ shardpref_S_obj.getString(PrefID_SLeadID, "").trim();
+ str_leadId = shardpref_S_obj.getString(PrefID_SLeadID, "").trim();
+ Log.d("str_leadId:",str_leadId);
+ //Toast.makeText(getActivity(),"LeadId: "+str_leadId,Toast.LENGTH_LONG).show();
+
+ shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ str_RegistrationId = shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ Log.d("str_RegistrationId:",str_RegistrationId);
+ //Toast.makeText(getActivity(),"RegistrationId: "+str_RegistrationId,Toast.LENGTH_LONG).show();
+
+
+
+ listEdMaterialName.clear();
+ listEdMaterialCost.clear();
+ listEdMemberName.clear();
+ listEdMemberMailId.clear();
+ listMaterialName.clear();
+ listMaterialCost.clear();
+ listMemberName.clear();
+ listMemberMailId.clear();
+
+
+
+
+
+
+ mainEdt_MemberName = (EditText) view.findViewById(R.id.edt_memberName);
+ mainEdt_MemberMailId = (EditText) view.findViewById(R.id.edt_memberMailId);
+
+
+ mainEdt_MemberMailId.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if(!hasFocus) {
+ mainMemberMailId = mainEdt_MemberMailId.getText().toString().trim();
+ if (mainMemberMailId.length() > 0) {
+ if (!isValidEmail(mainMemberMailId)) {
+ mainEdt_MemberMailId.setError("Enter correct mail id");
+ //mainEdt_MemberMailId.requestFocus();
+ }
+ }
+ }
+ }
+ });
+
+
+
+
+
+
+
+
+
+ edt_placeOfImpl = (EditText) view.findViewById(R.id.edt_placeOfImpl);
+
+
+ btn_addMember = (ImageButton) view.findViewById(R.id.imgbtn_addMember);
+ btn_addMember.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ Log.d("insidepppp","onclick");
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+ final View rowView = inflater.inflate(R.layout.add_member_layout, null);
+ // Add the new row before the add add_material_layout button.
+
+ parentLinearLayoutTM.addView(rowView, parentLinearLayoutTM.getChildCount() - 1);
+
+ Log.e("count",String.valueOf(parentLinearLayoutTM.getChildCount()));
+
+
+
+ EditText edt_memberName = (EditText) rowView.findViewById(R.id.edt_memberName);
+ listEdMemberName.add(edt_memberName);
+
+ final EditText edt_memberMailId = (EditText) rowView.findViewById(R.id.edt_memberMailId);
+ listEdMemberMailId.add(edt_memberMailId);
+
+
+
+
+ edt_memberMailId.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if(!hasFocus) {
+ memberMailId = edt_memberMailId.getText().toString().trim();
+ if (memberMailId.length() > 0) {
+ if (!isValidEmail(memberMailId)) {
+ edt_memberMailId.setError("Enter correct mail id");
+ }
+ }
+ }
+ }
+ });
+
+
+
+ Button delete_button_member = (Button) rowView.findViewById(R.id.delete_button_member);
+ delete_button_member.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v) {
+ Log.d("Insidexxx","delete button member");
+/* Log.d("Materialcostxxxxxxxx",edt_materialcost.getText().toString());
+ Double removedCost = Double.parseDouble(edt_materialcost.getText().toString());
+ grandSum = grandSum - removedCost;*/
+ //Log.d("grandsumxxxxx", String.valueOf(grandSum));
+ parentLinearLayoutTM.removeView((View) v.getParent());
+
+ View rowView = (View) v.getParent();
+ final EditText edt_memberMailId = (EditText) rowView.findViewById(R.id.edt_memberMailId);
+ listEdMemberMailId.remove(edt_memberMailId);
+
+ final EditText edt_memberName = (EditText) rowView.findViewById(R.id.edt_memberName);
+ listEdMemberName.remove(edt_memberName);
+
+ }
+ });
+ }
+ });// end add button
+
+
+ //new
+
+ add_field_button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view)
+ {
+ //LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ LayoutInflater inflater = (LayoutInflater) view.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ final View rowView = inflater.inflate(R.layout.field, null);
+ // Add the new row before the add field button.
+ parent_linear_layout1.addView(rowView, parent_linear_layout1.getChildCount() - 1);
+
+
+ EditText edt_memberName = (EditText) rowView.findViewById(R.id.edt_memberName);
+ listEdMemberName.add(edt_memberName);
+
+ final EditText edt_memberMailId = (EditText) rowView.findViewById(R.id.edt_memberMailId);
+ listEdMemberMailId.add(edt_memberMailId);
+
+
+
+
+ edt_memberMailId.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if(!hasFocus) {
+ memberMailId = edt_memberMailId.getText().toString().trim();
+ if (memberMailId.length() > 0) {
+ if (!isValidEmail(memberMailId)) {
+ edt_memberMailId.setError("Enter correct mail id");
+ }
+ }
+ }
+ }
+ });
+
+ Button delete_button_member = (Button) rowView.findViewById(R.id.delete_button_member);
+ delete_button_member.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v) {
+ Log.d("Insidexxx","delete button member");
+/* Log.d("Materialcostxxxxxxxx",edt_materialcost.getText().toString());
+ Double removedCost = Double.parseDouble(edt_materialcost.getText().toString());
+ grandSum = grandSum - removedCost;*/
+ //Log.d("grandsumxxxxx", String.valueOf(grandSum));
+ parent_linear_layout1.removeView((View) v.getParent());
+
+ View rowView = (View) v.getParent();
+ final EditText edt_memberMailId = (EditText) rowView.findViewById(R.id.edt_memberMailId);
+ listEdMemberMailId.remove(edt_memberMailId);
+
+ final EditText edt_memberName = (EditText) rowView.findViewById(R.id.edt_memberName);
+ listEdMemberName.remove(edt_memberName);
+
+ }
+ });
+
+
+
+ }
+ });
+
+
+
+
+
+ addmaterial_ib.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view)
+ {
+ LayoutInflater inflater = (LayoutInflater)view.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+ final View rowView = inflater.inflate(R.layout.field_material, null);
+ // Add the new row before the add field button.
+ parent_linearlayout_material.addView(rowView, parent_linearlayout_material.getChildCount() - 1);
+
+
+ EditText edt_materialname = (EditText) rowView.findViewById(R.id.edt_materialname);
+ listEdMaterialName.add(edt_materialname);
+ /* String materialName_str=edt_materialname.getText().toString();
+ Log.e("tag","materialName_str="+materialName_str);
+ if(listEdMaterialName.contains(materialName_str)){
+ Toast.makeText(getActivity(),materialName_str+ "is duplicated",Toast.LENGTH_LONG).show();
+
+ }else {
+ listEdMaterialName.add(edt_materialname);
+*/
+ final EditText edt_materialcost = (EditText) rowView.findViewById(R.id.edt_materialcost);
+ listEdMaterialCost.add(edt_materialcost);
+ // }
+ // final EditText edt_materialcost = (EditText) rowView.findViewById(R.id.edt_materialcost);
+ // listEdMaterialCost.add(edt_materialcost);
+
+
+
+
+
+ Button delete_button_material = (Button) rowView.findViewById(R.id.delete_button_material);
+ delete_button_material.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v) {
+ Log.d("Insidexxx","delete button member");
+/* Log.d("Materialcostxxxxxxxx",edt_materialcost.getText().toString());
+ Double removedCost = Double.parseDouble(edt_materialcost.getText().toString());
+ grandSum = grandSum - removedCost;*/
+ //Log.d("grandsumxxxxx", String.valueOf(grandSum));
+ parent_linearlayout_material.removeView((View) v.getParent());
+
+ View rowView = (View) v.getParent();
+ final EditText edt_materialname = (EditText) rowView.findViewById(R.id.edt_materialname);
+ listEdMaterialName.remove(edt_materialname);
+
+ final EditText edt_materialcost = (EditText) rowView.findViewById(R.id.edt_materialcost);
+ listEdMaterialCost.remove(edt_materialcost);
+
+ }
+ });
+
+
+
+ }
+ });
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ //new
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ btn_addMaterial = (ImageButton) view.findViewById(R.id.imgbtn_addmaterial1);
+ btn_addMaterial.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ Log.d("insidepppp","onclick");
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ final View rowView = inflater.inflate(R.layout.add_material_layout, null);
+ // Add the new row before the add add_material_layout button.
+
+ parentLinearLayout.addView(rowView, parentLinearLayout.getChildCount() - 1);
+
+
+
+ EditText edt_materialName = (EditText) rowView.findViewById(R.id.edt_materialname);
+ String materialName_str=edt_materialName.getText().toString();
+ Log.e("tag","materialName_str="+materialName_str);
+ /* if(listEdMaterialName.contains(materialName_str)){
+ Toast.makeText(getActivity(),materialName_str+ "is duplicated",Toast.LENGTH_LONG).show();
+
+ }else {*/
+ listEdMaterialName.add(edt_materialName);
+
+ final EditText edt_materialcost = (EditText) rowView.findViewById(R.id.edt_materialcost);
+ listEdMaterialCost.add(edt_materialcost);
+ // }
+
+ Button del_button = (Button) rowView.findViewById(R.id.delete_button);
+ del_button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.d("Insidexxx","delete button");
+/* Log.d("Materialcostxxxxxxxx",edt_materialcost.getText().toString());
+ Double removedCost = Double.parseDouble(edt_materialcost.getText().toString());
+ grandSum = grandSum - removedCost;*/
+ Log.d("grandsumxxxxx", String.valueOf(grandSum));
+ parentLinearLayout.removeView((View) v.getParent());
+
+ View rowView = (View) v.getParent();
+ final EditText edt_materialcost = (EditText) rowView.findViewById(R.id.edt_materialcost);
+ listEdMaterialCost.remove(edt_materialcost);
+
+ final EditText edt_materialName = (EditText) rowView.findViewById(R.id.edt_materialname);
+ listEdMaterialName.remove(edt_materialName);
+
+ }
+ });
+
+ /* edt_materialcost.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ //materialCost1 = s.toString();
+ //calculategrandSum();
+ }
+ });*/
+
+
+ }
+ });
+
+ edt_materialcost = (EditText) view.findViewById(R.id.edt_materialcost);
+
+ /* edt_materialcost.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ //materialCost2 = s.toString();
+ //calculategrandSum();
+ }
+ });*/
+
+
+ edt_projTitle = (EditText) view.findViewById(R.id.edt_title);
+ edt_beneficiaries = (EditText) view.findViewById(R.id.edt_noOfBeneficiaries);
+
+ edt_beneficiaries_name = (EditText) view.findViewById(R.id.edt_whoareBeneficiaries);
+
+ edt_objective = (EditText) view.findViewById(R.id.edt_objective);
+ edt_actionPlan = (EditText) view.findViewById(R.id.edt_actionplan);
+
+ btn_projsubmit = (Button) view.findViewById(R.id.btn_projsubmit);
+ mainEdt_Material = (EditText) view.findViewById(R.id.edt_materialname);
+ mainEdt_Cost = (EditText) view.findViewById(R.id.edt_materialcost);
+
+ btn_projsubmit.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v)
+ {
+
+ countEmailIds = 0;
+ listMaterialName.clear();
+ listMaterialCost.clear();
+ if(!(mainEdt_Material.getText().toString().isEmpty()) && !(mainEdt_Material.getText().toString().equals(""))) {
+ Log.e("mainEdt_Material","mainEdt_Material="+mainEdt_Material.getText().toString());
+ Log.e("mainEdt_Cost","mainEdt_Cost="+mainEdt_Cost.getText().toString());
+ listMaterialName.add(mainEdt_Material.getText().toString());
+ listMaterialCost.add(mainEdt_Cost.getText().toString());
+
+ }
+ if(listMaterialName.size()!=0) {
+ String arr_materialName[] = new String[0];
+ for (int i = 0; i < listEdMaterialName.size(); i++) {
+ String materialName = listEdMaterialName.get(i).getText().toString();
+
+ listMaterialName.add(materialName);
+
+ }
+
+ // Log.e("tag","bruteforce(listMaterialName)=="+bruteforce(listMaterialName));
+
+ }
+ if(checkMandatoryFields())
+ {
+ btn_projsubmit.setVisibility(View.GONE);
+
+ Log.d("Insideyyyyy","true");
+
+
+
+ if(!(mainEdt_MemberName.getText().toString().isEmpty()) && !(mainEdt_MemberName.getText().toString().equals(""))) {
+ listMemberName.add(mainEdt_MemberName.getText().toString());
+ listMemberMailId.add(mainEdt_MemberMailId.getText().toString());
+ }
+
+
+ /*for(int i = 0; i < listEdMaterialName.size(); i++)
+ {
+
+ if(!listMaterialName.contains(listEdMaterialName.get(i).getText().toString()))
+ {
+ listMaterialName.add(listEdMaterialName.get(i).getText().toString());
+ }
+ else{
+ Log.e("tag","duplicate");
+ }
+ }*/
+
+
+ Log.e("tag","listMaterialName=="+listMaterialName);
+ Log.e("tag","listMaterialName_newdup=="+listMaterialName_newdup);
+ if(!listEdMaterialCost.equals(null))
+ {
+
+ for (int i = 0; i < listEdMaterialCost.size(); i++) {
+
+ if (!listEdMaterialCost.get(i).getText().toString().equals("") && !listEdMaterialCost.get(i).getText().toString().isEmpty() && !listEdMaterialName.get(i).getText().toString().equals("") && !listEdMaterialName.get(i).getText().toString().isEmpty()) {
+ String materialCost = listEdMaterialCost.get(i).getText().toString();
+ listMaterialCost.add(materialCost);
+
+ double sumval = Double.parseDouble(materialCost);
+ grandSum = grandSum + sumval;
+ Log.d("Value ", "Val " + materialCost);
+ }
+ }
+
+ }
+
+ for(int i = 0; i < listEdMemberName.size(); i++)
+ {
+ String memberName = listEdMemberName.get(i).getText().toString();
+ listMemberName.add(memberName);
+ }
+
+ if(!listEdMemberMailId.equals(null))
+ {
+ for (int i = 0; i < listEdMemberMailId.size(); i++) {
+ if (!listEdMemberMailId.get(i).getText().toString().equals("") && !listEdMemberMailId.get(i).getText().toString().isEmpty()) {
+ String memberMailId = listEdMemberMailId.get(i).getText().toString();
+ listMemberMailId.add(memberMailId);
+ }
+ }
+ }
+
+ /*for (int j1=0;j1 {
+
+ Context context;
+ AlertDialog alertDialog;
+
+ /* private ProgressBar progressBar;*/
+
+ AddProject (Context ctx){
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+
+ SoapPrimitive response = addProjectDetails();
+
+ //Log.d("Soap response is",response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+/* progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+ progressBar.setVisibility(View.VISIBLE);*/
+
+ progressDialog.setMessage("Submitting");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+ /*progressBar.setVisibility(View.GONE);*/
+
+ progressDialog.dismiss();
+
+ if(result!=null) {
+ if (result.toString().equalsIgnoreCase("success")) {
+ Toast.makeText(getActivity(), "Project Added Successfully", Toast.LENGTH_LONG).show();
+ clearAllFields();
+ getActivity().finish();
+ Intent ittEditProjToProjDtls = new Intent(getActivity(), ProjectDetails.class);
+ startActivity(ittEditProjToProjDtls);
+ } else {
+ Toast.makeText(getActivity(), result.toString(), Toast.LENGTH_LONG).show();
+ }
+ }else{
+
+ }
+
+ /* String finalResult = result.toString();
+ String finals = finalResult.replace("anyType","");
+ Log.d("Finals is",finals);
+
+
+ SoapPrimitive status = (SoapPrimitive) result.getProperty("Status");
+ //Log.d("Status is:",status.toString());
+
+ if(status.toString().equals("Success")) {
+ SoapPrimitive role = (SoapPrimitive) result.getProperty("Role");
+ Log.d("Role is:", role.toString());
+
+ if(role.toString().equals("Student")){
+ *//* Intent ittLoginToEditProfile = new Intent(LoginActivity.this,EditProfileActivity.class);
+ ittLoginToEditProfile.putExtra("leadid",leadid);
+ startActivity(ittLoginToEditProfile);*//*
+ }
+ }else{
+ Log.d("Status is: ",status.toString());
+ }*/
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private void clearAllFields() {
+ getActivity().finish();
+ }
+
+ private SoapPrimitive addProjectDetails()
+ {
+
+ String METHOD_NAME = "AddProjectproposal1json";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/AddProjectproposal1json";
+ String NAMESPACE = "http://mis.leadcampus.org/";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
+
+ //SoapObject users = new SoapObject("http://mis.leadcampus.org/", "users");
+
+ ArrayList matModel = new ArrayList();
+
+ vmmaterial material = new vmmaterial();
+ material.setSlno(1);
+ material.setMeterialCost(50);
+ material.setMeterialName("Material 1");
+ matModel.add(material);
+
+ request.addProperty("Student_Id",str_RegistrationId);
+ request.addProperty("Lead_Id",str_leadId);
+ request.addProperty("Title",edt_projTitle.getText().toString());
+ request.addProperty("BeneficiaryNo",Integer.valueOf(edt_beneficiaries.getText().toString()));
+
+ request.addProperty("Beneficiary",edt_beneficiaries_name.getText().toString());
+
+ str_projectType = spin_projectType.getSelectedItem().toString();
+ long projectTypeId = (long) hashProjTypeId.get(str_projectType);
+
+ Log.d("projectIdinSubmissionxx", String.valueOf(projectTypeId));
+
+ request.addProperty("ProjectType",String.valueOf(projectTypeId));
+ request.addProperty("Objectives",edt_objective.getText().toString());
+ request.addProperty("ActionPlan",edt_actionPlan.getText().toString());
+
+
+ JSONObject jsonObject = new JSONObject();
+
+ for(int k=0;kstring
+ request.addProperty("ProjectEndDate",yyyyMMdd_enddate.toString());//string
+
+
+
+ Log.d("grandSumissss",String.valueOf(grandSum));
+
+ Log.d("AddProject_request",request.toString());
+
+ //request.addProperty("materials",)
+
+/*
+ SoapObject groupSoap=new SoapObject("http://mis.leadcampus.org/",METHOD_NAME);
+ SoapObject vmMaterial=new SoapObject("http://mis.leadcampus.org/",METHOD_NAME);
+
+ vmMaterial.addProperty("slno",1);
+ vmMaterial.addProperty("MeterialName","material1");
+ vmMaterial.addProperty("MeterialCost",5);
+
+ groupSoap.addProperty("vmmaterial",vmMaterial);
+
+
+ PropertyInfo materialProp = new PropertyInfo();
+ materialProp.setName("materials");i
+ materialProp.setValue(groupSoap);*/
+ //materialProp.setType(groupSoap.getClass());
+
+ //request.addProperty(materialProp);
+
+
+
+
+ //request.addProperty("materials",matModel);
+
+
+
+
+ //request.addProperty("vmp",addProjectObject);
+ //users.ad
+
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+
+ ///envelope.addMapping(NAMESPACE, "MediSenseLog",new MediSenseLog().getClass());
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Projects.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+
+ //SoapPrimitive response1 = (SoapPrimitive) envelope.getResponse();
+ // Log.d("soap response1xxxx",envelope.getResponse().toString());
+
+
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+ Log.e("soap responseyyyyyyy",response.toString());
+
+ return response;
+
+ //return response;
+
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ catch (Exception t) {
+ t.printStackTrace();
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ }catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+
+ t.printStackTrace();
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ return null;
+ }
+
+ private boolean checkMandatoryFields()
+ {
+ String str_Title = edt_projTitle.getText().toString();
+ String str_beneficiaries = edt_beneficiaries.getText().toString();
+ String str_beneficiaries_name = edt_beneficiaries_name.getText().toString();
+ String str_objectives = edt_objective.getText().toString();
+ String str_actionPlan = edt_actionPlan.getText().toString();
+ String str_projectType = spin_projectType.getSelectedItem().toString();
+ String str_placeOfImpl = edt_placeOfImpl.getText().toString();
+ String str_currentSituation = edt_currentSituation.getText().toString();
+
+
+
+
+ Boolean b_currentsituation,b_titlename,b_beneficiaries,b_beneficiaries_name,
+ b_placeofimpl,b_selecttype,b_objectives,b_datevalidation1,
+ b_actionplan,b_datevalidation2,b_materialName;
+
+ b_currentsituation=b_titlename=b_beneficiaries=b_beneficiaries_name=
+ b_placeofimpl=b_selecttype=b_objectives=b_datevalidation1=
+ b_actionplan=b_datevalidation2= true;
+
+ /* if(listEdMaterialName.size()!=0){
+ for(int i1=0;i1 0)
+ {
+ if (!isValidEmail(mainMemberMailIdCheckMandatory))
+ {
+ mainEdt_MemberMailId.setError("Enter correct mail id");
+ mainEdt_MemberMailId.requestFocus();
+ return false;
+ }
+ }
+
+
+
+ if(!listEdMemberMailId.equals(null))
+ {
+ Log.d("Insidedddd","listEdMemberMailIdnotnull");
+ for (int i = 0; i < listEdMemberMailId.size(); i++)
+ {
+ /* if (listEdMemberMailId.get(i).getError()!=null) {
+ *//* String memberMailId = listEdMemberMailId.get(i).getText().toString();
+ listMemberMailId.add(memberMailId);*//*
+ //return true;
+ countEmailIds++;
+ }*/
+
+ memberMailId = listEdMemberMailId.get(i).getText().toString().trim();
+ if (memberMailId.length() > 0)
+ {
+ if (!isValidEmail(memberMailId)) {
+ listEdMemberMailId.get(i).setError("Enter correct mail id");
+ listEdMemberMailId.get(i).requestFocus();
+ return false;
+ }
+ }
+
+
+ }
+
+ /*Log.d("countValueissss", String.valueOf(countEmailIds));
+
+ if(countEmailIds!=0){
+ return false;
+ }*/
+
+
+
+/*
+ if(countEmailIds==listEdMemberMailId.size()){
+ *//* if(mainEdt_MemberMailId!=null && !mainEdt_MemberMailId.getText().toString().isEmpty() && mainEdt_MemberMailId.getError()!=null){
+ return true;
+ }*//*
+ return true;
+ }
+ else{
+ return false;
+ }*/
+ }
+
+
+
+
+
+ if(str_currentSituation.equals(null) || str_currentSituation.equals("") || str_currentSituation.isEmpty()){
+ edt_currentSituation.setError("Enter current situation");
+ edt_currentSituation.requestFocus();
+ b_currentsituation=false;
+ // return false;
+ }
+
+
+ if(str_Title.equals(null) || str_Title.equals("") || str_Title.isEmpty()){
+ edt_projTitle.setError("Enter title of the project");
+ edt_projTitle.requestFocus();
+ b_titlename=false;
+ //return false;
+ }
+
+ if(str_beneficiaries.equals(null) || str_beneficiaries.equals("") || str_beneficiaries.isEmpty()){
+ edt_beneficiaries.setError("Enter no. of beneficiaries");
+ edt_beneficiaries.requestFocus();
+ b_beneficiaries=false;
+ //return false;
+ }
+
+
+
+
+ if(str_beneficiaries_name.equals(null) || str_beneficiaries_name.equals("") || str_beneficiaries_name.isEmpty()){
+ edt_beneficiaries_name.setError("Enter who are they");
+ edt_beneficiaries_name.requestFocus();
+ b_beneficiaries_name=false;
+ // return false;
+ }
+
+ if(str_placeOfImpl.equals(null) || str_placeOfImpl.equals("") || str_placeOfImpl.isEmpty()){
+ edt_placeOfImpl.setError("Enter place of Implementation");
+ edt_placeOfImpl.requestFocus();
+ b_placeofimpl=false;
+ //return false;
+ }
+
+ if(str_projectType.contains("Select")){
+/* edt_beneficiaries.setError("Enter no. of beneficiaries");
+ edt_beneficiaries.requestFocus();*/
+ Toast.makeText(context,"Please select the Project Type",Toast.LENGTH_LONG).show();
+ b_selecttype=false;
+ // return false;
+ }
+
+
+
+
+ if(str_objectives.equals(null) || str_objectives.equals("") || str_objectives.isEmpty()){
+ edt_objective.setError("Enter objective of the project");
+ edt_objective.requestFocus();
+ b_objectives=false;
+ //return false;
+ }
+
+
+
+//vijay
+ /*if(clickstartprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar")
+ ||clickendprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar"))
+ {
+ Toast.makeText(context, "Kindly enter the date", Toast.LENGTH_SHORT).show();
+ b_datevalidation1=false;
+ // return false;
+ }*/
+
+
+
+ if(clickstartprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar")
+ ||clickendprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar"))
+ {
+ Toast.makeText(context, "Kindly enter the date", Toast.LENGTH_SHORT).show();
+ b_datevalidation1=false;
+ }
+
+
+
+
+ if((!clickstartprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar"))
+ &&(!clickendprojectdate_tv.getText().toString().equalsIgnoreCase("Click for Calendar")))
+
+ {
+
+
+
+
+ if ((clickstartprojectdate_tv.getText().toString().length() != 0) && (clickendprojectdate_tv.getText().toString().length() != 0)) {
+ /*if(date1.compareTo(date2)<0){ //0 comes when two date are same,
+ //1 comes when date1 is higher then date2
+ //-1 comes when date1 is lower then date2 }*/
+
+
+ SimpleDateFormat mdyFormat = new SimpleDateFormat("yyyy-MM-dd"); //2017-06-22
+
+ try {
+ Date fromdate = mdyFormat.parse(yyyyMMdd_startdate);
+ Date todate = mdyFormat.parse(yyyyMMdd_enddate);
+
+ if (fromdate.compareTo(todate) <= 0)
+ {
+ //return true;
+ } else {
+ Toast.makeText(context, "Kindly enter valid date", Toast.LENGTH_SHORT).show();
+ b_datevalidation2 = false;
+ //return false;
+ }
+
+
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+ }//end of if
+
+ }
+
+
+
+ if(str_actionPlan.equals(null) || str_actionPlan.equals("") || str_actionPlan.isEmpty()){
+ edt_actionPlan.setError("Enter action plan of the project");
+ edt_actionPlan.requestFocus();
+ b_actionplan=false;
+ // return false;
+ }
+ /*else{
+ return true;
+ }*/
+
+
+
+ return( b_currentsituation&&b_titlename&&b_beneficiaries&&b_beneficiaries_name&&
+ b_placeofimpl&&b_selecttype&& b_objectives&&b_datevalidation1&&
+ b_actionplan&&b_datevalidation2&&b_materialName);
+
+
+ }
+
+ private void setProjectTypeSpinner(ArrayList projectTypeList) {
+
+ //getProjectType();
+
+ /*final ArrayList projType = new ArrayList();
+ projType.add("Education");
+ projType.add("Health Care");
+ projType.add("Sports");*/
+
+ ArrayAdapter dataAdapter2 = new ArrayAdapter(context, R.layout.simple_spinner_items, projectTypeList);
+
+ // Drop down layout style - list view with radio button
+ //dataAdapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ dataAdapter2.setDropDownViewResource(R.layout.spinnercustomstyle);
+
+ // attaching data adapter to spinner
+ spin_projectType.setAdapter(dataAdapter2);
+ //spin_projectType.setSupportBackgroundTintList(ContextCompat.getColorStateList(context, R.color.colorWhite));
+
+ }
+
+ private void getProjectType() {
+ ProjectType projType = new ProjectType(getActivity());
+ projType.execute();
+ }
+
+ public class ProjectType extends AsyncTask {
+
+ Context context;
+ AlertDialog alertDialog;
+
+ //private ProgressBar progressBar;
+
+ ProjectType (Context ctx){
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+ String METHOD_NAME = "GetThemeList";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/GetThemeList";
+ String NAMESPACE = "http://mis.leadcampus.org/";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
+
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Login.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("GetThemeList:",response.toString());
+
+ return response;
+
+ }
+
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+
+ t.printStackTrace();
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ }
+
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+
+ t.printStackTrace();
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ return null;
+
+
+ //Log.d("Soap response is",response.toString());
+
+ //return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ /* progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+ progressBar.setVisibility(View.VISIBLE);*/
+
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+ /* progressBar.setVisibility(View.GONE);*/
+ progressDialog.dismiss();
+
+ if(result!=null) {
+ String finalResult = result.toString();
+ String finals = finalResult.replace("anyType", "");
+ Log.d("Finals is", finals);
+
+ ArrayList projectTypeList = new ArrayList();
+ projectTypeList.add("Select Project Type");
+
+ Log.d("finalResultsssss", finalResult);
+
+ for (int i = 0; i < result.getPropertyCount(); i++) {
+ SoapObject list = (SoapObject) result.getProperty(i);
+ SoapPrimitive S_ThemeId, S_ThemeName, S_Status;
+ Object O_ThemeId, O_ThemeName, O_Status;
+
+ int projectTypeId = 0;
+
+ String str_ProjectTypeId = null, str_ProjectType = null, str_status = null;
+
+ O_ThemeId = list.getProperty("ThemeId");
+ if (!O_ThemeId.toString().equals("anyType") && !O_ThemeId.toString().equals(null) && !O_ThemeId.toString().equals("anyType{}")) {
+ S_ThemeId = (SoapPrimitive) list.getProperty("ThemeId");
+ Log.d("ThemeId", S_ThemeId.toString());
+ str_ProjectTypeId = O_ThemeId.toString();
+ projectTypeId = Integer.valueOf(str_ProjectTypeId);
+ }
+
+ O_ThemeName = list.getProperty("ThemeName");
+ if (!O_ThemeName.toString().equals("anyType") && !O_ThemeName.toString().equals(null) && !O_ThemeName.toString().equals("anyType{}")) {
+ S_ThemeName = (SoapPrimitive) list.getProperty("ThemeName");
+ Log.d("ProjectType Name", S_ThemeName.toString());
+ str_ProjectType = O_ThemeName.toString();
+
+ projectTypeList.add(str_ProjectType);
+
+ hashProjTypeId.put(str_ProjectType, projectTypeId);
+ }
+
+
+ }
+
+ setProjectTypeSpinner(projectTypeList);
+
+ }
+ //SoapPrimitive status = (SoapPrimitive) result.getProperty("Status");
+ //Log.d("Status is:",status.toString());
+
+ /*if(status.toString().equals("Success")) {
+ SoapPrimitive role = (SoapPrimitive) result.getProperty("Role");
+ Log.d("Role is:", role.toString());
+
+ if(role.toString().equals("Student")){
+ *//* Intent ittLoginToEditProfile = new Intent(LoginActivity.this,EditProfileActivity.class);
+ ittLoginToEditProfile.putExtra("leadid",leadid);
+ startActivity(ittLoginToEditProfile);*//*
+ }
+ }else{
+ Log.d("Status is: ",status.toString());
+ }*/
+
+
+ //setProjectTypeSpinner();
+
+
+
+
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private boolean isValidEmail(String email) {
+ String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{3,})$";
+
+ Pattern pattern = Pattern.compile(EMAIL_PATTERN);
+ Matcher matcher = pattern.matcher(email);
+ return matcher.matches();
+ }
+
+
+
+
+
+ public static void alerts_dialog(String str_error,String ws,Context context)
+ {
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(static_context1);
+ dialog.setCancelable(false);
+ dialog.setTitle("LeadMIS");
+ dialog.setMessage("Kindly submit the data before exiting");
+
+ /*Activity activity = (Activity) context;
+ fragmentManager = activity.getFragmentManager();
+*/
+
+
+ dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ /*FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+
+ fragmentTransaction.replace(R.id.frame_container, new Fragment_RHolidays());
+ fragmentTransaction.commit();*/
+
+ dialog.dismiss();
+
+ }
+ });
+
+
+
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+
+ }
+
+ public static boolean bruteforce(ArrayList input) {
+ for (int i = 0; i < input.size(); i++) {
+ for (int j = 0; j < input.size(); j++) {
+ if (input.get(i).equals(input.get(j)) && i != j) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/AddProjectObject.java b/app/src/main/java/com/leadcampusapp/AddProjectObject.java
new file mode 100644
index 0000000..ab9983b
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AddProjectObject.java
@@ -0,0 +1,118 @@
+package com.leadcampusapp;
+
+import org.ksoap2.serialization.KvmSerializable;
+import org.ksoap2.serialization.PropertyInfo;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+/**
+ * Created by Shripad on 08-07-2018.
+ */
+
+public class AddProjectObject implements KvmSerializable {
+ ArrayList materials;
+ String Title;
+ long Beneficiaries;
+ String Objectives;
+ String ActionPlan;
+ long PDId;
+ String Lead_Id;
+
+ public AddProjectObject(){
+
+ }
+
+/* public AddProjectObject(ArrayList matModel, String title, String beneficiaries, String objectives, String actionPlan, long PDId) {
+ this.vmmaterial = matModel;
+ Title = title;
+ Beneficiaries = beneficiaries;
+ Objectives = objectives;
+ ActionPlan = actionPlan;
+ this.PDId = PDId;
+ }*/
+
+ /* public ArrayList getMatModel() {
+ return materials;
+ }
+
+ public void setMatModel(ArrayList matModel) {
+ this.materials = matModel;
+ }*/
+
+ public ArrayList getMaterials() {
+ return materials;
+ }
+
+ public void setMaterials(ArrayList materials) {
+ this.materials = materials;
+ }
+
+ public String getLead_Id() {
+ return Lead_Id;
+ }
+
+ public void setLead_Id(String lead_Id) {
+ Lead_Id = lead_Id;
+ }
+
+ public String getTitle() {
+ return Title;
+ }
+
+ public void setTitle(String title) {
+ Title = title;
+ }
+
+ public long getBeneficiaries() {
+ return Beneficiaries;
+ }
+
+ public void setBeneficiaries(long beneficiaries) {
+ Beneficiaries = beneficiaries;
+ }
+
+ public String getObjectives() {
+ return Objectives;
+ }
+
+ public void setObjectives(String objectives) {
+ Objectives = objectives;
+ }
+
+ public String getActionPlan() {
+ return ActionPlan;
+ }
+
+ public void setActionPlan(String actionPlan) {
+ ActionPlan = actionPlan;
+ }
+
+ public long getPDId() {
+ return PDId;
+ }
+
+ public void setPDId(long PDId) {
+ this.PDId = PDId;
+ }
+
+ @Override
+ public Object getProperty(int i) {
+ return null;
+ }
+
+ @Override
+ public int getPropertyCount() {
+ return 0;
+ }
+
+ @Override
+ public void setProperty(int i, Object o) {
+
+ }
+
+ @Override
+ public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo propertyInfo) {
+
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/AmbassadorRequestFragment.java b/app/src/main/java/com/leadcampusapp/AmbassadorRequestFragment.java
new file mode 100644
index 0000000..1690883
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AmbassadorRequestFragment.java
@@ -0,0 +1,416 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 20-07-2018.
+ */
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+import android.widget.SimpleAdapter;
+
+import android.widget.Toast;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.leadcampusapp.module.AmbassadorRequestList;
+import com.leadcampusapp.module.AmbassadorRequestListModule;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class AmbassadorRequestFragment extends Fragment
+{
+
+ ListView list,list_head;
+ ArrayList> mylist, mylist_title;
+ ListAdapter adapter_title, adapter;
+ HashMap map1, map2;
+
+ AmbassadorRequestListModule ambassadorRequestListObj;
+ ArrayList ambassadorRequestListModules;
+ private ProgressBar progressBar;
+ AmbassadorRequestListModule[] ambassadorRequestInfosarr;
+ int responseCount=0;
+ int i=0;
+ String str_Lead_Id;
+
+ // Integer ManagerId;
+
+ public static final String PREFBook_PM= "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_PMID = "prefid_pmid"; //
+ SharedPreferences shardprefPM_obj;
+ String str_MangerID;
+ Integer MDId;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+ View view=inflater.inflate(R.layout.ambassadorrequest_fragment, container, false);
+
+ list = (ListView) view.findViewById(R.id.lv_ambassadorlist);
+ list_head = (ListView) view.findViewById(R.id.lv_ambassadorlisthead);
+ progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+ ambassadorRequestListObj = new AmbassadorRequestListModule();
+
+/* ManagerId = getActivity().getIntent().getExtras().getInt("ManagerId");
+ Log.i("tag","MangerID PMProjectDetails="+ManagerId);
+*/
+
+ shardprefPM_obj= getActivity().getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+
+ shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ str_MangerID = shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ Log.d("str_leadId:",str_MangerID);
+ // Toast.makeText(this,"LeadId: "+str_MangerID,Toast.LENGTH_LONG).show();
+ MDId=Integer.parseInt(str_MangerID);
+
+ GetAmbassadorRequestDetails getAmbassadorRequestDetails = new GetAmbassadorRequestDetails(getActivity());
+ getAmbassadorRequestDetails.execute(MDId);
+
+ // showActivity();
+ return view;
+ }
+
+ public void showActivity() {
+
+ mylist = new ArrayList>();
+ mylist_title = new ArrayList>();
+
+ /**********Display the headings************/
+ map1 = new HashMap();
+
+ // map1.put("slno", "Lead Id");
+ map1.put("one", " LEAD Id");
+ map1.put("two", "Student Name");
+ map1.put("three","Student Type");
+ /* map1.put("three","Applied");
+ map1.put("four","Disperse Amount");
+ map1.put("five","Balance Amount");*/
+ mylist_title.add(map1);
+
+
+ try {
+ adapter_title = new SimpleAdapter(getContext(), mylist_title, R.layout.pmmasterrequest_list,
+ new String[]{ "one", "two","three"}, new int[]{
+ R.id.LeadId, R.id.StudentName, R.id.StudentType});
+ list_head.setAdapter(adapter_title);
+ } catch (Exception e) {
+
+ }
+
+ /********************************************************/
+
+
+ for (int i = 0; i < AmbassadorRequestList.listview_arr.size(); i++) {
+
+ map2 = new HashMap();
+ map2.put("one", AmbassadorRequestList.listview_arr.get(i).getLead_Id());
+ map2.put("two", AmbassadorRequestList.listview_arr.get(i).getStudentName());
+ map2.put("three", AmbassadorRequestList.listview_arr.get(i).getStudent_Type());
+ // map2.put("four", ApprovedProjectList.listview_arr.get(i).getDisperse_amount());
+ //map2.put("five", ApprovedProjectList.listview_arr.get(i).getBalance_amount());
+ mylist.add(map2);
+
+ /* if(ApprovedProjectList.listview_arr.get(i).getApproved_amount().equals("0")){
+ list.setBackgroundColor(Color.GREEN);
+ }*/
+ }
+
+ try {
+ adapter = new SimpleAdapter(getContext(), mylist, R.layout.pmmasterrequest_list,
+ new String[]{"one", "two","three"}, new int[]{
+ R.id.LeadId, R.id.StudentName, R.id.StudentType});
+ list.setAdapter(adapter);
+ } catch (Exception e) {
+
+ }
+ /* if (ApprovedProjectList.listview_arr.get(i).getApproved_amount().equals("0")) {
+ list.setBackgroundColor(Color.YELLOW);
+ }*/
+
+ list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+
+ Object o = list.getItemAtPosition(position);
+
+ str_Lead_Id=AmbassadorRequestList.listview_arr.get(position).getLead_Id();
+
+ AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
+ alertDialogBuilder.setMessage("Are you sure, You wanted to make LEAD Ambassador");
+ alertDialogBuilder.setPositiveButton("Yes",
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface arg0, int arg1) {
+ // Toast.makeText(getActivity(), "You clicked yes button", Toast.LENGTH_LONG).show();
+ SubmitDetails submitDetails = new SubmitDetails();
+ submitDetails.execute();
+ }
+ });
+ alertDialogBuilder.setNegativeButton("No",new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ getActivity().finish();
+ }
+ });
+
+ final AlertDialog alertDialog = alertDialogBuilder.create();
+
+ alertDialog.setOnShowListener( new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.RED);
+ alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alertDialog.show();
+ }
+
+ });
+ }
+
+ public class SubmitDetails extends AsyncTask {
+
+ AlertDialog alertDialog;
+ // private ProgressBar progressBar;
+
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+
+ SoapPrimitive response = AmbassadorRequest();
+
+ // SoapObject response = ReApplyProjectDetails();
+ Log.d("Soap response issssss",response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ progressBar.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+ if(result != null) {
+ if (result.toString().equals("Error")) {
+ Toast.makeText(getContext(), "Error occured while saving to database", Toast.LENGTH_LONG).show();
+ } else {
+ Toast.makeText(getContext(), "Sucessfully updated to Lead Ambassador", Toast.LENGTH_LONG).show();
+ /*Intent ittEditProjToProjStatus = new Intent(getContext(),PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",0);
+ startActivity(ittEditProjToProjStatus);*/
+ GetAmbassadorRequestDetails getAmbassadorRequestDetails = new GetAmbassadorRequestDetails(getActivity());
+ getAmbassadorRequestDetails.execute(MDId);
+ }
+ }
+ progressBar.setVisibility(View.GONE);
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private SoapPrimitive AmbassadorRequest() {
+ String METHOD_NAME = "Applyleadmasterandambassador";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/Applyleadmasterandambassador";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("Lead_Id",str_Lead_Id);
+ Log.d("PDIdssssssxxxx","hi");
+
+ request.addProperty("Student_Type","Lead Ambassador");
+
+ Log.d("Requestisxxxxx",request.toString());
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Manager.toString().trim());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+ Log.e("tag","soap masterrequest update"+envelope.getResponse().toString());
+
+ //return null;
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+ }
+
+
+ public class GetAmbassadorRequestDetails extends AsyncTask {
+
+ Context context;
+
+ GetAmbassadorRequestDetails (Context ctx){
+ context = ctx;
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(Integer... params) {
+ Integer ManagerId = (Integer) params [0];
+ //SoapObject response = getStudDtls(leadid);
+
+ //unapprovedProjectListObj = new UnapprovedProjectListModule();
+ ambassadorRequestListModules = new ArrayList();
+
+ String METHOD_NAME = "ApplayedLeadAmbassador";
+ String NamespaceMail="http://mis.leadcampus.org/", SOAP_ACTION1="http://mis.leadcampus.org/ApplayedLeadAmbassador";//namespace+methodname
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("ManagerId", ManagerId);
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Manager.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ try {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ SoapObject response = (SoapObject) envelope.getResponse();
+
+ Log.d("Tag", "soap response ApplayedLeadAmbassador=" + response.toString());
+
+
+ responseCount = response.getPropertyCount();
+
+
+ Log.d("count ambassador", String.valueOf(response.getPropertyCount()));
+
+ AmbassadorRequestList.listview_arr.clear();
+ AmbassadorRequestListModule.listview_arr.clear();
+
+ if (responseCount > 0) {
+
+ ambassadorRequestInfosarr = new AmbassadorRequestListModule[responseCount];
+ for (i = 0; i < responseCount; i++) {
+
+ SoapObject response_soapobj = (SoapObject) response.getProperty(i); //resp starts from zero
+
+ String Status=response_soapobj.getProperty("Status").toString();
+ Log.i("tag","Status"+Status);
+
+ if( Status.equals("Success")) {
+ ambassadorRequestListObj.setStudentName(response_soapobj.getProperty("StudentName").toString());
+ ambassadorRequestListObj.setLead_Id(response_soapobj.getProperty("Lead_Id").toString());
+ ambassadorRequestListObj.setIsApply_MasterLeader(response_soapobj.getProperty("isApply_MasterLeader").toString());
+ ambassadorRequestListObj.setIsApply_LeadAmbassador(response_soapobj.getProperty("isApply_LeadAmbassador").toString());
+ ambassadorRequestListObj.setStudent_Type(response_soapobj.getProperty("Student_Type").toString());
+
+ // approvedProjectListObj.setBalance_amount(response_soapobj.getProperty("Amount").toString());
+ ambassadorRequestListModules.add(ambassadorRequestListObj);
+
+ Log.d("tag", "ambassadorRequestListModules.get(i)=" + ambassadorRequestListModules.get(i).getStudentName());
+ Log.d("tag", "ambassadorRequestListModules=" + ambassadorRequestListModules.size());
+ Log.d("tag", "ambassadorRequestListModules=" + ambassadorRequestListObj.getStudentName());
+
+ String StudentName = response_soapobj.getProperty("StudentName").toString();
+ String Lead_Id = response_soapobj.getProperty("Lead_Id").toString();
+ String isApply_MasterLeader = response_soapobj.getProperty("isApply_MasterLeader").toString();
+ String isApply_LeadAmbassador = response_soapobj.getProperty("isApply_LeadAmbassador").toString();
+ String Student_Type = response_soapobj.getProperty("Student_Type").toString();
+
+
+ ambassadorRequestInfosarr[i] = ambassadorRequestListObj;
+
+ AmbassadorRequestList.listview_arr.add(new AmbassadorRequestList(Lead_Id, StudentName, isApply_MasterLeader, isApply_LeadAmbassador, Student_Type));
+
+ Log.i("Tag", "AmbassadorRequestList.size=" + AmbassadorRequestList.listview_arr.size());
+ }else{
+ return null;
+ }
+ }
+ }
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+
+ return null;
+ }
+
+ @Override
+ protected void onPreExecute() {
+
+ progressBar.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+ progressBar.setVisibility(View.GONE);
+
+ /* if(result==null){
+ Toast.makeText(getActivity(),"There is no student applied for LEAD Ambassador ",Toast.LENGTH_LONG).show();
+ }*/
+ if(result!= null) {
+ showActivity();
+ }
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+
+}//end of fragment class
diff --git a/app/src/main/java/com/leadcampusapp/AnalyticAdapter.java b/app/src/main/java/com/leadcampusapp/AnalyticAdapter.java
new file mode 100644
index 0000000..f7754de
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AnalyticAdapter.java
@@ -0,0 +1,43 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 22-06-2018.
+ */
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+
+public class AnalyticAdapter extends FragmentStatePagerAdapter {
+ int mNumOfTabs;
+
+ public AnalyticAdapter(FragmentManager fm, int NumOfTabs) {
+ super(fm);
+ this.mNumOfTabs = NumOfTabs;
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+
+ switch (position) {
+ case 0:
+ ChartProjectCountFragment tab1 = new ChartProjectCountFragment();
+ return tab1;
+ /* case 1:
+ ChartStud_CollgCountFragment tab2 = new ChartStud_CollgCountFragment();
+ return tab2;*/
+ case 1:
+ ChartThemeProjCountFragment tab3 = new ChartThemeProjCountFragment();
+ return tab3;
+ case 2:
+ ChartFundAmtCountFragment tab4 = new ChartFundAmtCountFragment();
+ return tab4;
+ default:
+ return null;
+ }
+ }
+
+ @Override
+ public int getCount() {
+ return mNumOfTabs;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/AnalyticChartActivity.java b/app/src/main/java/com/leadcampusapp/AnalyticChartActivity.java
new file mode 100644
index 0000000..a9e86e4
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AnalyticChartActivity.java
@@ -0,0 +1,162 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.Bundle;
+//import android.support.design.widget.TabLayout;
+import androidx.viewpager.widget.ViewPager;
+import androidx.appcompat.app.AppCompatActivity;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.google.android.material.tabs.TabLayout;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+
+public class AnalyticChartActivity extends AppCompatActivity {
+
+ ImageButton img_eventsBack;
+
+ public static final String PREFBook_Stud= "prefbook_stud";
+ private SharedPreferences shardpref_S_obj;
+ public static final String PrefID_Role = "prefid_role";
+ public String str_role = null;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_analyticchart);
+
+ shardpref_S_obj=AnalyticChartActivity.this.getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ shardpref_S_obj.getString(PrefID_Role, "").trim();
+ str_role = shardpref_S_obj.getString(PrefID_Role, "").trim();
+
+
+ /* img_eventsBack = (ImageButton) findViewById(R.id.img_eventsBack);*/
+
+ getSupportActionBar().setDisplayShowCustomEnabled(true);
+ getSupportActionBar().setCustomView(R.layout.actionbar_layout);
+ //getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
+
+ View actionBarView = getSupportActionBar().getCustomView();
+ TextView actionBarTV = (TextView) actionBarView.findViewById(R.id.txt_actionBar);
+ actionBarTV.setText("Analytical Charts");
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+
+ View view1;
+ LayoutInflater inflater1 = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view1 = inflater1.inflate(R.layout.pm_projectcountchart_tablayout, null);
+
+ /* View view2;
+ LayoutInflater inflater2 = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view2 = inflater2.inflate(R.layout.pm_stu_collchart_tablayout, null);
+*/
+ View view3;
+ LayoutInflater inflater3 = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view3 = inflater3.inflate(R.layout.pm_themeproject_tablayout, null);
+
+ View view4;
+ LayoutInflater inflater4 = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view4 = inflater4.inflate(R.layout.pm_fundamt_tablayout, null);
+
+
+ TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
+ tabLayout.addTab(tabLayout.newTab().setCustomView(view1));
+ // tabLayout.addTab(tabLayout.newTab().setCustomView(view2));
+ tabLayout.addTab(tabLayout.newTab().setCustomView(view3));
+ tabLayout.addTab(tabLayout.newTab().setCustomView(view4));
+
+ TabLayout.Tab selectedTab = tabLayout.getTabAt(0);
+ View view = selectedTab.getCustomView();
+ TextView selectedText = (TextView) view.findViewById(R.id.txt_analytictabtitle);
+ selectedText.setTextColor(Color.parseColor("#000000"));
+
+
+ //tabLayout.addTab(tabLayout.newTab().setText("Tab 3"));
+ //tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
+
+ final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
+ final AnalyticAdapter adapter = new AnalyticAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
+ viewPager.setAdapter(adapter);
+ viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
+ tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+ @Override
+ public void onTabSelected(TabLayout.Tab tab) {
+ View view = tab.getCustomView();
+ TextView selectedText = (TextView) view.findViewById(R.id.txt_analytictabtitle);
+ selectedText.setTextColor(Color.parseColor("#000000"));
+ viewPager.setCurrentItem(tab.getPosition());
+ }
+
+ @Override
+ public void onTabUnselected(TabLayout.Tab tab) {
+ View view = tab.getCustomView();
+ TextView selectedText = (TextView) view.findViewById(R.id.txt_analytictabtitle);
+ selectedText.setTextColor(Color.parseColor("#000000"));
+ }
+
+ @Override
+ public void onTabReselected(TabLayout.Tab tab) {
+ View view = tab.getCustomView();
+ TextView selectedText = (TextView) view.findViewById(R.id.txt_analytictabtitle);
+ selectedText.setTextColor(Color.parseColor("#000000"));
+ }
+ });
+
+ /*img_eventsBack.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ finish();
+ }
+ });*/
+ }
+
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ MenuItem action_editProfile = menu.findItem(R.id.action_editProfile);
+ action_editProfile.setVisible(false);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+
+
+ /* if (id == R.id.action_editProfile) {
+ Intent ittEventsToEditProfile = new Intent(EventsActivity.this ,EditProfileActivity.class);
+ startActivity(ittEventsToEditProfile);
+ return true;
+ }*/
+
+ if (id == R.id.action_logout) {
+ Intent ittEventsToLogin = new Intent(AnalyticChartActivity.this ,LoginActivity.class);
+ startActivity(ittEventsToLogin);
+ return true;
+ }
+
+ if (id == android.R.id.home) {
+
+ if(str_role.equals("Student")) {
+ Intent ittEventsToStudHome = new Intent(AnalyticChartActivity.this, HomeActivity.class);
+ startActivity(ittEventsToStudHome);
+ }else{
+ Intent ittEventsToPMHome = new Intent(AnalyticChartActivity.this, PMHomeActivity.class);
+ startActivity(ittEventsToPMHome);
+ }
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/AnalyticsTrackers.java b/app/src/main/java/com/leadcampusapp/AnalyticsTrackers.java
new file mode 100644
index 0000000..2464774
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AnalyticsTrackers.java
@@ -0,0 +1,69 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+
+import com.google.android.gms.analytics.GoogleAnalytics;
+import com.google.android.gms.analytics.Tracker;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+
+
+import com.leadcampusapp.R;
+/*
+public class AnalyticsTrackers {
+}
+*/
+public final class AnalyticsTrackers {
+
+ public enum Target {
+ APP,
+ // Add more trackers here if you need, and update the code in #get(Target) below
+ }
+
+ private static AnalyticsTrackers sInstance;
+
+ public static synchronized void initialize(Context context) {
+ if (sInstance != null) {
+ throw new IllegalStateException("Extra call to initialize analytics trackers");
+ }
+
+ sInstance = new AnalyticsTrackers(context);
+ }
+
+ public static synchronized AnalyticsTrackers getInstance() {
+ if (sInstance == null) {
+ throw new IllegalStateException("Call initialize() before getInstance()");
+ }
+
+ return sInstance;
+ }
+
+ private final Map mTrackers = new HashMap();
+ private final Context mContext;
+
+ /**
+ * Don't instantiate directly - use {@link #getInstance()} instead.
+ */
+ private AnalyticsTrackers(Context context) {
+ mContext = context.getApplicationContext();
+ }
+
+ public synchronized Tracker get(Target target) {
+ if (!mTrackers.containsKey(target)) {
+ Tracker tracker;
+ switch (target) {
+ case APP:
+ tracker = GoogleAnalytics.getInstance(mContext).newTracker(R.xml.app_tracker);
+ break;
+ default:
+ throw new IllegalArgumentException("Unhandled analytics target " + target);
+ }
+ mTrackers.put(target, tracker);
+ }
+
+ return mTrackers.get(target);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/AutoFitGridLayoutManager.java b/app/src/main/java/com/leadcampusapp/AutoFitGridLayoutManager.java
new file mode 100644
index 0000000..5e4cddc
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/AutoFitGridLayoutManager.java
@@ -0,0 +1,46 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+//import androidx.appcompat.widget.GridLayoutManager;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * Created by anupamchugh on 05/03/17.
+ */
+
+public class AutoFitGridLayoutManager extends GridLayoutManager {
+
+ private int columnWidth;
+ private boolean columnWidthChanged = true;
+
+ public AutoFitGridLayoutManager(Context context, int columnWidth) {
+ super(context, 1);
+
+ setColumnWidth(columnWidth);
+ }
+
+
+ public void setColumnWidth(int newColumnWidth) {
+ if (newColumnWidth > 0 && newColumnWidth != columnWidth) {
+ columnWidth = newColumnWidth;
+ columnWidthChanged = true;
+ }
+ }
+
+ @Override
+ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
+ if (columnWidthChanged && columnWidth > 0) {
+ int totalSpace;
+ if (getOrientation() == VERTICAL) {
+ totalSpace = getWidth() - getPaddingRight() - getPaddingLeft();
+ } else {
+ totalSpace = getHeight() - getPaddingTop() - getPaddingBottom();
+ }
+ int spanCount = Math.max(1, totalSpace / columnWidth);
+ setSpanCount(spanCount);
+ columnWidthChanged = false;
+ }
+ super.onLayoutChildren(recycler, state);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/BottomSheetFragment.java b/app/src/main/java/com/leadcampusapp/BottomSheetFragment.java
new file mode 100644
index 0000000..9939360
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/BottomSheetFragment.java
@@ -0,0 +1,345 @@
+package com.leadcampusapp;
+
+import android.annotation.SuppressLint;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.media.MediaScannerConnection;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import androidx.annotation.NonNull;
+//import android.support.design.widget.BottomSheetBehavior;
+//import android.support.design.widget.BottomSheetDialogFragment;
+import androidx.annotation.RequiresApi;
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
+import androidx.core.content.FileProvider;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.android.material.bottomsheet.BottomSheetBehavior;
+import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+ * Created by gurleensethi on 15/01/18.
+ */
+
+@SuppressLint("ValidFragment")
+public class BottomSheetFragment extends BottomSheetDialogFragment {
+
+
+ TextView btn_readMore1;
+ ImageView shareit1;
+ ImageView iv_top;
+ Context mContext;
+ RelativeLayout share_images;
+ String story_blog;
+ String Story_Type;
+ public File pictureFile;
+ File pictureFileDir;
+ String Story_Video;
+ private BottomSheetBehavior mBottomSheetBehaviour;
+
+ @SuppressLint("ValidFragment")
+ public BottomSheetFragment(Context mContext, RelativeLayout share_images, String story_blog, File pictureFile,String Story_Type) {
+ this.mContext = mContext;
+ this.share_images = share_images;
+ this.story_blog = story_blog;
+ this.pictureFile = pictureFile;
+ this.Story_Type = Story_Type;
+ }
+
+ public BottomSheetFragment(Context mContext, RelativeLayout share_images, String story_blog, File pictureFile, String story_type, String story_video) {
+ this.mContext = mContext;
+ this.share_images = share_images;
+ this.story_blog = story_blog;
+ this.pictureFile = pictureFile;
+ this.Story_Type = story_type;
+ this.Story_Video = story_video;
+ }
+
+
+ /*@SuppressLint("ValidFragment")
+ public BottomSheetFragment(Context mContext, String story_Blog, File pictureFile, RelativeLayout share_images){
+ this.mContext=mContext;
+ story_blog=story_blog;
+ this.pictureFile=pictureFile;
+ this.share_images=share_images;
+ }*/
+
+ /* public BottomSheetFragment(String story_blog) {
+ this.story_blog=story_blog;
+ }*/
+ /* @SuppressLint("ValidFragment")
+ public BottomSheetFragment(String story_blog, File pictureFile) {
+ // this.Story_Type=Story_Type;
+ this.story_blog=story_blog;
+ this.pictureFile=pictureFile;
+ }*/
+
+ @SuppressLint("RestrictedApi")
+ @Override
+ public void setupDialog
+ (Dialog dialog, int style) {
+ super.setupDialog(dialog, style);
+
+ //Set the custom view
+ View view = LayoutInflater.from(getContext()).inflate(R.layout.fragment_bottom_sheet, null);
+ dialog.setContentView(view);
+
+ Log.i("tag","story_blog=="+story_blog);
+ btn_readMore1 = (TextView) view.findViewById(R.id.btn_readMore1);
+ shareit1=(ImageView) view.findViewById(R.id.shareit1);
+ iv_top=(ImageView) view.findViewById(R.id.iv_top);
+
+ // btn_readMore1.setVisibility(View.GONE);
+
+ /*btn_readMore1.setTextColor(Color.GRAY);
+ btn_readMore1.setClickable(false);
+ btn_readMore1.setFocusable(false);*/
+ /* }
+ else{
+ btn_readMore1.setVisibility(View.VISIBLE);
+
+ }*/
+ Log.i("tag","Story_Type="+Story_Type);
+ if(Story_Type.equals("1")){
+ btn_readMore1.setVisibility(View.GONE);
+ }else {
+ if(story_blog.equals("") || story_blog.equals("anyType{}") || story_blog.equals("null") || story_blog.equals("")) {
+ btn_readMore1.setVisibility(View.GONE);
+ }
+ else {
+ btn_readMore1.setVisibility(View.VISIBLE);
+ }
+ }
+
+ CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) view.getParent()).getLayoutParams();
+ final CoordinatorLayout.Behavior behavior = params.getBehavior();
+
+ if (behavior != null && behavior instanceof BottomSheetBehavior) {
+ ((BottomSheetBehavior) behavior).setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
+ @Override
+ public void onStateChanged(@NonNull View bottomSheet, int newState) {
+ String state = "";
+
+ switch (newState) {
+ case BottomSheetBehavior.STATE_DRAGGING: {
+ state = "DRAGGING";
+ break;
+ }
+ case BottomSheetBehavior.STATE_SETTLING: {
+ state = "SETTLING";
+ break;
+ }
+ case BottomSheetBehavior.STATE_EXPANDED: {
+ state = "EXPANDED";
+ break;
+ }
+ case BottomSheetBehavior.STATE_COLLAPSED: {
+ state = "COLLAPSED";
+ break;
+ }
+ case BottomSheetBehavior.STATE_HIDDEN: {
+ dismiss();
+ state = "HIDDEN";
+ break;
+ }
+ }
+
+ Toast.makeText(getContext(), "Bottom Sheet State Changed to: " + state, Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onSlide(@NonNull View bottomSheet, float slideOffset) {
+ }
+ });
+ }
+
+
+
+ shareit1.setOnClickListener(new View.OnClickListener() {
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+ public void onClick(View v) {
+ Log.i("TAG", "pictureFile=bottom="+pictureFile);
+ File file = saveBitMap(mContext, share_images);
+ if (file != null) {
+ Log.i("TAG", "Drawing saved to the gallery!");
+ } else {
+ Log.i("TAG", "Oops! Image could not be saved.");
+ }
+ if(Story_Type.equals("4")){
+ shareVideo();
+ }else {
+ shareImage();
+ }
+
+ // state. BottomSheetBehavior.STATE_HIDDEN;
+ dismiss();
+ }
+ });
+
+ btn_readMore1.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(story_blog));
+ mContext.startActivity(browserIntent);
+ }
+ });
+
+ iv_top.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //verticalViewPager.setAdapter(new VerticlePagerAdapter(getActivity(), LeadStoryList.listview_arr));
+
+ //verticalViewPager.setPageTransformer(true, new VerticalPageTransformerAnimate());
+ //verticalViewPager.setCurrentItem(0);
+ LeadStoryFragment.verticalFunction();
+ // mBottomSheetBehaviour.setState(BottomSheetBehavior.STATE_COLLAPSED);
+ dismiss();
+ }
+ });
+ }
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+ public File saveBitMap(Context context, View drawView){
+ pictureFileDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS),"Logicchip");
+ if (!pictureFileDir.exists()) {
+ boolean isDirectoryCreated = pictureFileDir.mkdirs();
+ if(!isDirectoryCreated)
+ Log.i("TAG", "Can't create directory to save the image");
+ return null;
+ }
+ String filename = pictureFileDir.getPath() + File.separator+ System.currentTimeMillis()+".jpg";
+ pictureFile = new File(filename);
+ Bitmap bitmap =getBitmapFromView(drawView);
+ try {
+ pictureFile.createNewFile();
+ FileOutputStream oStream = new FileOutputStream(pictureFile);
+ bitmap.compress(Bitmap.CompressFormat.PNG, 100, oStream);
+ oStream.flush();
+ oStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ Log.i("TAG", "There was an issue saving the image.");
+ }
+ scanGallery( context,pictureFile.getAbsolutePath());
+ Log.i("tag","pictureFile="+pictureFile);
+ return pictureFile;
+ }
+ private void scanGallery(Context cntx, String path) {
+ try {
+ MediaScannerConnection.scanFile(cntx, new String[]{path}, null, new MediaScannerConnection.OnScanCompletedListener() {
+ public void onScanCompleted(String path, Uri uri) {
+ }
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ Log.i("TAG", "There was an issue scanning gallery.");
+ }
+ }
+ private Bitmap getBitmapFromView(View view) {
+ //Define a bitmap with the same size as the view
+ Bitmap returnedBitmap;
+ if(Build.VERSION.SDK_INT == Build.VERSION_CODES.M){
+ returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),Bitmap.Config.ARGB_8888);
+ }else if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP){
+ returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),Bitmap.Config.ARGB_8888);
+ }else if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1){
+ returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),Bitmap.Config.ARGB_8888);
+ }else {
+ returnedBitmap = Bitmap.createBitmap(1080, 1500, Bitmap.Config.ARGB_8888);
+ }
+ //Bind a canvas to it
+ Canvas canvas = new Canvas(returnedBitmap);
+ //Get the view's background
+ Drawable bgDrawable =view.getBackground();
+ if (bgDrawable!=null) {
+ //has background drawable, then draw it on the canvas
+ bgDrawable.draw(canvas);
+ } else{
+ //does not have background drawable, then draw white background on the canvas
+ canvas.drawColor(Color.WHITE);
+ }
+ // draw the view on the canvas
+ view.draw(canvas);
+ //return the bitmap
+ return returnedBitmap;
+ }
+
+ /* private Bitmap getBitmapFromView(View view) {
+ //Define a bitmap with the same size as the view
+ Bitmap returnedBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
+ //Bind a canvas to it
+ Canvas canvas = new Canvas(returnedBitmap);
+ //Get the view's background
+ Drawable bgDrawable =view.getBackground();
+ if (bgDrawable!=null) {
+ //has background drawable, then draw it on the canvas
+ bgDrawable.draw(canvas);
+ } else{
+ //does not have background drawable, then draw white background on the canvas
+ canvas.drawColor(Color.WHITE);
+ }
+ // draw the view on the canvas
+ view.draw(canvas);
+ //return the bitmap
+ return returnedBitmap;
+ }
+*/
+ public void shareVideo() {
+ Intent share = new Intent(Intent.ACTION_SEND);
+ share.setType("image/*");
+
+ String imagePath= pictureFile.getAbsolutePath();
+ Log.i("tag","pictureFile="+imagePath);
+ File imageFileToShare = new File(imagePath);
+
+ //Uri uri = Uri.fromFile(pictureFile);
+ Uri uri = FileProvider.getUriForFile(getContext(), "com.mydomain.fileprovider", pictureFile);
+ share.putExtra(android.content.Intent.EXTRA_SUBJECT, "Leader Story");
+ share.putExtra(Intent.EXTRA_TEXT,"http://www.youtube.com/embed/"+Story_Video);
+ share.putExtra(Intent.EXTRA_STREAM, uri);
+
+ startActivity(Intent.createChooser(share, "Share Image!"));
+ // File fdelete = new File(imagePath);
+ // if (pictureFileDir.exists()) {
+
+ //}
+ }
+ public void shareImage() {
+ Intent share = new Intent(Intent.ACTION_SEND);
+ share.setType("image/*");
+
+ String imagePath= pictureFile.getAbsolutePath();
+ Log.i("tag","pictureFile="+imagePath);
+ File imageFileToShare = new File(imagePath);
+
+ // Uri uri = Uri.fromFile(pictureFile);
+ Uri uri = FileProvider.getUriForFile(getContext(), "com.mydomain.fileprovider", pictureFile);
+ share.putExtra(android.content.Intent.EXTRA_SUBJECT, "Leader Story");
+ // share.putExtra(Intent.EXTRA_TEXT,"http://www.youtube.com/embed/"+story_blog);
+ share.putExtra(Intent.EXTRA_STREAM, uri);
+
+ startActivity(Intent.createChooser(share, "Share Image!"));
+ // File fdelete = new File(imagePath);
+ // if (pictureFileDir.exists()) {
+
+ //}
+ }
+ /* public void show(FragmentManager supportFragmentManager, String tag, String story_blog) {
+ Log.i("tag","story_blog"+story_blog);
+ }*/
+}
diff --git a/app/src/main/java/com/leadcampusapp/ChartFundAmtCountFragment.java b/app/src/main/java/com/leadcampusapp/ChartFundAmtCountFragment.java
new file mode 100644
index 0000000..9c9d3d5
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChartFundAmtCountFragment.java
@@ -0,0 +1,641 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 20-07-2018.
+ */
+
+import android.annotation.SuppressLint;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import androidx.core.content.ContextCompat;
+import androidx.appcompat.widget.AppCompatSpinner;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.github.mikephil.charting.charts.BarChart;
+import com.github.mikephil.charting.charts.PieChart;
+import com.github.mikephil.charting.components.Legend;
+import com.github.mikephil.charting.components.XAxis;
+import com.github.mikephil.charting.components.YAxis;
+import com.github.mikephil.charting.data.BarData;
+import com.github.mikephil.charting.data.BarDataSet;
+import com.github.mikephil.charting.data.BarEntry;
+import com.github.mikephil.charting.data.Entry;
+import com.github.mikephil.charting.data.PieData;
+import com.github.mikephil.charting.data.PieDataSet;
+import com.github.mikephil.charting.formatter.PercentFormatter;
+import com.github.mikephil.charting.utils.ColorTemplate;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class ChartFundAmtCountFragment extends Fragment
+{
+
+ private ArrayList listThemeName;
+ private ArrayList listCount;
+
+ public static final String PREFBook_PM= "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_PMID = "prefid_pmid"; //
+ SharedPreferences shardprefPM_obj;
+ String str_MangerID;
+ Integer MDId;
+ BarChart barChart;
+ String AcademicYear;
+ private HashMap mapYearCode;
+ AppCompatSpinner sandbox_spin,year_spin;
+ PieChart pieChart;
+ String str_Status=null,str_fundriserdamount=null,str_Counts=null,str_SanctionAmount,str_fundRelised,str_AcademicCode;
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+ View view=inflater.inflate(R.layout.activity_pm_fundamt_count, container, false);
+ listThemeName = new ArrayList();
+ listCount = new ArrayList();
+
+ shardprefPM_obj= getActivity().getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+
+ shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ str_MangerID = shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ Log.d("str_MDId:",str_MangerID);
+ // Toast.makeText(this,"LeadId: "+str_MangerID,Toast.LENGTH_LONG).show();
+ MDId=Integer.parseInt(str_MangerID);
+
+ barChart = (BarChart) view.findViewById(R.id.piechart);
+
+ /* pieChart = (PieChart) view.findViewById(R.id.piechart);
+ pieChart.setUsePercentValues(true);*/
+
+ year_spin=(AppCompatSpinner) view.findViewById(R.id.spin_year);
+ mapYearCode = new HashMap();
+ initializeSpinnerYear();
+
+ year_spin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ AcademicYear = year_spin.getSelectedItem().toString();
+
+ if(AcademicYear!="Select Year"){
+ GetFundAmtCount getFundAmtCount = new GetFundAmtCount(getActivity());
+ getFundAmtCount.execute();
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+ // GetFundAmtCount getFundAmtCount = new GetFundAmtCount(getActivity());
+ // getFundAmtCount.execute();
+
+ return view;
+ }
+
+ @SuppressLint("RestrictedApi")
+ private void initializeSpinnerYear() {
+ final ArrayList listYear = new ArrayList();
+
+ // listYear.add("Select Year");
+ listYear.add("2018-2019");
+ listYear.add("2017-2018");
+ listYear.add("2016-2017");
+ listYear.add("2015-2016");
+ listYear.add("2014-2015");
+ listYear.add("Below 2014");
+
+ mapYearCode.put("Below 2014",0);
+ mapYearCode.put("2014-2015",1);
+ mapYearCode.put("2015-2016",2);
+ mapYearCode.put("2016-2017",3);
+ mapYearCode.put("2017-2018",4);
+ mapYearCode.put("2018-2019",5);
+
+ ArrayAdapter dataAdapterListYear = new ArrayAdapter(getContext(), R.layout.simple_spinner_items, listYear);
+ dataAdapterListYear.setDropDownViewResource(R.layout.spinnercustomstyle);
+
+ year_spin.setAdapter(dataAdapterListYear);
+ year_spin.setSupportBackgroundTintList(ContextCompat.getColorStateList(getContext(), R.color.colorBlack));
+
+ }
+
+ public class GetFundAmtCount extends AsyncTask {
+
+ Context context;
+ //AlertDialog alertDialog;
+ private ProgressDialog progressDialog;
+
+ //private ProgressBar progressBar;
+
+ GetFundAmtCount (Context ctx){
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(Void... params) {
+ //String str_leadId = (String) params [0];
+ //String versionCode = (String) params[2];
+
+ SoapObject response = getFundAmtCount();
+
+ //Log.d("GetThemeWiseProjCout",response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ /* progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+ progressBar.setVisibility(View.VISIBLE);*/
+
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+
+ Log.d("GetFundAmt resp",result.toString());
+
+ SoapPrimitive S_Status,S_ThemeName,S_Counts,S_fundriserdamount,S_SanctionAmount,S_fundRelised,S_AcademicCode;
+ Object O_Status,O_ThemeName,O_Counts,O_fundriserdamount,O_SanctionAmount,O_fundRelised,O_AcademicCode;
+
+ for(int i=0;i < result.getPropertyCount();i++) {
+ SoapObject list = (SoapObject) result.getProperty(i);
+
+ Log.d("finalStringssssss",list.toString());
+ SoapPrimitive indivisualObject = (SoapPrimitive) list.getProperty("Status");
+
+ O_Status = list.getProperty("Status");
+ if (!O_Status.toString().equals("anyType{}") && !O_Status.toString().equals(null)) {
+ S_Status = (SoapPrimitive) list.getProperty("Status");
+ Log.d("Status:", S_Status.toString());
+ str_Status = S_Status.toString();
+ }
+
+
+ if(str_Status.equalsIgnoreCase("Success")) {
+ O_AcademicCode = list.getProperty("AcademicCode");
+ if (!O_AcademicCode.toString().equals("anyType{}") && !O_AcademicCode.toString().equals(null)) {
+ S_AcademicCode = (SoapPrimitive) list.getProperty("AcademicCode");
+ Log.d("S_AcademicCode", S_AcademicCode.toString());
+ str_AcademicCode = S_AcademicCode.toString();
+ }
+ int yearId = mapYearCode.get(AcademicYear);
+ if(str_AcademicCode.equals(String.valueOf(yearId))){
+ O_fundriserdamount = list.getProperty("fundriserdamount");
+ if (!O_fundriserdamount.toString().equals("anyType{}") && !O_fundriserdamount.toString().equals(null)) {
+ S_fundriserdamount = (SoapPrimitive) list.getProperty("fundriserdamount");
+ Log.d("S_fundriserdamount", S_fundriserdamount.toString());
+ str_fundriserdamount = S_fundriserdamount.toString();
+ }
+
+ O_SanctionAmount = list.getProperty("SanctionAmount");
+ if (!O_SanctionAmount.toString().equals("anyType{}") && !O_SanctionAmount.toString().equals(null)) {
+ S_SanctionAmount = (SoapPrimitive) list.getProperty("SanctionAmount");
+ Log.d("SanctionAmount", S_SanctionAmount.toString());
+ str_SanctionAmount = S_SanctionAmount.toString();
+ }
+
+ O_fundRelised = list.getProperty("fundRelised");
+ if (!O_fundRelised.toString().equals("anyType{}") && !O_fundRelised.toString().equals(null)) {
+ S_fundRelised = (SoapPrimitive) list.getProperty("fundRelised");
+ Log.d("fundRelised", S_fundRelised.toString());
+ str_fundRelised = S_fundRelised.toString();
+ }
+
+ }
+
+
+
+ /* if (str_ThemeName != null && !str_ThemeName.isEmpty() && str_ThemeName != "" && !str_ThemeName.equals("anyType{}") && str_ThemeName != "{}") {
+ //txt.setText(str_ThemeName);
+ Log.d("ThemeNameIsss",str_ThemeName);
+ listThemeName.add(str_ThemeName);
+ }
+*/
+ /* if (str_Counts != null && !str_Counts.isEmpty() && str_Counts != "" && !str_Counts.equals("anyType{}") && str_Counts != "{}") {
+ //txt.setText(str_ThemeName);
+ Log.d("Countssissss",str_Counts);
+ listCount.add(str_Counts);
+ }*/
+
+ /* if (str_StudCollegeName != null && !str_StudCollegeName.isEmpty() && str_StudCollegeName != "" && !str_StudCollegeName.equals("anyType{}") && str_StudCollegeName != "{}") {
+ txt_studCollegeName.setText(str_StudCollegeName);
+ }
+
+ if (str_StudLeadId != null && !str_StudLeadId.isEmpty() && str_StudLeadId != "" && !str_StudLeadId.equals("anyType{}") && str_StudLeadId != "{}") {
+ txt_leadId.setText(str_StudLeadId);
+ }
+
+ if (str_StudType != null && !str_StudType.isEmpty() && str_StudType != "" && !str_StudType.equals("anyType{}") && str_StudType != "{}") {
+ txt_studType.setText(str_StudType);
+ }
+*/
+ }
+
+ }
+
+ // multiBarchartsInOne();
+ // pieChartFunction();
+ newbarchart();
+ progressDialog.dismiss();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private SoapObject getFundAmtCount()
+ {
+
+ String METHOD_NAME = "GetFundamountYearwise";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/GetFundamountYearwise";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("ManagerId", MDId);
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Manager.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ Log.d("soap responseyyyyyyy",envelope.getResponse().toString());
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("soap responseyyyyyyy",response.toString());
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+
+ }
+
+ private void pieChartFunction(){
+
+ Float AcademicCode_float= Float.valueOf(str_AcademicCode).floatValue();
+ Float fundriserdamount_float= Float.valueOf(str_fundriserdamount).floatValue();
+ Float fundRelised_float= Float.valueOf(str_fundRelised).floatValue();
+ Float SanctionAmount_float= Float.valueOf(str_SanctionAmount).floatValue();
+
+ ArrayList yvalues2 = new ArrayList();
+ ArrayList xVals2 = new ArrayList();
+
+ if(fundriserdamount_float!=0) {
+ yvalues2.add(new Entry(fundriserdamount_float, 0));
+ }
+ if(fundRelised_float!=0) {
+ yvalues2.add(new Entry(fundRelised_float, 1));
+ }
+ if(SanctionAmount_float!=0) {
+ yvalues2.add(new Entry(SanctionAmount_float, 2));
+ }
+ /*if(Not_Assigned_Per_float!=0) {
+ yvalues2.add(new Entry(Not_Assigned_Per_float, 3));
+ }*/
+
+
+ // PieDataSet dataSet2 = new PieDataSet(yvalues2, "");
+ // pieChart.getDescription().setEnabled(false);
+
+ xVals2.add("Fund Raised");
+ xVals2.add("Fund Released");
+ xVals2.add("Approved Amount");
+ // xVals2.add("Not_Assigned_Per");
+
+ // pieChart.setEntryLabelColor(Color.BLACK);
+ PieDataSet dataSet = new PieDataSet(yvalues2, "");
+
+ final int[] MY_COLORS = {Color.rgb(45, 170, 165), Color.rgb(198, 53, 53), Color.rgb(243, 200, 61),
+ Color.rgb(45, 170, 165), Color.rgb(146,208,80), Color.rgb(0,176,80), Color.rgb(79,129,189)};
+ ArrayList colors = new ArrayList();
+
+ for(int c: MY_COLORS) colors.add(c);
+
+ /* ArrayList colors = new ArrayList();
+
+ for (int c : ColorTemplate.VORDIPLOM_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.JOYFUL_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.COLORFUL_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.LIBERTY_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.PASTEL_COLORS)
+ colors.add(c);*/
+
+ // colors.add(ColorTemplate.getHoloBlue());
+
+ dataSet.setColors(colors);
+
+ PieData data = new PieData(xVals2,dataSet);
+ // In Percentage term
+ data.setValueFormatter(new PercentFormatter());
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+ pieChart.setData(data);
+ /* pieChart.setDescription("Student and College Counts");
+ pieChart.setDescriptionColor(Color.WHITE);
+ pieChart.setDescriptionPosition(450,100);
+ pieChart.setDescriptionTextSize(20f);*/
+ pieChart.getLegend().setTextColor(Color.BLACK);
+ pieChart.setDrawHoleEnabled(true);
+ pieChart.setTransparentCircleRadius(25f);
+ pieChart.setHoleRadius(25f);
+ pieChart.setDrawSliceText(false);
+ // dataSet.setColors(ColorTemplate.JOYFUL_COLORS);
+ data.setValueTextSize(10f);
+ data.setValueTextColor(Color.DKGRAY);
+ pieChart.setDescriptionColor(Color.WHITE);
+
+ // pieChart.setOnChartValueSelectedListener(this);
+
+ pieChart.animateXY(1400, 1400);
+
+ }
+ private void multiBarchartsInOne() {
+ // create BarEntry for Bar Group 1
+/* HorizontalBarChart barChart = (HorizontalBarChart) findViewById(R.id.barchart);
+
+ ArrayList bargroup1 = new ArrayList<>();
+ bargroup1.add(new BarEntry(8f, 0));
+ bargroup1.add(new BarEntry(2f, 1));
+ bargroup1.add(new BarEntry(5f, 2));
+ bargroup1.add(new BarEntry(20f, 3));
+ bargroup1.add(new BarEntry(15f, 4));
+ bargroup1.add(new BarEntry(19f, 5));
+
+// create BarEntry for Bar Group 1
+ ArrayList bargroup2 = new ArrayList<>();
+ bargroup2.add(new BarEntry(6f, 0));
+ bargroup2.add(new BarEntry(10f, 1));
+ bargroup2.add(new BarEntry(5f, 2));
+ bargroup2.add(new BarEntry(25f, 3));
+ bargroup2.add(new BarEntry(4f, 4));
+ bargroup2.add(new BarEntry(17f, 5));
+
+// creating dataset for Bar Group1
+ BarDataSet barDataSet1 = new BarDataSet(bargroup1, "Bar Group 1");
+
+//barDataSet1.setColor(Color.rgb(0, 155, 0));
+ barDataSet1.setColors(ColorTemplate.COLORFUL_COLORS);
+
+// creating dataset for Bar Group 2
+ BarDataSet barDataSet2 = new BarDataSet(bargroup2, "Bar Group 2");
+ barDataSet2.setColors(ColorTemplate.COLORFUL_COLORS);
+
+ List dataSets = new ArrayList<>(); // combined all dataset into an arraylist
+ dataSets.add(barDataSet1);
+ dataSets.add(barDataSet2);
+
+
+
+
+
+
+
+ //BarDataSet bardataset = new BarDataSet(entries, "Cells");
+
+ ArrayList labels = new ArrayList();
+ labels.add("2016");
+ labels.add("2015");
+ labels.add("2014");
+ labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");
+ labels.add("2010");
+ labels.add("2009");
+ labels.add("2008");
+ labels.add("2007");
+ labels.add("2006");
+ labels.add("2005");
+ labels.add("2004");
+ labels.add("2003");
+
+
+ //BarData data = new BarData(labels,dataSets);
+ BarData data = new BarData(labels,dataSets);
+ barChart.setData(data); // set the data and list of lables into chart
+
+ barChart.setDescription("Set Bar Chart Description"); // set the description
+
+ //bardataset.setColors(ColorTemplate.COLORFUL_COLORS);
+
+ barChart.animateY(5000);*/
+
+
+
+
+
+ //HorizontalBarChart barChart = (HorizontalBarChart) findViewById(R.id.barchart);
+
+ ArrayList entries = new ArrayList<>();
+
+
+ for(int k=0;k labels = new ArrayList();
+ labels.add("2016");
+ labels.add("2015");
+ labels.add("2014");
+ labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");
+
+ // barChart.getXAxis().setValueFormatter(new IndexAxisValueFormatter(labels));
+ // XAxis xAxis = barChart.getXAxis();
+ // xAxis.setValueFormatter(new IndexAxisValueFormatter(labels));
+
+ String[] arrString = new String[listThemeName.size()];
+
+ for(int l=0;l entries = new ArrayList<>();
+Log.i("tag","SanctionAmount_float="+SanctionAmount_float+"fundriserdamount_float="+fundriserdamount_float+"fundRelised_float="+fundRelised_float);
+ if(SanctionAmount_float!=null) {
+ if (SanctionAmount_float != 0) {
+ entries.add(new BarEntry(SanctionAmount_float, 1));
+ }
+ }
+ if(fundriserdamount_float!=null) {
+ if (fundriserdamount_float != 0) {
+ entries.add(new BarEntry(fundriserdamount_float, 0));
+ }
+ }
+ if(fundRelised_float!=null) {
+ if (fundRelised_float != 0) {
+ entries.add(new BarEntry(fundRelised_float, 2));
+ }
+ }
+ /*entries.add(new BarEntry(20f, 3));
+ entries.add(new BarEntry(15f, 4));
+ entries.add(new BarEntry(19f, 5));*/
+
+ /* for(int k=0;k labels = new ArrayList();
+ if(SanctionAmount_float!=null) {
+ if (SanctionAmount_float != 0) {
+ labels.add("Approved Amount");
+ }
+ }
+ if(fundriserdamount_float!=null) {
+ if (fundriserdamount_float != 0) {
+ labels.add("Requested Amount");
+ }
+ }
+ if(fundRelised_float!=null) {
+ if (fundRelised_float != 0) {
+ labels.add("Fund Released");
+ }
+ }
+ BarDataSet bardataset = new BarDataSet(entries, null);
+
+
+ /* labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");*/
+
+
+ BarData data1 = new BarData(labels, bardataset);
+ barChart.setData(data1); // set the data and list of lables into chart
+
+
+ // barChart.setDescription(""); // set the description
+ final int[] MY_COLORS = {Color.rgb(45, 170, 165),Color.rgb(243, 200, 61), Color.rgb(198, 53, 53),
+ Color.rgb(144, 193, 51), Color.rgb(146,208,80), Color.rgb(0,176,80), Color.rgb(79,129,189)};
+ ArrayList colors = new ArrayList();
+
+ for(int c: MY_COLORS) colors.add(c);
+
+ bardataset.setColors(colors);
+
+
+ Legend legend = barChart.getLegend();
+ legend.setEnabled(false);
+ legend.setPosition(Legend.LegendPosition.BELOW_CHART_CENTER);
+ legend.setForm(Legend.LegendForm.SQUARE);
+ /* legend.setColors(colors);
+ legend.setLabels(labels);*/
+
+ barChart.setDescription(null);
+ XAxis xLabels = barChart.getXAxis();
+ // xLabels.setPosition(XAxis.XAxisPosition.BOTTOM_INSIDE);
+ xLabels.setTextColor(Color.BLACK);
+ YAxis yLabels = (YAxis) barChart.getAxisLeft();
+ yLabels.setTextColor(Color.BLACK);
+
+ YAxis yLabels1 = (YAxis) barChart.getAxisRight();
+ yLabels1.setTextColor(Color.BLACK);
+ // xLabels.setLabelRotationAngle(-30f);
+
+ barChart.setDescriptionColor(Color.WHITE);
+
+ barChart.animateY(3000);
+
+ }
+
+}//end of fragment class
diff --git a/app/src/main/java/com/leadcampusapp/ChartProjectCountFragment.java b/app/src/main/java/com/leadcampusapp/ChartProjectCountFragment.java
new file mode 100644
index 0000000..dea8cee
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChartProjectCountFragment.java
@@ -0,0 +1,574 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 20-07-2018.
+ */
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.github.mikephil.charting.charts.BarChart;
+import com.github.mikephil.charting.charts.PieChart;
+import com.github.mikephil.charting.components.Legend;
+import com.github.mikephil.charting.components.XAxis;
+import com.github.mikephil.charting.components.YAxis;
+import com.github.mikephil.charting.data.BarData;
+import com.github.mikephil.charting.data.BarDataSet;
+import com.github.mikephil.charting.data.BarEntry;
+import com.github.mikephil.charting.data.Entry;
+import com.github.mikephil.charting.data.PieData;
+import com.github.mikephil.charting.data.PieDataSet;
+import com.github.mikephil.charting.formatter.PercentFormatter;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.util.ArrayList;
+
+public class ChartProjectCountFragment extends Fragment //implements OnChartValueSelectedListener
+{
+
+ int count=0;
+ Integer MDId;
+ SharedPreferences shardprefPM_obj;
+ public static final String PREFBook_PM= "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_PMID = "prefid_pmid";
+ String str_MangerID;
+ PieChart pieChart;
+
+ String str_responsecount,str_responseStatus,str_studentcount,str_collegecount;
+ String ApprovedCount="0",ComplitedCount="0",UnapprovedCount="0",RequestForCompletion="0",Rejected="0",RequestForModification="0";
+
+ public static final String PREFBook_PM_Count= "prefbook_pm_count"; //sharedpreference Book
+ public static final String PrefID_UNCount = "prefid_UNCount"; //
+ public static final String PrefID_ComCount = "prefid_ComCount"; //
+ public static final String PrefID_AppCount = "prefid_AppCount"; //
+ public static final String PrefID_ReqModCount = "prefid_ReqModCount"; //
+ public static final String PrefID_RejCount = "prefid_RejCount"; //
+ public static final String PrefID_ReqComCount = "prefid_ReqComCount"; //
+
+ SharedPreferences shardprefPM_obj_count;
+ SharedPreferences.Editor editor_PM_count;
+ BarChart barChart;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+ View view=inflater.inflate(R.layout.frag_project_countchart, container, false);
+ Intent intent = getActivity().getIntent();
+
+ // barChart = (BarChart) view.findViewById(R.id.piechart);
+
+ shardprefPM_obj= getActivity().getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+
+ shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ str_MangerID = shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ Log.d("str_leadId:",str_MangerID);
+ // Toast.makeText(this,"LeadId: "+str_MangerID,Toast.LENGTH_LONG).show();
+ MDId=Integer.parseInt(str_MangerID);
+
+ shardprefPM_obj_count=getActivity().getSharedPreferences(PREFBook_PM_Count, Context.MODE_PRIVATE);
+
+ shardprefPM_obj_count.getString(PrefID_AppCount, "").trim();
+ ApprovedCount = shardprefPM_obj_count.getString(PrefID_AppCount, "").trim();
+ Log.d("ApprovedCount:",ApprovedCount);
+
+ shardprefPM_obj_count.getString(PrefID_UNCount, "").trim();
+ UnapprovedCount = shardprefPM_obj_count.getString(PrefID_UNCount, "").trim();
+ Log.d("ApprovedCount:",UnapprovedCount);
+
+ shardprefPM_obj_count.getString(PrefID_RejCount, "").trim();
+ Rejected = shardprefPM_obj_count.getString(PrefID_RejCount, "").trim();
+ Log.d("ApprovedCount:",Rejected);
+
+ shardprefPM_obj_count.getString(PrefID_ReqComCount, "").trim();
+ RequestForCompletion = shardprefPM_obj_count.getString(PrefID_ReqComCount, "").trim();
+ Log.d("RequestForCompletion:",RequestForCompletion);
+
+ shardprefPM_obj_count.getString(PrefID_ReqModCount, "").trim();
+ RequestForModification = shardprefPM_obj_count.getString(PrefID_ReqModCount, "").trim();
+ Log.d("PrefID_ReqModCount:",RequestForModification);
+
+ shardprefPM_obj_count.getString(PrefID_ComCount, "").trim();
+ ComplitedCount = shardprefPM_obj_count.getString(PrefID_ComCount, "").trim();
+ Log.d("PrefID_ComCount:",ComplitedCount);
+
+ /*String UnapprovedCount=intent.getStringExtra("UnapprovedCount");
+ String ComplitedCount=intent.getStringExtra("ComplitedCount");
+ String ApprovedCount=intent.getStringExtra("ApprovedCount");
+ String RequestForCompletion=intent.getStringExtra("RequestForCompletion");
+ String RequestForModification=intent.getStringExtra("RequestForModification");
+ String Rejected=intent.getStringExtra("Rejected");
+ String str_studentcount=intent.getStringExtra("str_studentcount");
+ String str_collegecount=intent.getStringExtra("str_collegecount");*/
+
+ pieChart = (PieChart) view.findViewById(R.id.piechart);
+ pieChart.setUsePercentValues(true);
+
+ Log.i("tag","UnapprovedCount"+UnapprovedCount);
+
+
+ /* ArrayList yvalues = new ArrayList();
+ ArrayList xVals = new ArrayList();
+
+
+ if(unapproved_float!=0) {
+ yvalues.add(new Entry(unapproved_float, 0));
+ xVals.add("Proposed");
+ }
+ if(approved_float!=0) {
+ yvalues.add(new Entry(approved_float, 2));
+ xVals.add("Approved");
+ }
+ if(complited_float!=0) {
+ yvalues.add(new Entry(complited_float, 1));
+ xVals.add("Completed");
+ }
+ if(rejected_float!=0) {
+ yvalues.add(new Entry(rejected_float, 5));
+ xVals.add("Rejected");
+ }
+ if(requestforcomplition_float!=0) {
+ yvalues.add(new Entry(requestforcomplition_float, 3));
+ xVals.add("Completion");
+ }
+ if(requestformodification_float!=0) {
+ yvalues.add(new Entry(requestformodification_float, 4));
+ xVals.add("Modification");
+ }
+*/
+
+
+
+
+ /* PieDataSet dataSet = new PieDataSet(yvalues, "");
+ PieData data = new PieData(xVals,dataSet);
+
+ data.setValueFormatter(new DefaultValueFormatter(1));*/
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+
+ /* Log.i("tag","data="+data.toString()+pieChart.getData());
+ pieChart.getData();
+ pieChart.setData(data);
+ pieChart.setDescription("Project Counts");
+ pieChart.setDescriptionColor(Color.WHITE);
+ pieChart.setDescriptionPosition(450,100);
+ pieChart.setDescriptionTextSize(20f);
+ pieChart.getLegend().setTextColor(Color.BLACK);
+ pieChart.setDrawHoleEnabled(true);
+ pieChart.setTransparentCircleRadius(25f);
+ pieChart.setHoleRadius(25f);
+ pieChart.setDrawSliceText(false);
+ final int[] MY_COLORS = {Color.rgb(229, 154, 29),Color.rgb(243, 200, 61), Color.rgb(144, 193, 51),Color.rgb(198, 53, 53), Color.rgb( 255, 0, 128),
+ Color.rgb(45, 170, 165), Color.rgb(127, 0, 255), Color.rgb(185, 98, 237)};
+ ArrayList colors = new ArrayList();
+
+ for(int c: MY_COLORS) colors.add(c);
+ dataSet.setColors(colors);
+
+ // dataSet.setColors(ColorTemplate.JOYFUL_COLORS);
+ data.setValueTextSize(10f);
+ data.setValueTextColor(Color.DKGRAY);
+ pieChart.setClickable(false);*/
+
+ // pieChart.setOnChartValueSelectedListener(this);
+
+ // pieChart.animateXY(1400, 1400);
+
+ // showActivity();
+ pieChartFunction();
+ // newbarchart();
+ return view;
+ }
+ private void newbarchart(){
+
+ Float unapproved_float=Float.valueOf(UnapprovedCount).floatValue();
+ Float complited_float=Float.valueOf(ComplitedCount).floatValue();
+ Float approved_float=Float.valueOf(ApprovedCount).floatValue();
+ Float requestforcomplition_float=Float.valueOf(RequestForCompletion).floatValue();
+ Float requestformodification_float=Float.valueOf(RequestForModification).floatValue();
+ Float rejected_float=Float.valueOf(Rejected).floatValue();
+
+
+ ArrayList entries = new ArrayList<>();
+ if(unapproved_float!=0) {
+ entries.add(new BarEntry(unapproved_float, 0));
+ }
+ if(approved_float!=0) {
+ entries.add(new BarEntry(approved_float, 1));
+ }
+ if(complited_float!=0) {
+ entries.add(new BarEntry(complited_float, 2));
+ }
+ if(rejected_float!=0) {
+ entries.add(new BarEntry(rejected_float, 3));
+ }
+ if(requestforcomplition_float!=0) {
+ entries.add(new BarEntry(requestforcomplition_float, 4));
+ }
+ if(requestformodification_float!=0) {
+ entries.add(new BarEntry(requestformodification_float, 5));
+ }
+ /*entries.add(new BarEntry(20f, 3));
+ entries.add(new BarEntry(15f, 4));
+ entries.add(new BarEntry(19f, 5));*/
+
+ /* for(int k=0;k labels = new ArrayList();
+ if(unapproved_float!=0) {
+ labels.add("Proposed");
+ }
+ if(approved_float!=0) {
+ labels.add("Approved");
+ }
+ if(complited_float!=0) {
+ labels.add("Completed");
+ }
+ if(rejected_float!=0) {
+ labels.add("Rejected");
+ }
+ if(requestforcomplition_float!=0) {
+ labels.add("Completion");
+ }
+ if(requestformodification_float!=0) {
+ labels.add("Modification");
+ }
+
+ BarDataSet bardataset = new BarDataSet(entries, null);
+
+
+ /* labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");*/
+
+
+ BarData data1 = new BarData(labels, bardataset);
+ barChart.setData(data1); // set the data and list of lables into chart
+
+
+ // barChart.setDescription(""); // set the description
+ final int[] MY_COLORS = {Color.rgb(229, 154, 29),Color.rgb(243, 200, 61), Color.rgb(144, 193, 51),Color.rgb(198, 53, 53), Color.rgb( 255, 0, 128),
+ Color.rgb(45, 170, 165), Color.rgb(127, 0, 255), Color.rgb(185, 98, 237)};
+ ArrayList colors = new ArrayList();
+
+ for(int c: MY_COLORS) colors.add(c);
+
+ bardataset.setColors(colors);
+
+
+ Legend legend = barChart.getLegend();
+ legend.setEnabled(false);
+ legend.setPosition(Legend.LegendPosition.BELOW_CHART_CENTER);
+ legend.setForm(Legend.LegendForm.SQUARE);
+ /* legend.setColors(colors);
+ legend.setLabels(labels);*/
+
+ barChart.setDescription(null);
+ XAxis xLabels = barChart.getXAxis();
+ // xLabels.setPosition(XAxis.XAxisPosition.BOTTOM_INSIDE);
+ xLabels.setTextColor(Color.BLACK);
+ xLabels.setPosition(XAxis.XAxisPosition.BOTTOM);
+ xLabels.setDrawLabels(true);
+ // barChart.getXAxis().setAxisMinValue(6);
+ // barChart.getXAxis().setAxisMaxValue(6);
+ xLabels.setValues(labels);
+ YAxis yLabels = (YAxis) barChart.getAxisLeft();
+ yLabels.setTextColor(Color.BLACK);
+
+ YAxis yLabels1 = (YAxis) barChart.getAxisRight();
+ yLabels1.setTextColor(Color.BLACK);
+ // xLabels.setLabelRotationAngle(-30f);
+
+ barChart.setDescriptionColor(Color.WHITE);
+barChart.getXAxis().setAxisMaxValue(6);
+ barChart.animateY(3000);
+
+ }
+
+ private void pieChartFunction(){
+
+ Float unapproved_float=Float.valueOf(UnapprovedCount).floatValue();
+ Float complited_float=Float.valueOf(ComplitedCount).floatValue();
+ Float approved_float=Float.valueOf(ApprovedCount).floatValue();
+ Float requestforcomplition_float=Float.valueOf(RequestForCompletion).floatValue();
+ Float requestformodification_float=Float.valueOf(RequestForModification).floatValue();
+ Float rejected_float=Float.valueOf(Rejected).floatValue();
+
+ Log.i("tag","Proposed="+unapproved_float+"complited_float="+complited_float);
+ Log.i("tag","approved_float="+approved_float+"requestforcomplition_float="+requestforcomplition_float);
+ Log.i("tag","requestformodification_float="+requestformodification_float+"rejected_float="+rejected_float);
+
+ ArrayList yvalues2 = new ArrayList();
+ ArrayList xVals2 = new ArrayList();
+
+ if(unapproved_float!=0) {
+ yvalues2.add(new Entry(unapproved_float, 0));
+ }
+ if(approved_float!=0) {
+ yvalues2.add(new Entry(approved_float, 1));
+ }
+ if(complited_float!=0) {
+ yvalues2.add(new Entry(complited_float, 2));
+ }
+ if(rejected_float!=0) {
+ yvalues2.add(new Entry(rejected_float, 3));
+ }
+ if(requestforcomplition_float!=0) {
+ yvalues2.add(new Entry(requestforcomplition_float, 4));
+ }
+ if(requestformodification_float!=0) {
+ yvalues2.add(new Entry(requestformodification_float, 5));
+ }
+
+ /*if(Not_Assigned_Per_float!=0) {
+ yvalues2.add(new Entry(Not_Assigned_Per_float, 3));
+ }*/
+
+
+ // PieDataSet dataSet2 = new PieDataSet(yvalues2, "");
+ // pieChart.getDescription().setEnabled(false);
+
+ xVals2.add("Proposed");
+ xVals2.add("Approved");
+ xVals2.add("Completed");
+ xVals2.add("Rejected");
+ xVals2.add("Completion");
+ xVals2.add("Modification");
+ // xVals2.add("Not_Assigned_Per");
+
+ // pieChart.setEntryLabelColor(Color.BLACK);
+ PieDataSet dataSet = new PieDataSet(yvalues2, "");
+
+ final int[] MY_COLORS = {Color.rgb(229, 154, 29),Color.rgb(243, 200, 61), Color.rgb(144, 193, 51),Color.rgb(198, 53, 53), Color.rgb( 255, 0, 128),
+ Color.rgb(45, 170, 165), Color.rgb(127, 0, 255), Color.rgb(185, 98, 237)};
+ ArrayList colors = new ArrayList();
+
+ for(int c: MY_COLORS) colors.add(c);
+
+ /* ArrayList colors = new ArrayList();
+
+ for (int c : ColorTemplate.VORDIPLOM_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.JOYFUL_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.COLORFUL_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.LIBERTY_COLORS)
+ colors.add(c);
+
+ for (int c : ColorTemplate.PASTEL_COLORS)
+ colors.add(c);*/
+
+ // colors.add(ColorTemplate.getHoloBlue());
+
+ dataSet.setColors(colors);
+
+ PieData data = new PieData(xVals2,dataSet);
+ // In Percentage term
+ data.setValueFormatter(new PercentFormatter());
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+ pieChart.setData(data);
+ /* pieChart.setDescription("Student and College Counts");
+ pieChart.setDescriptionColor(Color.WHITE);
+ pieChart.setDescriptionPosition(450,100);
+ pieChart.setDescriptionTextSize(20f);*/
+ pieChart.getLegend().setTextColor(Color.BLACK);
+ pieChart.setDrawHoleEnabled(true);
+ pieChart.setTransparentCircleRadius(25f);
+ pieChart.setHoleRadius(25f);
+ pieChart.setDrawSliceText(false);
+ // dataSet.setColors(ColorTemplate.JOYFUL_COLORS);
+ data.setValueTextSize(10f);
+ data.setValueTextColor(Color.DKGRAY);
+ pieChart.setDescriptionColor(Color.WHITE);
+
+ // pieChart.setOnChartValueSelectedListener(this);
+
+ pieChart.animateXY(1400, 1400);
+
+ }
+
+ /* @Override
+ public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
+ if (e == null)
+ return;
+ Log.i("VAL SELECTED",
+ "Value: " + e.getVal() + ", xIndex: " + e.getXIndex()
+ + ", DataSet index: " + dataSetIndex);*/
+ /* if(e.getXIndex()==0){
+ Intent ittEditProjToProjStatus = new Intent(getContext(),PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",0);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==2){
+ Intent ittEditProjToProjStatus = new Intent(getContext(),PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",1);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==1){
+ Intent ittEditProjToProjStatus = new Intent(getContext(),PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",3);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==3){
+ Intent ittEditProjToProjStatus = new Intent(getContext(),PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",2);
+ startActivity(ittEditProjToProjStatus);
+ }*/
+ /* }
+
+ @Override
+ public void onNothingSelected() {
+ Log.i("PieChart", "nothing selected");
+ }
+*/
+
+
+ public class GetProjectCount extends AsyncTask {
+
+ Context context;
+
+ //ProgressBar progressBar;
+
+ GetProjectCount (Context ctx){
+ context = ctx;
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(Integer... params) {
+ Integer ManagerId = (Integer) params [0];
+ //SoapObject response = getStudDtls(leadid);
+
+ String METHOD_NAME = "GetProjectCount";
+ String NamespaceMail="http://mis.leadcampus.org/", SOAP_ACTION1="http://mis.leadcampus.org/GetProjectCount";//namespace+methodname
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ request.addProperty("ManagerId", ManagerId);
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Manager.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+
+ //anyType{Counts=1; ProjectStatus=Approved; Status=Success; };
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("tag","soap response project count"+response.toString());
+
+ int int_projectcount =response.getPropertyCount();
+
+ Log.e("projectcount", Integer.toString(int_projectcount));
+
+ for(int i=0;i " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+
+ //Log.d("Soap response is",response.toString());
+
+ return null;
+ }
+
+ @Override
+ protected void onPreExecute() {
+
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+ /*compeleted_tv.setText(ComplitedCount);
+ pending_tv.setText(UnapprovedCount);
+ approved_tv.setText(ApprovedCount);*/
+ /* setupComplited();
+ setupApproved();
+ setupUnapproved();*/
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+}//end of fragment class
diff --git a/app/src/main/java/com/leadcampusapp/ChartStud_CollgCountFragment.java b/app/src/main/java/com/leadcampusapp/ChartStud_CollgCountFragment.java
new file mode 100644
index 0000000..53b6dc7
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChartStud_CollgCountFragment.java
@@ -0,0 +1,110 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 20-07-2018.
+ */
+
+import android.content.Intent;
+import android.graphics.Color;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.github.mikephil.charting.charts.PieChart;
+import com.github.mikephil.charting.data.Entry;
+import com.github.mikephil.charting.data.PieData;
+import com.github.mikephil.charting.data.PieDataSet;
+import com.github.mikephil.charting.formatter.PercentFormatter;
+import com.github.mikephil.charting.highlight.Highlight;
+import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
+import com.github.mikephil.charting.utils.ColorTemplate;
+
+import java.util.ArrayList;
+
+public class ChartStud_CollgCountFragment extends Fragment implements OnChartValueSelectedListener
+{
+
+ int count=0;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+ View view=inflater.inflate(R.layout.frag_project_countchart, container, false);
+ Intent intent = getActivity().getIntent();
+ /* String UnapprovedCount=intent.getStringExtra("UnapprovedCount");
+ String ComplitedCount=intent.getStringExtra("ComplitedCount");
+ String ApprovedCount=intent.getStringExtra("ApprovedCount");
+ String RequestForCompletion=intent.getStringExtra("RequestForCompletion");
+ String RequestForModification=intent.getStringExtra("RequestForModification");
+ String Rejected=intent.getStringExtra("Rejected");*/
+ String str_studentcount=intent.getStringExtra("str_studentcount");
+ String str_collegecount=intent.getStringExtra("str_collegecount");
+
+ PieChart pieChart = (PieChart) view.findViewById(R.id.piechart);
+ pieChart.setUsePercentValues(true);
+
+ /* Float unapproved_float=Float.valueOf(UnapprovedCount).floatValue();
+ Float complited_float=Float.valueOf(ComplitedCount).floatValue();
+ Float approved_float=Float.valueOf(ApprovedCount).floatValue();
+ Float requestforcomplition_float=Float.valueOf(RequestForCompletion).floatValue();
+ Float requestformodification_float=Float.valueOf(RequestForModification).floatValue();
+ Float rejected_float=Float.valueOf(Rejected).floatValue();*/
+ Float collegecount_float=Float.valueOf(str_collegecount).floatValue();
+
+ Float studentcount_float=Float.valueOf(str_studentcount).floatValue();
+
+ ArrayList yvalues2 = new ArrayList();
+ ArrayList xVals2 = new ArrayList();
+
+ yvalues2.add(new Entry(studentcount_float, 0));
+ yvalues2.add(new Entry(collegecount_float,1));
+ PieDataSet dataSet2 = new PieDataSet(yvalues2, "");
+
+ xVals2.add("No of Students");
+ xVals2.add("No of Colleges");
+
+ PieDataSet dataSet = new PieDataSet(yvalues2, "");
+ PieData data = new PieData(xVals2,dataSet);
+ // In Percentage term
+ data.setValueFormatter(new PercentFormatter());
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+ pieChart.setData(data);
+ pieChart.setDescription("Student and College Counts");
+ pieChart.setDescriptionColor(Color.WHITE);
+ pieChart.setDescriptionPosition(450,100);
+ pieChart.setDescriptionTextSize(20f);
+ pieChart.getLegend().setTextColor(Color.WHITE);
+ pieChart.setDrawHoleEnabled(true);
+ pieChart.setTransparentCircleRadius(25f);
+ pieChart.setHoleRadius(25f);
+
+ dataSet.setColors(ColorTemplate.JOYFUL_COLORS);
+ data.setValueTextSize(10f);
+ data.setValueTextColor(Color.DKGRAY);
+ // pieChart.setOnChartValueSelectedListener(this);
+
+ pieChart.animateXY(1400, 1400);
+
+ // showActivity();
+ return view;
+ }
+ @Override
+ public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
+ if (e == null)
+ return;
+ Log.i("VAL SELECTED",
+ "Value: " + e.getVal() + ", xIndex: " + e.getXIndex()
+ + ", DataSet index: " + dataSetIndex);
+ }
+
+ @Override
+ public void onNothingSelected() {
+ Log.i("PieChart", "nothing selected");
+ }
+
+}//end of fragment class
diff --git a/app/src/main/java/com/leadcampusapp/ChartThemeProjCountFragment.java b/app/src/main/java/com/leadcampusapp/ChartThemeProjCountFragment.java
new file mode 100644
index 0000000..907a36d
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChartThemeProjCountFragment.java
@@ -0,0 +1,500 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 20-07-2018.
+ */
+
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import androidx.fragment.app.Fragment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.github.mikephil.charting.charts.BarChart;
+import com.github.mikephil.charting.components.Legend;
+import com.github.mikephil.charting.components.XAxis;
+import com.github.mikephil.charting.components.YAxis;
+import com.github.mikephil.charting.data.BarData;
+import com.github.mikephil.charting.data.BarDataSet;
+import com.github.mikephil.charting.data.BarEntry;
+import com.github.mikephil.charting.utils.ColorTemplate;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.util.ArrayList;
+
+public class ChartThemeProjCountFragment extends Fragment
+{
+
+ private ArrayList listThemeName;
+ private ArrayList listCount;
+
+ public static final String PREFBook_PM= "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_PMID = "prefid_pmid"; //
+ SharedPreferences shardprefPM_obj;
+ String str_MangerID;
+ Integer MDId;
+ BarChart barChart;
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+
+ View view=inflater.inflate(R.layout.activity_pmget_theme_wise_project_count, container, false);
+ listThemeName = new ArrayList();
+ listCount = new ArrayList();
+
+ shardprefPM_obj= getActivity().getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+
+ shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ str_MangerID = shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ Log.d("str_leadId:",str_MangerID);
+ // Toast.makeText(this,"LeadId: "+str_MangerID,Toast.LENGTH_LONG).show();
+ MDId=Integer.parseInt(str_MangerID);
+
+ barChart = (BarChart) view.findViewById(R.id.barchart);
+
+
+ GetThemeWiseProjCount getThemeWiseProjCount = new GetThemeWiseProjCount(getActivity());
+ getThemeWiseProjCount.execute();
+
+ return view;
+ }
+
+ public class GetThemeWiseProjCount extends AsyncTask {
+
+ Context context;
+ //AlertDialog alertDialog;
+ private ProgressDialog progressDialog;
+
+ //private ProgressBar progressBar;
+
+ GetThemeWiseProjCount (Context ctx){
+ context = ctx;
+ progressDialog = new ProgressDialog(context);
+ }
+
+
+ @Override
+ protected SoapObject doInBackground(Void... params) {
+ //String str_leadId = (String) params [0];
+ //String versionCode = (String) params[2];
+
+ SoapObject response = getThemeWiseProjCount();
+
+ //Log.d("GetThemeWiseProjCout",response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ /* progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+ progressBar.setVisibility(View.VISIBLE);*/
+
+ progressDialog.setMessage("Loading");
+ progressDialog.setCanceledOnTouchOutside(false);
+ progressDialog.show();
+
+ }
+
+ @Override
+ protected void onPostExecute(SoapObject result) {
+
+ if(result!=null){
+
+ Log.d("GetStudentDetailssresp", result.toString());
+
+ /* SoapPrimitive S_Status,S_ThemeName,S_Counts;
+ Object O_Status,O_ThemeName,O_Counts;
+ String str_Status=null,str_ThemeName=null,str_Counts=null;
+
+ for(int i=0;i");
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+ Log.d("soap responseyyyyyyy",envelope.getResponse().toString());
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.d("soap responseyyyyyyy",response.toString());
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.d("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+
+ }
+
+
+ private void multiBarchartsInOne() {
+ // create BarEntry for Bar Group 1
+/* HorizontalBarChart barChart = (HorizontalBarChart) findViewById(R.id.barchart);
+
+ ArrayList bargroup1 = new ArrayList<>();
+ bargroup1.add(new BarEntry(8f, 0));
+ bargroup1.add(new BarEntry(2f, 1));
+ bargroup1.add(new BarEntry(5f, 2));
+ bargroup1.add(new BarEntry(20f, 3));
+ bargroup1.add(new BarEntry(15f, 4));
+ bargroup1.add(new BarEntry(19f, 5));
+
+// create BarEntry for Bar Group 1
+ ArrayList bargroup2 = new ArrayList<>();
+ bargroup2.add(new BarEntry(6f, 0));
+ bargroup2.add(new BarEntry(10f, 1));
+ bargroup2.add(new BarEntry(5f, 2));
+ bargroup2.add(new BarEntry(25f, 3));
+ bargroup2.add(new BarEntry(4f, 4));
+ bargroup2.add(new BarEntry(17f, 5));
+
+// creating dataset for Bar Group1
+ BarDataSet barDataSet1 = new BarDataSet(bargroup1, "Bar Group 1");
+
+//barDataSet1.setColor(Color.rgb(0, 155, 0));
+ barDataSet1.setColors(ColorTemplate.COLORFUL_COLORS);
+
+// creating dataset for Bar Group 2
+ BarDataSet barDataSet2 = new BarDataSet(bargroup2, "Bar Group 2");
+ barDataSet2.setColors(ColorTemplate.COLORFUL_COLORS);
+
+ List dataSets = new ArrayList<>(); // combined all dataset into an arraylist
+ dataSets.add(barDataSet1);
+ dataSets.add(barDataSet2);
+
+
+
+
+
+
+
+ //BarDataSet bardataset = new BarDataSet(entries, "Cells");
+
+ ArrayList labels = new ArrayList();
+ labels.add("2016");
+ labels.add("2015");
+ labels.add("2014");
+ labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");
+ labels.add("2010");
+ labels.add("2009");
+ labels.add("2008");
+ labels.add("2007");
+ labels.add("2006");
+ labels.add("2005");
+ labels.add("2004");
+ labels.add("2003");
+
+
+ //BarData data = new BarData(labels,dataSets);
+ BarData data = new BarData(labels,dataSets);
+ barChart.setData(data); // set the data and list of lables into chart
+
+ barChart.setDescription("Set Bar Chart Description"); // set the description
+
+ //bardataset.setColors(ColorTemplate.COLORFUL_COLORS);
+
+ barChart.animateY(5000);*/
+
+
+
+
+
+ //HorizontalBarChart barChart = (HorizontalBarChart) findViewById(R.id.barchart);
+
+ ArrayList entries = new ArrayList<>();
+
+
+ for(int k=0;k labels = new ArrayList();
+ /* labels.add("2016");
+ labels.add("2015");
+ labels.add("2014");
+ labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");*/
+ /* labels.add("abc");
+ labels.add("mnc");
+ labels.add("xyz");
+ labels.add("pmo");*/
+ // barChart.getXAxis().setValueFormatter(new IndexAxisValueFormatter(labels));
+ // XAxis xAxis = barChart.getXAxis();
+ // xAxis.setValueFormatter(new IndexAxisValueFormatter(labels));
+
+ String[] arrString = new String[listThemeName.size()];
+
+ for(int l=0;l entries = new ArrayList<>();
+ /*entries.add(new BarEntry(8f, 0));
+ entries.add(new BarEntry(2f, 1));
+ entries.add(new BarEntry(5f, 2));
+ entries.add(new BarEntry(20f, 3));
+ entries.add(new BarEntry(15f, 4));
+ entries.add(new BarEntry(19f, 5));*/
+
+ for(int k=0;k labels = new ArrayList();
+ /* labels.add("2016");
+ labels.add("2015");
+ labels.add("2014");
+ labels.add("2013");
+ labels.add("2012");
+ labels.add("2011");*/
+
+ String[] arrString = new String[listThemeName.size()];
+
+ for(int l=0;l chatHistory;
+ Class_ChatModule[] class_chatModules_arrayobj;
+ ArrayList class_chatModulesobj=new ArrayList<>();
+ String str_chat_status;
+ String comments, userType, managerName, studentName,replyTime,projectStatus;
+
+ SharedPreferences shardprefPM_obj;
+ SharedPreferences.Editor editor_PM;
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefID_RegID = "prefid_regid"; //
+
+ public static final String PREFBook_PM= "prefbook_pm"; //sharedpreference Book
+ public static final String PrefID_PMID = "prefid_pmid"; //
+
+
+ String userId,intent_projectId,intent_projectStatus,final_projStatus,intent_userType;
+ String messageText;
+ Context context;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_chat);
+
+ context=getApplicationContext();
+
+ intent_projectStatus = getIntent().getStringExtra("projectStatus");
+ intent_projectId = getIntent().getStringExtra("projectId");
+ intent_userType = getIntent().getStringExtra("userType");
+
+
+ if(intent_projectStatus.equals("completed")){
+ /* messageET.setVisibility(View.GONE);
+ sendBtn.setVisibility(View.GONE);*/
+ final_projStatus="Completed";
+ }
+ else if(intent_projectStatus.equals("reapply")){
+ final_projStatus="Proposed";
+ }
+ else if(intent_projectStatus.equals("approved")){
+ final_projStatus="Approved";
+ }
+ else if(intent_projectStatus.equals("rejected")){
+ final_projStatus="Rejected";
+ }
+ else if(intent_projectStatus.equals("requested")){
+ final_projStatus="RequestForCompletion";
+ }
+ else if(intent_projectStatus.equals("pending")){
+ final_projStatus="Proposed";
+ }
+
+ initControls();
+
+
+
+
+
+ sendBtn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ messageText = messageET.getText().toString();
+ if (TextUtils.isEmpty(messageText)) {
+ return;
+ }
+
+ boolean stud_manag_send;
+ //if(intent_userType.equals("Student")) {
+ if (intent_userType.equals("Student")) {
+ stud_manag_send = false;
+ } else {
+ stud_manag_send = true;
+ }
+ ChatMessage chatMessage = new ChatMessage();
+ chatMessage.setId(Long.parseLong(userId));//dummy
+ chatMessage.setMessage(messageText);
+ chatMessage.setDate(DateFormat.getDateTimeInstance().format(new Date()));
+ chatMessage.setProjectStatus(final_projStatus);
+ chatMessage.setMe(stud_manag_send);
+ Log.e("tag","txtProjStatus 1="+final_projStatus+"==="+chatMessage.getProjectStatus());
+
+ // messageET.setText("");
+
+ displayMessage(chatMessage);
+
+ SaveMentorMentee saveMentorMentee = new SaveMentorMentee(ChatActivity.this);
+ saveMentorMentee.execute();
+ messageET.setText("");
+
+ }
+ });
+
+ }
+
+
+ @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();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.action_settings) {
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ private void initControls() {
+ messagesContainer = (ListView) findViewById(R.id.messagesContainer);
+ messageET = (EditText) findViewById(R.id.messageEdit);
+ sendBtn = (Button) findViewById(R.id.chatSendButton);
+
+ TextView meLabel = (TextView) findViewById(R.id.meLbl);
+ TextView companionLabel = (TextView) findViewById(R.id.friendLabel);
+ RelativeLayout container = (RelativeLayout) findViewById(R.id.container);
+ companionLabel.setText("Me");
+ //meLabel.setText("Mentor");
+
+ if(intent_userType.equals("Student")){
+ meLabel.setText("Manager");
+ shardprefPM_obj=getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ shardprefPM_obj.getString(PrefID_RegID, "").trim();
+ userId = shardprefPM_obj.getString(PrefID_RegID, "").trim();
+ }else {
+ meLabel.setText("Student");
+ shardprefPM_obj=getSharedPreferences(PREFBook_PM, Context.MODE_PRIVATE);
+ shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ userId = shardprefPM_obj.getString(PrefID_PMID, "").trim();
+ }
+ AsyncCallWS_GetMentorMentee asyncCallWS_getMentorMentee = new AsyncCallWS_GetMentorMentee(ChatActivity.this);
+ asyncCallWS_getMentorMentee.execute();
+
+ }
+
+ public void displayMessage(ChatMessage message) {
+ adapter.add(message);
+ adapter.notifyDataSetChanged();
+ scroll();
+ }
+
+ private void scroll() {
+ messagesContainer.setSelection(messagesContainer.getCount() - 1);
+ }
+
+ private void loadDummyHistory(){
+
+ chatHistory = new ArrayList();
+
+ ArrayList msg_final=new ArrayList<>();
+
+ boolean stud_manag;
+ /* for (int j=1;j());
+ messagesContainer.setAdapter(adapter);
+
+ for(int i=0; i {
+ ProgressDialog dialog;
+
+ Context context;
+
+ protected void onPreExecute() {
+ // Log.i(TAG, "onPreExecute---tab2");
+ dialog.setMessage("Please wait..");
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.show();
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ //Log.i(TAG, "onProgressUpdate---tab2");
+ }
+
+
+ @Override
+ protected Void doInBackground(String... params) {
+ Log.i("DFTech", "doInBackground");
+ // GetAllEvents();
+ GetMentorMentee(); // call of details
+ return null;
+ }
+
+ public AsyncCallWS_GetMentorMentee(ChatActivity context1) {
+ context = context1;
+ dialog = new ProgressDialog(context1);
+ }
+
+ @Override
+ protected void onPostExecute(Void result)
+ {
+
+ /* if ((this.dialog != null) && this.dialog.isShowing()) {
+ dialog.dismiss();
+
+ }*/
+
+ dialog.dismiss();
+ loadDummyHistory();
+ /* if (class_contactus_arrayObj != null)
+ {
+ ContactUsActivity.CustomAdapter adapter = new ContactUsActivity.CustomAdapter();
+ listView.setAdapter(adapter);
+
+ int x = class_contactus_arrayObj.length;
+
+ System.out.println("Inside the if list adapter" + x);
+ } else {
+ Log.d("onPostExecute", "ondutyhistoryclass_arrayObj == null");
+ }
+*/
+
+ // Toast.makeText(getApplicationContext(),""+class_contactus_arrayObj[0].getEmailid1().toString(),Toast.LENGTH_LONG).show();
+
+
+
+ // System.out.println("Reached the onPostExecute");
+
+ }//end of onPostExecute
+ }// end Async task
+
+ public void GetMentorMentee() {
+
+ String URL = Class_URL.URL_Manager.toString();
+ String METHOD_NAME = "GetMentorMentee";
+ String Namespace = "http://mis.leadcampus.org/", SOAPACTION = "http://mis.leadcampus.org/GetMentorMentee";
+
+ long PDId= Long.parseLong(intent_projectId);
+ try {
+ SoapObject request = new SoapObject(Namespace, METHOD_NAME);
+ request.addProperty("PDId", PDId);
+
+ Log.e("request", request.toString());
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+ //Create HTTP call object
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
+ try {
+
+ androidHttpTransport.call(SOAPACTION, envelope);
+ // Log.i(TAG, "GetAllLoginDetails is running");
+ // result1 = (Vector) envelope.getResponse();
+ SoapObject response = (SoapObject) envelope.getResponse();
+ Log.e("get mentor response", response.toString());
+ int int_count = response.getPropertyCount();
+
+ Log.e("number of rows", "" + int_count);
+//Response
+// anyType{vmGetMentorMentee=anyType{Comments=testing; UserType=Manager; ManagerName=Anisha Cardoza; StudentName=Mallikarjun kumbar; ReplyTime=14-08-19 02:52:24 PM; ProjectStatus=anyType{}; Status=Success; }; }
+
+ class_chatModules_arrayobj = new Class_ChatModule[int_count];
+ class_chatModulesobj.clear();
+ // class_chatModulesobj=new ArrayList<>(int_count);
+ // listitems_arraylist.clear();
+ for (int i = 0; i < int_count; i++) {
+ SoapObject list = (SoapObject) response.getProperty(i);
+ str_chat_status = (String) list.getProperty("Status").toString();
+ // Holidays not found
+
+ if (str_chat_status.equalsIgnoreCase("Success")){
+ SoapPrimitive Comments, UserType, ManagerName, StudentName,ReplyTime,ProjectStatus;
+ String str_ProjectStatus;
+ String approved = "";
+ Comments = (SoapPrimitive) list.getProperty("Comments");
+ UserType = (SoapPrimitive) list.getProperty("UserType");
+ ManagerName = (SoapPrimitive) list.getProperty("ManagerName");
+ StudentName = (SoapPrimitive) list.getProperty("StudentName");
+ ReplyTime = (SoapPrimitive) list.getProperty("ReplyTime");
+ // ProjectStatus=(SoapPrimitive) list.getProperty("ProjectStatus");
+ if(list.getProperty("ProjectStatus").toString().equals("anyType{}"))
+ {
+ str_ProjectStatus="anyType{}";
+ }
+ else
+ { str_ProjectStatus=(String)list.getProperty("ProjectStatus").toString(); }
+
+
+
+ Class_ChatModule innerObj = new Class_ChatModule();
+ innerObj.setComments(Comments.toString());
+ innerObj.setUserType(UserType.toString());
+ innerObj.setManagerName(ManagerName.toString());
+ innerObj.setStudentName(StudentName.toString());
+ innerObj.setReplyTime(ReplyTime.toString());
+ innerObj.setProjectStatus(str_ProjectStatus);
+
+
+ class_chatModules_arrayobj[i] = innerObj;
+ class_chatModulesobj.add(class_chatModules_arrayobj[i]);
+ //listitems_arraylist.add(innerObj);
+
+ }//End of for loop
+ }
+ }
+ catch(Throwable t){
+ //Toast.makeText(MainActivity.this, "Request failed: " + t.toString(),
+ // Toast.LENGTH_LONG).show();
+ Log.e("Chat fail", "> " + t.getMessage());
+
+
+ }
+ } catch (Throwable t) {
+ Log.e("Chat Error", "> " + t.getMessage());
+
+ }
+
+
+
+ }//End of contactus
+
+ public class SaveMentorMentee extends AsyncTask {
+
+ AlertDialog alertDialog;
+ // private ProgressBar progressBar;
+ ProgressDialog dialog;
+
+ SaveMentorMentee (Context ctx){
+ context = ctx;
+ dialog = new ProgressDialog(context);
+
+ }
+
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+
+ SoapPrimitive response = SaveMentorMentee();
+
+ // SoapObject response = ReApplyProjectDetails();
+ Log.d("tag","Soap response approvedDetails"+response.toString());
+
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ dialog.setMessage("Please wait..");
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.show();
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+ if(result!=null) {
+ if (result.toString().equals("Error")) {
+ Toast.makeText(getApplicationContext(), "Error occured while saving to database", Toast.LENGTH_LONG).show();
+ } else {
+ Toast.makeText(getApplicationContext(), "Comment sent successfully", Toast.LENGTH_LONG).show();
+ finish();
+ }
+ }
+ dialog.dismiss();
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+ private SoapPrimitive SaveMentorMentee() {
+ String METHOD_NAME = "SaveMentorMentee";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/SaveMentorMentee";
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject("http://mis.leadcampus.org/", METHOD_NAME);
+
+ long projectIds = (long) Integer.valueOf(intent_projectId);
+
+ Log.d("PDIdssssssxxxx", intent_projectId);
+ Log.d("messageText=", messageText);
+ request.addProperty("PDId",projectIds);
+ request.addProperty("Comments",messageText);
+ request.addProperty("UserType",intent_userType);
+ request.addProperty("UserId",userId);
+ request.addProperty("ProjectStatus",final_projStatus);
+
+ Log.d("Requestisxxxxx chat==",request.toString());
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //SoapSerializationEnvelope evp = new SoapSoapEnvelope.XSD;
+
+ envelope.dotNet = true;
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Manager.toString().trim());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+
+ return response;
+
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ }
+ }catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+ }
+ return null;
+
+ }
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/ChatAdapter.java b/app/src/main/java/com/leadcampusapp/ChatAdapter.java
new file mode 100644
index 0000000..af1275a
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChatAdapter.java
@@ -0,0 +1,151 @@
+package com.leadcampusapp;
+
+import android.app.Activity;
+import android.content.Context;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import java.util.List;
+
+/**
+ * Created by Technovibe on 17-04-2015.
+ */
+public class ChatAdapter extends BaseAdapter {
+
+ private final List chatMessages;
+ private Activity context;
+
+ public ChatAdapter(Activity context, List chatMessages) {
+ this.context = context;
+ this.chatMessages = chatMessages;
+ }
+
+ @Override
+ public int getCount() {
+ if (chatMessages != null) {
+ return chatMessages.size();
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public ChatMessage getItem(int position) {
+ if (chatMessages != null) {
+ return chatMessages.get(position);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ ViewHolder holder;
+ ChatMessage chatMessage = getItem(position);
+ LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+
+ if (convertView == null) {
+ convertView = vi.inflate(R.layout.list_item_chat_message, null);
+ holder = createViewHolder(convertView);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+
+ boolean myMsg = chatMessage.getIsme() ;//Just a dummy check to simulate whether it me or other sender
+ setAlignment(holder, myMsg);
+ holder.txtMessage.setText(chatMessage.getMessage());
+ holder.txtInfo.setText(chatMessage.getDate());
+ holder.txtProjStatus.setText(chatMessage.getProjectStatus());
+ Log.e("tag","txtProjStatus="+chatMessage.getProjectStatus());
+
+ return convertView;
+ }
+
+ public void add(ChatMessage message) {
+ chatMessages.add(message);
+ }
+
+ public void add(List messages) {
+ chatMessages.addAll(messages);
+ }
+
+ private void setAlignment(ViewHolder holder, boolean isMe) {
+ if (!isMe) {
+ holder.contentWithBG.setBackgroundResource(R.drawable.in_message_bg);
+
+ LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) holder.contentWithBG.getLayoutParams();
+ layoutParams.gravity = Gravity.RIGHT;
+ holder.contentWithBG.setLayoutParams(layoutParams);
+
+ RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) holder.content.getLayoutParams();
+ lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT, 0);
+ lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+ holder.content.setLayoutParams(lp);
+ layoutParams = (LinearLayout.LayoutParams) holder.txtMessage.getLayoutParams();
+ layoutParams.gravity = Gravity.RIGHT;
+ holder.txtMessage.setLayoutParams(layoutParams);
+
+ layoutParams = (LinearLayout.LayoutParams) holder.txtInfo.getLayoutParams();
+ layoutParams.gravity = Gravity.RIGHT;
+ holder.txtInfo.setLayoutParams(layoutParams);
+
+ layoutParams = (LinearLayout.LayoutParams) holder.txtProjStatus.getLayoutParams();
+ layoutParams.gravity = Gravity.RIGHT;
+ holder.txtProjStatus.setLayoutParams(layoutParams);
+ } else {
+ holder.contentWithBG.setBackgroundResource(R.drawable.out_message_bg);
+
+ LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) holder.contentWithBG.getLayoutParams();
+ layoutParams.gravity = Gravity.LEFT;
+ holder.contentWithBG.setLayoutParams(layoutParams);
+
+ RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) holder.content.getLayoutParams();
+ lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 0);
+ lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
+ holder.content.setLayoutParams(lp);
+ layoutParams = (LinearLayout.LayoutParams) holder.txtMessage.getLayoutParams();
+ layoutParams.gravity = Gravity.LEFT;
+ holder.txtMessage.setLayoutParams(layoutParams);
+
+ layoutParams = (LinearLayout.LayoutParams) holder.txtInfo.getLayoutParams();
+ layoutParams.gravity = Gravity.LEFT;
+ holder.txtInfo.setLayoutParams(layoutParams);
+
+ layoutParams = (LinearLayout.LayoutParams) holder.txtProjStatus.getLayoutParams();
+ layoutParams.gravity = Gravity.LEFT;
+ holder.txtProjStatus.setLayoutParams(layoutParams);
+ }
+ }
+
+ private ViewHolder createViewHolder(View v) {
+ ViewHolder holder = new ViewHolder();
+ holder.txtMessage = (TextView) v.findViewById(R.id.txtMessage);
+ holder.content = (LinearLayout) v.findViewById(R.id.content);
+ holder.contentWithBG = (LinearLayout) v.findViewById(R.id.contentWithBackground);
+ holder.txtInfo = (TextView) v.findViewById(R.id.txtInfo);
+ holder.txtProjStatus=(TextView) v.findViewById(R.id.txtProjStatus);
+ return holder;
+ }
+
+
+ private static class ViewHolder {
+ public TextView txtMessage;
+ public TextView txtInfo;
+ public TextView txtProjStatus;
+ public LinearLayout content;
+ public LinearLayout contentWithBG;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/ChatMessage.java b/app/src/main/java/com/leadcampusapp/ChatMessage.java
new file mode 100644
index 0000000..d60bbac
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChatMessage.java
@@ -0,0 +1,61 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Technovibe on 17-04-2015.
+ */
+public class ChatMessage {
+ private long id;
+ private boolean isMe;
+ private String message;
+ private Long userId;
+ private String dateTime;
+ private String projectStatus;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public boolean getIsme() {
+ return isMe;
+ }
+
+ public void setMe(boolean isMe) {
+ this.isMe = isMe;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ public String getDate() {
+ return dateTime;
+ }
+
+ public void setDate(String dateTime) {
+ this.dateTime = dateTime;
+ }
+
+ public String getProjectStatus() {
+ return projectStatus;
+ }
+
+ public void setProjectStatus(String projectStatus) {
+ this.projectStatus = projectStatus;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/ChatsActivity.java b/app/src/main/java/com/leadcampusapp/ChatsActivity.java
new file mode 100644
index 0000000..4dda066
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/ChatsActivity.java
@@ -0,0 +1,404 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+
+//import com.android.sripad.leadnew_22_6_2018.R;
+import com.github.mikephil.charting.charts.PieChart;
+import com.github.mikephil.charting.data.PieData;
+import com.github.mikephil.charting.data.PieDataSet;
+import com.github.mikephil.charting.formatter.PercentFormatter;
+import com.github.mikephil.charting.highlight.Highlight;
+import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
+import com.github.mikephil.charting.utils.ColorTemplate;
+
+import com.github.mikephil.charting.data.Entry;
+
+import java.util.ArrayList;
+
+public class ChatsActivity extends AppCompatActivity implements OnChartValueSelectedListener,ConnectivityReceiver.ConnectivityReceiverListener {
+
+ int count=0;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_chats);
+
+ Intent intent = getIntent();
+ String UnapprovedCount=intent.getStringExtra("UnapprovedCount");
+ String ComplitedCount=intent.getStringExtra("ComplitedCount");
+ String ApprovedCount=intent.getStringExtra("ApprovedCount");
+ String RequestForCompletion=intent.getStringExtra("RequestForCompletion");
+ String RequestForModification=intent.getStringExtra("RequestForModification");
+ String Rejected=intent.getStringExtra("Rejected");
+ String str_studentcount=intent.getStringExtra("str_studentcount");
+ String str_collegecount=intent.getStringExtra("str_collegecount");
+
+ PieChart pieChart = (PieChart) findViewById(R.id.piechart);
+ pieChart.setUsePercentValues(true);
+
+ PieChart pieChart2 = (PieChart) findViewById(R.id.piechart2);
+ pieChart.setUsePercentValues(true);
+ // IMPORTANT: In a PieChart, no values (Entry) should have the same
+ // xIndex (even if from different DataSets), since no values can be
+ // drawn above each other.
+
+ Float unapproved_float=Float.valueOf(UnapprovedCount).floatValue();
+ Float complited_float=Float.valueOf(ComplitedCount).floatValue();
+ Float approved_float=Float.valueOf(ApprovedCount).floatValue();
+ Float requestforcomplition_float=Float.valueOf(RequestForCompletion).floatValue();
+ Float requestformodification_float=Float.valueOf(RequestForModification).floatValue();
+ Float rejected_float=Float.valueOf(Rejected).floatValue();
+ Float collegecount_float=Float.valueOf(str_collegecount).floatValue();
+
+ Float studentcount_float=Float.valueOf(str_studentcount).floatValue();
+
+ /* ArrayList yvalues = new ArrayList();
+ ArrayList xVals = new ArrayList();
+
+ if(unapproved_float!=0) {
+ yvalues.add(new PieEntry(unapproved_float, "Proposed"));
+ xVals.add("Proposed");
+ }
+ if(complited_float!=0) {
+ yvalues.add(new PieEntry(complited_float, "Complited"));
+ xVals.add("Complited");
+ }
+ if(approved_float!=0) {
+ yvalues.add(new PieEntry(approved_float, "Approved"));
+ xVals.add("Approved");
+ }
+ if(requestforcomplition_float!=0) {
+ yvalues.add(new PieEntry(requestforcomplition_float, "Completion"));
+ xVals.add("Completion");
+ }
+ if(requestformodification_float!=0) {
+ yvalues.add(new PieEntry(requestformodification_float, "Modification"));
+ xVals.add("Modification");
+ }
+ if(rejected_float!=0) {
+ yvalues.add(new PieEntry(rejected_float, "Rejected"));
+ xVals.add("Rejected");
+ }*/
+ ArrayList yvalues = new ArrayList();
+ ArrayList xVals = new ArrayList();
+
+ if(unapproved_float!=0) {
+ yvalues.add(new Entry(unapproved_float, 0));
+ xVals.add("Proposed");
+ }
+ if(complited_float!=0) {
+ yvalues.add(new Entry(complited_float, 1));
+ xVals.add("Complited");
+ }
+ if(approved_float!=0) {
+ yvalues.add(new Entry(approved_float, 2));
+ xVals.add("Approved");
+ }
+ if(requestforcomplition_float!=0) {
+ yvalues.add(new Entry(requestforcomplition_float, 3));
+ xVals.add("Completion");
+ }
+ if(requestformodification_float!=0) {
+ yvalues.add(new Entry(requestformodification_float, 4));
+ xVals.add("Modification");
+ }
+ if(rejected_float!=0) {
+ yvalues.add(new Entry(rejected_float, 5));
+ xVals.add("Rejected");
+ }
+
+
+ /* yvalues.add(new Entry(unapproved_float, 0));
+ yvalues.add(new Entry(complited_float, 1));
+ yvalues.add(new Entry(approved_float, 2));
+ yvalues.add(new Entry(requestforcomplition_float, 3));
+ yvalues.add(new Entry(requestformodification_float, 4));
+ yvalues.add(new Entry(rejected_float, 5));
+*/
+ PieDataSet dataSet = new PieDataSet(yvalues, "");
+
+
+ /* xVals.add("Proposed");
+ xVals.add("Complited");
+ xVals.add("Approved");
+ xVals.add("Completion");
+ xVals.add("Modification");
+ xVals.add("Rejected");*/
+
+ PieData data = new PieData(xVals,dataSet);
+ // In Percentage term
+ data.setValueFormatter(new PercentFormatter());
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+ pieChart.setData(data);
+ pieChart.setDescription("Project Counts");
+
+ pieChart.setDrawHoleEnabled(true);
+ pieChart.setTransparentCircleRadius(25f);
+ pieChart.setHoleRadius(25f);
+
+ dataSet.setColors(ColorTemplate.JOYFUL_COLORS);
+ data.setValueTextSize(10f);
+ data.setValueTextColor(Color.DKGRAY);
+ pieChart.setOnChartValueSelectedListener(this);
+
+ pieChart.animateXY(1400, 1400);
+
+ /* BarChart barChart = (BarChart) findViewById(R.id.barchart);
+
+ ArrayList entries = new ArrayList<>();
+ entries.add(new BarEntry(unapproved_float, 0));
+ entries.add(new BarEntry(complited_float, 1));
+ entries.add(new BarEntry(approved_float, 2));
+ entries.add(new BarEntry(requestforcomplition_float, 3));
+ entries.add(new BarEntry(requestformodification_float, 4));
+ entries.add(new BarEntry(rejected_float, 5));
+
+
+
+ ArrayList labels = new ArrayList();
+ labels.add("Proposed");
+ labels.add("Complited");
+ labels.add("Approved");
+ labels.add("Completion");
+ labels.add("Modification");
+ labels.add("Rejected");*/
+
+ /* if(unapproved_float!=0) {
+ entries.add(new BarEntry(unapproved_float, count++));
+ labels.add("Proposed");
+ }
+ if(complited_float!=0) {
+ entries.add(new BarEntry(complited_float, count++));
+ labels.add("Complited");
+ }
+ if(approved_float!=0) {
+ entries.add(new BarEntry(approved_float, count++));
+ labels.add("Approved");
+ }
+ if(requestforcomplition_float!=0) {
+ entries.add(new BarEntry(requestforcomplition_float, count++));
+ labels.add("Completion");
+ }
+ if(requestformodification_float!=0) {
+ entries.add(new BarEntry(requestformodification_float, count++));
+ labels.add("Modification");
+ }
+ if(rejected_float!=0) {
+ entries.add(new BarEntry(rejected_float, count++));
+ labels.add("Rejected");
+ }*/
+
+ /*BarDataSet bardataset = new BarDataSet(entries, "Cells");
+
+ BarData data1 = new BarData(labels, bardataset);
+ barChart.setData(data1); // set the data and list of lables into chart
+
+ // barChart.setDescription("Set Bar Chart Description"); // set the description
+
+ bardataset.setColors(ColorTemplate.COLORFUL_COLORS);
+
+ barChart.animateY(5000);*/
+//----------------------------------------------------------------------------------------------
+
+ ArrayList yvalues2 = new ArrayList();
+ ArrayList xVals2 = new ArrayList();
+
+ yvalues2.add(new Entry(studentcount_float, 0));
+ yvalues2.add(new Entry(collegecount_float,1));
+ PieDataSet dataSet2 = new PieDataSet(yvalues2, "");
+
+ xVals2.add("No of Students");
+ xVals2.add("No of Colleges");
+
+ /* xVals.add("Proposed");
+ xVals.add("Complited");
+ xVals.add("Approved");
+ xVals.add("Completion");
+ xVals.add("Modification");
+ xVals.add("Rejected");*/
+
+ PieData data2 = new PieData(xVals2, dataSet2);
+
+ data2.setValueFormatter(new PercentFormatter());
+ // Default value
+ //data.setValueFormatter(new DefaultValueFormatter(0));
+ pieChart2.setData(data2);
+ // pieChart2.setDescription("Student Counts");
+
+ pieChart2.setDrawHoleEnabled(true);
+ pieChart2.setTransparentCircleRadius(25f);
+ pieChart2.setHoleRadius(25f);
+
+ dataSet2.setColors(ColorTemplate.JOYFUL_COLORS);
+ data2.setValueTextSize(10f);
+ data2.setValueTextColor(Color.DKGRAY);
+ pieChart2.setOnChartValueSelectedListener(this);
+
+ pieChart2.animateXY(1400, 1400);
+
+ }
+
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ // register connection status listener
+ MyApplication.getInstance().setConnectivityListener(this);
+ }
+
+ @Override
+ public void onNetworkConnectionChanged(boolean isConnected) {
+ showSnack(isConnected);
+ }
+
+ private void showSnack(boolean isConnected) {
+
+ if (!isConnected) {
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(ChatsActivity.this);
+ //adb.setView(alertDialogView);
+
+ adb.setTitle("Sorry! Not connected to the internet");
+
+ adb.setIcon(android.R.drawable.ic_dialog_alert);
+
+ adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+
+ adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+ adb.setCancelable(true);
+ adb.show();
+
+ //finish();
+ }
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Override
+ public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
+ if (e == null)
+ return;
+ Log.i("VAL SELECTED",
+ "Value: " + e.getVal() + ", xIndex: " + e.getXIndex()
+ + ", DataSet index: " + dataSetIndex);
+ if(e.getXIndex()==0){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",0);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==2){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",1);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==1){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",3);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==3){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",2);
+ startActivity(ittEditProjToProjStatus);
+ }
+ }
+
+ /* @Override
+ public void onValueSelected(Entry e, Highlight h) {
+
+ if (e == null)
+ return;
+ Log.i("VAL SELECTED",
+ "Value: " + e.getY() + ", xIndex: " + e.getX()
+ + ", DataSet index: " + h.getDataSetIndex());
+ if(e.getX()==0){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",0);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getX()==2){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",1);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getX()==1){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",3);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getX()==3){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",2);
+ startActivity(ittEditProjToProjStatus);
+ }
+ }
+*/
+ @Override
+ public void onNothingSelected() {
+ Log.i("PieChart", "nothing selected");
+ }
+ /* @Override
+ public void onValueSelected(Entry e, int dataSetIndex) {
+
+ if (e == null)
+ return;
+ Log.i("VAL SELECTED",
+ "Value: " + e.getVal() + ", xIndex: " + e.getXIndex()
+ + ", DataSet index: " + dataSetIndex);
+ if(e.getXIndex()==0){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",0);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==2){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",1);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==1){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",3);
+ startActivity(ittEditProjToProjStatus);
+ }
+ if(e.getXIndex()==3){
+ Intent ittEditProjToProjStatus = new Intent(ChatsActivity.this,PMProjectDetailActivity.class);
+ ittEditProjToProjStatus.putExtra("pageCount",2);
+ startActivity(ittEditProjToProjStatus);
+ }
+ }
+
+ @Override
+ public void onNothingSelected() {
+ Log.i("PieChart", "nothing selected");
+ }*/
+}
diff --git a/app/src/main/java/com/leadcampusapp/CheckForSDCard.java b/app/src/main/java/com/leadcampusapp/CheckForSDCard.java
new file mode 100644
index 0000000..ff652cb
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CheckForSDCard.java
@@ -0,0 +1,15 @@
+package com.leadcampusapp;
+
+import android.os.Environment;
+
+public class CheckForSDCard {
+ //Check If SD Card is present or not method
+ public boolean isSDCardPresent() {
+ if (Environment.getExternalStorageState().equals(
+
+ Environment.MEDIA_MOUNTED)) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_ApprovedProjectList.java b/app/src/main/java/com/leadcampusapp/Class_ApprovedProjectList.java
new file mode 100644
index 0000000..fa6bfea
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_ApprovedProjectList.java
@@ -0,0 +1,117 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/10/2017.
+ */
+
+public class Class_ApprovedProjectList {
+
+
+ int id;
+
+ String ProjectSlNo;
+ String ProjectId;
+ String ProjectName;
+ String ProjectStatus;
+ String ProjectprecentCount;
+ String WebServiceStatus;
+ String ImpactProject;
+
+ /*38393
+ title15
+ Success
+ 0
+ 0*/
+
+ public Class_ApprovedProjectList(){
+
+ }
+
+
+ public Class_ApprovedProjectList(int id,String slno ,String projectid, String projectname, String projectstatus,String projectprecentcount,String webservicestatus,String impactproject)
+ {
+
+ this.id = id;
+ this.ProjectId = projectid;
+ this.ProjectName = projectname;
+ this.ProjectStatus=projectstatus;
+ this.ProjectSlNo=slno;
+ this.ProjectprecentCount=projectprecentcount;
+ this.WebServiceStatus=webservicestatus;
+ this.ImpactProject=impactproject;
+
+
+ }
+
+
+ public Class_ApprovedProjectList(String slno,String projectid, String projectname, String projectstatus,String projectprecentcount,String webservicestatus,String impactproject){
+
+ this.ProjectId = projectid;
+ this.ProjectName = projectname;
+ this.ProjectStatus=projectstatus;
+ this.ProjectSlNo=slno;
+ this.ProjectprecentCount=projectprecentcount;
+ this.WebServiceStatus=webservicestatus;
+ this.ImpactProject=impactproject;
+ }
+
+ //get and set
+ public String getproject_id(){
+ return this.ProjectId;
+ }
+ public void setproject_id(String projectid){
+ this.ProjectId = projectid;
+ }
+
+ //get and set
+ public String getproject_name(){
+ return this.ProjectName;
+ }
+ public void setproject_name(String projectname){
+ this.ProjectName = projectname;
+ }
+
+
+
+ //get and set
+ public String getproject_status(){
+ return this.ProjectStatus;
+ }
+ public void setproject_status(String project_status){
+ this.ProjectStatus = project_status;
+ }
+
+
+public String getproject_slno()
+{ return this.ProjectSlNo;}
+
+ public void setproject_slno(String project_slno){
+ this.ProjectSlNo = project_slno;
+ }
+
+
+ public String getproject_precentCount()
+ { return this.ProjectprecentCount;}
+
+ public void setproject_precentcount(String projectprecentcount)
+ {
+ this.ProjectprecentCount = projectprecentcount;
+ }
+
+
+ public String get_webservicestatus()
+ { return this.WebServiceStatus;}
+
+ public void set_webservicestatus(String webservicestatus)
+ {
+ this.WebServiceStatus = webservicestatus;
+ }
+
+ public String get_impactproject() {
+ return ImpactProject;
+ }
+
+ public void set_impactproject(String impactProject) {
+ ImpactProject = impactProject;
+ }
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_ChatModule.java b/app/src/main/java/com/leadcampusapp/Class_ChatModule.java
new file mode 100644
index 0000000..c002935
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_ChatModule.java
@@ -0,0 +1,86 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 16-Aug-19.
+ */
+
+public class Class_ChatModule {
+ //anyType{vmGetMentorMentee=anyType{Comments=testing; UserType=Manager; ManagerName=Anisha Cardoza; StudentName=Mallikarjun kumbar; ReplyTime=14-08-19 02:52:24 PM; ProjectStatus=anyType{}; Status=Success; }; }
+ String Comments;
+ String UserType;
+ String ManagerName;
+ String StudentName;
+ String ReplyTime;
+ String ProjectStatus;
+ String Status;
+
+ public Class_ChatModule(String comments, String userType, String managerName, String studentName, String replyTime, String projectStatus, String status) {
+ Comments = comments;
+ UserType = userType;
+ ManagerName = managerName;
+ StudentName = studentName;
+ ReplyTime = replyTime;
+ ProjectStatus = projectStatus;
+ Status = status;
+ }
+
+ public Class_ChatModule() {
+
+ }
+
+ public String getComments() {
+ return Comments;
+ }
+
+ public void setComments(String comments) {
+ Comments = comments;
+ }
+
+ public String getUserType() {
+ return UserType;
+ }
+
+ public void setUserType(String userType) {
+ UserType = userType;
+ }
+
+ public String getManagerName() {
+ return ManagerName;
+ }
+
+ public void setManagerName(String managerName) {
+ ManagerName = managerName;
+ }
+
+ public String getStudentName() {
+ return StudentName;
+ }
+
+ public void setStudentName(String studentName) {
+ StudentName = studentName;
+ }
+
+ public String getReplyTime() {
+ return ReplyTime;
+ }
+
+ public void setReplyTime(String replyTime) {
+ ReplyTime = replyTime;
+ }
+
+ public String getProjectStatus() {
+ return ProjectStatus;
+ }
+
+ public void setProjectStatus(String projectStatus) {
+ ProjectStatus = projectStatus;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_Colleges.java b/app/src/main/java/com/leadcampusapp/Class_Colleges.java
new file mode 100644
index 0000000..06e3ba0
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Colleges.java
@@ -0,0 +1,236 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/13/2017.
+ */
+
+public class Class_Colleges {
+
+ int id;
+
+
+ String CollegeId;
+ String College_TID;
+ String CollegeName;
+ String CollegeStatus;
+ String CollegeType;
+
+ String CurrentApplCount;
+ String CurrentAdmissionCount;
+ String PreviousApplCount;
+ String PreviousAdmissionCount;
+ String Prev2prevApplCount;
+ String Prev2prevAdmissionCount;
+
+ String Fees;
+ String Fees_Id;
+ String Status;
+
+ public Class_Colleges(){
+
+ }
+
+ public Class_Colleges(int id, String collegeId, String college_tid, String collegename, String collegestatus, String collegetype,
+ String currentapplcount, String currentadmissioncount, String previousapplcount, String previousadmissioncount, String prev2prevapplcount, String prev2prevadmissioncount)
+ {
+ this.id = id;
+ this.CollegeId = collegeId;
+ this.College_TID=college_tid;
+ this.CollegeName = collegename;
+ this.CollegeStatus=collegestatus;
+ this.CollegeType=collegetype;
+
+ this.CurrentApplCount=currentapplcount;
+ this.CurrentAdmissionCount=currentadmissioncount;
+ this.PreviousApplCount=previousapplcount;
+ this.PreviousAdmissionCount=previousadmissioncount;
+ this.Prev2prevApplCount=prev2prevapplcount;
+ this.Prev2prevAdmissionCount= prev2prevadmissioncount;
+ }
+
+ public Class_Colleges(String collegeId, String college_tid, String collegename, String collegestatus, String collegetype,
+ String currentapplcount, String currentadmissioncount, String previousapplcount, String previousadmissioncount, String prev2prevapplcount, String prev2prevadmissioncount)
+ {
+
+ this.CollegeId = collegeId;
+ this.College_TID=college_tid;
+ this.CollegeName = collegename;
+ this.CollegeStatus=collegestatus;
+ this.CollegeType=collegetype;
+
+ this.CurrentApplCount=currentapplcount;
+ this.CurrentAdmissionCount=currentadmissioncount;
+ this.PreviousApplCount=previousapplcount;
+ this.PreviousAdmissionCount=previousadmissioncount;
+ this.Prev2prevApplCount=prev2prevapplcount;
+ this.Prev2prevAdmissionCount= prev2prevadmissioncount;
+ }
+
+
+ //get and set
+ public String getcollege_id(){
+ return this.CollegeId;
+ }
+ public void setcollege_id(String collegeId){
+ this.CollegeId = collegeId;
+ }
+
+
+ //get and set
+ public String getcollege_tid(){
+ return this.College_TID;
+ }
+ public void setcollege_tid(String college_tid){
+ this.College_TID = college_tid;
+ }
+
+ //get and set
+ public String getcollegename(){
+ return this.CollegeName;
+ }
+ public void setcollegename(String collegename){
+ this.CollegeName = collegename;
+ }
+
+ //get and set
+ public String getcollegestatus(){
+ return this.CollegeStatus;
+ }
+ public void setcollegestatus(String collegestatus){
+ this.CollegeStatus = collegestatus;
+ }
+
+
+
+ //get and set
+ public String getcollegetype(){
+ return this.CollegeType;
+ }
+ public void setcollegetype(String collegetype){
+ this.CollegeType = collegetype;
+ }
+
+
+
+
+
+
+
+
+
+
+
+ //get and set
+ public String getcurrentapplcount(){
+ return this.CurrentApplCount;
+ }
+ public void setcurrentapplcount(String currentapplcount){
+ this.CurrentApplCount = currentapplcount;
+ }
+
+
+
+ //get and set
+ public String getcurrentadmissioncount(){
+ return this.CurrentAdmissionCount;
+ }
+ public void setcurrentadmissioncount(String currentadmissioncount){
+ this.CurrentAdmissionCount = currentadmissioncount;
+ }
+
+ //get and set
+ public String getpreviousapplcount(){
+ return this.PreviousApplCount;
+ }
+ public void setpreviousapplcount(String previousapplcount){
+ this.PreviousApplCount = previousapplcount;
+ }
+
+
+
+
+
+
+ //get and set
+ public String getpreviousadmissioncount(){
+ return this.PreviousAdmissionCount;
+ }
+ public void setpreviousadmissioncount(String previousadmissioncount){
+ this.PreviousAdmissionCount = previousadmissioncount;
+ }
+
+
+ //get and set
+ public String getprev2prevapplcount(){
+ return this.Prev2prevApplCount;
+ }
+ public void setprev2prevapplcount(String prev2prevapplcount){
+ this.Prev2prevApplCount = prev2prevapplcount;
+ }
+
+
+ //get and set
+ public String getprev2prevadmissioncount(){
+ return this.Prev2prevAdmissionCount;
+ }
+ public void setprev2prevadmissioncount(String prev2prevadmissioncount){
+ this.Prev2prevAdmissionCount = prev2prevadmissioncount;
+ }
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getCollegeId() {
+ return CollegeId;
+ }
+
+ public void setCollegeId(String collegeId) {
+ CollegeId = collegeId;
+ }
+
+ public String getCollegeName() {
+ return CollegeName;
+ }
+
+ public void setCollegeName(String collegeName) {
+ CollegeName = collegeName;
+ }
+
+ public String getFees() {
+ return Fees;
+ }
+
+ public void setFees(String fees) {
+ Fees = fees;
+ }
+
+ public String getFees_Id() {
+ return Fees_Id;
+ }
+
+ public void setFees_Id(String fees_Id) {
+ Fees_Id = fees_Id;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ //set the string
+ public String toString()
+ {
+ return( this.CollegeName );
+ }
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_ContactUs.java b/app/src/main/java/com/leadcampusapp/Class_ContactUs.java
new file mode 100644
index 0000000..a120695
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_ContactUs.java
@@ -0,0 +1,76 @@
+package com.leadcampusapp;
+
+/*
+1
+Any queries in WebApp and Mobile App
+Hubballi
+Contact Helpline
+9686654748
+leadmis@dfmail.org
+
+Helpline
+1
+Success
+*/
+
+
+public class Class_ContactUs
+{
+String sandbox_name;
+ String sandbox_address;
+ String contact_person;
+ String contact_number1;
+ String emailid1;
+ String emailid2;
+
+ public String getSandbox_name() {
+ return sandbox_name;
+ }
+
+ public void setSandbox_name(String sandbox_name) {
+ this.sandbox_name = sandbox_name;
+ }
+
+ public String getSandbox_address() {
+ return sandbox_address;
+ }
+
+ public void setSandbox_address(String sandbox_address) {
+ this.sandbox_address = sandbox_address;
+ }
+
+ public String getContact_person() {
+ return contact_person;
+ }
+
+ public void setContact_person(String contact_person) {
+ this.contact_person = contact_person;
+ }
+
+ public String getContact_number1() {
+ return contact_number1;
+ }
+
+ public void setContact_number1(String contact_number1) {
+ this.contact_number1 = contact_number1;
+ }
+
+ public String getEmailid1() {
+ return emailid1;
+ }
+
+ public void setEmailid1(String emailid1) {
+ this.emailid1 = emailid1;
+ }
+
+ public String getEmailid2() {
+ return emailid2;
+ }
+
+ public void setEmailid2(String emailid2) {
+ this.emailid2 = emailid2;
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_Course.java b/app/src/main/java/com/leadcampusapp/Class_Course.java
new file mode 100644
index 0000000..b81b45a
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Course.java
@@ -0,0 +1,116 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 12/7/18.
+ */
+
+public class Class_Course
+{
+
+ int id;
+
+ String CourseId;
+ String CourseName;
+ String CourseProgCode;
+ String CourseStatus;
+
+
+ /*long
+ string
+ long
+ string*/
+
+
+
+
+ public Class_Course(){
+
+ }
+
+
+ public Class_Course(int id, String courseId, String coursename, String courseprogcode, String coursestatus){
+ this.id = id;
+ this.CourseId = courseId;
+ this.CourseName = coursename;
+ this.CourseProgCode=courseprogcode;
+ this.CourseStatus=coursestatus;
+
+
+ }
+
+ public Class_Course(String courseId, String coursename, String courseprogcode, String coursestatus){
+
+ this.CourseId = courseId;
+ this.CourseName = coursename;
+ this.CourseProgCode=courseprogcode;
+ this.CourseStatus=coursestatus;
+ }
+
+
+ //get and set
+ public String getcourse_id(){
+ return this.CourseId;
+ }
+ public void setcourse_id(String courseId){
+ this.CourseId = courseId;
+ }
+
+
+
+
+ //courseprogcode
+
+ //get and set
+ public String getcourse_progcode(){
+ return this.CourseProgCode;
+ }
+ public void setcourse_progcode(String courseprogcode){
+ this.CourseProgCode = courseprogcode;
+ }
+
+
+
+
+
+ //get and set
+ public String getcourse_name(){
+ return this.CourseName;
+ }
+ public void setcourse_name(String coursename){
+ this.CourseName = coursename;
+ }
+
+
+
+
+
+
+
+
+
+
+
+ //get and set
+ public String getcourse_status(){
+ return this.CourseStatus;
+ }
+ public void setcourse_status(String coursestatus){
+ this.CourseStatus = coursestatus;
+ }
+
+
+
+
+
+
+
+
+ //set the string
+ public String toString()
+ {
+ return( this.CourseName );
+ }
+
+
+
+}// End of course
diff --git a/app/src/main/java/com/leadcampusapp/Class_CurrentEvents.java b/app/src/main/java/com/leadcampusapp/Class_CurrentEvents.java
new file mode 100644
index 0000000..7f772ea
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_CurrentEvents.java
@@ -0,0 +1,131 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 20/7/18.
+ */
+
+/*long
+string
+string
+string
+string
+string
+string
+string
+ int
+string*/
+
+
+public class Class_CurrentEvents {
+
+ int _id;
+ //String EventName;
+ //String EventDesc;
+ // String EventImageURL;
+ String EventApplyURL; //string
+ String EventURL; //string
+ byte[] EventImage; //string
+ String PastorCurrent; //int
+ String Status; //string
+ String FromDate;//string
+ String Todate;//string
+
+
+
+
+
+ /* int _id;
+ String EventApplyURL;
+ String EventURL;
+ byte[] EventImage;*/
+
+
+ public Class_CurrentEvents() {
+ }
+
+
+ public Class_CurrentEvents(int id, String eventapplyurl, String eventurl,byte[] eventimage,String pastorcurrent,String status,String fromdate,String todate) {
+ this._id = id;
+ this.EventApplyURL = eventapplyurl;
+ this.EventURL = eventurl;
+ this.EventImage = eventimage;
+ this.PastorCurrent=pastorcurrent;
+ this.Status=status;
+ this.FromDate=fromdate;
+ this.Todate=todate;
+ }
+
+
+
+ public Class_CurrentEvents(String eventapplyurl, String eventurl,byte[] eventimage,String pastorcurrent,String status,String fromdate,String todate) {
+
+ this.EventApplyURL = eventapplyurl;
+ this.EventURL = eventurl;
+ this.EventImage = eventimage;
+ this.PastorCurrent=pastorcurrent;
+ this.Status=status;
+ this.FromDate=fromdate;
+ this.Todate=todate;
+
+ }
+
+
+ public String getEventApplyURL(){
+ return this.EventApplyURL;
+ }
+ // setting id
+ public void setEventApplyURL(String eventapplyurl){
+ this.EventApplyURL = eventapplyurl;
+ }
+
+ public String getEventURL(){
+ return this.EventURL;
+ }
+ // setting id
+ public void setEventURL(String eventurl){
+ this.EventURL = eventurl;
+ }
+
+
+ public byte[] getEventImage(){
+ return this.EventImage;
+ }
+ public byte[] setEventImage(byte[] eventimage){
+ return this.EventImage=eventimage;
+ }
+
+
+
+ public String getPastorCurrent(){
+ return this.PastorCurrent;
+ }
+ // setting id
+ public void setPastorCurrent(String pastorcurrent){
+ this.PastorCurrent = pastorcurrent;
+ }
+
+
+ public String getStatus(){
+ return this.Status;
+ }
+ // setting id
+ public void setStatus(String status){
+ this.Status = status;
+ }
+
+ public String getFromDate() {
+ return FromDate;
+ }
+
+ public void setFromDate(String fromDate) {
+ FromDate = fromDate;
+ }
+
+ public String getTodate() {
+ return Todate;
+ }
+
+ public void setTodate(String todate) {
+ Todate = todate;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Class_District.java b/app/src/main/java/com/leadcampusapp/Class_District.java
new file mode 100644
index 0000000..137dabb
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_District.java
@@ -0,0 +1,98 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/10/2017.
+ */
+
+/*
+ 1
+ Nicobar
+ Success
+ 1*/
+
+public class Class_District {
+
+ int id;
+
+ String DistrictId;
+ String DistrictName;
+ String DistrictStatus;
+ String DStateId;
+
+ /*1
+ Nicobar
+ Success
+ 1 */
+
+ public Class_District(){
+
+ }
+
+
+ public Class_District(int id, String districtid, String districtname, String districtstatus, String dstateid){
+ this.id = id;
+ this.DistrictId = districtid;
+ this.DistrictName = districtname;
+ this.DistrictStatus=districtstatus;
+ this.DStateId=dstateid;
+
+ }
+
+
+ public Class_District(String districtid, String districtname, String districtstatus, String dstateid){
+
+ this.DistrictId = districtid;
+ this.DistrictName = districtname;
+ this.DistrictStatus=districtstatus;
+ this.DStateId=dstateid;
+ }
+
+ //get and set
+ public String getdistrict_id(){
+ return this.DistrictId;
+ }
+ public void setdistrict_id(String districtid){
+ this.DistrictId = districtid;
+ }
+
+ //get and set
+ public String getdistrict_name(){
+ return this.DistrictName;
+ }
+ public void setdistrict_name(String districtname){
+ this.DistrictName = districtname;
+ }
+
+
+
+ //get and set
+ public String getdistrict_status(){
+ return this.DistrictStatus;
+ }
+ public void setdistrict_status(String districtstatus){
+ this.DistrictStatus = districtstatus;
+ }
+
+
+ //get and set
+ public String getdstateid_id(){
+ return this.DStateId;
+ }
+ public void setdstateid_id(String dstateid){
+ this.DStateId = dstateid;
+ }
+
+
+ public String toString()
+ {
+ return( this.DistrictName );
+ }
+
+
+
+
+
+
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_FeesCatMaster.java b/app/src/main/java/com/leadcampusapp/Class_FeesCatMaster.java
new file mode 100644
index 0000000..d8f9b49
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_FeesCatMaster.java
@@ -0,0 +1,80 @@
+package com.leadcampusapp;
+
+
+
+/*anyType{vmGET_FeeCategory_Master=anyType{Fees_Category_Slno=1; fees_category_code=RG;
+Fees_category_description=Registration; Fees=1; Fees_ID=486; academic_year=0; Status=Success; }; }*/
+
+public class Class_FeesCatMaster
+{
+
+ private String Fees_Category_Slno;
+ private String fees_category_code;
+ private String Fees_category_description;
+
+ private String Fees;
+ private String Fees_ID;
+ private String academic_year;
+ private String Status;
+
+ public String getFees_Category_Slno() {
+ return Fees_Category_Slno;
+ }
+
+ public void setFees_Category_Slno(String fees_Category_Slno) {
+ Fees_Category_Slno = fees_Category_Slno;
+ }
+
+ public String getFees_category_code() {
+ return fees_category_code;
+ }
+
+ public void setFees_category_code(String fees_category_code) {
+ this.fees_category_code = fees_category_code;
+ }
+
+ public String getFees_category_description() {
+ return Fees_category_description;
+ }
+
+ public void setFees_category_description(String fees_category_description) {
+ Fees_category_description = fees_category_description;
+ }
+
+ public String getFees() {
+ return Fees;
+ }
+
+ public void setFees(String fees) {
+ Fees = fees;
+ }
+
+ public String getFees_ID() {
+ return Fees_ID;
+ }
+
+ public void setFees_ID(String fees_ID) {
+ Fees_ID = fees_ID;
+ }
+
+ public String getAcademic_year() {
+ return academic_year;
+ }
+
+ public void setAcademic_year(String academic_year) {
+ this.academic_year = academic_year;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+
+ public String toString() {
+ return Fees_category_description;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_FeesCatg.java b/app/src/main/java/com/leadcampusapp/Class_FeesCatg.java
new file mode 100644
index 0000000..e980978
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_FeesCatg.java
@@ -0,0 +1,113 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 10/02/2021.
+ */
+
+public class Class_FeesCatg {
+
+ int id;
+
+ String Fees_Category_Slno;
+ String fees_category_code;
+ String Fees_category_description;
+ String academic_year;
+ String Fees;
+ String Fees_ID;
+ String Status;
+
+ /*1
+ Nicobar
+ Success
+ 1 */
+
+ public Class_FeesCatg(){
+
+ }
+
+ public Class_FeesCatg(int id, String fees_Category_Slno, String fees_category_code, String fees_category_description, String academic_year, String status) {
+ this.id = id;
+ Fees_Category_Slno = fees_Category_Slno;
+ this.fees_category_code = fees_category_code;
+ Fees_category_description = fees_category_description;
+ this.academic_year = academic_year;
+ Status = status;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getFees_Category_Slno() {
+ return Fees_Category_Slno;
+ }
+
+ public void setFees_Category_Slno(String fees_Category_Slno) {
+ Fees_Category_Slno = fees_Category_Slno;
+ }
+
+ public String getFees_category_code() {
+ return fees_category_code;
+ }
+
+ public void setFees_category_code(String fees_category_code) {
+ this.fees_category_code = fees_category_code;
+ }
+
+ public String getFees_category_description() {
+ return Fees_category_description;
+ }
+
+ public void setFees_category_description(String fees_category_description) {
+ Fees_category_description = fees_category_description;
+ }
+
+ public String getAcademic_year() {
+ return academic_year;
+ }
+
+ public void setAcademic_year(String academic_year) {
+ this.academic_year = academic_year;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ public String getFees() {
+ return Fees;
+ }
+
+ public void setFees(String fees) {
+ Fees = fees;
+ }
+
+ public String getFees_ID() {
+ return Fees_ID;
+ }
+
+ public void setFees_ID(String fees_ID) {
+ Fees_ID = fees_ID;
+ }
+
+ public String toString()
+ {
+ return( this.Fees_category_description );
+ }
+
+
+
+
+
+
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_FileUtil_forImage.java b/app/src/main/java/com/leadcampusapp/Class_FileUtil_forImage.java
new file mode 100644
index 0000000..dec8682
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_FileUtil_forImage.java
@@ -0,0 +1,109 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.OpenableColumns;
+import android.util.Log;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+class Class_FileUtil_forImage {
+ private static final int EOF = -1;
+ private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
+
+ private Class_FileUtil_forImage() {
+
+ }
+
+ public static File from(Context context, Uri uri) throws IOException {
+ InputStream inputStream = context.getContentResolver().openInputStream(uri);
+ String fileName = getFileName(context, uri);
+ String[] splitName = splitFileName(fileName);
+ File tempFile = File.createTempFile(splitName[0], splitName[1]);
+ tempFile = rename(tempFile, fileName);
+ tempFile.deleteOnExit();
+ FileOutputStream out = null;
+ try {
+ out = new FileOutputStream(tempFile);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ if (inputStream != null) {
+ copy(inputStream, out);
+ inputStream.close();
+ }
+
+ if (out != null) {
+ out.close();
+ }
+ return tempFile;
+ }
+
+ private static String[] splitFileName(String fileName) {
+ String name = fileName;
+ String extension = "";
+ int i = fileName.lastIndexOf(".");
+ if (i != -1) {
+ name = fileName.substring(0, i);
+ extension = fileName.substring(i);
+ }
+
+ return new String[]{name, extension};
+ }
+
+ private static String getFileName(Context context, Uri uri) {
+ String result = null;
+ if (uri.getScheme().equals("content")) {
+ Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
+ try {
+ if (cursor != null && cursor.moveToFirst()) {
+ result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (cursor != null) {
+ cursor.close();
+ }
+ }
+ }
+ if (result == null) {
+ result = uri.getPath();
+ int cut = result.lastIndexOf(File.separator);
+ if (cut != -1) {
+ result = result.substring(cut + 1);
+ }
+ }
+ return result;
+ }
+
+ private static File rename(File file, String newName) {
+ File newFile = new File(file.getParent(), newName);
+ if (!newFile.equals(file)) {
+ if (newFile.exists() && newFile.delete()) {
+ Log.d("Class_FileUtil_forImage", "Delete old " + newName + " file");
+ }
+ if (file.renameTo(newFile)) {
+ Log.d("Class_FileUtil_forImage", "Rename file to " + newName);
+ }
+ }
+ return newFile;
+ }
+
+ private static long copy(InputStream input, OutputStream output) throws IOException {
+ long count = 0;
+ int n;
+ byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+ while (EOF != (n = input.read(buffer))) {
+ output.write(buffer, 0, n);
+ count += n;
+ }
+ return count;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_FromToDate.java b/app/src/main/java/com/leadcampusapp/Class_FromToDate.java
new file mode 100644
index 0000000..80705a5
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_FromToDate.java
@@ -0,0 +1,59 @@
+package com.leadcampusapp;
+
+public class Class_FromToDate {
+
+ String Academic_Id;
+ String Academic_Code;
+ String Year_Code;
+ String From_Date;
+ String To_Date;
+ String Status;
+
+ public String getAcademic_Id() {
+ return Academic_Id;
+ }
+
+ public void setAcademic_Id(String academic_Id) {
+ Academic_Id = academic_Id;
+ }
+
+ public String getAcademic_Code() {
+ return Academic_Code;
+ }
+
+ public void setAcademic_Code(String academic_Code) {
+ Academic_Code = academic_Code;
+ }
+
+ public String getYear_Code() {
+ return Year_Code;
+ }
+
+ public void setYear_Code(String year_Code) {
+ Year_Code = year_Code;
+ }
+
+ public String getFrom_Date() {
+ return From_Date;
+ }
+
+ public void setFrom_Date(String from_Date) {
+ From_Date = from_Date;
+ }
+
+ public String getTo_Date() {
+ return To_Date;
+ }
+
+ public void setTo_Date(String to_Date) {
+ To_Date = to_Date;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_FundStudList.java b/app/src/main/java/com/leadcampusapp/Class_FundStudList.java
new file mode 100644
index 0000000..30e5fbf
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_FundStudList.java
@@ -0,0 +1,128 @@
+package com.leadcampusapp;
+
+import java.util.List;
+
+public class Class_FundStudList {
+ /* 37003
+ MH03842
+ One Test edit
+ 7619298575
+ mallikarjun.tech@dfmail.com
+ Malnad College
+ 3rd year (6th sem)
+ Success
+
+
+ 53433
+ First project
+ 25
+ 12
+ 12
+ 0
+ 12
+ success
+
+
+ 53435
+ Web Project modify in mobile
+ 30
+ 10
+ 10
+ 0
+ 10
+ success
+
+
+ */
+ String Registration_Id;
+ String Student_Name;
+ String Mobile_No;
+ String Email_Id;
+ String Lead_Id;
+ String College_Name;
+ String Sem_Name;
+ String Status;
+ private Class_Fund_Details[] Fund_details;
+
+ List Fund_Details;
+
+ public String getRegistration_Id() {
+ return Registration_Id;
+ }
+
+ public void setRegistration_Id(String registration_Id) {
+ Registration_Id = registration_Id;
+ }
+
+ public String getStudent_Name() {
+ return Student_Name;
+ }
+
+ public void setStudent_Name(String student_Name) {
+ Student_Name = student_Name;
+ }
+
+ public String getMobile_No() {
+ return Mobile_No;
+ }
+
+ public void setMobile_No(String mobile_No) {
+ Mobile_No = mobile_No;
+ }
+
+ public String getEmail_Id() {
+ return Email_Id;
+ }
+
+ public void setEmail_Id(String email_Id) {
+ Email_Id = email_Id;
+ }
+
+ public String getLead_Id() {
+ return Lead_Id;
+ }
+
+ public void setLead_Id(String lead_Id) {
+ Lead_Id = lead_Id;
+ }
+
+ public String getCollege_Name() {
+ return College_Name;
+ }
+
+ public void setCollege_Name(String college_Name) {
+ College_Name = college_Name;
+ }
+
+ public String getSem_Name() {
+ return Sem_Name;
+ }
+
+ public void setSem_Name(String sem_Name) {
+ Sem_Name = sem_Name;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ /* public List getFund_Details() {
+ return Fund_Details;
+ }*/
+
+ public void setFund_Details(List fund_Details) {
+ Fund_Details = fund_Details;
+ }
+
+ public Class_Fund_Details[] getFund_details() {
+ return Fund_details;
+ }
+
+ public void setFund_details(Class_Fund_Details[] fund_details) {
+ Fund_details = fund_details;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_Fund_Details.java b/app/src/main/java/com/leadcampusapp/Class_Fund_Details.java
new file mode 100644
index 0000000..9f5c2d3
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Fund_Details.java
@@ -0,0 +1,112 @@
+package com.leadcampusapp;
+
+public class Class_Fund_Details {
+ /*
+ 53433
+ First project
+ 25
+ 12
+ 12
+ 0
+ 12
+ success
+ */
+
+ String PDID;
+ String Project_Title;
+ String Requested_Amount;
+ String Santioned_Amount;
+ String Released_Amount;
+ String Total_Released_Amount;
+ String Balance_Amount;
+ String Status;
+ String Registration_Id;
+
+
+ public String getPDID() {
+ return PDID;
+ }
+
+ public void setPDID(String PDID) {
+ this.PDID = PDID;
+ }
+
+ public String getProject_Title() {
+ return Project_Title;
+ }
+
+ public void setProject_Title(String project_Title) {
+ Project_Title = project_Title;
+ }
+
+ public String getRequested_Amount() {
+ return Requested_Amount;
+ }
+
+ public void setRequested_Amount(String requested_Amount) {
+ Requested_Amount = requested_Amount;
+ }
+
+ public String getSantioned_Amount() {
+ return Santioned_Amount;
+ }
+
+ public void setSantioned_Amount(String santioned_Amount) {
+ Santioned_Amount = santioned_Amount;
+ }
+
+ public String getReleased_Amount() {
+ return Released_Amount;
+ }
+
+ public void setReleased_Amount(String released_Amount) {
+ Released_Amount = released_Amount;
+ }
+
+ public String getTotal_Released_Amount() {
+ return Total_Released_Amount;
+ }
+
+ public void setTotal_Released_Amount(String total_Released_Amount) {
+ Total_Released_Amount = total_Released_Amount;
+ }
+
+ public String getBalance_Amount() {
+ return Balance_Amount;
+ }
+
+ public void setBalance_Amount(String balance_Amount) {
+ Balance_Amount = balance_Amount;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ public String getRegistration_Id() {
+ return Registration_Id;
+ }
+
+ public void setRegistration_Id(String registration_Id) {
+ Registration_Id = registration_Id;
+ }
+
+ public Class_Fund_Details(String PDID, String project_Title, String requested_Amount, String santioned_Amount, String released_Amount, String total_Released_Amount, String balance_Amount, String status, String registration_Id) {
+ this.PDID = PDID;
+ Project_Title = project_Title;
+ Requested_Amount = requested_Amount;
+ Santioned_Amount = santioned_Amount;
+ Released_Amount = released_Amount;
+ Total_Released_Amount = total_Released_Amount;
+ Balance_Amount = balance_Amount;
+ Status = status;
+ Registration_Id =registration_Id;
+ }
+
+ public Class_Fund_Details() {
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_HintSpinnerAdapter.java b/app/src/main/java/com/leadcampusapp/Class_HintSpinnerAdapter.java
new file mode 100644
index 0000000..153714e
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_HintSpinnerAdapter.java
@@ -0,0 +1,30 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 23/7/18.
+ */
+
+ import android.content.Context;
+ import android.widget.ArrayAdapter;
+
+public class Class_HintSpinnerAdapter extends ArrayAdapter {
+
+ public Class_HintSpinnerAdapter(Context context, int textViewResourceId) {
+ super(context, textViewResourceId);
+ // TODO Auto-generated constructor stub
+
+ }
+
+ @Override
+ public int getCount() {
+
+ // TODO Auto-generated method stub
+ int count = super.getCount();
+
+ return count>0 ? count-1 : count ;
+
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/leadcampusapp/Class_InternetDectector.java b/app/src/main/java/com/leadcampusapp/Class_InternetDectector.java
new file mode 100644
index 0000000..06eeb92
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_InternetDectector.java
@@ -0,0 +1,43 @@
+package com.leadcampusapp;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+public class Class_InternetDectector {
+
+ private Context _context;
+
+ public Class_InternetDectector(Context context){
+ this._context = context;
+ }
+
+ public boolean isConnectingToInternet()
+ {
+
+ ConnectivityManager connectivity = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ if (connectivity != null)
+ {
+ NetworkInfo[] info = connectivity.getAllNetworkInfo();
+
+ NetworkInfo wifiNetwork = connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+ if (wifiNetwork != null && wifiNetwork.isConnected()) {
+ return true;
+ }
+
+ NetworkInfo mobileNetwork = connectivity.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
+ if (mobileNetwork != null && mobileNetwork.isConnected()) {
+ return true;
+ }
+
+ /*if (info != null)
+ for (int i = 0; i < info.length; i++)
+ if (info[i].getState() == NetworkInfo.State.CONNECTED)
+ {
+ return true;
+ }*/
+
+ }
+ return false;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_ManagerSummary.java b/app/src/main/java/com/leadcampusapp/Class_ManagerSummary.java
new file mode 100644
index 0000000..60c3ea8
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_ManagerSummary.java
@@ -0,0 +1,68 @@
+package com.leadcampusapp;
+
+public class Class_ManagerSummary {
+
+ String Fees_Category_Id;
+ String Fees_Category_Name;
+ String Collected;
+ String Submitted;
+ String Balance;
+ String Total;
+ String Status;
+
+ public String getFees_Category_Id() {
+ return Fees_Category_Id;
+ }
+
+ public void setFees_Category_Id(String fees_Category_Id) {
+ Fees_Category_Id = fees_Category_Id;
+ }
+
+ public String getFees_Category_Name() {
+ return Fees_Category_Name;
+ }
+
+ public void setFees_Category_Name(String fees_Category_Name) {
+ Fees_Category_Name = fees_Category_Name;
+ }
+
+ public String getCollected() {
+ return Collected;
+ }
+
+ public void setCollected(String collected) {
+ Collected = collected;
+ }
+
+ public String getSubmitted() {
+ return Submitted;
+ }
+
+ public void setSubmitted(String submitted) {
+ Submitted = submitted;
+ }
+
+ public String getBalance() {
+ return Balance;
+ }
+
+ public void setBalance(String balance) {
+ Balance = balance;
+ }
+
+ public String getTotal() {
+ return Total;
+ }
+
+ public void setTotal(String total) {
+ Total = total;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_ManagerSummaryDetails.java b/app/src/main/java/com/leadcampusapp/Class_ManagerSummaryDetails.java
new file mode 100644
index 0000000..ba26b02
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_ManagerSummaryDetails.java
@@ -0,0 +1,140 @@
+package com.leadcampusapp;
+
+public class Class_ManagerSummaryDetails {
+
+ String Submission_slno;
+ String Fees_Category_Id;
+ String Fees_Category_description;
+ String Submission_Amount;
+ String Submitted_Date;
+ String Submitted_Mode;
+ String Submitted_Remark;
+ String Submitted_By;
+ String Rec_Status;
+ String Submitter_Name;
+ String Rec_Date;
+ String Rec_By;
+ String Rec_Mail_id;
+ String Rec_Remark;
+ String Status;
+
+ public String getSubmission_slno() {
+ return Submission_slno;
+ }
+
+ public void setSubmission_slno(String submission_slno) {
+ Submission_slno = submission_slno;
+ }
+
+ public String getFees_Category_Id() {
+ return Fees_Category_Id;
+ }
+
+ public void setFees_Category_Id(String fees_Category_Id) {
+ Fees_Category_Id = fees_Category_Id;
+ }
+
+ public String getFees_Category_description() {
+ return Fees_Category_description;
+ }
+
+ public void setFees_Category_description(String fees_Category_description) {
+ Fees_Category_description = fees_Category_description;
+ }
+
+ public String getSubmission_Amount() {
+ return Submission_Amount;
+ }
+
+ public void setSubmission_Amount(String submission_Amount) {
+ Submission_Amount = submission_Amount;
+ }
+
+ public String getSubmitted_Date() {
+ return Submitted_Date;
+ }
+
+ public void setSubmitted_Date(String submitted_Date) {
+ Submitted_Date = submitted_Date;
+ }
+
+ public String getSubmitted_Mode() {
+ return Submitted_Mode;
+ }
+
+ public void setSubmitted_Mode(String submitted_Mode) {
+ Submitted_Mode = submitted_Mode;
+ }
+
+ public String getSubmitted_Remark() {
+ return Submitted_Remark;
+ }
+
+ public void setSubmitted_Remark(String submitted_Remark) {
+ Submitted_Remark = submitted_Remark;
+ }
+
+ public String getSubmitted_By() {
+ return Submitted_By;
+ }
+
+ public void setSubmitted_By(String submitted_By) {
+ Submitted_By = submitted_By;
+ }
+
+ public String getRec_Status() {
+ return Rec_Status;
+ }
+
+ public void setRec_Status(String rec_Status) {
+ Rec_Status = rec_Status;
+ }
+
+ public String getSubmitter_Name() {
+ return Submitter_Name;
+ }
+
+ public void setSubmitter_Name(String submitter_Name) {
+ Submitter_Name = submitter_Name;
+ }
+
+ public String getRec_Date() {
+ return Rec_Date;
+ }
+
+ public void setRec_Date(String rec_Date) {
+ Rec_Date = rec_Date;
+ }
+
+ public String getRec_By() {
+ return Rec_By;
+ }
+
+ public void setRec_By(String rec_By) {
+ Rec_By = rec_By;
+ }
+
+ public String getRec_Mail_id() {
+ return Rec_Mail_id;
+ }
+
+ public void setRec_Mail_id(String rec_Mail_id) {
+ Rec_Mail_id = rec_Mail_id;
+ }
+
+ public String getRec_Remark() {
+ return Rec_Remark;
+ }
+
+ public void setRec_Remark(String rec_Remark) {
+ Rec_Remark = rec_Remark;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_PaidStudList.java b/app/src/main/java/com/leadcampusapp/Class_PaidStudList.java
new file mode 100644
index 0000000..eee2949
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_PaidStudList.java
@@ -0,0 +1,236 @@
+package com.leadcampusapp;
+
+public class Class_PaidStudList {
+ /* 40
+ MH02868
+ mamata gundu karambalkar
+ 35909
+ 1
+ 22-February-21
+ 22-02-2021 04:02;59 04:26:59 PM
+ 36
+ 0
+ 0
+ Registration
+ Completed
+ 2020-21
+
+
+ Manager
+ Cash
+ test yest
+
+
+
+
+
+ 0
+ Success*/
+
+ String Payment_Id,Lead_Id,StudentName,Registration_Id,Paid_Fees;
+ String paid_date,Created_Date,Auto_Receipt_No,transanction_Id,reference_id;
+ String Fees_Category_description,transactionStatus,YearCode,Payment_Type,Payeer_Id;
+ String Created_User_Type,Payment_Mode,Payment_Remark,Manager_Submission_Status,Payment_Receipt_Path;
+ String Rec_Date,Rec_Remark,Rec_By,Rec_Status;
+ String Status;
+
+ public String getPayment_Id() {
+ return Payment_Id;
+ }
+
+ public void setPayment_Id(String payment_Id) {
+ Payment_Id = payment_Id;
+ }
+
+ public String getLead_Id() {
+ return Lead_Id;
+ }
+
+ public void setLead_Id(String lead_Id) {
+ Lead_Id = lead_Id;
+ }
+
+ public String getStudentName() {
+ return StudentName;
+ }
+
+ public void setStudentName(String studentName) {
+ StudentName = studentName;
+ }
+
+ public String getRegistration_Id() {
+ return Registration_Id;
+ }
+
+ public void setRegistration_Id(String registration_Id) {
+ Registration_Id = registration_Id;
+ }
+
+ public String getPaid_Fees() {
+ return Paid_Fees;
+ }
+
+ public void setPaid_Fees(String paid_Fees) {
+ Paid_Fees = paid_Fees;
+ }
+
+ public String getPaid_date() {
+ return paid_date;
+ }
+
+ public void setPaid_date(String paid_date) {
+ this.paid_date = paid_date;
+ }
+
+ public String getCreated_Date() {
+ return Created_Date;
+ }
+
+ public void setCreated_Date(String created_Date) {
+ Created_Date = created_Date;
+ }
+
+ public String getAuto_Receipt_No() {
+ return Auto_Receipt_No;
+ }
+
+ public void setAuto_Receipt_No(String auto_Receipt_No) {
+ Auto_Receipt_No = auto_Receipt_No;
+ }
+
+ public String getTransanction_Id() {
+ return transanction_Id;
+ }
+
+ public void setTransanction_Id(String transanction_Id) {
+ this.transanction_Id = transanction_Id;
+ }
+
+ public String getReference_id() {
+ return reference_id;
+ }
+
+ public void setReference_id(String reference_id) {
+ this.reference_id = reference_id;
+ }
+
+ public String getFees_Category_description() {
+ return Fees_Category_description;
+ }
+
+ public void setFees_Category_description(String fees_Category_description) {
+ Fees_Category_description = fees_Category_description;
+ }
+
+ public String getTransactionStatus() {
+ return transactionStatus;
+ }
+
+ public void setTransactionStatus(String transactionStatus) {
+ this.transactionStatus = transactionStatus;
+ }
+
+ public String getYearCode() {
+ return YearCode;
+ }
+
+ public void setYearCode(String yearCode) {
+ YearCode = yearCode;
+ }
+
+ public String getPayment_Type() {
+ return Payment_Type;
+ }
+
+ public void setPayment_Type(String payment_Type) {
+ Payment_Type = payment_Type;
+ }
+
+ public String getPayeer_Id() {
+ return Payeer_Id;
+ }
+
+ public void setPayeer_Id(String payeer_Id) {
+ Payeer_Id = payeer_Id;
+ }
+
+ public String getCreated_User_Type() {
+ return Created_User_Type;
+ }
+
+ public void setCreated_User_Type(String created_User_Type) {
+ Created_User_Type = created_User_Type;
+ }
+
+ public String getPayment_Mode() {
+ return Payment_Mode;
+ }
+
+ public void setPayment_Mode(String payment_Mode) {
+ Payment_Mode = payment_Mode;
+ }
+
+ public String getPayment_Remark() {
+ return Payment_Remark;
+ }
+
+ public void setPayment_Remark(String payment_Remark) {
+ Payment_Remark = payment_Remark;
+ }
+
+ public String getManager_Submission_Status() {
+ return Manager_Submission_Status;
+ }
+
+ public void setManager_Submission_Status(String manager_Submission_Status) {
+ Manager_Submission_Status = manager_Submission_Status;
+ }
+
+ public String getPayment_Receipt_Path() {
+ return Payment_Receipt_Path;
+ }
+
+ public void setPayment_Receipt_Path(String payment_Receipt_Path) {
+ Payment_Receipt_Path = payment_Receipt_Path;
+ }
+
+ public String getRec_Date() {
+ return Rec_Date;
+ }
+
+ public void setRec_Date(String rec_Date) {
+ Rec_Date = rec_Date;
+ }
+
+ public String getRec_Remark() {
+ return Rec_Remark;
+ }
+
+ public void setRec_Remark(String rec_Remark) {
+ Rec_Remark = rec_Remark;
+ }
+
+ public String getRec_By() {
+ return Rec_By;
+ }
+
+ public void setRec_By(String rec_By) {
+ Rec_By = rec_By;
+ }
+
+ public String getRec_Status() {
+ return Rec_Status;
+ }
+
+ public void setRec_Status(String rec_Status) {
+ Rec_Status = rec_Status;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_PastEvents.java b/app/src/main/java/com/leadcampusapp/Class_PastEvents.java
new file mode 100644
index 0000000..590c1ec
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_PastEvents.java
@@ -0,0 +1,78 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 24/7/18.
+ */
+
+public class Class_PastEvents
+{
+ int _id;
+
+ byte[] EventImage; //string
+ String PastorCurrent; //int
+ String Status; //string
+ String PastEventURL;
+
+
+
+ public Class_PastEvents() {
+ }
+
+
+ public Class_PastEvents(int id, byte[] eventimage, String pastorcurrent, String status,String pasteventurl) {
+ this._id = id;
+ this.EventImage = eventimage;
+ this.PastorCurrent=pastorcurrent;
+ this.Status=status;
+ this.PastEventURL = pasteventurl;
+ }
+
+
+
+ public Class_PastEvents(byte[] eventimage, String pastorcurrent, String status,String pasteventurl)
+ {
+ this.EventImage = eventimage;
+ this.PastorCurrent=pastorcurrent;
+ this.Status=status;
+ this.PastEventURL = pasteventurl;
+ }
+
+
+ public byte[] getEventImage(){
+ return this.EventImage;
+ }
+ public byte[] setEventImage(byte[] eventimage){
+ return this.EventImage=eventimage;
+ }
+
+
+ public String getPastorCurrent(){
+ return this.PastorCurrent;
+ }
+ // setting id
+ public void setPastorCurrent(String pastorcurrent){
+ this.PastorCurrent = pastorcurrent;
+ }
+
+
+ public String getStatus(){
+ return this.Status;
+ }
+ // setting id
+ public void setStatus(String status){
+ this.Status = status;
+ }
+
+
+
+ public String getPastEventURL(){
+ return this.PastEventURL;
+ }
+ public void setPastEventURL(String pastEventURL)
+ {
+ this.PastEventURL=pastEventURL;
+ }
+
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_PaymentMode.java b/app/src/main/java/com/leadcampusapp/Class_PaymentMode.java
new file mode 100644
index 0000000..b04618a
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_PaymentMode.java
@@ -0,0 +1,62 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/10/2017.
+ */
+
+public class Class_PaymentMode {
+
+
+ int id;
+
+ String payment_mode_slno;
+ String short_code;
+ String description;
+ String Status;
+
+
+ public Class_PaymentMode(){
+
+ }
+
+ public String getPayment_mode_slno() {
+ return payment_mode_slno;
+ }
+
+ public void setPayment_mode_slno(String payment_mode_slno) {
+ this.payment_mode_slno = payment_mode_slno;
+ }
+
+ public String getShort_code() {
+ return short_code;
+ }
+
+ public void setShort_code(String short_code) {
+ this.short_code = short_code;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ public String toString()
+ {
+ return( this.description );
+ }
+
+
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_Program.java b/app/src/main/java/com/leadcampusapp/Class_Program.java
new file mode 100644
index 0000000..f252161
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Program.java
@@ -0,0 +1,86 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 12/7/18.
+ */
+
+public class Class_Program
+{
+ int id;
+
+ String ProgramId;
+ String ProgramName;
+ String ProgramStatus;
+
+
+ /* long
+ string
+ string*/
+
+
+
+
+ public Class_Program(){
+
+ }
+
+
+
+
+ public Class_Program(int id, String programId, String programname, String programstatus){
+ this.id = id;
+ this.ProgramId = programId;
+ this.ProgramName = programname;
+ this.ProgramStatus=programstatus;
+
+
+ }
+
+ public Class_Program(String programId, String programname, String programstatus){
+
+ this.ProgramId = programId;
+ this.ProgramName = programname;
+ this.ProgramStatus=programstatus;
+ }
+
+
+ //get and set
+ public String getprogram_id(){
+ return this.ProgramId;
+ }
+ public void setprogram_id(String programId){
+ this.ProgramId = programId;
+ }
+
+
+
+ //get and set
+ public String getprog_name(){
+ return this.ProgramName;
+ }
+ public void setprog_name(String programname){
+ this.ProgramName = programname;
+ }
+
+
+
+
+ //get and set
+ public String getprog_status(){
+ return this.ProgramStatus;
+ }
+ public void setprog_status(String programstatus){
+ this.ProgramStatus = programstatus;
+ }
+
+
+
+ //set the string
+ public String toString()
+ {
+ return( this.ProgramName );
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_Project_FundMain.java b/app/src/main/java/com/leadcampusapp/Class_Project_FundMain.java
new file mode 100644
index 0000000..7ce8589
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Project_FundMain.java
@@ -0,0 +1,56 @@
+package com.leadcampusapp;
+
+public class Class_Project_FundMain {
+
+ String Slno;
+ String Ticket_Status;
+ String Manager_Alert_Days;
+ String Account_Alert_Days;
+ String Status;
+
+ public String getSlno() {
+ return Slno;
+ }
+
+ public void setSlno(String slno) {
+ Slno = slno;
+ }
+
+ public String getTicket_Status() {
+ return Ticket_Status;
+ }
+
+ public void setTicket_Status(String ticket_Status) {
+ Ticket_Status = ticket_Status;
+ }
+
+ public String getManager_Alert_Days() {
+ return Manager_Alert_Days;
+ }
+
+ public void setManager_Alert_Days(String manager_Alert_Days) {
+ Manager_Alert_Days = manager_Alert_Days;
+ }
+
+ public String getAccount_Alert_Days() {
+ return Account_Alert_Days;
+ }
+
+ public void setAccount_Alert_Days(String account_Alert_Days) {
+ Account_Alert_Days = account_Alert_Days;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ public String toString()
+ {
+ return( this.Ticket_Status );
+ }
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_Sem.java b/app/src/main/java/com/leadcampusapp/Class_Sem.java
new file mode 100644
index 0000000..7aa32f6
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Sem.java
@@ -0,0 +1,87 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 12/7/18.
+ */
+
+
+
+
+
+
+public class Class_Sem
+{
+
+ int id;
+
+ String SemId;
+ String SemName;
+ String SemStatus;
+
+
+ /*long
+string
+string*/
+
+
+
+ public Class_Sem(){
+
+ }
+
+
+ public Class_Sem(int id, String semId, String semname, String semstatus){
+ this.id = id;
+ this.SemId = semId;
+ this.SemName = semname;
+ this.SemStatus=semstatus;
+
+ }
+
+ public Class_Sem(String semId, String semname, String semstatus){
+
+ this.SemId = semId;
+ this.SemName = semname;
+ this.SemStatus=semstatus;
+ }
+
+
+
+ //get and set
+ public String getsem_id(){
+ return this.SemId;
+ }
+ public void setsem_id(String semId){
+ this.SemId = semId;
+ }
+
+
+
+
+ //get and set
+ public String getsem_name(){
+ return this.SemName;
+ }
+ public void setsem_name(String semname){
+ this.SemName = semname;
+ }
+
+
+ //get and set
+ public String getsem_status(){
+ return this.SemStatus;
+ }
+ public void setsem_status(String semstatus){
+ this.SemStatus = semstatus;
+ }
+
+
+ //set the string
+ public String toString()
+ {
+ return( this.SemName );
+ }
+
+
+
+}// end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_States.java b/app/src/main/java/com/leadcampusapp/Class_States.java
new file mode 100644
index 0000000..0aaaac4
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_States.java
@@ -0,0 +1,77 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/10/2017.
+ */
+
+public class Class_States {
+
+
+ int id;
+
+ String StateId;
+ String StateName;
+ String StateStatus;
+
+ /* 1
+ Andaman and Nicobar Islands
+ Success
+ */
+
+ public Class_States(){
+
+ }
+
+
+ public Class_States(int id, String stateid, String statename, String statestatus){
+ this.id = id;
+ this.StateId = stateid;
+ this.StateName = statename;
+ this.StateStatus=statestatus;
+
+ }
+
+
+ public Class_States(String stateid, String statename, String statestatus){
+
+ this.StateId = stateid;
+ this.StateName = statename;
+ this.StateStatus=statestatus;
+ }
+
+ //get and set
+ public String getstate_id(){
+ return this.StateId;
+ }
+ public void setstate_id(String stateid){
+ this.StateId = stateid;
+ }
+
+ //get and set
+ public String getstate_name(){
+ return this.StateName;
+ }
+ public void setstate_name(String statename){
+ this.StateName = statename;
+ }
+
+
+
+ //get and set
+ public String getstate_status(){
+ return this.StateStatus;
+ }
+ public void setstate_status(String statestatus){
+ this.StateStatus = statestatus;
+ }
+
+
+ public String toString()
+ {
+ return( this.StateName );
+ }
+
+
+
+
+}//end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_Taluk.java b/app/src/main/java/com/leadcampusapp/Class_Taluk.java
new file mode 100644
index 0000000..f08afb3
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_Taluk.java
@@ -0,0 +1,91 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 11/13/2017.
+ */
+
+public class Class_Taluk
+{
+
+ int id;
+
+ String TalukId;
+ String Taluk_DID;
+ String TalukName;
+ String TalukStatus;
+
+ /*
+ 70
+ 266
+ Hubli
+ Success
+
+ */
+
+ public Class_Taluk(){
+
+ }
+
+
+
+ public Class_Taluk(int id, String talukId, String taluk_did, String talukname, String talukstatus){
+ this.id = id;
+ this.TalukId = talukId;
+ this.Taluk_DID=taluk_did;
+ this.TalukName = talukname;
+ this.TalukStatus=talukstatus;
+ }
+
+ public Class_Taluk(String talukId, String taluk_did, String talukname, String talukstatus){
+
+ this.TalukId = talukId;
+ this.Taluk_DID=taluk_did;
+ this.TalukName = talukname;
+ this.TalukStatus=talukstatus;
+ }
+
+
+
+ //get and set
+ public String gettaluk_id(){
+ return this.TalukId;
+ }
+ public void settaluk_id(String talukId){
+ this.TalukId = talukId;
+ }
+
+ //get and set
+ public String gettaluk_did(){
+ return this.Taluk_DID;
+ }
+ public void settaluk_did(String taluk_did){
+ this.Taluk_DID = taluk_did;
+ }
+
+
+ //get and set
+ public String gettalukname(){
+ return this.TalukName;
+ }
+ public void settalukname(String talukname){
+ this.TalukName = talukname;
+ }
+
+
+ //get and set
+ public String gettalukstatus(){
+ return this.TalukStatus;
+ }
+ public void settalukstatus(String talukstatus){
+ this.TalukStatus = talukstatus;
+ }
+
+
+ //set the string
+ public String toString()
+ {
+ return( this.TalukName );
+ }
+
+
+}// end of class
diff --git a/app/src/main/java/com/leadcampusapp/Class_URL.java b/app/src/main/java/com/leadcampusapp/Class_URL.java
new file mode 100644
index 0000000..b507c69
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_URL.java
@@ -0,0 +1,68 @@
+package com.leadcampusapp;
+
+/**
+ * Created by User on 2/8/18.
+ */
+
+public class Class_URL
+{
+ public String packagename="com.leadcampusapp.";
+
+ /*public static String URL_Login ="http://mis.leadcampus.org/leadws/Login.asmx?WSDL";
+
+ public static String URL_Projects ="http://mis.leadcampus.org/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="http://mis.leadcampus.org/leadws/Managerws.asmx?WSDL";
+ public static String ServerPath ="http://mis.leadcampus.org/";*/
+
+
+
+
+ /* public static String URL_Login ="https://mis.leadcampus.org/leadws/Login.asmx?WSDL";
+
+ public static String URL_Projects ="https://mis.leadcampus.org/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="https://mis.leadcampus.org/leadws/Managerws.asmx?WSDL";
+ public static String ServerPath ="https://mis.leadcampus.org/";*/
+
+
+//Testbed
+
+ public static String URL_Login ="https://mis.leadcampus.org:8084/leadws/Login.asmx?WSDL";
+
+ public static String URL_Projects ="https://mis.leadcampus.org:8084/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="https://mis.leadcampus.org:8084/leadws/Managerws.asmx?WSDL";
+ public static String ServerPath ="https://mis.leadcampus.org:8084/";
+ //Testbed
+
+ /*public static String URL_Login ="http://mis.leadcampus.org:8000/leadws/Login.asmx?WSDL";
+
+ public static String URL_Projects ="http://mis.leadcampus.org:8000/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="http://mis.leadcampus.org:8000/leadws/Managerws.asmx?WSDL";
+ public static String ServerPath ="http://mis.leadcampus.org:8000/";*/
+
+
+
+
+ //http://testbed.dfindia.org/leadws/Login.asmx
+
+
+ /*public static String URL_Login ="http://testbed.dfindia.org/leadws/Login.asmx?WSDL";
+ public static String URL_Projects ="http://testbed.dfindia.org/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="http://testbed.dfindia.org/leadws/Managerws.asmx?WSDL";
+
+ public static String ServerPath ="http://testbed.dfindia.org/";*/
+
+
+
+
+
+ // public static String URL_Login ="http://testbed.dfindia.org/leadws/Login.asmx?WSDL";
+ /* public static String URL_Login ="http://testbed.dfindia.org/leadws/Login.asmx?WSDL";
+ public static String URL_Projects ="http://testbed.dfindia.org/leadws/Projectsws.asmx?WSDL";
+ public static String URL_Manager ="http://testbed.dfindia.org/leadws/Managerws.asmx?WSDL";
+ // public static String ServerPath ="http://mis.leadcampus.org/";
+ public static String ServerPath ="http://testbed.dfindia.org/";*/
+
+
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_UnpaidStudList.java b/app/src/main/java/com/leadcampusapp/Class_UnpaidStudList.java
new file mode 100644
index 0000000..8ec5d9b
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_UnpaidStudList.java
@@ -0,0 +1,184 @@
+package com.leadcampusapp;
+
+public class Class_UnpaidStudList {
+ /* 51311
+ Ashwini Nalawade
+ 9019319197
+ ashwininalawade872@gmail.com
+ MJ00924
+ 17
+ 256
+ 15
+ 110
+ DMS Mandal`s BCA College of computer application
+ 17
+ 1/18/2021 8:40:16 PM
+ 1
+ 0
+ Success
+ 0
+ 0 */
+ String Registration_Id;
+ String StudentName;
+ String MobileNo;
+ String MaidId;
+ String Lead_id;
+ String StateCode;
+ String DistrictCode;
+ String TalukaCode;
+ String CollegeCode;
+ String CollegeName;
+ String StreamId;
+ String RegistrationDate;
+ String Fees;
+ String isFeePaid;
+ String Status;
+ String projectcount;
+ String RequestedId;
+ String Payment_Mode;
+
+
+ public String getRegistration_Id() {
+ return Registration_Id;
+ }
+
+ public void setRegistration_Id(String registration_Id) {
+ Registration_Id = registration_Id;
+ }
+
+ public String getStudentName() {
+ return StudentName;
+ }
+
+ public void setStudentName(String studentName) {
+ StudentName = studentName;
+ }
+
+ public String getMobileNo() {
+ return MobileNo;
+ }
+
+ public void setMobileNo(String mobileNo) {
+ MobileNo = mobileNo;
+ }
+
+ public String getMaidId() {
+ return MaidId;
+ }
+
+ public void setMaidId(String maidId) {
+ MaidId = maidId;
+ }
+
+ public String getLead_id() {
+ return Lead_id;
+ }
+
+ public void setLead_id(String lead_id) {
+ Lead_id = lead_id;
+ }
+
+ public String getStateCode() {
+ return StateCode;
+ }
+
+ public void setStateCode(String stateCode) {
+ StateCode = stateCode;
+ }
+
+ public String getDistrictCode() {
+ return DistrictCode;
+ }
+
+ public void setDistrictCode(String districtCode) {
+ DistrictCode = districtCode;
+ }
+
+ public String getTalukaCode() {
+ return TalukaCode;
+ }
+
+ public void setTalukaCode(String talukaCode) {
+ TalukaCode = talukaCode;
+ }
+
+ public String getCollegeCode() {
+ return CollegeCode;
+ }
+
+ public void setCollegeCode(String collegeCode) {
+ CollegeCode = collegeCode;
+ }
+
+ public String getCollegeName() {
+ return CollegeName;
+ }
+
+ public void setCollegeName(String collegeName) {
+ CollegeName = collegeName;
+ }
+
+ public String getStreamId() {
+ return StreamId;
+ }
+
+ public void setStreamId(String streamId) {
+ StreamId = streamId;
+ }
+
+ public String getRegistrationDate() {
+ return RegistrationDate;
+ }
+
+ public void setRegistrationDate(String registrationDate) {
+ RegistrationDate = registrationDate;
+ }
+
+ public String getFees() {
+ return Fees;
+ }
+
+ public void setFees(String fees) {
+ Fees = fees;
+ }
+
+ public String getIsFeePaid() {
+ return isFeePaid;
+ }
+
+ public void setIsFeePaid(String isFeePaid) {
+ this.isFeePaid = isFeePaid;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+
+ public String getProjectcount() {
+ return projectcount;
+ }
+
+ public void setProjectcount(String projectcount) {
+ this.projectcount = projectcount;
+ }
+
+ public String getRequestedId() {
+ return RequestedId;
+ }
+
+ public void setRequestedId(String requestedId) {
+ RequestedId = requestedId;
+ }
+
+ public String getPayment_Mode() {
+ return Payment_Mode;
+ }
+
+ public void setPayment_Mode(String payment_Mode) {
+ Payment_Mode = payment_Mode;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_YearList.java b/app/src/main/java/com/leadcampusapp/Class_YearList.java
new file mode 100644
index 0000000..92e2cba
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_YearList.java
@@ -0,0 +1,37 @@
+package com.leadcampusapp;
+
+public class Class_YearList {
+
+ String slno;
+ String AcademicCode;
+ String Status;
+
+ public String getSlno() {
+ return slno;
+ }
+
+ public void setSlno(String slno) {
+ this.slno = slno;
+ }
+
+ public String getAcademicCode() {
+ return AcademicCode;
+ }
+
+ public void setAcademicCode(String academicCode) {
+ AcademicCode = academicCode;
+ }
+
+ public String getStatus() {
+ return Status;
+ }
+
+ public void setStatus(String status) {
+ Status = status;
+ }
+ public String toString()
+ {
+ return( this.AcademicCode );
+ }
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_alert_msg.java b/app/src/main/java/com/leadcampusapp/Class_alert_msg.java
new file mode 100644
index 0000000..1f5762e
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_alert_msg.java
@@ -0,0 +1,134 @@
+package com.leadcampusapp;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.FragmentManager;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+
+public class Class_alert_msg
+{
+ private final Context mContext;
+
+ private FragmentManager fragmentManager;
+
+ public Class_alert_msg(Context context) {
+ this.mContext = context;
+
+ }
+
+
+
+
+
+
+ public static void alerts_dialog(String str_error,String ws,Context context)
+ {
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(context);
+ dialog.setCancelable(false);
+ dialog.setTitle("LeadMIS");
+ dialog.setMessage("End Date should be after Start Date");
+
+ Activity activity = (Activity) context;
+ // fragmentManager = activity.getFragmentManager();
+
+
+ dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ /*FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+
+ fragmentTransaction.replace(R.id.frame_container, new Fragment_RHolidays());
+ fragmentTransaction.commit();*/
+
+ dialog.dismiss();
+
+ }
+ });
+
+
+
+
+ final AlertDialog alert = dialog.create();
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ }
+ });
+ alert.show();
+
+
+ }
+
+
+
+ public void alerts_dialog2(final Context context, final Class classname)
+ {
+
+ AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
+ dialog.setCancelable(false);
+ dialog.setTitle("LEADCampus");
+ dialog.setMessage("Are you sure you want to leave this page?");
+
+ final Activity activity = (Activity) context;
+ fragmentManager = activity.getFragmentManager();
+
+ dialog.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id)
+ {
+
+ /*FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+
+ fragmentTransaction.replace(R.id.frame_container, new Fragment_RHolidays());
+ fragmentTransaction.commit();*/
+
+
+
+ Intent lauchactivity = new Intent(context ,classname);
+ context.startActivity(lauchactivity);
+ ((Activity) context).finish();
+
+
+
+
+ }
+ });
+
+
+
+
+ dialog.setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int i)
+ {
+ dialog.dismiss();
+ }
+ });
+
+ final AlertDialog alert = dialog.create();
+
+ alert.setOnShowListener(new DialogInterface.OnShowListener() {
+ @Override
+ public void onShow(DialogInterface arg0) {
+ alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#004D40"));
+ alert.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(Color.parseColor("#ff0000"));
+ }
+ });
+ alert.show();
+
+
+ }
+
+
+
+
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_fundticket_resp.java b/app/src/main/java/com/leadcampusapp/Class_fundticket_resp.java
new file mode 100644
index 0000000..1ebc355
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_fundticket_resp.java
@@ -0,0 +1,142 @@
+package com.leadcampusapp;
+
+
+/*
+anyType{vmGet_Funding_Status=anyType{Ticket_Id=1; Requeted_By=Abhinandan;
+ Requested_Date=04-05-2021; Approved_By=Pending; Approved_Date= ;
+ Approved_Remark= ; Approval_Status=Pending; Requested_Project=2;
+ Manager_Approved_Project=0; Account_Approved_Project=0; Requested_Amount=200;
+ Manager_Approved_Amount=0; Account_Approved_Amount=0; status=success; };
+*/
+
+public class Class_fundticket_resp {
+
+
+ String str_ticketid;
+ String str_requestedby;
+ String str_requesteddate;
+ String str_approvedby;
+ String str_approveddate;
+ String str_approvedremarks;
+ String str_approvalstatus;
+ String str_requestedproject;
+ String str_managerapprovedproject;
+ String str_accountapprovedprojects;
+ String str_requestedamount;
+ String str_managerapprovedamount;
+ String str_accountapprovedamount;
+ String str_status;
+
+
+ public String getStr_ticketid() {
+ return str_ticketid;
+ }
+
+ public void setStr_ticketid(String str_ticketid) {
+ this.str_ticketid = str_ticketid;
+ }
+
+ public String getStr_requestedby() {
+ return str_requestedby;
+ }
+
+ public void setStr_requestedby(String str_requestedby) {
+ this.str_requestedby = str_requestedby;
+ }
+
+ public String getStr_requesteddate() {
+ return str_requesteddate;
+ }
+
+ public void setStr_requesteddate(String str_requesteddate) {
+ this.str_requesteddate = str_requesteddate;
+ }
+
+ public String getStr_approvedby() {
+ return str_approvedby;
+ }
+
+ public void setStr_approvedby(String str_approvedby) {
+ this.str_approvedby = str_approvedby;
+ }
+
+ public String getStr_approveddate() {
+ return str_approveddate;
+ }
+
+ public void setStr_approveddate(String str_approveddate) {
+ this.str_approveddate = str_approveddate;
+ }
+
+ public String getStr_approvedremarks() {
+ return str_approvedremarks;
+ }
+
+ public void setStr_approvedremarks(String str_approvedremarks) {
+ this.str_approvedremarks = str_approvedremarks;
+ }
+
+ public String getStr_approvalstatus() {
+ return str_approvalstatus;
+ }
+
+ public void setStr_approvalstatus(String str_approvalstatus) {
+ this.str_approvalstatus = str_approvalstatus;
+ }
+
+ public String getStr_requestedproject() {
+ return str_requestedproject;
+ }
+
+ public void setStr_requestedproject(String str_requestedproject) {
+ this.str_requestedproject = str_requestedproject;
+ }
+
+ public String getStr_managerapprovedproject() {
+ return str_managerapprovedproject;
+ }
+
+ public void setStr_managerapprovedproject(String str_managerapprovedproject) {
+ this.str_managerapprovedproject = str_managerapprovedproject;
+ }
+
+ public String getStr_accountapprovedprojects() {
+ return str_accountapprovedprojects;
+ }
+
+ public void setStr_accountapprovedprojects(String str_accountapprovedprojects) {
+ this.str_accountapprovedprojects = str_accountapprovedprojects;
+ }
+
+ public String getStr_requestedamount() {
+ return str_requestedamount;
+ }
+
+ public void setStr_requestedamount(String str_requestedamount) {
+ this.str_requestedamount = str_requestedamount;
+ }
+
+ public String getStr_managerapprovedamount() {
+ return str_managerapprovedamount;
+ }
+
+ public void setStr_managerapprovedamount(String str_managerapprovedamount) {
+ this.str_managerapprovedamount = str_managerapprovedamount;
+ }
+
+ public String getStr_accountapprovedamount() {
+ return str_accountapprovedamount;
+ }
+
+ public void setStr_accountapprovedamount(String str_accountapprovedamount) {
+ this.str_accountapprovedamount = str_accountapprovedamount;
+ }
+
+ public String getStr_status() {
+ return str_status;
+ }
+
+ public void setStr_status(String str_status) {
+ this.str_status = str_status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_imagedelete.java b/app/src/main/java/com/leadcampusapp/Class_imagedelete.java
new file mode 100644
index 0000000..0dafe92
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_imagedelete.java
@@ -0,0 +1,34 @@
+package com.leadcampusapp;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.FragmentManager;
+import android.app.FragmentTransaction;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.database.sqlite.SQLiteDatabase;
+import android.graphics.Color;
+
+public class Class_imagedelete
+{
+ private final Context mContext;
+
+
+ SharedPreferences prefs_book;
+
+ public Class_imagedelete(Context context)
+ {
+ this.mContext = context;
+
+ }
+
+
+ public void alerts_dialog_Error(int x)
+ {
+
+
+ }
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_studentpayment_summary.java b/app/src/main/java/com/leadcampusapp/Class_studentpayment_summary.java
new file mode 100644
index 0000000..3f195ea
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_studentpayment_summary.java
@@ -0,0 +1,159 @@
+package com.leadcampusapp;
+
+
+/*19
+MH08103
+Mallikarjun kumbar
+41275
+1
+10-February-21
+10-02-2021 06:02;30 06:11:30 PM
+19
+0
+1612960865
+Registration
+success
+2020-21
+UPI
+empty
+Success*/
+public class Class_studentpayment_summary
+{
+
+ String Str_paymentid;
+ String Str_Lead_Id;
+ String Str_StudentName;
+ String Str_Registration_Id;
+ String Str_Paid_Fees;
+ String Str_Created_Date;
+ String Str_Auto_Receipt_No;
+ String Str_transanction_Id;
+ String Str_reference_id;
+ String Str_Fees_Category_description;
+ String Str_transactionStatus;
+ String Str_YearCode;
+ String Str_Payment_Type;
+ String Str_Payeer_Id;
+ String Str_Status;
+
+
+ public String getStr_paymentid() {
+ return Str_paymentid;
+ }
+
+ public void setStr_paymentid(String str_paymentid) {
+ Str_paymentid = str_paymentid;
+ }
+
+ public String getStr_Lead_Id() {
+ return Str_Lead_Id;
+ }
+
+ public void setStr_Lead_Id(String str_Lead_Id) {
+ Str_Lead_Id = str_Lead_Id;
+ }
+
+ public String getStr_StudentName() {
+ return Str_StudentName;
+ }
+
+ public void setStr_StudentName(String str_StudentName) {
+ Str_StudentName = str_StudentName;
+ }
+
+ public String getStr_Registration_Id() {
+ return Str_Registration_Id;
+ }
+
+ public void setStr_Registration_Id(String str_Registration_Id) {
+ Str_Registration_Id = str_Registration_Id;
+ }
+
+ public String getStr_Paid_Fees() {
+ return Str_Paid_Fees;
+ }
+
+ public void setStr_Paid_Fees(String str_Paid_Fees) {
+ Str_Paid_Fees = str_Paid_Fees;
+ }
+
+ public String getStr_Created_Date() {
+ return Str_Created_Date;
+ }
+
+ public void setStr_Created_Date(String str_Created_Date) {
+ Str_Created_Date = str_Created_Date;
+ }
+
+ public String getStr_Auto_Receipt_No() {
+ return Str_Auto_Receipt_No;
+ }
+
+ public void setStr_Auto_Receipt_No(String str_Auto_Receipt_No) {
+ Str_Auto_Receipt_No = str_Auto_Receipt_No;
+ }
+
+ public String getStr_transanction_Id() {
+ return Str_transanction_Id;
+ }
+
+ public void setStr_transanction_Id(String str_transanction_Id) {
+ Str_transanction_Id = str_transanction_Id;
+ }
+
+ public String getStr_reference_id() {
+ return Str_reference_id;
+ }
+
+ public void setStr_reference_id(String str_reference_id) {
+ Str_reference_id = str_reference_id;
+ }
+
+ public String getStr_Fees_Category_description() {
+ return Str_Fees_Category_description;
+ }
+
+ public void setStr_Fees_Category_description(String str_Fees_Category_description) {
+ Str_Fees_Category_description = str_Fees_Category_description;
+ }
+
+ public String getStr_transactionStatus() {
+ return Str_transactionStatus;
+ }
+
+ public void setStr_transactionStatus(String str_transactionStatus) {
+ Str_transactionStatus = str_transactionStatus;
+ }
+
+ public String getStr_YearCode() {
+ return Str_YearCode;
+ }
+
+ public void setStr_YearCode(String str_YearCode) {
+ Str_YearCode = str_YearCode;
+ }
+
+ public String getStr_Payment_Type() {
+ return Str_Payment_Type;
+ }
+
+ public void setStr_Payment_Type(String str_Payment_Type) {
+ Str_Payment_Type = str_Payment_Type;
+ }
+
+ public String getStr_Payeer_Id() {
+ return Str_Payeer_Id;
+ }
+
+ public void setStr_Payeer_Id(String str_Payeer_Id) {
+ Str_Payeer_Id = str_Payeer_Id;
+ }
+
+ public String getStr_Status() {
+ return Str_Status;
+ }
+
+ public void setStr_Status(String str_Status) {
+ Str_Status = str_Status;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_token.java b/app/src/main/java/com/leadcampusapp/Class_token.java
new file mode 100644
index 0000000..25bb873
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_token.java
@@ -0,0 +1,60 @@
+package com.leadcampusapp;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+// "PaytmChecksum": "EkdqSgtcbVT5bw4dkPZtFnnvr/AHeaOiDgFG4DoFzBYz3UdiNs4NM9MBxbu65kCUEOnRXcvwRP9e0hNYtFJGpuvr1bOJlM4YTEQAhkaevHI=",
+// "VerifySignature": true,
+public class Class_token
+{
+
+ @SerializedName("PaytmChecksum")
+ @Expose
+ private String PaytmChecksum;
+
+ @SerializedName("VerifySignature")
+ @Expose
+ private String VerifySignature;
+
+
+ @SerializedName("PaytmChecksumNew")
+ @Expose
+ private String PaytmChecksumNew;
+
+ @SerializedName("VerifySignatureNew")
+ @Expose
+ private String VerifySignatureNew;
+
+
+ public String getPaytmChecksum() {
+ return PaytmChecksum;
+ }
+
+ public void setPaytmChecksum(String paytmChecksum) {
+ PaytmChecksum = paytmChecksum;
+ }
+
+ public String getVerifySignature() {
+ return VerifySignature;
+ }
+
+ public void setVerifySignature(String verifySignature) {
+ VerifySignature = verifySignature;
+ }
+
+ public String getPaytmChecksumNew() {
+ return PaytmChecksumNew;
+ }
+
+ public void setPaytmChecksumNew(String paytmChecksumNew) {
+ PaytmChecksumNew = paytmChecksumNew;
+ }
+
+ public String getVerifySignatureNew() {
+ return VerifySignatureNew;
+ }
+
+ public void setVerifySignatureNew(String verifySignatureNew) {
+ VerifySignatureNew = verifySignatureNew;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/Class_token_response.java b/app/src/main/java/com/leadcampusapp/Class_token_response.java
new file mode 100644
index 0000000..6337096
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/Class_token_response.java
@@ -0,0 +1,47 @@
+package com.leadcampusapp;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+
+public class Class_token_response
+{
+
+ @SerializedName("Status")
+ @Expose
+ private Boolean status;
+
+ @SerializedName("Message")
+ @Expose
+ private String message;
+
+
+ @SerializedName("obj")
+ @Expose
+ private Class_token tokenresp = null;
+
+
+ public Boolean getStatus() {
+ return status;
+ }
+
+ public void setStatus(Boolean status) {
+ this.status = status;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public Class_token getTokenresp() {
+ return tokenresp;
+ }
+
+ public void setTokenresp(Class_token tokenresp) {
+ this.tokenresp = tokenresp;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/CommonUtils.java b/app/src/main/java/com/leadcampusapp/CommonUtils.java
new file mode 100644
index 0000000..68538a2
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CommonUtils.java
@@ -0,0 +1,177 @@
+package com.leadcampusapp;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.media.ExifInterface;
+import android.os.Environment;
+import android.view.inputmethod.InputMethodManager;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Created by Grishma on 14/3/16.
+ */
+public class CommonUtils {
+ private static final float maxHeight = 1280.0f;
+ private static final float maxWidth = 1280.0f;
+
+ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
+ final int height = options.outHeight;
+ final int width = options.outWidth;
+ int inSampleSize = 1;
+
+ if (height > reqHeight || width > reqWidth) {
+ final int heightRatio = Math.round((float) height / (float) reqHeight);
+ final int widthRatio = Math.round((float) width / (float) reqWidth);
+ inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;
+ }
+ final float totalPixels = width * height;
+ final float totalReqPixelsCap = reqWidth * reqHeight * 2;
+ while (totalPixels / (inSampleSize * inSampleSize) > totalReqPixelsCap) {
+ inSampleSize++;
+ }
+ return inSampleSize;
+ }
+
+
+ /**
+ * Reduces the size of an image without affecting its quality.
+ *
+ * @param imagePath -Path of an image
+ * @return
+ */
+ public static String compressImage(String imagePath) {
+ Bitmap scaledBitmap = null;
+ BitmapFactory.Options options = new BitmapFactory.Options();
+ options.inJustDecodeBounds = true;
+ Bitmap bmp = BitmapFactory.decodeFile(imagePath, options);
+
+ int actualHeight = options.outHeight;
+ int actualWidth = options.outWidth;
+
+ float imgRatio = (float) actualWidth / (float) actualHeight;
+ float maxRatio = maxWidth / maxHeight;
+
+ if (actualHeight > maxHeight || actualWidth > maxWidth) {
+ if (imgRatio < maxRatio) {
+ imgRatio = maxHeight / actualHeight;
+ actualWidth = (int) (imgRatio * actualWidth);
+ actualHeight = (int) maxHeight;
+ } else if (imgRatio > maxRatio) {
+ imgRatio = maxWidth / actualWidth;
+ actualHeight = (int) (imgRatio * actualHeight);
+ actualWidth = (int) maxWidth;
+ } else {
+ actualHeight = (int) maxHeight;
+ actualWidth = (int) maxWidth;
+ }
+ }
+ options.inSampleSize = calculateInSampleSize(options, actualWidth, actualHeight);
+ options.inJustDecodeBounds = false;
+ options.inDither = false;
+ options.inPurgeable = true;
+ options.inInputShareable = true;
+ options.inTempStorage = new byte[16 * 1024];
+ try {
+ bmp = BitmapFactory.decodeFile(imagePath, options);
+ } catch (OutOfMemoryError exception) {
+ exception.printStackTrace();
+ }
+ try {
+ scaledBitmap = Bitmap.createBitmap(actualWidth, actualHeight, Bitmap.Config.RGB_565);
+ } catch (OutOfMemoryError exception) {
+ exception.printStackTrace();
+ }
+
+ float ratioX = actualWidth / (float) options.outWidth;
+ float ratioY = actualHeight / (float) options.outHeight;
+ float middleX = actualWidth / 2.0f;
+ float middleY = actualHeight / 2.0f;
+ Matrix scaleMatrix = new Matrix();
+ scaleMatrix.setScale(ratioX, ratioY, middleX, middleY);
+ Canvas canvas = new Canvas(scaledBitmap);
+ canvas.setMatrix(scaleMatrix);
+ canvas.drawBitmap(bmp, middleX - bmp.getWidth() / 2, middleY - bmp.getHeight() / 2, new Paint(Paint.FILTER_BITMAP_FLAG));
+ if (bmp != null) {
+ bmp.recycle();
+ }
+ ExifInterface exif;
+ try {
+ exif = new ExifInterface(imagePath);
+ int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0);
+ Matrix matrix = new Matrix();
+ if (orientation == 6) {
+ matrix.postRotate(90);
+ } else if (orientation == 3) {
+ matrix.postRotate(180);
+ } else if (orientation == 8) {
+ matrix.postRotate(270);
+ }
+ scaledBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0, scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix, true);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ FileOutputStream out = null;
+ String filepath = CompletionGalleryFolderSelectActivity.imageFilePath;//getFilename();
+ try {
+ //new File(imageFilePath).delete();
+ out = new FileOutputStream(filepath);
+
+ //write the compressed bitmap at the destination specified by filename.
+ scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
+
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ return filepath;
+ }
+
+ public static String getFilename() {
+ File mediaStorageDir = new File(Environment.getExternalStorageDirectory()
+ + "/ImageCompApp/Images");
+
+ // Create the storage directory if it does not exist
+ if (!mediaStorageDir.exists()) {
+ mediaStorageDir.mkdirs();
+ }
+
+ String mImageName = "IMG_" + String.valueOf(System.currentTimeMillis()) + ".jpg";
+ String uriString = (mediaStorageDir.getAbsolutePath() + "/" + mImageName);
+ return uriString;
+ }
+
+ public static void hideKeyboard(Activity context) {
+ try {
+ if (context == null) return;
+ InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(context.getWindow().getCurrentFocus().getWindowToken(), 0);
+ } catch (Exception e) {
+ }
+ }
+
+ public static void copyFile(String selectedImagePath, String mdestinationPath) throws IOException {
+ InputStream in = new FileInputStream(selectedImagePath);
+ OutputStream out = new FileOutputStream(mdestinationPath);
+
+ // Transfer bytes from in to out
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionAdapter_PhotosFolder.java b/app/src/main/java/com/leadcampusapp/CompletionAdapter_PhotosFolder.java
new file mode 100644
index 0000000..7fa4c73
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionAdapter_PhotosFolder.java
@@ -0,0 +1,131 @@
+package com.leadcampusapp;
+
+/**
+ * Created by deepshikha on 3/3/17.
+ */
+
+import android.content.Context;
+import android.util.Log;
+import android.util.SparseBooleanArray;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+
+import java.util.ArrayList;
+
+
+public class CompletionAdapter_PhotosFolder extends ArrayAdapter {
+
+ Context context;
+ ViewHolder viewHolder;
+ ArrayList al_menu = new ArrayList<>();
+ private SparseBooleanArray mSparseBooleanArray;
+
+
+ public CompletionAdapter_PhotosFolder(Context context, ArrayList al_menu) {
+ super(context, R.layout.activity_completion_adapter_photosfolder, al_menu);
+ this.al_menu = al_menu;
+ this.context = context;
+ mSparseBooleanArray = new SparseBooleanArray();
+ }
+
+ /* CompoundButton.OnCheckedChangeListener mCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mSparseBooleanArray.put((Integer) buttonView.getTag(), isChecked);
+ }
+ };*/
+
+
+/* public ArrayList getCheckedItems() {
+ ArrayList mTempArry = new ArrayList();
+
+ for(int i=0;i 0) {
+ return al_menu.size();
+ } else {
+ return 1;
+ }
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ if (convertView == null) {
+
+ viewHolder = new ViewHolder();
+ convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_completion_adapter_photosfolder, parent, false);
+ viewHolder.tv_foldern = (TextView) convertView.findViewById(R.id.tv_folder);
+ viewHolder.tv_foldersize = (TextView) convertView.findViewById(R.id.tv_folder2);
+ viewHolder.iv_image = (ImageView) convertView.findViewById(R.id.iv_image);
+
+ //viewHolder.check_1 = (CheckBox) convertView.findViewById(R.id.checkBox1);
+
+
+
+ convertView.setTag(viewHolder);
+ } else {
+ viewHolder = (ViewHolder) convertView.getTag();
+ }
+
+ viewHolder.tv_foldern.setText(al_menu.get(position).getStr_folder());
+ viewHolder.tv_foldersize.setText(al_menu.get(position).getAl_imagepath().size()+"");
+
+ //viewHolder.checkBox.setOnCheckedChangeListener(mCheckedChangeListener);
+
+
+
+ Glide.with(context).load("file://" + al_menu.get(position).getAl_imagepath().get(0))
+ .diskCacheStrategy(DiskCacheStrategy.NONE)
+ .skipMemoryCache(true)
+ .into(viewHolder.iv_image);
+
+
+ return convertView;
+
+ }
+
+
+ private static class ViewHolder {
+ TextView tv_foldern, tv_foldersize;
+ ImageView iv_image;
+ //CheckBox check_1;
+ }
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionDocumentFolderSelectActivity.java b/app/src/main/java/com/leadcampusapp/CompletionDocumentFolderSelectActivity.java
new file mode 100644
index 0000000..3e7eeb1
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionDocumentFolderSelectActivity.java
@@ -0,0 +1,204 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Environment;
+import androidx.appcompat.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.Toast;
+
+import java.io.File;
+import java.util.ArrayList;
+
+/**
+ * Created by deepshikha on 20/3/17.
+ */
+
+public class CompletionDocumentFolderSelectActivity extends AppCompatActivity implements ConnectivityReceiver.ConnectivityReceiverListener{
+ int int_position;
+ private GridView gridView;
+ private CompletionDocumentGridViewAdapter adapter;
+ private ArrayList mTempArry;
+ private String path;
+ private ArrayList completionDocumentModelArrLst;
+ private ArrayList filePaths,filenames;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_completion_document_photo_select);
+
+ Log.d("Insidexxx","photosActivitysss");
+
+ //Toast.makeText(getApplicationContext(),"Inside CompletionGalleryFolderSelectActivity",Toast.LENGTH_LONG).show();
+
+ completionDocumentModelArrLst = new ArrayList();
+ filePaths = new ArrayList();
+ filenames = new ArrayList();
+
+
+ //ArrayList filenames = new ArrayList();
+ path = Environment.getExternalStorageDirectory() + File.separator;
+
+ File directory = new File(path);
+ File[] files = directory.listFiles();
+
+
+
+ if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
+ {
+ ///mounted
+ File dir= android.os.Environment.getExternalStorageDirectory();
+ walkdir(dir);
+ }
+
+
+
+/* for (int i = 0; i < files.length; i++) {
+ String file_name = files[i].getName();
+
+ if(file_name.endsWith(".pdf") || file_name.endsWith(".doc")) {
+ Log.d("file_nameissss", files[i].getAbsolutePath());
+ filePaths.add(files[i].getAbsolutePath());
+ filenames.add(file_name);
+ }
+ // you can store name to arraylist and use it later
+
+ }*/
+
+ CompletionDocumentModel completionDocumentModel = new CompletionDocumentModel();
+ completionDocumentModel.setAl_documentpath(filePaths);
+ completionDocumentModel.setAl_documentName(filenames);
+
+ completionDocumentModelArrLst.add(completionDocumentModel);
+
+
+
+ gridView = (GridView)findViewById(R.id.gv_folder);
+ int_position = getIntent().getIntExtra("value", 0);
+ adapter = new CompletionDocumentGridViewAdapter(this, completionDocumentModelArrLst,0);
+
+
+
+ //adapter.getCheckedItems();
+
+ getSupportActionBar().setDisplayShowCustomEnabled(true);
+ getSupportActionBar().setCustomView(R.layout.activity_completion_document_actionbar_layouts);
+
+ View custView = getSupportActionBar().getCustomView();
+ Button btn_selectAll = (Button) custView.findViewById(R.id.btn_selectAll);
+ btn_selectAll.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mTempArry = adapter.getCheckedItems();
+ Toast.makeText(getApplicationContext(),"Selected Items: "+mTempArry.size(),Toast.LENGTH_SHORT).show();
+
+ if(mTempArry.size()==1) {
+
+ for (int i = 0; i < mTempArry.size(); i++) {
+ Log.d("FileNameisss:", mTempArry.get(i));
+ }
+
+ CompletionProjectStaticClass.setFileDocString(mTempArry);
+
+ // Intent documentToCompletion = new Intent(getApplicationContext(), ProjectDetails.class);// for fragment
+
+ Intent documentToCompletion = new Intent(getApplicationContext(), FinalProjectCompletion_Activity.class);// for Activity
+ //photosToCompletion.putExtra("fromTeam","CompletionGalleryFolderSelectActivity");
+ documentToCompletion.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+ //photosToCompletion.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ CompletionProjectStaticClass.setCountDocumentCompletion(1);// for fragment
+ startActivity(documentToCompletion);
+ }else{
+ Toast.makeText(getApplicationContext(),"You can upload only one document",Toast.LENGTH_SHORT).show();
+ }
+
+ //finish();
+ }
+ });
+
+ gridView.setAdapter(adapter);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ // register connection status listener
+ MyApplication.getInstance().setConnectivityListener(this);
+ }
+
+ @Override
+ public void onNetworkConnectionChanged(boolean isConnected) {
+ showSnack(isConnected);
+ }
+
+ private void showSnack(boolean isConnected) {
+
+ if (!isConnected) {
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(CompletionDocumentFolderSelectActivity.this);
+ //adb.setView(alertDialogView);
+
+ adb.setTitle("Sorry! Not connected to the internet");
+
+ adb.setIcon(android.R.drawable.ic_dialog_alert);
+
+ adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+
+ adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+ adb.setCancelable(true);
+ adb.show();
+ }
+ }
+
+
+
+
+
+ private void walkdir(File dir) {
+ File listFile[] = dir.listFiles();
+
+ if (listFile != null) {
+ for (int i = 0; i < listFile.length; i++) {
+
+ if (listFile[i].isDirectory()) {// if its a directory need to get the files under that directory
+ walkdir(listFile[i]);
+ } else {// add path of files to your arraylist for later use
+
+ //Do what ever u want
+ //filepath.add(listFile[i].getAbsolutePath());
+ String file_name = listFile[i].getName();
+
+ if(file_name.endsWith(".pdf") || file_name.endsWith(".doc") || file_name.endsWith(".docx") || file_name.endsWith(".xls") || file_name.endsWith(".xlsx")) {
+ Log.d("file_nameissss", listFile[i].getAbsolutePath());
+ filePaths.add(listFile[i].getAbsolutePath());
+ filenames.add(file_name);
+ }
+
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ }
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionDocumentGridViewAdapter.java b/app/src/main/java/com/leadcampusapp/CompletionDocumentGridViewAdapter.java
new file mode 100644
index 0000000..9094b24
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionDocumentGridViewAdapter.java
@@ -0,0 +1,152 @@
+package com.leadcampusapp;
+
+/**
+ * Created by deepshikha on 3/3/17.
+ */
+
+import android.content.Context;
+import android.util.Log;
+import android.util.SparseBooleanArray;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+
+public class CompletionDocumentGridViewAdapter extends ArrayAdapter {
+
+ Context context;
+ ViewHolder viewHolder;
+ ArrayList al_menu = new ArrayList<>();
+ private int int_position;
+ private SparseBooleanArray mSparseBooleanArray;
+ private boolean barray[];
+
+
+ public CompletionDocumentGridViewAdapter(Context context, ArrayList al_menu,int int_position) {
+ super(context, R.layout.activity_completion_document_adapter_photosfolder, al_menu);
+ this.al_menu = al_menu;
+ this.context = context;
+ this.int_position = int_position;
+ mSparseBooleanArray = new SparseBooleanArray();
+ }
+
+ /* CompoundButton.OnCheckedChangeListener mCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mSparseBooleanArray.put((Integer) buttonView.getTag(), isChecked);
+ }
+ };*/
+
+ public ArrayList getCheckedItems() {
+ ArrayList mTempArry = new ArrayList();
+
+ for(int i=0;i 0) {
+ return al_menu.get(int_position).getAl_documentpath().size();
+ } else {
+ return 1;
+ }
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ if (convertView == null) {
+
+ viewHolder = new ViewHolder();
+
+ convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_completion_document_adapter_photosfolders, parent, false);
+
+ viewHolder.iv_image = (ImageView) convertView.findViewById(R.id.iv_image);
+
+ viewHolder.checkBox = (CheckBox) convertView.findViewById(R.id.checkBox1);
+
+ viewHolder.tv_fileName = (TextView) convertView.findViewById(R.id.tv_fileName);
+
+
+ viewHolder.tv_fileName.setText(al_menu.get(int_position).getAl_documentName().get(position));
+
+ //viewHolder.checkBox = (CheckBox) convertView.findViewById(R.id.checkBox1);
+ viewHolder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ Log.d("IsCheckedssskddf", String.valueOf(isChecked));
+ //mSparseBooleanArray.put(buttonView.getId(), isChecked);
+ mSparseBooleanArray.put(position, isChecked);
+ }
+ });
+
+ convertView.setTag(viewHolder);
+ } else {
+ viewHolder = (ViewHolder) convertView.getTag();
+ }
+
+
+ if(al_menu.get(int_position).getAl_documentpath().get(position).endsWith(".doc") || al_menu.get(int_position).getAl_documentpath().get(position).endsWith(".docx")){
+ viewHolder.iv_image.setImageResource(R.drawable.microsoft_office_word);
+ }
+
+ if(al_menu.get(int_position).getAl_documentpath().get(position).endsWith(".xls") || al_menu.get(int_position).getAl_documentpath().get(position).endsWith(".xlsx")){
+ viewHolder.iv_image.setImageResource(R.drawable.microsoft_office_excel);
+ }
+
+
+/* viewHolder.tv_foldern.setVisibility(View.GONE);
+ viewHolder.tv_foldersize.setVisibility(View.GONE);*/
+
+
+
+ /* Glide.with(context).load("file://" + al_menu.get(int_position).getAl_documentpath().get(position))
+ .diskCacheStrategy(DiskCacheStrategy.NONE)
+ .skipMemoryCache(true)
+ .into(viewHolder.iv_image);*/
+
+
+ return convertView;
+
+ }
+
+ private static class ViewHolder {
+ ImageView iv_image;
+ CheckBox checkBox;
+ TextView tv_fileName;
+ }
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionDocumentModel.java b/app/src/main/java/com/leadcampusapp/CompletionDocumentModel.java
new file mode 100644
index 0000000..5c23dbd
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionDocumentModel.java
@@ -0,0 +1,37 @@
+package com.leadcampusapp;
+
+import java.util.ArrayList;
+
+/**
+ * Created by deepshikha on 3/3/17.
+ */
+
+public class CompletionDocumentModel {
+ ArrayList al_documentpath;
+ String str_folder;
+ ArrayList al_documentName;
+
+ public String getStr_folder() {
+ return str_folder;
+ }
+
+ public void setStr_folder(String str_folder) {
+ this.str_folder = str_folder;
+ }
+
+ public ArrayList getAl_documentpath() {
+ return al_documentpath;
+ }
+
+ public void setAl_documentpath(ArrayList al_documentpath) {
+ this.al_documentpath = al_documentpath;
+ }
+
+ public ArrayList getAl_documentName() {
+ return al_documentName;
+ }
+
+ public void setAl_documentName(ArrayList al_documentName) {
+ this.al_documentName = al_documentName;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionGalleryFolderSelectActivity.java b/app/src/main/java/com/leadcampusapp/CompletionGalleryFolderSelectActivity.java
new file mode 100644
index 0000000..3474206
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionGalleryFolderSelectActivity.java
@@ -0,0 +1,214 @@
+package com.leadcampusapp;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+
+/**
+ * Created by deepshikha on 20/3/17.
+ */
+
+public class CompletionGalleryFolderSelectActivity extends AppCompatActivity{ //implements ConnectivityReceiver.ConnectivityReceiverListener{
+ int int_position;
+ private GridView gridView;
+ CompletionGalleryGridViewAdapter adapter;
+ ArrayList mTempArry;
+ ArrayList mCompressArry;
+ byte[] imageInByte;
+ ArrayList mImageInByte;
+ ArrayList mImageInByteAll;
+ public static String imageFilePath;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_completion_photo_select);
+
+ Log.d("Insidexxx","photosActivitysss");
+
+ //Toast.makeText(getApplicationContext(),"Inside CompletionGalleryFolderSelectActivity",Toast.LENGTH_LONG).show();
+
+
+ gridView = (GridView)findViewById(R.id.gv_folder);
+ int_position = getIntent().getIntExtra("value", 0);
+ adapter = new CompletionGalleryGridViewAdapter(this, CompletionGallerySelectActivity.al_images,int_position);
+
+
+
+ //adapter.getCheckedItems();
+
+ getSupportActionBar().setDisplayShowCustomEnabled(true);
+ getSupportActionBar().setCustomView(R.layout.activity_completion_actionbar_layouts);
+
+ View custView = getSupportActionBar().getCustomView();
+ Button btn_selectAll = (Button) custView.findViewById(R.id.btn_selectAll);
+ btn_selectAll.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mTempArry = adapter.getCheckedItems();
+ Toast.makeText(getApplicationContext(),"Selected Items: "+mTempArry.size(),Toast.LENGTH_SHORT).show();
+
+ Log.d("ImageUrl gallery", String.valueOf(mTempArry.size()));
+ //
+ // Log.d("tag","ImageUrl name ="+ String.valueOf(mTempArry.toString()));
+
+
+ mCompressArry=new ArrayList();
+ mImageInByte=new ArrayList<>();
+ mImageInByteAll=new ArrayList<>();
+
+ for(int i=0;i {
+ Context context;
+ ViewHolder viewHolder;
+ ArrayList al_menu = new ArrayList<>();
+ int int_position;
+ private SparseBooleanArray mSparseBooleanArray;
+ private boolean barray[];
+
+
+ public CompletionGalleryGridViewAdapter(Context context, ArrayList al_menu, int int_position) {
+ super(context, R.layout.activity_completion_adapter_photosfolder, al_menu);
+ this.al_menu = al_menu;
+ this.context = context;
+ this.int_position = int_position;
+ mSparseBooleanArray = new SparseBooleanArray();
+ barray = new boolean[al_menu.get(int_position).getAl_imagepath().size()];
+ }
+
+ /* CompoundButton.OnCheckedChangeListener mCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ mSparseBooleanArray.put((Integer) buttonView.getTag(), isChecked);
+ }
+ };*/
+
+ public ArrayList getCheckedItems() {
+ ArrayList mTempArry = new ArrayList();
+
+ for(int i=0;i 0) {
+ return al_menu.get(int_position).getAl_imagepath().size();
+ } else {
+ return 1;
+ }
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ if (convertView == null) {
+
+ viewHolder = new ViewHolder();
+ convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_completion_adapter_photosfolders, parent, false);
+ viewHolder.tv_foldern = (TextView) convertView.findViewById(R.id.tv_folder);
+ viewHolder.tv_foldersize = (TextView) convertView.findViewById(R.id.tv_folder2);
+ viewHolder.iv_image = (ImageView) convertView.findViewById(R.id.iv_image);
+
+ viewHolder.checkBox = (CheckBox) convertView.findViewById(R.id.checkBox1);
+ viewHolder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ Log.d("IsCheckedssskddf", String.valueOf(isChecked));
+ //mSparseBooleanArray.put(buttonView.getId(), isChecked);
+ mSparseBooleanArray.put(position, isChecked);
+ }
+ });
+
+ convertView.setTag(viewHolder);
+ } else {
+ viewHolder = (ViewHolder) convertView.getTag();
+ }
+
+ viewHolder.tv_foldern.setVisibility(View.GONE);
+ viewHolder.tv_foldersize.setVisibility(View.GONE);
+
+
+
+ Glide.with(context).load("file://" + al_menu.get(int_position).getAl_imagepath().get(position))
+ .diskCacheStrategy(DiskCacheStrategy.NONE)
+ .skipMemoryCache(true)
+ .into(viewHolder.iv_image);
+
+
+ return convertView;
+
+ }
+
+ private static class ViewHolder {
+ TextView tv_foldern, tv_foldersize;
+ ImageView iv_image;
+ CheckBox checkBox;
+ }
+
+
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionGallerySelectActivity.java b/app/src/main/java/com/leadcampusapp/CompletionGallerySelectActivity.java
new file mode 100644
index 0000000..31f2e5b
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionGallerySelectActivity.java
@@ -0,0 +1,310 @@
+package com.leadcampusapp;
+
+import android.Manifest;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.MediaStore;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+
+public class CompletionGallerySelectActivity extends AppCompatActivity implements ConnectivityReceiver.ConnectivityReceiverListener{
+ public static ArrayList al_images = new ArrayList<>();
+ boolean boolean_folder;
+ CompletionAdapter_PhotosFolder obj_adapter;
+ GridView gv_folder;
+ private static final int REQUEST_PERMISSIONS = 100;
+ String path;
+ Context context;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_completion_photo_select);
+
+
+ context = CompletionGallerySelectActivity.this;
+
+
+
+
+ gv_folder = (GridView)findViewById(R.id.gv_folder);
+
+ gv_folder.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
+ Log.d("Insidexxx","gv_folderssss");
+ Intent intent = new Intent(getApplicationContext(), CompletionGalleryFolderSelectActivity.class);
+ intent.putExtra("value",i);
+ //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivityForResult(intent,100);
+ //startActivity(intent);
+ }
+ });
+
+
+ if ((ContextCompat.checkSelfPermission(getApplicationContext(),
+ android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) && (ContextCompat.checkSelfPermission(getApplicationContext(),
+ android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)) {
+ if ((ActivityCompat.shouldShowRequestPermissionRationale(CompletionGallerySelectActivity.this,
+ android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) && (ActivityCompat.shouldShowRequestPermissionRationale(CompletionGallerySelectActivity.this,
+ android.Manifest.permission.READ_EXTERNAL_STORAGE))) {
+
+ } else {
+ ActivityCompat.requestPermissions(CompletionGallerySelectActivity.this,
+ new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE},
+ REQUEST_PERMISSIONS);
+ }
+ }else {
+ Log.e("Else","Else");
+ fn_imagespath();
+ }
+
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+ // register connection status listener
+ MyApplication.getInstance().setConnectivityListener(this);
+ }
+
+ @Override
+ public void onNetworkConnectionChanged(boolean isConnected) {
+ showSnack(isConnected);
+ }
+
+ private void showSnack(boolean isConnected) {
+
+ if (!isConnected) {
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(CompletionGallerySelectActivity.this);
+ //adb.setView(alertDialogView);
+
+ adb.setTitle("Sorry! Not connected to the internet");
+
+ adb.setIcon(android.R.drawable.ic_dialog_alert);
+
+ adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+
+ adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ //startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
+ }
+ });
+
+ adb.setCancelable(true);
+ adb.show();
+ }
+
+/* String message;
+ int color;
+ if (isConnected) {
+ message = "Good! Connected to Internet";
+ color = Color.WHITE;
+ } else {
+ message = "Sorry! Not connected to internet";
+ color = Color.RED;
+ }
+
+ Snackbar snackbar = Snackbar
+ .make(findViewById(R.id.coordinator_layout), message, Snackbar.LENGTH_LONG);
+
+ View sbView = snackbar.getView();
+ TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text);
+ textView.setTextColor(color);
+ snackbar.show();*/
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+
+ if (resultCode == RESULT_OK) {
+ if (requestCode == 100) {
+ Log.d("Inside","Resultreturned");
+ //finish();
+ }
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ public ArrayList fn_imagespath() {
+ al_images.clear();
+
+ int int_position = 0;
+ Uri uri;
+ Cursor cursor;
+ int column_index_data, column_index_folder_name,column_mime_type;
+
+
+ String absolutePathOfImage = null;
+ uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
+
+ String[] projection = {MediaStore.MediaColumns.DATA, MediaStore.Images.Media.BUCKET_DISPLAY_NAME};
+
+ final String orderBy = MediaStore.Images.Media.DATE_TAKEN;
+ cursor = getApplicationContext().getContentResolver().query(uri, projection, null, null, orderBy + " DESC");
+
+ column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
+ column_index_folder_name = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);
+
+ /*Log.e("cursor", String.valueOf(cursor));
+ Log.e("cursorindex", String.valueOf(column_index_data));
+ Log.e("cursorindexfoldername", String.valueOf(column_index_folder_name));*/
+
+
+
+ while (cursor.moveToNext())
+ {
+ absolutePathOfImage = cursor.getString(column_index_data);
+ // Log.e("Column", absolutePathOfImage);
+ // Log.e("Folder", cursor.getString(column_index_folder_name));
+
+ for (int i = 0; i < al_images.size(); i++) {
+ // Log.e("al_images", al_images.get(i).getStr_folder());
+ //Log.e("cursorname", cursor.getString(column_index_folder_name));
+ try{
+ if (al_images.get(i).getStr_folder().equals(cursor.getString(column_index_folder_name))) {
+ boolean_folder = true;
+ int_position = i;
+ break;
+ } else {
+ boolean_folder = false;
+ }
+
+ }catch(Exception ex)
+ {
+ String exp= String.valueOf(ex);
+
+ Log.e("exp",""+exp);
+ }
+ }
+
+
+ if (boolean_folder) {
+ ArrayList al_path = new ArrayList<>();
+ al_path.addAll(al_images.get(int_position).getAl_imagepath());
+ al_path.add(absolutePathOfImage);
+ al_images.get(int_position).setAl_imagepath(al_path);
+ } else {
+ ArrayList al_path = new ArrayList<>();
+ al_path.add(absolutePathOfImage);
+ CompletionModelImages obj_model = new CompletionModelImages();
+ obj_model.setStr_folder(cursor.getString(column_index_folder_name));
+ obj_model.setAl_imagepath(al_path);
+
+ al_images.add(obj_model);
+ }
+
+ }
+
+
+
+ /* ArrayList filenames = new ArrayList();
+ path = Environment.getExternalStorageDirectory()
+ + File.separator;
+
+ File directory = new File(path);
+ File[] files = directory.listFiles();
+
+ for (int i = 0; i < files.length; i++)
+ {
+ String file_name = files[i].getName();
+
+ if(file_name.endsWith(".pdf")) {
+ Log.d("file_nameissss", files[i].getAbsolutePath());
+ }
+ // you can store name to arraylist and use it later
+ filenames.add(file_name);
+ }*/
+
+
+
+ /*ContentResolver cr = context.getContentResolver();
+ Uri uriExternal = MediaStore.Files.getContentUri("internal");
+
+ String[] projections = null;
+ String sortOrder = null; // unordered
+
+ String selectionMimeType = MediaStore.Files.FileColumns.MIME_TYPE + "=?";
+ String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension("pdf");
+ String[] selectionArgsPdf = new String[]{ mimeType };
+ Cursor allPdfFiles = cr.query(uri, projections, selectionMimeType, selectionArgsPdf, sortOrder);
+
+ column_index_data = allPdfFiles.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
+ column_index_folder_name = allPdfFiles.getColumnIndexOrThrow(MediaStore..Media.BUCKET_DISPLAY_NAME);
+
+ while (allPdfFiles.moveToNext()){
+ Log.d("FileNameis,",allPdfFiles.getString(column_index_data));
+ Log.d("FolderNameiss,",allPdfFiles.getString(column_index_folder_name));
+ }*/
+
+
+
+
+
+
+
+
+
+ /* for (int i = 0; i < al_images.size(); i++) {
+ Log.e("FOLDER", al_images.get(i).getStr_folder());
+ for (int j = 0; j < al_images.get(i).getAl_imagepath().size(); j++) {
+ Log.e("FILE", al_images.get(i).getAl_imagepath().get(j));
+ }
+ }*/
+
+ obj_adapter = new CompletionAdapter_PhotosFolder(getApplicationContext(),al_images);
+ gv_folder.setAdapter(obj_adapter);
+ return al_images;
+ }
+
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+
+ switch (requestCode) {
+ case REQUEST_PERMISSIONS: {
+ for (int i = 0; i < grantResults.length; i++) {
+ if (grantResults.length > 0 && grantResults[i] == PackageManager.PERMISSION_GRANTED) {
+ fn_imagespath();
+ } else {
+ Toast.makeText(CompletionGallerySelectActivity.this, "The app was not allowed to read or write to your storage. Hence, it cannot function properly. Please consider granting it this permission", Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionModelImages.java b/app/src/main/java/com/leadcampusapp/CompletionModelImages.java
new file mode 100644
index 0000000..210a666
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionModelImages.java
@@ -0,0 +1,28 @@
+package com.leadcampusapp;
+
+import java.util.ArrayList;
+
+/**
+ * Created by deepshikha on 3/3/17.
+ */
+
+public class CompletionModelImages {
+ String str_folder;
+ ArrayList al_imagepath;
+
+ public String getStr_folder() {
+ return str_folder;
+ }
+
+ public void setStr_folder(String str_folder) {
+ this.str_folder = str_folder;
+ }
+
+ public ArrayList getAl_imagepath() {
+ return al_imagepath;
+ }
+
+ public void setAl_imagepath(ArrayList al_imagepath) {
+ this.al_imagepath = al_imagepath;
+ }
+}
diff --git a/app/src/main/java/com/leadcampusapp/CompletionProjectFragment.java b/app/src/main/java/com/leadcampusapp/CompletionProjectFragment.java
new file mode 100644
index 0000000..d042a37
--- /dev/null
+++ b/app/src/main/java/com/leadcampusapp/CompletionProjectFragment.java
@@ -0,0 +1,2377 @@
+package com.leadcampusapp;
+
+/**
+ * Created by Admin on 22-06-2018.
+ */
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.media.ExifInterface;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Environment;
+import android.provider.MediaStore;
+import androidx.fragment.app.Fragment;
+import androidx.appcompat.widget.AppCompatSpinner;
+//import androidx.appcompat.widget.DefaultItemAnimator;
+//import androidx.appcompat.widget.GridLayoutManager;
+import androidx.recyclerview.widget.DefaultItemAnimator;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.serialization.MarshalBase64;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapPrimitive;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.HttpTransportSE;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+import it.sauronsoftware.ftp4j.FTPClient;
+import it.sauronsoftware.ftp4j.FTPDataTransferListener;
+
+import static android.app.Activity.RESULT_CANCELED;
+import static android.app.Activity.RESULT_OK;
+import static android.view.View.GONE;
+import static com.leadcampusapp.CompletionGalleryFolderSelectActivity.imageFilePath;
+
+public class CompletionProjectFragment extends Fragment {
+ private Context context;
+ private AppCompatSpinner spin_completedProject;
+ private String userChoosenTask;
+ private int REQUEST_CAMERA = 2, SELECT_FILE = 1;
+ private View view4;
+
+
+
+ private Button btn_submitCompletion;
+ private HashMap mapProjectIdProject;
+
+ private LinearLayout lnrlyt_ProjectName;
+ private LinearLayout lnrlyt_projectType;
+ private LinearLayout lnrlyt_projObjective;
+ private LinearLayout lnrlyt_placeOfimpl;
+ private LinearLayout lnrlyt_leadFunded;
+ private LinearLayout lnrlyt_challanges;
+ //private LinearLayout lnrlyt_uploadImage;
+ private Button lnrlyt_submit;
+
+ private LinearLayout lnrlyt_txtUploadProj;
+ private LinearLayout lnrlyt_uploadDocument;
+
+ private String selectedProject;
+
+ private TextView txt_projectName;
+ private TextView txt_projectType;
+ private TextView txt_beneficiaries;
+ private TextView txt_objective;
+ private TextView txt_leadFunded;
+ private TextView txt_approvedAmt;
+
+ private EditText edt_fundRaised;
+ private EditText edt_challanges;
+ private EditText edt_learning;
+ private EditText edt_story;
+ private EditText edt_resourcesUtilised;
+ //private EditText edt_resourcesUtilisedAmt;
+
+ public static final String PREFBook_Stud= "prefbook_stud"; //sharedpreference Book
+ public static final String PrefID_RegID = "prefid_regid"; //
+ public static final String PrefID_SLeadID = "prefid_sleadid"; //
+ private SharedPreferences shardpref_S_obj;
+ private String str_leadId,str_RegistrationId;
+
+ // public static String imageFilePath;
+
+ static final String FTP_HOST= "54.169.178.228";
+
+ /********* FTP USERNAME ***********/
+ static final String FTP_USER = "administrator";
+
+ /********* FTP PASSWORD ***********/
+ static final String FTP_PASS ="y7Kvso7;ZFz";
+
+ private ArrayList arrlstUploadedImageBitmap = null;
+
+ private ArrayList arrlstUploadImageByteArray = null;
+
+ private ProgressDialog progressDialog;
+ private ImageView btn_uploadReport;
+ private static final int PICKFILE_RESULT_CODE = 45;
+ private byte[] docbyteArray = null;
+ private String extensions = null;
+ private ImageButton btn_additional;
+ private Button btn_removeProjImag;
+ private RelativeLayout rl_relativelayout;
+ private TextView txt_placeOfImpl;
+
+
+ private File actualImage,compressedImage;
+
+ private TextView fileSelected;
+
+ private RelativeLayout rowLinearLayout;
+
+ private File img;
+ private static Uri fileUri;
+ File imageFile;
+ String path;
+ ImageView imgProj;
+
+ private ImageAdapter imageAdapter;
+ private ArrayList imageUrls;
+ private ArrayList imgurlss;
+ private HashMap cameraImgMap;
+ private ProgressDialog pd;
+ private List imagesEncodedList;
+ private List imagesbyteEncodedList;
+ private ArrayList imagesbyteEncodedListAll;
+ private String imageEncoded;
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+ {
+
+ context = getActivity().getBaseContext();
+ final View view = inflater.inflate(R.layout.completionproject_fragment, container, false);
+ view4 = view;
+
+
+ shardpref_S_obj=getActivity().getSharedPreferences(PREFBook_Stud, Context.MODE_PRIVATE);
+ shardpref_S_obj.getString(PrefID_SLeadID, "").trim();
+ str_leadId = shardpref_S_obj.getString(PrefID_SLeadID, "").trim();
+ Log.d("str_leadId:",str_leadId);
+ //Toast.makeText(context,"LeadId: "+str_leadId,Toast.LENGTH_LONG).show();
+
+ shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ str_RegistrationId = shardpref_S_obj.getString(PrefID_RegID, "").trim();
+ Log.d("str_RegistrationId:",str_RegistrationId);
+
+
+
+ initializeViews();
+
+ rl_relativelayout = (RelativeLayout) view4.findViewById(R.id.relativelayout_RL);
+ rl_relativelayout.setVisibility(View.INVISIBLE);
+
+ LoadApprovedProject loadApprovedProject = new LoadApprovedProject(getActivity());
+ loadApprovedProject.execute();
+
+
+ btn_submitCompletion.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //Toast.makeText(context,"You clicked on submit please wait",Toast.LENGTH_SHORT).show();
+
+ /* pd = new ProgressDialog(context);
+ pd.setMessage("Submitting please wait");
+ pd.show();*/
+
+
+ if (checkMandatory())
+ {
+ btn_submitCompletion.setVisibility(View.GONE);
+ /* imgurlss.clear();
+ imgurlss.addAll(imageAdapter.getImageList());*/
+
+ //Log.d("imgurlsssizeisss", String.valueOf(imageAdapter.getImageList().size()));
+
+ /* for(String imgUrl : imgurlss)
+ {
+ Log.d("imgUrlissssss",imgUrl);
+ Bitmap bitmap;
+ BitmapFactory.Options bmOptions = new BitmapFactory.Options();
+
+ if(imgUrl.startsWith("content")){
+ bitmap = cameraImgMap.get(imgUrl);
+ }else {
+ bitmap = BitmapFactory.decodeFile(imgUrl, bmOptions);
+ }
+
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
+ byte[] imageInByte;
+ imageInByte = stream.toByteArray();
+*/
+ //String encodedImageString = Base64.encodeToString(imageInByte, Base64.DEFAULT);
+ //Log.d("encodeImageStringssssss",encodedImageString);
+
+ /* if(!imgUrl.startsWith("content")) {
+ String where = MediaStore.MediaColumns.DATA + "=?";
+ String[] selectionArgs = new String[]{imgUrl};
+ ContentResolver contentResolver = context.getContentResolver();
+ Uri filesUri = MediaStore.Files.getContentUri("external");
+
+ int deleted = contentResolver.delete(filesUri, where, selectionArgs);
+ Log.d("deltedCountcontentissss", String.valueOf(deleted));
+ }else{
+ ContentResolver contentResolver = context.getContentResolver();
+ Uri filesUri = Uri.parse(imgUrl);
+ int deleted = contentResolver.delete(filesUri, null, null);
+ Log.d("deletedCountCameraissss", String.valueOf(deleted));
+ }*/
+
+ //arrlstUploadedImageBitmap.add(encodedImageString);
+
+ /* arrlstUploadImageByteArray.add(imageInByte);
+ }*/
+
+ //bitmap = Bitmap.createScaledBitmap(bitmap,parent.getWidth(),parent.getHeight(),true);
+ //imageView.setImageBitmap(bitmap);
+
+ // ArrayList byteArrayImage = CompletionProjectStaticClass.getByteArrayImage();
+ byte[] byteImage = CompletionProjectStaticClass.getBytesImage();
+ ArrayList byteArrayImage;
+ byteArrayImage = new ArrayList<>();
+
+ byteArrayImage.addAll(imagesbyteEncodedListAll);
+
+ /* if(byteArrayImage!=null){
+ for(int i=0;i 10){
+ btn_submitCompletion.setVisibility(View.VISIBLE);
+ Toast.makeText(getActivity(),"You can upload maximum of 10 images",Toast.LENGTH_LONG).show();
+ }
+ else {
+ if (imgurlss.size() >= 4) {
+ btn_submitCompletion.setVisibility(View.VISIBLE);
+ Log.d("insidesizessssss", "greater than 4");
+ //Toast.makeText(getActivity(),"Inside size greater than 4",Toast.LENGTH_SHORT).show();
+ //pd.dismiss();
+ UploadProjectImages uploadProjectImages = new UploadProjectImages(getActivity());
+ uploadProjectImages.execute();
+ } else {
+ //pd.dismiss();
+ Toast.makeText(getActivity(), "Please Upload atleast 4 images", Toast.LENGTH_LONG).show();
+ //btn_submitCompletion.setVisibility(View.VISIBLE);
+ }
+ }
+ }
+ }
+ });
+
+
+ btn_removeProjImag.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if(imageAdapter!=null) {
+ imageAdapter.clear();
+ imageUrls.clear();
+ imageAdapter = null;
+ }else{
+ Toast.makeText(context,"No Images to remove",Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+
+
+ spin_completedProject.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ if(!spin_completedProject.getSelectedItem().toString().equals("List Of Projects") && !spin_completedProject.getSelectedItem().toString().equals("No Approved Projects")){
+ selectedProject = spin_completedProject.getSelectedItem().toString();
+
+ GetProjectDetails getProjctDtls = new GetProjectDetails(getActivity());
+ getProjctDtls.execute();
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+
+ btn_additional.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ selectImage();
+ }
+ });
+
+ btn_uploadReport.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ /* String[] mimeTypes = {"application/pdf","application/msword","application/vnd.ms-excel"};
+
+ String mimeTypesStr = "";
+ for (String mimeType : mimeTypes) {
+ mimeTypesStr += mimeType + "|";
+ }
+
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.setType(mimeTypesStr.substring(0,mimeTypesStr.length() - 1));
+ startActivityForResult(intent,PICKFILE_RESULT_CODE);*/
+ Intent documentIntent = new Intent(getActivity().getBaseContext(),CompletionDocumentFolderSelectActivity.class);
+ startActivityForResult(documentIntent,SELECT_FILE);
+
+
+
+ }
+ });
+
+ return view;
+
+
+ }// end of oncreate()
+
+/* @Override
+ public void onDetach() {
+ Log.d("insideexitsss","exitsssss");
+
+ for(String imgUrl : imageUrls){
+ if(!imgUrl.startsWith("content")) {
+ String where = MediaStore.MediaColumns.DATA + "=?";
+ String[] selectionArgs = new String[]{imgUrl};
+ ContentResolver contentResolver = context.getContentResolver();
+ Uri filesUri = MediaStore.Files.getContentUri("external");
+
+ int deleted = contentResolver.delete(filesUri, where, selectionArgs);
+ Log.d("deltedCountcontentissss", String.valueOf(deleted));
+ }else{
+ ContentResolver contentResolver = context.getContentResolver();
+ Uri filesUri = Uri.parse(imgUrl);
+ int deleted = contentResolver.delete(filesUri, null, null);
+ Log.d("deletedCountCameraissss", String.valueOf(deleted));
+ }
+ }
+ super.onDetach();
+ }*/
+
+ private boolean checkMandatory() {
+
+ String str_challanges = edt_challanges.getText().toString();
+ String str_learning = edt_learning.getText().toString();
+ String str_story = edt_story.getText().toString();
+
+
+ if(str_challanges.isEmpty()){
+ //pd.dismiss();
+ edt_challanges.setError("Enter the challenges");
+ edt_challanges.requestFocus();
+ return false;
+ }
+
+ if(str_learning.isEmpty()){
+ //pd.dismiss();
+ edt_learning.setError("Enter the learnings");
+ edt_learning.requestFocus();
+ return false;
+ }
+
+ if(str_story.isEmpty()){
+ //pd.dismiss();
+ edt_story.setError("Enter the story");
+ edt_story.requestFocus();
+ return false;
+ }
+ else{
+ return true;
+ }
+ }
+
+
+ public class UploadProjectImages extends AsyncTask {
+
+ Context context;
+ AlertDialog alertDialog;
+
+ /*private ProgressBar progressBar;*/
+
+ UploadProjectImages (Context ctx)
+ {
+ context = ctx;
+ pd = new ProgressDialog(context);
+ pd.setMessage("Submitting your request please wait. If you press back button your request will be uploaded in the backend");
+ pd.show();
+ }
+
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+ SoapPrimitive response =null;
+
+ /* for(int k=0;k " + t.getMessage().toString());
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ //getActivity().finish();
+ }
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+
+ }
+ });
+ /* getActivity().finish();*/
+ }
+ return null;
+ }
+
+ public class SubmitForCompletion extends AsyncTask {
+
+ Context context;
+ AlertDialog alertDialog;
+
+ SubmitForCompletion (Context ctx){
+ context = ctx;
+ }
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ SoapPrimitive response = submitCompletionProject();
+ return response;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+ Toast.makeText(getActivity(),result.toString(),Toast.LENGTH_LONG).show();
+ pd.dismiss();
+ //progressDialog.dismiss();
+ if(result!=null) {
+ if (result.toString().equalsIgnoreCase("success")) {
+ //pd.dismiss();
+ getActivity().finish();
+ }
+ }else{
+ //getActivity().finish();
+ }
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private SoapPrimitive submitCompletionProject() {
+ String METHOD_NAME = "UpdateProjectCompletions";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/UpdateProjectCompletions";
+ String NAMESPACE = "http://mis.leadcampus.org/";
+
+ Log.d("Insidexxxxx","submitCompletionProject");
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
+
+ //SoapObject users = new SoapObject("http://mis.leadcampus.org/", "users");
+ request.addProperty("leadId",str_leadId);
+ request.addProperty("RegistrationId",str_RegistrationId);
+
+ Log.d("Projectssssssss", String.valueOf(mapProjectIdProject.get(selectedProject)));
+
+ request.addProperty("ProjectId",mapProjectIdProject.get(selectedProject));
+
+ if(edt_fundRaised != null){
+ int length = edt_fundRaised.getText().length();
+ Log.d("Lengthisss", String.valueOf(length));
+ if(length > 0) {
+ Log.d("beforelengthgreaterthan","zero");
+ String str_fundRaised = edt_fundRaised.getText().toString();
+ Log.d("str_fundraisedafter", str_fundRaised);
+ if (!str_fundRaised.equals(null) && !str_fundRaised.isEmpty() && !str_fundRaised.equals("")) {
+ request.addProperty("FundsRaised", str_fundRaised);
+ } else {
+ request.addProperty("FundsRaised", "0");
+ }
+ }else{
+ request.addProperty("FundsRaised", "0");
+ }
+ }else{
+ request.addProperty("FundsRaised", "0");
+ }
+
+ if(edt_challanges.getText()!=null) {
+ String str_Challanges = edt_challanges.getText().toString();
+ if (!str_Challanges.isEmpty() && !str_Challanges.equals("") && !str_Challanges.equals(null)) {
+ request.addProperty("Challenge", str_Challanges);
+ } else {
+ request.addProperty("Challenge", "");
+ }
+ }else{
+ request.addProperty("Challenge", "");
+ }
+
+ if(edt_learning.getText()!=null) {
+ String str_learning = edt_learning.getText().toString();
+ if (!str_learning.isEmpty() && !str_learning.equals("") && !str_learning.equals(null)) {
+ request.addProperty("Learning", str_learning);
+ } else {
+ request.addProperty("Learning", "");
+ }
+ }else{
+ request.addProperty("Learning", "");
+ }
+
+ if(edt_story.getText()!=null) {
+ String str_story = edt_story.getText().toString();
+ if (!str_story.isEmpty() && !str_story.equals("") && !str_story.equals(null)) {
+ request.addProperty("AsAStory", str_story);
+ } else {
+ request.addProperty("AsAStory", "");
+ }
+ }else{
+ request.addProperty("AsAStory", "");
+ }
+
+ if(edt_resourcesUtilised.getText() != null){
+ String str_resourceUtilised = edt_resourcesUtilised.getText().toString();
+ Log.d("StringResourcesUtilised",str_resourceUtilised);
+
+ if (!str_resourceUtilised.isEmpty() && !str_resourceUtilised.equals("") && !str_resourceUtilised.equals(null)) {
+ request.addProperty("Resource", str_resourceUtilised);
+ } else {
+ request.addProperty("Resource", "");
+ }
+ }
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ //new MarshalBase64().register(envelope);
+ //new Marshal.register(envelope);
+
+ envelope.dotNet = true;
+
+
+
+
+ //Set output SOAP object
+ envelope.setOutputSoapObject(request);
+
+
+
+ //envelope.addMapping(NAMESPACE, "MediSenseLog",new MediSenseLog().getClass());
+ //Create HTTP call object
+ //envelope.encodingStyle = SoapSerializationEnvelope.XSD;
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Projects.toString().trim());
+ //androidHttpTransport.setXmlVersionTag("");
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+
+ //SoapPrimitive response1 = (SoapPrimitive) envelope.getResponse();
+ Log.d("soaprespsubmitComplnPrj",envelope.getResponse().toString());
+
+ //Log.d("Requestsssss",request.toString());
+
+
+ //SoapObject response = (SoapObject) envelope.getResponse();
+
+ //return null;
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+ //Log.e("soaprespsubmitComplnPrj",response.toString());
+ return response;
+
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ //getActivity().finish();
+ }
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ return null;
+
+ }
+
+ public class UploadProjectDocument extends AsyncTask {
+
+ Context context;
+ AlertDialog alertDialog;
+
+ UploadProjectDocument (Context ctx){
+ context = ctx;
+ }
+
+
+ @Override
+ protected SoapPrimitive doInBackground(Void... params) {
+ //String versionCode = (String) params[2];
+ SoapPrimitive response =null;
+
+ response = uploadProjectDocument();
+
+ //Log.d("Soap response is",response.toString());
+ return response;
+
+ }
+
+ @Override
+ protected void onPreExecute() {
+ /* progressBar = (ProgressBar) view4.findViewById(R.id.progressBar);
+ progressBar.setVisibility(View.VISIBLE);*/
+ }
+
+ @Override
+ protected void onPostExecute(SoapPrimitive result) {
+ /* Toast.makeText(getActivity(),result.toString(),Toast.LENGTH_LONG).show();
+ progressDialog.dismiss();*/
+
+
+ if(result != null) {
+ if (result.toString().equalsIgnoreCase("success")) {
+ //Log.d("FinalSoapResult",result.toString());
+/* LoadApprovedProject loadApprovedProject = new LoadApprovedProject(getActivity());
+ loadApprovedProject.execute();*/
+
+ SubmitForCompletion submitForCompletion = new SubmitForCompletion(getActivity());
+ submitForCompletion.execute();
+ } else {
+ Toast.makeText(getActivity(), result.toString(), Toast.LENGTH_LONG).show();
+ progressDialog.dismiss();
+ }
+
+ Log.d("Resultisssss", result.toString());
+ }else{
+ progressDialog.dismiss();
+ }
+
+ }
+
+ @Override
+ protected void onProgressUpdate(Void... values) {
+ super.onProgressUpdate(values);
+ }
+ }
+
+ private SoapPrimitive uploadProjectDocument() {
+ String METHOD_NAME = "UpdateProjectCompletionDocument";
+ String SOAP_ACTION1 = "http://mis.leadcampus.org/UpdateProjectCompletionDocument";
+ String NAMESPACE = "http://mis.leadcampus.org/";
+
+ Log.d("Insidexxxxx","uploadProjectDocumentssss");
+
+ try{
+ //mis.leadcampus.org
+
+ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
+
+ //SoapObject users = new SoapObject("http://mis.leadcampus.org/", "users");
+ request.addProperty("leadId",str_leadId);
+ request.addProperty("RegistrationId",str_RegistrationId);
+
+ Log.d("Projectssssssss", String.valueOf(mapProjectIdProject.get(selectedProject)));
+ request.addProperty("ProjectId",mapProjectIdProject.get(selectedProject));
+
+ request.addProperty("docFile",docbyteArray);
+ request.addProperty("extension",extensions);
+
+
+ SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
+ new MarshalBase64().register(envelope);
+
+ envelope.dotNet = true;
+ envelope.setOutputSoapObject(request);
+ HttpTransportSE androidHttpTransport = new HttpTransportSE(Class_URL.URL_Projects.toString().trim());
+
+ try
+ {
+ androidHttpTransport.call(SOAP_ACTION1, envelope);
+
+ //Log.d("soaprespUpldPrjctDoc",envelope.getResponse().toString());
+
+ SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
+ //Log.e("soaprespUpldPrjctDoc",response.toString());
+ return response;
+
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ catch (Exception t) {
+ Log.e("request fail", "> " + t.getMessage().toString());
+
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ //getActivity().finish();
+ }
+ }
+ catch(OutOfMemoryError ex){
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Slow Internet or Internet Dropped", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+
+ catch (Exception t) {
+ Log.e("exception outside",t.getMessage().toString());
+ final String exceptionStr = t.getMessage().toString();
+ getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ Toast.makeText(getActivity(),"Web Service Error", Toast.LENGTH_LONG).show();
+ }
+ });
+ }
+ return null;
+ }
+
+
+ private void initializeViews() {
+ mapProjectIdProject = new HashMap();
+
+ lnrlyt_ProjectName = (LinearLayout) view4.findViewById(R.id.lnrlyt_ProjectName);
+ lnrlyt_projectType = (LinearLayout) view4.findViewById(R.id.lnrlyt_projectType);
+ lnrlyt_projObjective = (LinearLayout) view4.findViewById(R.id.lnrlyt_projObjective);
+ lnrlyt_placeOfimpl = (LinearLayout) view4.findViewById(R.id.lnrlyt_placeOfimpl);
+ lnrlyt_leadFunded = (LinearLayout) view4.findViewById(R.id.lnrlyt_leadFunded);
+ lnrlyt_challanges = (LinearLayout) view4.findViewById(R.id.lnrlyt_challanges);
+ //lnrlyt_uploadImage = (LinearLayout) view4.findViewById(R.id.lnrlyt_uploadImage);
+ //lnrlyt_submit = (Button) view4.findViewById(R.id.lnrlyt_submit);
+
+ lnrlyt_txtUploadProj = (LinearLayout) view4.findViewById(R.id.lnrlyt_txtUploadProj);
+ lnrlyt_uploadDocument = (LinearLayout) view4.findViewById(R.id.lnrlyt_uploadDocument);
+
+ txt_projectName = (TextView) view4.findViewById(R.id.txt_projectName);
+ txt_projectType = (TextView) view4.findViewById(R.id.txt_projectType);
+ txt_beneficiaries = (TextView) view4.findViewById(R.id.txt_beneficiaries);
+ txt_objective = (TextView) view4.findViewById(R.id.txt_objective);
+ txt_leadFunded = (TextView) view4.findViewById(R.id.txt_leadFunded);
+ txt_approvedAmt = (TextView) view4.findViewById(R.id.txt_approvedAmt);
+
+ //edt_placeOfImpl = (EditText) view4.findViewById(R.id.edt_placeOfImpl);
+ edt_fundRaised = (EditText) view4.findViewById(R.id.edt_fundRaised);
+ edt_challanges = (EditText) view4.findViewById(R.id.edt_challanges);
+ edt_learning = (EditText) view4.findViewById(R.id.edt_learning);
+ edt_story = (EditText) view4.findViewById(R.id.edt_story);
+
+ edt_resourcesUtilised = (EditText) view4.findViewById(R.id.edt_resourcesUtilised);
+ //edt_resourcesUtilisedAmt = (EditText) view4.findViewById(R.id.edt_resourcesUtilisedAmt);
+
+ spin_completedProject = (AppCompatSpinner) view4.findViewById(R.id.spin_completedProject);//
+ //btn_uploadReport = (Button) view4.findViewById(R.id.btn_uploadReport);
+
+ btn_uploadReport = (ImageView) view4.findViewById(R.id.btn_uploadReport);
+
+ btn_additional = (ImageButton) view4.findViewById(R.id.btn_addProject);
+
+ fileSelected = (TextView) view4.findViewById(R.id.txt_fileSelected);
+
+ txt_placeOfImpl = (TextView) view4.findViewById(R.id.txt_placeOfImpl);
+
+ btn_submitCompletion = (Button) view4.findViewById(R.id.btn_submitCompletion);
+
+ btn_removeProjImag = (Button) view4.findViewById(R.id.btn_removeProjImag);
+
+ //coordinatorLayout = (CoordinatorLayout) view4.findViewById(R.id.coordinatorLayout);
+
+ imageUrls = new ArrayList();
+
+ imgurlss = new ArrayList