├── Database Backup └── id7552327_foodorder.sql ├── FoodOrder ├── .gitignore ├── .idea │ ├── assetWizardSettings.xml │ ├── caches │ │ ├── build_file_checksums.ser │ │ └── gradle_models.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ ├── sampledata │ │ ├── CartAdapter.java │ │ ├── HttpConnector.java │ │ ├── UsersAdapter.java │ │ └── customer_menu_data.java │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── manitejagande │ │ │ └── foodorder │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_profile-web.png │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── manitejagande │ │ │ │ └── foodorder │ │ │ │ ├── Async_Task.java │ │ │ │ ├── CartActivity.java │ │ │ │ ├── CartItemAdapter.java │ │ │ │ ├── CartItemDataModel.java │ │ │ │ ├── CurrentOrder.java │ │ │ │ ├── CurrentOrderRecyclerAdapter.java │ │ │ │ ├── HttpHandler.java │ │ │ │ ├── LoginActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MenuItemAdapter.java │ │ │ │ ├── MenuItemAdapterCart.java │ │ │ │ ├── MenuItemDataModel.java │ │ │ │ ├── MenuListActivity.java │ │ │ │ ├── OrderHistory.java │ │ │ │ ├── OrderHistoryDataModel.java │ │ │ │ ├── OrderHistoryRecyclerAdapter.java │ │ │ │ ├── ProfileActivity.java │ │ │ │ ├── SuggestedActivity.java │ │ │ │ ├── fetchData.java │ │ │ │ └── registerActivity.java │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── ic_action_cart.png │ │ │ ├── ic_action_neworder.png │ │ │ └── ic_action_profile.png │ │ │ ├── drawable-mdpi │ │ │ ├── ic_action_cart.png │ │ │ ├── ic_action_neworder.png │ │ │ └── ic_action_profile.png │ │ │ ├── drawable-v21 │ │ │ ├── ic_menu_camera.xml │ │ │ ├── ic_menu_gallery.xml │ │ │ ├── ic_menu_manage.xml │ │ │ ├── ic_menu_send.xml │ │ │ ├── ic_menu_share.xml │ │ │ └── ic_menu_slideshow.xml │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── ic_action_cart.png │ │ │ ├── ic_action_neworder.png │ │ │ └── ic_action_profile.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── delete.png │ │ │ ├── home.png │ │ │ ├── ic_action_cart.png │ │ │ ├── ic_action_neworder.png │ │ │ └── ic_action_profile.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── ic_action_cart.png │ │ │ ├── ic_action_neworder.png │ │ │ └── ic_action_profile.png │ │ │ ├── drawable │ │ │ ├── appicon.png │ │ │ ├── background.png │ │ │ ├── background_login_two.xml │ │ │ ├── dots1.gif │ │ │ ├── dots2.gif │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_lock_white_24dp.xml │ │ │ ├── ic_person_white_24dp.xml │ │ │ ├── list_item_background.jpg │ │ │ ├── loginbackground1.jpg │ │ │ ├── man.jpg │ │ │ ├── menu.png │ │ │ ├── profile.png │ │ │ ├── rightarrow.png │ │ │ ├── side_nav_bar.xml │ │ │ └── top1.jpg │ │ │ ├── layout-v26 │ │ │ ├── activity_register.xml │ │ │ └── login_activity.xml │ │ │ ├── layout │ │ │ ├── activity_cart.xml │ │ │ ├── activity_cart_item.xml │ │ │ ├── activity_currentorder.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_orderhistory.xml │ │ │ ├── activity_profile.xml │ │ │ ├── activity_profile1.xml │ │ │ ├── activity_register.xml │ │ │ ├── activity_suggested.xml │ │ │ ├── app_bar_main.xml │ │ │ ├── content_main.xml │ │ │ ├── currentorder_list_item.xml │ │ │ ├── login_activity1.xml │ │ │ ├── login_activity2.xml │ │ │ ├── menu_list.xml │ │ │ ├── menu_list_activity1.xml │ │ │ ├── menu_list_item.xml │ │ │ ├── nav_header_main.xml │ │ │ └── orderhistory_list_item.xml │ │ │ ├── menu │ │ │ ├── activity_main_drawer.xml │ │ │ └── main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ ├── ic_launcher_round.xml │ │ │ ├── ic_profile.xml │ │ │ └── ic_profile_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_profile.png │ │ │ └── ic_profile_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_profile.png │ │ │ └── ic_profile_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_profile.png │ │ │ └── ic_profile_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_profile.png │ │ │ └── ic_profile_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_profile.png │ │ │ └── ic_profile_round.png │ │ │ ├── values-v21 │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── drawables.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── manitejagande │ │ └── foodorder │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── PHP files └── foodorder │ ├── admin │ ├── admin_all_orders.php │ ├── admin_current_orders.php │ ├── admin_current_orders_cancelled.php │ ├── admin_current_orders_completed.php │ ├── admin_delete_menu_process.php │ ├── admin_delete_process.php │ ├── admin_home.php │ ├── admin_logout.php │ ├── admin_manage_menu.php │ ├── admin_manage_menu_action.php │ ├── admin_manage_users.php │ ├── admin_manage_users_action.php │ ├── admin_update_menu.php │ ├── admin_update_menu_process.php │ ├── admin_update_menu_process_submit.php │ ├── admin_update_process.php │ ├── admin_update_process_submit.php │ ├── admin_update_users.php │ ├── associationRules.txt │ ├── class.apriori.php │ ├── connection.php │ ├── example.php │ ├── footer.php │ ├── freqItemsets.txt │ ├── header.php │ ├── image1.jpg │ ├── index.php │ └── login.php │ └── customer │ ├── associationRules.txt │ ├── cart.php │ ├── cartsuggestions.php │ ├── class.apriori.php │ ├── connection.php │ ├── currentorders.php │ ├── dataset1.txt │ ├── displaycurrentorders.php │ ├── example.php │ ├── freqItemsets.txt │ ├── get_suggested.php │ ├── getuserid.php │ ├── login.php │ ├── menu.php │ ├── orderhistory.php │ ├── register.php │ ├── removecart.php │ ├── saveData.php │ └── showcart.php └── README.md /FoodOrder/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /FoodOrder/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /FoodOrder/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /FoodOrder/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /FoodOrder/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /FoodOrder/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | -------------------------------------------------------------------------------- /FoodOrder/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /FoodOrder/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /FoodOrder/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.example.manitejagande.foodorder" 7 | minSdkVersion 15 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(dir: 'libs', include: ['*.jar']) 23 | implementation 'com.android.support:appcompat-v7:27.1.1' 24 | implementation 'com.android.support:design:27.1.1' 25 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 29 | implementation 'com.android.support:cardview-v7:27.1.1' 30 | } 31 | dependencies { 32 | implementation 'com.android.support:cardview-v7:27.1.1' 33 | implementation 'de.hdodenhof:circleimageview:2.1.0' 34 | implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2+' 35 | //compile 'com.android.support:support-annotations:28.0.0' 36 | } -------------------------------------------------------------------------------- /FoodOrder/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /FoodOrder/app/sampledata/CartAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.net.Uri; 6 | import android.preference.PreferenceManager; 7 | import android.util.Log; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.ArrayAdapter; 12 | import android.widget.Button; 13 | import android.widget.TextView; 14 | 15 | import java.util.ArrayList; 16 | 17 | public class CartAdapter extends ArrayAdapter { 18 | public static int total=0; 19 | Context context; 20 | public CartAdapter(Context context, ArrayList users) { 21 | super(context, 0, users); 22 | this.context=context; 23 | } 24 | 25 | @Override 26 | public View getView(int position, View convertView, ViewGroup parent) { 27 | // Get the data item for this position 28 | customer_menu_data customerMenuData = getItem(position); 29 | // Check if an existing view is being reused, otherwise inflate the view 30 | if (convertView == null) { 31 | convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_cart_item, parent, false); 32 | } 33 | // Lookup view for data population 34 | TextView tv1 = (TextView) convertView.findViewById(R.id.c_itemname); 35 | TextView tv2 = (TextView) convertView.findViewById(R.id.c_itemprice); 36 | // TextView tv3 = (TextView) convertView.findViewById(R.id.orderid); 37 | //TextView tv3= (TextView) convertView.findViewById(R.id.c_itemquantity); 38 | // Populate the data into the template view using the data object 39 | tv1.setText(customerMenuData.itemname); 40 | tv2.setText(customerMenuData.itemprice); 41 | //tv3.setText(); 42 | // final String name=customerMenuData.itemname; 43 | // final String price=customerMenuData.itemprice; 44 | // int p=Integer.parseInt(price); 45 | // total=total+p; 46 | /*b.setOnClickListener(new View.OnClickListener() { 47 | @Override 48 | public void onClick(View v) { 49 | String url="http://192.168.0.2/foodorder/menu.php"; 50 | String email=getDefaults("userid",context); 51 | Uri.Builder builder = new Uri.Builder() 52 | .appendQueryParameter("email", email) 53 | .appendQueryParameter("itemname", name) 54 | .appendQueryParameter("itemprice", price); 55 | 56 | 57 | String query = builder.build().getEncodedQuery(); 58 | Log.i("url",query); 59 | 60 | Async_Task a=new Async_Task(context,url,query,false); 61 | a.execute(); 62 | 63 | } 64 | });*/ 65 | // Return the completed view to render on screen 66 | return convertView; 67 | } 68 | public String getDefaults(String key, Context context) { 69 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 70 | return preferences.getString(key, null); 71 | } 72 | public int gettotal() 73 | { 74 | return total; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /FoodOrder/app/sampledata/HttpConnector.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | public class HttpConnector { 4 | 5 | public static final int CONNECTION_TIMEOUT=10000; 6 | public static final int READ_TIMEOUT=15000; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /FoodOrder/app/sampledata/UsersAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.preference.PreferenceManager; 8 | import android.util.Log; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.ArrayAdapter; 13 | import android.widget.Button; 14 | import android.widget.TextView; 15 | 16 | import java.util.ArrayList; 17 | 18 | public class UsersAdapter extends ArrayAdapter { 19 | Context context; 20 | public UsersAdapter(Context context, ArrayList users) { 21 | super(context, 0, users); 22 | this.context=context; 23 | } 24 | 25 | @Override 26 | public View getView(int position, View convertView, ViewGroup parent) { 27 | // Get the data item for this position 28 | customer_menu_data customerMenuData = getItem(position); 29 | // Check if an existing view is being reused, otherwise inflate the view 30 | if (convertView == null) { 31 | convertView = LayoutInflater.from(getContext()).inflate(R.layout.menu_list_item, parent, false); 32 | } 33 | // Lookup view for data population 34 | TextView tv1 = (TextView) convertView.findViewById(R.id.itemname); 35 | TextView tv2 = (TextView) convertView.findViewById(R.id.itemprice); 36 | Button b=(Button)convertView.findViewById(R.id.additem); 37 | // Populate the data into the template view using the data object 38 | tv1.setText(customerMenuData.itemname); 39 | tv2.setText(customerMenuData.itemprice); 40 | final String name=customerMenuData.itemname; 41 | final String price=customerMenuData.itemprice; 42 | b.setOnClickListener(new View.OnClickListener() { 43 | @Override 44 | public void onClick(View v) { 45 | String url="https://inamtginamtg.000webhostapp.com/cart.php"; 46 | String email=getDefaults("userid",context); 47 | Uri.Builder builder = new Uri.Builder() 48 | .appendQueryParameter("email", email) 49 | .appendQueryParameter("itemname", name) 50 | .appendQueryParameter("itemprice", price); 51 | 52 | 53 | String query = builder.build().getEncodedQuery(); 54 | Log.i("url",query); 55 | 56 | Async_Task a=new Async_Task(context,url,query,false); 57 | a.execute(); 58 | 59 | } 60 | }); 61 | // Return the completed view to render on screen 62 | return convertView; 63 | } 64 | public String getDefaults(String key, Context context) { 65 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 66 | return preferences.getString(key, null); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /FoodOrder/app/sampledata/customer_menu_data.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class customer_menu_data { 10 | public String itemname; 11 | public String itemprice; 12 | 13 | public customer_menu_data(JSONObject object) { 14 | try { 15 | this.itemname = object.getString("itemname"); 16 | this.itemprice = object.getString("itemprice"); 17 | } catch (JSONException e) { 18 | e.printStackTrace(); 19 | } 20 | 21 | } 22 | public static ArrayList fromJson(JSONArray jsonObjects) { 23 | ArrayList menuitems = new ArrayList(); 24 | for (int i = 0; i < jsonObjects.length(); i++) { 25 | try { 26 | menuitems.add(new customer_menu_data(jsonObjects.getJSONObject(i))); 27 | } catch (JSONException e) { 28 | e.printStackTrace(); 29 | } 30 | } 31 | return menuitems; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /FoodOrder/app/src/androidTest/java/com/example/manitejagande/foodorder/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.manitejagande.foodorder", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/ic_profile-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/ic_profile-web.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/Async_Task.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.os.AsyncTask; 8 | import android.util.Log; 9 | import android.widget.Toast; 10 | 11 | import java.io.BufferedReader; 12 | import java.io.BufferedWriter; 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | import java.io.InputStreamReader; 16 | import java.io.OutputStream; 17 | import java.io.OutputStreamWriter; 18 | import java.net.HttpURLConnection; 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | 22 | public class Async_Task extends AsyncTask { 23 | Context context; 24 | String str_url; 25 | public static final int CONNECTION_TIMEOUT=10000; 26 | public static final int READ_TIMEOUT=15000; 27 | String query; 28 | boolean show; 29 | String r; 30 | 31 | ProgressDialog pdLoading; 32 | HttpURLConnection conn; 33 | URL url = null; 34 | Async_Task(Context context,String url, String query,boolean show) 35 | { 36 | this.context=context; 37 | str_url=url; 38 | this.query=query; 39 | this.show=show; 40 | } 41 | 42 | 43 | @Override 44 | protected void onPreExecute() { 45 | super.onPreExecute(); 46 | 47 | //this method will be running on UI thread 48 | if(show) { 49 | pdLoading = new ProgressDialog(context); 50 | pdLoading.setMessage("\tLoading..."); 51 | pdLoading.setCancelable(false); 52 | pdLoading.show(); 53 | } 54 | } 55 | 56 | 57 | 58 | @Override 59 | protected String doInBackground(String... params) { 60 | 61 | try 62 | { 63 | // Enter URL address where your php file resides 64 | url = new URL(str_url); 65 | } 66 | catch (MalformedURLException e) 67 | { 68 | // TODO Auto-generated catch block 69 | e.printStackTrace(); 70 | return "exception"; 71 | } 72 | try 73 | { 74 | // Setup HttpURLConnection class to send and receive data from php and mysql 75 | conn = (HttpURLConnection)url.openConnection(); 76 | conn.setReadTimeout(READ_TIMEOUT); 77 | conn.setConnectTimeout(CONNECTION_TIMEOUT); 78 | conn.setRequestMethod("POST"); 79 | 80 | // setDoInput and setDoOutput method depict handling of both send and receive 81 | conn.setDoInput(true); 82 | conn.setDoOutput(true); 83 | 84 | OutputStream os = conn.getOutputStream(); 85 | BufferedWriter writer = new BufferedWriter( 86 | new OutputStreamWriter(os, "UTF-8")); 87 | writer.write(query); 88 | writer.flush(); 89 | writer.close(); 90 | os.close(); 91 | conn.connect(); 92 | 93 | } catch (IOException e1) 94 | { 95 | // TODO Auto-generated catch block 96 | e1.printStackTrace(); 97 | return "exception"; 98 | } 99 | 100 | try 101 | { 102 | 103 | int response_code = conn.getResponseCode(); 104 | 105 | // Check if successful connection made 106 | if (response_code == HttpURLConnection.HTTP_OK) 107 | { 108 | // Read data sent from server 109 | InputStream input = conn.getInputStream(); 110 | BufferedReader reader = new BufferedReader(new InputStreamReader(input)); 111 | StringBuilder result = new StringBuilder(); 112 | String line; 113 | 114 | while ((line = reader.readLine()) != null) 115 | { 116 | result.append(line); 117 | } 118 | Log.i("a13q345",result.toString()); 119 | // Pass data to onPostExecute method 120 | return(result.toString()); 121 | 122 | }else{ 123 | 124 | return("unsuccessful"); 125 | } 126 | 127 | } 128 | catch (IOException e) 129 | { 130 | e.printStackTrace(); 131 | return "exception"; 132 | } 133 | finally 134 | { 135 | conn.disconnect(); 136 | } 137 | } 138 | 139 | @Override 140 | protected void onPostExecute(String result) { 141 | r=result; 142 | 143 | //this method will be running on UI thread 144 | if(show) { 145 | pdLoading.dismiss(); 146 | } 147 | 148 | if(result!=null) 149 | { 150 | /* Here launching another activity when login successful. If you persist login state 151 | use sharedPreferences of Android. and logout button to clear sharedPreferences. 152 | */ 153 | 154 | 155 | Toast.makeText(context, "successful", Toast.LENGTH_SHORT).show(); 156 | 157 | 158 | 159 | }else{ 160 | 161 | // If username and password does not match display a error message 162 | Toast.makeText(context, "unsuccessful", Toast.LENGTH_SHORT).show(); 163 | 164 | } 165 | } 166 | String getResult() 167 | { 168 | return r; 169 | } 170 | 171 | } 172 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/CartItemAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.preference.PreferenceManager; 8 | import android.support.annotation.NonNull; 9 | import android.support.v7.widget.RecyclerView; 10 | import android.util.Log; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.Button; 15 | import android.widget.ImageButton; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import java.math.BigInteger; 20 | import java.util.ArrayList; 21 | 22 | 23 | 24 | 25 | public class CartItemAdapter extends RecyclerView.Adapter 26 | { 27 | Context context; 28 | int total=0; 29 | ArrayList data; 30 | 31 | public CartItemAdapter(Context context,ArrayList data) { 32 | this.data = data; 33 | this.context=context; 34 | } 35 | 36 | @NonNull 37 | @Override 38 | public CartItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 39 | 40 | View view = LayoutInflater.from(parent.getContext()) 41 | .inflate(R.layout.activity_cart_item, parent, false); 42 | CartItemViewHolder myViewHolder = new CartItemViewHolder(view); 43 | return myViewHolder; 44 | 45 | } 46 | public String getDefaults(String key, Context context) { 47 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 48 | return preferences.getString(key, null); 49 | } 50 | 51 | @Override 52 | public void onBindViewHolder(@NonNull CartItemViewHolder holder, int position) { 53 | TextView c_itemname=holder.c_itemname; 54 | TextView c_itemprice=holder.c_itemprice; 55 | TextView orderid=holder.orderid; 56 | TextView qty=holder.qty; 57 | ImageButton remove=holder.remove; 58 | 59 | final String name=data.get(position).itemname.toString(); 60 | final String price=data.get(position).itemprice.toString(); 61 | final String order_id=data.get(position).orderid.toString(); 62 | final String qty1=data.get(position).qty.toString(); 63 | 64 | c_itemname.setText(name); 65 | c_itemprice.setText(price); 66 | orderid.setText(order_id); 67 | qty.setText(qty1); 68 | 69 | 70 | remove.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | String url = LoginActivity.weburl + "removecart.php"; 74 | 75 | String email = getDefaults("userid", context); 76 | Uri.Builder builder = new Uri.Builder() 77 | .appendQueryParameter("email", email) 78 | .appendQueryParameter("itemname", name) 79 | .appendQueryParameter("itemprice", price) 80 | .appendQueryParameter("orderid",order_id); 81 | 82 | 83 | String query = builder.build().getEncodedQuery(); 84 | Log.i("url", query); 85 | // Toast.makeText(context, "Item removed Successfully..!", Toast.LENGTH_SHORT).show(); 86 | Async_Task a = new Async_Task(context, url, query, true); 87 | a.execute(); 88 | //Toast.makeText(context, "Item removed", Toast.LENGTH_SHORT).show(); 89 | Intent i=new Intent(context,CartActivity.class); 90 | context.startActivity(i); 91 | } 92 | 93 | }); 94 | 95 | int intprice=Integer.parseInt(price); 96 | int intprice1=Integer.parseInt(price); 97 | total=total+intprice; 98 | 99 | } 100 | 101 | int grandTotal(ArrayList data){ 102 | 103 | int totalPrice = 0; 104 | for(int i = 0 ; i < data.size(); i++) { 105 | int qty=Integer.parseInt(data.get(i).qty); 106 | totalPrice += Integer.parseInt(data.get(i).itemprice)*qty; 107 | } 108 | 109 | return totalPrice; 110 | } 111 | 112 | String return_oids(){ 113 | 114 | String oids=""; 115 | for(int i = 0 ; i < data.size(); i++) { 116 | oids = oids + "," + data.get(i).orderid; 117 | } 118 | 119 | return oids; 120 | } 121 | 122 | @Override 123 | public int getItemCount() { 124 | return data.size(); 125 | } 126 | 127 | 128 | public static class CartItemViewHolder extends RecyclerView.ViewHolder 129 | { 130 | TextView c_itemname; 131 | TextView c_itemprice; 132 | TextView orderid; 133 | ImageButton remove; 134 | TextView qty; 135 | 136 | public CartItemViewHolder(View itemView) { 137 | super(itemView); 138 | this.c_itemname=(TextView)itemView.findViewById(R.id.c_itemname); 139 | this.c_itemprice=(TextView)itemView.findViewById(R.id.c_itemprice); 140 | this.orderid=(TextView)itemView.findViewById(R.id.orderid); 141 | this.remove=(ImageButton)itemView.findViewById(R.id.remove); 142 | this.qty=(TextView)itemView.findViewById(R.id.c_qty); 143 | 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/CartItemDataModel.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | import java.util.ArrayList; 7 | 8 | public class CartItemDataModel { 9 | public String itemname; 10 | public String itemprice; 11 | public String orderid; 12 | public String qty; 13 | 14 | public CartItemDataModel(JSONObject object) { 15 | 16 | try 17 | { 18 | this.itemname = object.getString("itemname"); 19 | this.itemprice = object.getString("itemprice"); 20 | this.orderid =object.getString("orderid"); 21 | this.qty=object.getString("qty"); 22 | 23 | } 24 | catch (JSONException e) 25 | { 26 | e.printStackTrace(); 27 | } 28 | } 29 | 30 | //itemname and itemprice values retrieval from JSON Array.. 31 | public static ArrayList fromJson(JSONArray jsonObjects) 32 | { 33 | ArrayList cartitems = new ArrayList(); 34 | for (int i = 0; i < jsonObjects.length(); i++) 35 | { 36 | try 37 | { 38 | cartitems.add(new CartItemDataModel(jsonObjects.getJSONObject(i))); 39 | } 40 | catch (JSONException e) 41 | { 42 | e.printStackTrace(); 43 | } 44 | } 45 | return cartitems; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/CurrentOrderRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.preference.PreferenceManager; 8 | import android.support.annotation.NonNull; 9 | import android.support.v7.widget.RecyclerView; 10 | import android.util.Log; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.Button; 15 | import android.widget.ImageButton; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import java.math.BigInteger; 20 | import java.util.ArrayList; 21 | 22 | 23 | 24 | 25 | public class CurrentOrderRecyclerAdapter extends RecyclerView.Adapter 26 | { 27 | Context context; 28 | int total=0; 29 | ArrayList data; 30 | 31 | public CurrentOrderRecyclerAdapter(Context context,ArrayList data) { 32 | this.data = data; 33 | this.context=context; 34 | } 35 | 36 | @NonNull 37 | @Override 38 | public CurrentOrderRecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 39 | 40 | View view = LayoutInflater.from(parent.getContext()) 41 | .inflate(R.layout.currentorder_list_item, parent, false); 42 | CurrentOrderRecyclerViewHolder myViewHolder = new CurrentOrderRecyclerViewHolder(view); 43 | return myViewHolder; 44 | 45 | } 46 | public String getDefaults(String key, Context context) { 47 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 48 | return preferences.getString(key, null); 49 | } 50 | 51 | @Override 52 | public void onBindViewHolder(@NonNull CurrentOrderRecyclerViewHolder holder, int position) { 53 | TextView c_itemname = holder.c_itemname; 54 | TextView c_itemprice = holder.c_itemprice; 55 | TextView orderid = holder.orderid; 56 | TextView qty=holder.qty; 57 | 58 | 59 | 60 | final String name = data.get(position).itemname.toString(); 61 | final String price = data.get(position).itemprice.toString(); 62 | final String order_id = data.get(position).orderid.toString(); 63 | final String qty1= data.get(position).qty.toString(); 64 | c_itemname.setText(name); 65 | c_itemprice.setText(price); 66 | orderid.setText(order_id); 67 | qty.setText(qty1); 68 | 69 | int intprice = Integer.parseInt(price); 70 | int intprice1 = Integer.parseInt(price); 71 | total = total + intprice; 72 | } 73 | 74 | // int grandTotal(){ 75 | // 76 | // int totalPrice = 0; 77 | // for(int i = 0 ; i < data.size(); i++) { 78 | // totalPrice += Integer.parseInt(data.get(i).itemprice); 79 | // } 80 | // 81 | // return totalPrice; 82 | // } 83 | int grandTotal(){ 84 | 85 | int totalPrice = 0; 86 | for(int i = 0 ; i < data.size(); i++) { 87 | int qty=Integer.parseInt(data.get(i).qty); 88 | totalPrice += Integer.parseInt(data.get(i).itemprice)*qty; 89 | } 90 | 91 | return totalPrice; 92 | } 93 | 94 | String return_oids(){ 95 | 96 | String oids=""; 97 | for(int i = 0 ; i < data.size(); i++) { 98 | oids = oids + "," + data.get(i).orderid; 99 | } 100 | 101 | return oids; 102 | } 103 | 104 | @Override 105 | public int getItemCount() { 106 | return data.size(); 107 | } 108 | 109 | 110 | public static class CurrentOrderRecyclerViewHolder extends RecyclerView.ViewHolder 111 | { 112 | TextView c_itemname; 113 | TextView c_itemprice; 114 | TextView orderid; 115 | TextView qty; 116 | 117 | 118 | public CurrentOrderRecyclerViewHolder(View itemView) { 119 | super(itemView); 120 | this.c_itemname=(TextView)itemView.findViewById(R.id.itemname); 121 | this.c_itemprice=(TextView)itemView.findViewById(R.id.itemprice); 122 | this.orderid=(TextView)itemView.findViewById(R.id.orderid); 123 | this.qty=(TextView)itemView.findViewById(R.id.quantity); 124 | 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/HttpHandler.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.BufferedInputStream; 6 | import java.io.BufferedReader; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.InputStreamReader; 10 | import java.net.HttpURLConnection; 11 | import java.net.MalformedURLException; 12 | import java.net.ProtocolException; 13 | import java.net.URL; 14 | 15 | 16 | public class HttpHandler { 17 | 18 | private static final String TAG = HttpHandler.class.getSimpleName(); 19 | 20 | public HttpHandler() { 21 | } 22 | 23 | public String makeServiceCall(String reqUrl) { 24 | String response = null; 25 | try { 26 | URL url = new URL(reqUrl); 27 | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 28 | conn.setRequestMethod("GET"); 29 | // read the response 30 | InputStream in = new BufferedInputStream(conn.getInputStream()); 31 | response = convertStreamToString(in); 32 | } catch (MalformedURLException e) { 33 | Log.e(TAG, "MalformedURLException: " + e.getMessage()); 34 | } catch (ProtocolException e) { 35 | Log.e(TAG, "ProtocolException: " + e.getMessage()); 36 | } catch (IOException e) { 37 | Log.e(TAG, "IOException: " + e.getMessage()); 38 | } catch (Exception e) { 39 | Log.e(TAG, "Exception: " + e.getMessage()); 40 | } 41 | return response; 42 | } 43 | 44 | private String convertStreamToString(InputStream is) { 45 | BufferedReader reader = new BufferedReader(new InputStreamReader(is)); 46 | StringBuilder sb = new StringBuilder(); 47 | 48 | String line; 49 | try { 50 | while ((line = reader.readLine()) != null) { 51 | sb.append(line).append('\n'); 52 | } 53 | } catch (IOException e) { 54 | e.printStackTrace(); 55 | } finally { 56 | try { 57 | is.close(); 58 | } catch (IOException e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | return sb.toString(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/MenuItemDataModel.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | import java.util.ArrayList; 7 | 8 | public class MenuItemDataModel { 9 | public String itemname; 10 | public String itemprice; 11 | 12 | public MenuItemDataModel(JSONObject object) { 13 | 14 | try 15 | { 16 | this.itemname = object.getString("itemname"); 17 | this.itemprice = object.getString("itemprice"); 18 | } 19 | catch (JSONException e) 20 | { 21 | e.printStackTrace(); 22 | } 23 | } 24 | 25 | //itemname and itemprice values retrieval from JSON Array.. 26 | public static ArrayList fromJson(JSONArray jsonObjects) 27 | { 28 | ArrayList menuitems = new ArrayList(); 29 | for (int i = 0; i < jsonObjects.length(); i++) 30 | { 31 | try 32 | { 33 | menuitems.add(new MenuItemDataModel(jsonObjects.getJSONObject(i))); 34 | } 35 | catch (JSONException e) 36 | { 37 | e.printStackTrace(); 38 | } 39 | } 40 | return menuitems; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/OrderHistoryDataModel.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | import java.util.ArrayList; 7 | 8 | public class OrderHistoryDataModel { 9 | public String orderid1; 10 | public String desc; 11 | public String total1; 12 | public String status; 13 | 14 | public OrderHistoryDataModel(JSONObject obj) { 15 | try 16 | { 17 | this.orderid1 = obj.getString("orderid"); 18 | this.desc = obj.getString("desc"); 19 | this.total1=obj.getString("total"); 20 | this.status=obj.getString("status"); 21 | } 22 | catch (JSONException e) 23 | { 24 | e.printStackTrace(); 25 | } 26 | } 27 | 28 | public static ArrayList fromJson(JSONArray jsonObjects) 29 | { 30 | ArrayList orderitems = new ArrayList(); 31 | for (int i = 0; i < jsonObjects.length(); i++) 32 | { 33 | try 34 | { 35 | orderitems.add(new OrderHistoryDataModel(jsonObjects.getJSONObject(i))); 36 | } 37 | catch (JSONException e) 38 | { 39 | e.printStackTrace(); 40 | } 41 | } 42 | return orderitems; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/OrderHistoryRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.preference.PreferenceManager; 8 | import android.support.annotation.NonNull; 9 | import android.support.v7.widget.RecyclerView; 10 | import android.util.Log; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.Button; 15 | import android.widget.ImageButton; 16 | import android.widget.TextView; 17 | import android.widget.Toast; 18 | 19 | import java.math.BigInteger; 20 | import java.util.ArrayList; 21 | 22 | public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter 23 | { 24 | Context context; 25 | ArrayList data; 26 | 27 | public OrderHistoryRecyclerAdapter(Context context,ArrayList data) { 28 | this.data = data; 29 | this.context=context; 30 | } 31 | 32 | @NonNull 33 | @Override 34 | public OrderHistoryRecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 35 | 36 | View view = LayoutInflater.from(parent.getContext()) 37 | .inflate(R.layout.orderhistory_list_item, parent, false); 38 | OrderHistoryRecyclerViewHolder myViewHolder = new OrderHistoryRecyclerViewHolder(view); 39 | return myViewHolder; 40 | 41 | } 42 | public String getDefaults(String key, Context context) { 43 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 44 | return preferences.getString(key, null); 45 | } 46 | 47 | 48 | @Override 49 | public void onBindViewHolder(@NonNull OrderHistoryRecyclerViewHolder holder, int position) { 50 | TextView orderid1=holder.orderid; 51 | TextView desc=holder.desc; 52 | TextView total1=holder.total; 53 | TextView status1=holder.status; 54 | 55 | final String orderid2 = data.get(position).orderid1.toString(); 56 | final String desc2= data.get(position).desc.toString(); 57 | final String total2 = data.get(position).total1.toString(); 58 | final String status= data.get(position).status.toString(); 59 | orderid1.setText(orderid2); 60 | desc.setText(desc2); 61 | total1.setText(total2); 62 | status1.setText(status); 63 | 64 | } 65 | 66 | @Override 67 | public int getItemCount() { 68 | return data.size(); 69 | } 70 | 71 | 72 | public static class OrderHistoryRecyclerViewHolder extends RecyclerView.ViewHolder 73 | { 74 | TextView orderid; 75 | TextView desc; 76 | TextView total; 77 | TextView status; 78 | 79 | 80 | public OrderHistoryRecyclerViewHolder(View itemView) { 81 | super(itemView); 82 | this.orderid=(TextView)itemView.findViewById(R.id.orderid); 83 | this.desc=(TextView)itemView.findViewById(R.id.desc); 84 | this.total=(TextView)itemView.findViewById(R.id.total); 85 | this.status=(TextView)itemView.findViewById(R.id.status); 86 | 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/java/com/example/manitejagande/foodorder/ProfileActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.manitejagande.foodorder; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.ProgressDialog; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.SharedPreferences; 8 | import android.net.Uri; 9 | import android.os.AsyncTask; 10 | import android.os.Build; 11 | import android.os.Bundle; 12 | import android.os.StrictMode; 13 | import android.preference.PreferenceManager; 14 | import android.support.annotation.RequiresApi; 15 | import android.support.design.widget.FloatingActionButton; 16 | import android.support.design.widget.Snackbar; 17 | import android.view.View; 18 | import android.support.design.widget.NavigationView; 19 | import android.support.v4.view.GravityCompat; 20 | import android.support.v4.widget.DrawerLayout; 21 | import android.support.v7.app.ActionBarDrawerToggle; 22 | import android.support.v7.app.AppCompatActivity; 23 | import android.support.v7.widget.Toolbar; 24 | import android.view.Menu; 25 | import android.view.MenuItem; 26 | import android.widget.EditText; 27 | import android.widget.TextView; 28 | import android.widget.Toast; 29 | 30 | import org.json.JSONArray; 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | import java.io.BufferedReader; 35 | import java.io.BufferedWriter; 36 | import java.io.IOException; 37 | import java.io.InputStream; 38 | import java.io.InputStreamReader; 39 | import java.io.OutputStream; 40 | import java.io.OutputStreamWriter; 41 | import java.net.HttpURLConnection; 42 | import java.net.MalformedURLException; 43 | import java.net.URL; 44 | import java.text.BreakIterator; 45 | 46 | public class ProfileActivity extends AppCompatActivity { 47 | public static final int CONNECTION_TIMEOUT=10000; 48 | public static final int READ_TIMEOUT=15000; 49 | public static TextView u1; 50 | public static TextView e1; 51 | public static TextView r1; 52 | public static TextView p1; 53 | 54 | @TargetApi(Build.VERSION_CODES.KITKAT) 55 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) 56 | protected void onCreate(Bundle savedInstanceState) { 57 | super.onCreate(savedInstanceState); 58 | setContentView(R.layout.activity_profile1); 59 | // if (android.os.Build.VERSION.SDK_INT > 9) { 60 | // StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); 61 | // StrictMode.setThreadPolicy(policy); 62 | // } 63 | 64 | u1=(TextView)findViewById(R.id.u1); 65 | e1=(TextView)findViewById(R.id.e1); 66 | r1=(TextView)findViewById(R.id.r1); 67 | p1=(TextView)findViewById(R.id.p1); 68 | e1.setText(MainActivity.getDefaults("userid",this)); 69 | /* HttpURLConnection conn; 70 | URL url = null; 71 | StringBuilder result=null; 72 | 73 | 74 | String user = getDefaults("user",this); 75 | 76 | 77 | try { 78 | url = new URL("https://inamtginamtg.000webhostapp.com/getuserid.php"); 79 | conn = (HttpURLConnection)url.openConnection(); 80 | conn.setReadTimeout(READ_TIMEOUT); 81 | conn.setConnectTimeout(CONNECTION_TIMEOUT); 82 | conn.setRequestMethod("POST"); 83 | conn.setDoInput(true); 84 | conn.setDoOutput(true); 85 | Uri.Builder builder = new Uri.Builder() 86 | .appendQueryParameter("email", user); 87 | String query = builder.build().getEncodedQuery(); 88 | 89 | // Open connection for sending data 90 | OutputStream os = conn.getOutputStream(); 91 | BufferedWriter writer = new BufferedWriter( 92 | new OutputStreamWriter(os, "UTF-8")); 93 | writer.write(query); 94 | writer.flush(); 95 | writer.close(); 96 | os.close(); 97 | conn.connect(); 98 | 99 | 100 | 101 | int response_code = conn.getResponseCode(); 102 | 103 | // Check if successful connection made 104 | if (response_code == HttpURLConnection.HTTP_OK) { 105 | 106 | // Read data sent from server 107 | InputStream input = conn.getInputStream(); 108 | BufferedReader reader = new BufferedReader(new InputStreamReader(input)); 109 | result = new StringBuilder(); 110 | String line; 111 | 112 | while ((line = reader.readLine()) != null) { 113 | result.append(line); 114 | } 115 | 116 | // Pass data to onPostExecute method 117 | 118 | }else{ 119 | 120 | result=new StringBuilder("unsuccessful"); 121 | } 122 | 123 | 124 | } catch (IOException e) { 125 | e.printStackTrace(); 126 | } 127 | 128 | // if(result.toString()!="unsuccessful") 129 | // { 130 | try { 131 | JSONArray arr=new JSONArray(result); 132 | for(int i=0;i { 22 | String data=""; 23 | String un=""; 24 | String em=""; 25 | String ro=""; 26 | String ph=""; 27 | ProgressDialog pdLoading; 28 | 29 | Context c=null; 30 | fetchData(Context d) 31 | { 32 | c=d; 33 | } 34 | @Override 35 | protected void onPreExecute() { 36 | super.onPreExecute(); 37 | pdLoading = new ProgressDialog(c); 38 | //this method will be running on UI thread 39 | pdLoading.setMessage("\tLoading..."); 40 | pdLoading.setCancelable(false); 41 | pdLoading.show(); 42 | 43 | } 44 | @Override 45 | protected Void doInBackground(Void... voids) { 46 | 47 | try { 48 | em=getDefaults("userid",c); 49 | //URL url=new URL("https://inamtginamtg.000webhostapp.com/getuserid.php?email="+em); 50 | URL url=new URL(LoginActivity.weburl+"getuserid.php?email="+em); 51 | HttpURLConnection httpURLConnection=(HttpURLConnection)url.openConnection(); 52 | InputStream inputStream=httpURLConnection.getInputStream(); 53 | BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(inputStream)); 54 | String line=""; 55 | while(line!=null) 56 | { 57 | line=bufferedReader.readLine(); 58 | data=data+line; 59 | } 60 | // Log.i("a1111111",data+"zxcv"); 61 | // Log.i("qwerty","asdf"); 62 | 63 | JSONObject jsonObject=new JSONObject(data); 64 | un=jsonObject.get("username").toString(); 65 | ro=jsonObject.get("dob").toString(); 66 | ph=jsonObject.get("phone").toString(); 67 | 68 | 69 | 70 | 71 | } catch (MalformedURLException e) { 72 | e.printStackTrace(); 73 | } catch (IOException e) { 74 | e.printStackTrace(); 75 | } catch (JSONException e) { 76 | e.printStackTrace(); 77 | } 78 | return null; 79 | } 80 | 81 | @Override 82 | protected void onPostExecute(Void aVoid) { 83 | 84 | pdLoading.dismiss(); 85 | super.onPostExecute(aVoid); 86 | ProfileActivity.u1.setText(this.un); 87 | ProfileActivity.r1.setText(this.ro); 88 | ProfileActivity.p1.setText(this.ph); 89 | } 90 | public static String getDefaults(String key, Context context) { 91 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 92 | return preferences.getString(key, null); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-hdpi/ic_action_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-hdpi/ic_action_cart.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-hdpi/ic_action_neworder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-hdpi/ic_action_neworder.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-hdpi/ic_action_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-hdpi/ic_action_profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-mdpi/ic_action_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-mdpi/ic_action_cart.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-mdpi/ic_action_neworder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-mdpi/ic_action_neworder.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-mdpi/ic_action_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-mdpi/ic_action_profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_cart.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_neworder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_neworder.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xhdpi/ic_action_profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxhdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxhdpi/delete.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxhdpi/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxhdpi/home.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_cart.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_neworder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_neworder.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxhdpi/ic_action_profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_cart.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_neworder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_neworder.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable-xxxhdpi/ic_action_profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/appicon.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/background_login_two.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/dots1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/dots1.gif -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/dots2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/dots2.gif -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 75 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/ic_lock_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/ic_person_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/list_item_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/list_item_background.jpg -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/loginbackground1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/loginbackground1.jpg -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/man.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/man.jpg -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/menu.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/profile.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/rightarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/rightarrow.png -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/drawable/top1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/FoodOrder/app/src/main/res/drawable/top1.jpg -------------------------------------------------------------------------------- /FoodOrder/app/src/main/res/layout-v26/activity_register.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 32 | 33 | 42 | 43 | 44 | 57 | 58 | 71 | 72 | 85 | 86 | 99 | 100 | 113 | 114 | 40 | 70 | 71 | 72 | 76 | \n"; 79 | echo "\n"; 82 | echo "\n"; 83 | exit; 84 | } ?> 85 | -------------------------------------------------------------------------------- /PHP files/foodorder/admin/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/G-Maniteja/Android-PHP-MySQL-BootStrap-FoodOrder/c019346f3e3ba460de6e7e61ef71a87c0a1ac845/PHP files/foodorder/admin/image1.jpg -------------------------------------------------------------------------------- /PHP files/foodorder/admin/index.php: -------------------------------------------------------------------------------- 1 | 2 |

3 |
4 | 6 |
7 | Invalid Login! Please enter the correct login credintials. 8 |
9 | 10 | 13 | 14 | 15 | 17 |
18 | Logout Successful! 19 |
20 | 21 | 24 | 25 | 26 |

Admin Login

27 |
28 |
29 |
30 |
31 |
Login
32 |
33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 | 41 |
42 |
43 | 46 |
47 |
48 |
49 |
50 | 52 |
53 |
54 |
55 |
56 | 57 |
58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /PHP files/foodorder/admin/login.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/associationRules.txt: -------------------------------------------------------------------------------- 1 | Palak Paneer=Roti (Two Pieces) 2 | Roti (Two Pieces)=Palak Paneer 3 | Malasa Panner=Onion Dosa 4 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/cart.php: -------------------------------------------------------------------------------- 1 | 0) 10 | { 11 | echo "insert succesfull"; 12 | } 13 | 14 | 15 | 16 | 17 | ?> -------------------------------------------------------------------------------- /PHP files/foodorder/customer/cartsuggestions.php: -------------------------------------------------------------------------------- 1 | setMaxScan(20); //Scan 2, 3, ... 21 | $Apriori->setMinSup(2); //Minimum support 1, 2, 3, ... 22 | $Apriori->setMinConf(75); //Minimum confidence - Percent 1, 2, ..., 100 23 | $Apriori->setDelimiter(','); //Delimiter 24 | 25 | $Apriori->process('dataset1.txt'); 26 | $content1=$Apriori->saveAssociationRules('associationRules.txt'); 27 | //print_r($content1); 28 | $a1=array(); 29 | $a1=explode("\n",$content1); 30 | //$a1[count($a1)]="Idly Sambar,Masala Dosa=Vada Sambar,Masala Dosa"; 31 | //print_r($a1); 32 | 33 | 34 | $email=$_REQUEST['email']; 35 | $q="select * from cart where email='$email'"; 36 | $res=mysqli_query($con,$q); 37 | $array=array(); 38 | $c=0; 39 | while($row=mysqli_fetch_assoc($res)) 40 | { 41 | $array[$c++]=$row["itemname"]; 42 | } 43 | 44 | $count=count($a1); 45 | 46 | $array1=array(); 47 | $i1=0; 48 | 49 | for($i=0;$i<$count;$i=$i+1) 50 | { 51 | $a2=array(); 52 | $a2=explode("=",$a1[$i]); 53 | 54 | $larray=array(); 55 | $rarray=array(); 56 | 57 | $larray=explode(",",$a2[0]); 58 | $rarray=explode(",",$a2[1]); 59 | $flag=0; 60 | for($j=0;$j -------------------------------------------------------------------------------- /PHP files/foodorder/customer/connection.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/currentorders.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/dataset1.txt: -------------------------------------------------------------------------------- 1 | Roti (Single Piece),Roti (Two Pieces) 2 | Idly Sambar,Roti (Single Piece),Idly Sambar 3 | Roti (Two Pieces),Palak Paneer,Masala Dosa,Vada Sambar 4 | Onion Dosa 5 | Masala Dosa,Idly Sambar 6 | Idly Sambar,Masala Dosa,Vada Sambar,Masala Dosa,Vada Sambar,Onion Dosa,Idly Sambar 7 | Roti (Two Pieces),Palak Paneer 8 | Roti (Two Pieces),Palak Paneer 9 | Roti (Two Pieces),Palak Paneer 10 | Palak Paneer,Roti (Two Pieces) 11 | Palak Paneer,Roti (Two Pieces) 12 | Palak Paneer 13 | Palak Paneer 14 | Idly Sambar,Roti (Two Pieces),Pa 15 | Idly Sambar,Masala Dosa, 16 | Malasa Panner,Onion Dosa 17 | Malasa Panner,Onion Dosa 18 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/displaycurrentorders.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/example.php: -------------------------------------------------------------------------------- 1 | 2 | setMaxScan(20); //Scan 2, 3, ... 22 | $Apriori->setMinSup(2); //Minimum support 1, 2, 3, ... 23 | $Apriori->setMinConf(75); //Minimum confidence - Percent 1, 2, ..., 100 24 | $Apriori->setDelimiter(','); //Delimiter 25 | 26 | 27 | /* 28 | Use Array: 29 | $dataset = array(); 30 | $dataset[] = array('A', 'B', 'C', 'D'); 31 | $dataset[] = array('A', 'D', 'C'); 32 | $dataset[] = array('B', 'C'); 33 | $dataset[] = array('A', 'E', 'C'); 34 | $Apriori->process($dataset); 35 | */ 36 | $Apriori->process('dataset1.txt'); 37 | 38 | //Frequent Itemsets 39 | echo '

Frequent Itemsets

'; 40 | $Apriori->printFreqItemsets(); 41 | 42 | echo '

Frequent Itemsets Array

'; 43 | print_r($Apriori->getFreqItemsets()); 44 | 45 | //Association Rules 46 | echo '

Association Rules

'; 47 | $Apriori->printAssociationRules(); 48 | 49 | echo '

Association Rules Array

'; 50 | print_r($Apriori->getAssociationRules()); 51 | 52 | //Save to file 53 | $Apriori->saveFreqItemsets('freqItemsets.txt'); 54 | $Apriori->saveAssociationRules('associationRules.txt'); 55 | ?> -------------------------------------------------------------------------------- /PHP files/foodorder/customer/freqItemsets.txt: -------------------------------------------------------------------------------- 1 | Roti (Two Pieces),Palak Paneer 2 | Idly Sambar,Masala Dosa 3 | Masala Dosa,Vada Sambar 4 | Onion Dosa,Malasa Panner 5 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/get_suggested.php: -------------------------------------------------------------------------------- 1 | setMaxScan(20); //Scan 2, 3, ... 21 | $Apriori->setMinSup(2); //Minimum support 1, 2, 3, ... 22 | $Apriori->setMinConf(75); //Minimum confidence - Percent 1, 2, ..., 100 23 | $Apriori->setDelimiter(','); //Delimiter 24 | 25 | $Apriori->process('dataset1.txt'); 26 | 27 | //Frequent Itemsets 28 | //echo '

Frequent Itemsets

'; 29 | //$Apriori->printFreqItemsets(); 30 | 31 | // echo '

Frequent Itemsets Array

'; 32 | // print_r($Apriori->getFreqItemsets()); 33 | // 34 | // //Association Rules 35 | // //echo '

Association Rules

'; 36 | // //$Apriori->printAssociationRules(); 37 | // 38 | // echo '

Association Rules Array

'; 39 | // print_r($Apriori->getAssociationRules()); 40 | 41 | //Save to file 42 | $arr=$Apriori->saveFreqItemsets('freqItemsets.txt'); 43 | $Apriori->saveAssociationRules('associationRules.txt'); 44 | 45 | // print_r($arr); 46 | //for($i=0;$i"; 49 | //} 50 | 51 | 52 | 53 | 54 | $itemids=array(); 55 | $itemids_pointer=0; 56 | 57 | $itemnames=array(); 58 | $itemnames_pointer=0; 59 | 60 | $itemprice=array(); 61 | $itemprice_pointer=0; 62 | 63 | 64 | for($p1=0;$p1 112 | 113 | 127 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/getuserid.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/login.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/menu.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/orderhistory.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/register.php: -------------------------------------------------------------------------------- 1 | 0) 11 | { 12 | echo "successful"; 13 | } 14 | else 15 | { 16 | echo "unsuccessful"; 17 | } 18 | 19 | ?> -------------------------------------------------------------------------------- /PHP files/foodorder/customer/removecart.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/saveData.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP files/foodorder/customer/showcart.php: -------------------------------------------------------------------------------- 1 |