DAFTAR PUSTAKA
Nofriansyah, S.Kom., M.Kom., D. (2014). Konsep Data Mining Vs Sistem Pendukung Keputusan. Yogyakarta: Deepublish. Basyaib, F. (2006). Teori Pembuatan Keputusan. Jakarta: Grasindo. Fatta, H. A. (2007). Analisis & Perancangan Sistem Informasi untuk Keunggulan Bersaing Perusahaan & Organisasi Modern. Yogyakarta: ANDI OFFSET. Hamdi, A. S., & Bahruddin, E. (2014). Metode Penelitian Kuantitatif Aplikasi dalam Pendidikan. Yogyakarta: Deepublish. Pressman, Ph.D., R. S. (2012). Rekayasa Perangkat Lunak (Pendekatan Praktisi). Yogyakarta: Andi Publisher. Prof.Dr.Ir Marimin, M. (2004). Teknik dan Aplikasi Pengambilan Keputusan Kriteria Majemuk. Jakarta: Grasindo. Rosmawanti, N., & Bahar. (2014). Penentuan Skala Prioritas Berbasis Algoritma AHP. 962. Salbino, S. (2014). Buku Pintar Gadget Android untuk Pemula: untuk pemula. Jakarta: Kunci Komunikasi. Simarmata, J. (2010). Rekayasa Perangkat Lunak. Yogyakarta: ANDI OFFSET. Sommerville, I. (2003). Software Engineering (Rekayasa Perangkat Lunak). Jakarta: Erlangga. Supriyanto. (2010). Pemrograman Database Menggunakan Java dan MySQL untuk Pemula. Jakarta: Mediakita. Syafaruddin. (2004). Sistem Pengambilan Keputusan Pendidikan. Jakarta: Grasindo. Tim Visi Yustisia. (2015). Undang-undang Nomor 13 Tahun 2003 Tentang Ketenagakerjaan. Jakarta: VisiMedia Pustaka.
http://digilib.mercubuana.ac.id/
Lampiran Source Code
http://digilib.mercubuana.ac.id/
package com.example.simulatorgaji; import import import import import import import
android.support.v7.app.ActionBarActivity; android.os.Bundle; android.view.Menu; android.content.Intent; android.content.res.Configuration; android.os.Handler; android.view.Window;
public class Splash extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_splash); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { public void run() { // berpindah kemenu utama setelah 3 detik startActivity(new Intent(getBaseContext(), LoginActivity.class)); } }, 3000L); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.splash, menu); return true; } public void onConfigurationChanged(Configuration newConfig) { // Manages auto rotation for the Splash Screen Layout super.onConfigurationChanged(newConfig); setContentView(R.layout.activity_splash); } }
http://digilib.mercubuana.ac.id/
tools:context="com.example.simulatorgaji.LoginActivity" > <ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="16dp" >
<EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="17dp" android:layout_marginLeft="30dp" android:layout_marginTop="20dp" android:ems="10" android:hint="Masukan NIK" android:textColor="#7C7C7C" /> <EditText android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="30dp" android:ems="10" android:hint="Masukan Password" android:inputType="textPassword" android:textColor="#7C7C7C" > <requestFocus /> <Button android:id="@+id/buttonlogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="50dp" android:layout_marginLeft="105dp" android:layout_marginTop="10dp" android:text="Login" />
http://digilib.mercubuana.ac.id/
package com.example.simulatorgaji; import import import import import import import import import import
android.app.Activity; android.content.Intent; android.os.Bundle; android.view.View; android.widget.Button; android.widget.EditText; android.widget.Toast; android.os.AsyncTask; android.app.ProgressDialog; android.util.Log;
import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONObject; public class LoginActivity extends Activity { EditText editText1, editText2; Button buttonLogin; Intent a; String url, success; SessionManager session;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); session = new SessionManager(getApplicationContext()); buttonLogin = (Button) findViewById(R.id.buttonlogin); editText1 = (EditText) findViewById(R.id.editText1); editText2 = (EditText) findViewById(R.id.editText2);
buttonLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { url = "http://mugiono.pe.hu/login.php?" + "NIK="+ editText1.getText().toString() + "&Password="+ editText2.getText().toString(); if (editText1.getText().toString().trim().length() > 0 && editText2.getText().toString().trim().length() > 0) { new Masuk().execute(); } else { Toast.makeText(getApplicationContext(), "Username/password masih kosong.!!", Toast.LENGTH_LONG).show();
http://digilib.mercubuana.ac.id/
} } }); } public class Masuk extends AsyncTask<String, String, String> { ArrayList
> contactList = new ArrayList>(); ProgressDialog pDialog; @Override protected void onPreExecute() { // TODO Auto-generated method stub super.onPreExecute(); pDialog = new ProgressDialog(LoginActivity.this); pDialog.setMessage("Tunggu Bentar ya..."); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } @Override protected String doInBackground(String... arg0) { JSONParser jParser = new JSONParser(); JSONObject json = jParser.getJSONFromUrl(url); try { success = json.getString("success"); Log.e("error", "nilai sukses=" + success); JSONArray hasil = json.getJSONArray("mugiono"); if (success.equals("1")) { for (int i = 0; i < hasil.length(); i++) { JSONObject c = hasil.getJSONObject(i); String NIK = c.getString("NIK").trim(); String Password = c.getString("Password").trim(); String Nama = c.getString("Nama").trim(); String Alamat = c.getString("Alamat").trim(); String TTL = c.getString("TTL").trim(); String Masuk = c.getString("Masuk").trim(); String Status = c.getString("Status").trim(); String Alpha = c.getString("Alpha").trim(); String Sakit = c.getString("Sakit").trim(); String Izin = c.getString("Izin").trim(); String Terlambat = c.getString("Terlambat").trim(); String Gaji = c.getString("Gaji").trim(); String Tunjangan = c.getString("Tunjangan").trim();
http://digilib.mercubuana.ac.id/
String UM = c.getString("UM").trim(); String Pot = c.getString("Pot").trim(); String Gaber = c.getString("Gaber").trim(); String Foto = c.getString("Foto").trim(); session.createLoginSession(NIK, Password, Nama, Alamat, TTL, Masuk, Status, Alpha, Sakit, Izin, Terlambat, Gaji, Tunjangan, UM, Pot, Gaber, Foto); Log.e("ok", " ambil data"); } } else { Log.e("error", "tidak bisa ambil data 0"); } } catch (Exception e) { // TODO: handle exception Log.e("error", "tidak bisa ambil data 1"); } return null; } @Override protected void onPostExecute(String result) { // TODO Auto-generated method stub super.onPostExecute(result); pDialog.dismiss(); if (success.equals("1")) { a = new Intent(LoginActivity.this, MenuUtamaActivity.class); startActivity(a); finish(); } else { Toast.makeText(getApplicationContext(), "Username/password salah!!", Toast.LENGTH_LONG).show(); } } } }
package com.example.simulatorgaji; import import import import import import
java.io.BufferedReader; java.io.IOException; java.io.InputStream; java.io.InputStreamReader; java.io.UnsupportedEncodingException; java.util.List;
http://digilib.mercubuana.ac.id/
import import import import import import import import import import import
org.apache.http.HttpEntity; org.apache.http.HttpResponse; org.apache.http.NameValuePair; org.apache.http.client.ClientProtocolException; org.apache.http.client.entity.UrlEncodedFormEntity; org.apache.http.client.methods.HttpGet; org.apache.http.client.methods.HttpPost; org.apache.http.client.utils.URLEncodedUtils; org.apache.http.impl.client.DefaultHttpClient; org.json.JSONException; org.json.JSONObject;
import android.util.Log; public class JSONParser { static InputStream is = null; static JSONObject jObj = null; static String json =""; // constructor public JSONParser() { } public JSONObject getJSONFromUrl(String url) { // Making HTTP request try { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); json = sb.toString(); } catch (Exception e) {
http://digilib.mercubuana.ac.id/
Log.e("Buffer Error", "Error converting result " + e.toString()); } // try parse the string to a JSON object try { jObj = new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jObj; } public JSONObject makeHttpRequest(String url, String method, List params) { // Making HTTP request try { // check for request method if (method == "POST") { // request method is POST // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); httpPost.setEntity(new UrlEncodedFormEntity(params)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); } else if (method == "GET") { // request method is GET DefaultHttpClient httpClient = new DefaultHttpClient(); String paramString = URLEncodedUtils.format(params, "utf-8"); url += "?" + paramString; HttpGet httpGet = new HttpGet(url); HttpResponse httpResponse = httpClient.execute(httpGet); HttpEntity httpEntity = httpResponse.getEntity(); is = httpEntity.getContent(); } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try {
http://digilib.mercubuana.ac.id/
BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); json = sb.toString(); } catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.toString()); } // try parse the string to a JSON object try { jObj = new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jObj; } }
package com.example.simulatorgaji; import java.util.HashMap; import import import import
android.annotation.SuppressLint; android.content.Context; android.content.SharedPreferences; android.content.SharedPreferences.Editor;
@SuppressLint("CommitPrefEdits") public class SessionManager { // Shared Preferences SharedPreferences pref; // Editor for Shared preferences Editor editor; // Context Context _context; // Shared pref mode int PRIVATE_MODE = 0; // nama sharepreference private static final String PREF_NAME = "Sesi"; // All Shared Preferences Keys
http://digilib.mercubuana.ac.id/
private static final String IS_LOGIN = "isLoggedIn"; public static final String KEY_NIK = "NIK"; public static final String KEY_Pass = "Password"; public static final String KEY_Nama = "Nama"; public static final String KEY_Alamat = "Alamat"; public static final String KEY_TTL = "TTL"; public static final String KEY_Masuk = "Masuk"; public static final String KEY_Status = "Status"; public static final String KEY_Alpha = "Alpha"; public static final String KEY_Sakit = "Sakit"; public static final String KEY_Izin = "Izin"; public static final String KEY_Terlambat = "Terlambat"; public static final String KEY_Gaji = "Gaji"; public static final String KEY_Tunjangan = "Tunjangan"; public static final String KEY_UM = "UM"; public static final String KEY_Pot = "Pot"; public static final String KEY_Gaber = "Gaber"; public static final String KEY_Foto = "Foto"; // Constructor public SessionManager(Context context){ this._context = context; pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE); editor = pref.edit(); } /** * Create login session * */ public void createLoginSession(String NIK, String Password, String Nama, String Alamat, String TTL, String Masuk, String Status,String Alpha, String Sakit, String Izin, String Terlambat, String Gaji, String Tunjangan, String UM, String Pot, String Gaber, String Foto) { // Storing login value as TRUE editor.putBoolean(IS_LOGIN, true); editor.putString(KEY_NIK, NIK); editor.putString(KEY_Pass, Password); editor.putString(KEY_Nama, Nama); editor.putString(KEY_Alamat, Alamat); editor.putString(KEY_TTL, TTL); editor.putString(KEY_Masuk, Masuk); editor.putString(KEY_Status, Status); editor.putString(KEY_Alpha, Alpha); editor.putString(KEY_Sakit, Sakit); editor.putString(KEY_Izin, Izin); editor.putString(KEY_Terlambat, Terlambat); editor.putString(KEY_Gaji, Gaji); editor.putString(KEY_Tunjangan, Tunjangan); editor.putString(KEY_UM, UM); editor.putString(KEY_Pot, Pot); editor.putString(KEY_Gaber, Gaber); editor.putString(KEY_Foto, Foto); editor.commit(); }
http://digilib.mercubuana.ac.id/
/** * Get stored session data * */ public HashMap<String, String> getUserDetails(){ HashMap<String, String> karyawan = new HashMap<String, String>(); karyawan.put(KEY_NIK, pref.getString(KEY_NIK, null)); karyawan.put(KEY_Pass, pref.getString(KEY_Pass, null)); karyawan.put(KEY_Nama, pref.getString(KEY_Nama, null)); karyawan.put(KEY_Foto, pref.getString(KEY_Foto, null)); karyawan.put(KEY_Alamat, pref.getString(KEY_Alamat, null)); karyawan.put(KEY_TTL, pref.getString(KEY_TTL, null)); karyawan.put(KEY_Masuk, pref.getString(KEY_Masuk, null)); karyawan.put(KEY_Status, pref.getString(KEY_Status, null)); karyawan.put(KEY_Alpha, pref.getString(KEY_Alpha, null)); karyawan.put(KEY_Sakit, pref.getString(KEY_Sakit, null)); karyawan.put(KEY_Izin, pref.getString(KEY_Izin, null)); karyawan.put(KEY_Terlambat, pref.getString(KEY_Terlambat, null)); karyawan.put(KEY_Gaji, pref.getString(KEY_Gaji, null)); karyawan.put(KEY_Tunjangan, pref.getString(KEY_Tunjangan, null)); karyawan.put(KEY_UM, pref.getString(KEY_UM, null)); karyawan.put(KEY_Pot, pref.getString(KEY_Pot, null)); karyawan.put(KEY_Gaber, pref.getString(KEY_Gaber, null)); return karyawan; } }
<Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/button1" android:layout_centerHorizontal="true" android:layout_marginTop="22dp" android:minWidth="200dip" android:text="Profil & Kinerja" /> <Button android:id="@+id/button3" android:layout_width="wrap_content"
http://digilib.mercubuana.ac.id/
android:layout_height="wrap_content" android:layout_below="@+id/button2" android:layout_centerHorizontal="true" android:layout_marginTop="23dp" android:minWidth="200dip" android:text="Simulator" /> <Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/button3" android:layout_centerHorizontal="true" android:layout_marginTop="22dp" android:minWidth="200dip" android:text="Keluar" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/button2" android:layout_alignParentTop="true" android:layout_marginTop="73dp" android:minWidth="200dip" android:text="Info Gaji" />
package com.example.simulatorgaji; import import import import import import import import
android.support.v7.app.ActionBarActivity; android.os.Bundle; android.view.Menu; android.view.View; android.widget.Button; android.content.Intent; android.view.View.OnClickListener; android.view.Window;
public class MenuUtamaActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_menu_utama); //inisialisasi tombol Button btn1 = (Button) findViewById (R.id.button1); Button btn2 = (Button) findViewById (R.id.button2); Button btn3 = (Button) findViewById (R.id.button3); Button btn4 = (Button) findViewById (R.id.button4); //set tombol info gaji btn1.setOnClickListener(new OnClickListener(){
http://digilib.mercubuana.ac.id/
@Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah1= new Intent(MenuUtamaActivity.this, InfoGajiActivity.class); startActivity(pindah1); } }); //set tombol info karyawan btn2.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah2= new Intent(MenuUtamaActivity.this, InfoKaryawanActivity.class); startActivity(pindah2); } }); //set tombol simulator btn3.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah3= new Intent(MenuUtamaActivity.this, SimulatorActivity.class); startActivity(pindah3); } }); //set tombol keluar btn4.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah4= new Intent(MenuUtamaActivity.this, LoginActivity.class); pindah4.putExtra("finish",true); pindah4.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(pindah4); finish(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_utama, menu); return true;
} }
http://digilib.mercubuana.ac.id/
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#f8f8f8" android:gravity="top" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.simulatorgaji.InfoGajiActivity" >
http://digilib.mercubuana.ac.id/
android:text="Nama Karyawan" android:textAppearance="?android:attr/textAppearance" />
http://digilib.mercubuana.ac.id/
android:layout_height="wrap_content" android:layout_marginTop="3dp" android:text="Tunjangan" android:textAppearance="?android:attr/textAppearance" />
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
package com.example.simulatorgaji; import import import import import import import import
android.support.v7.app.ActionBarActivity; android.os.Bundle; android.view.Menu; android.view.View; android.widget.Button; android.content.Intent; android.view.View.OnClickListener; android.view.Window;
public class MenuUtamaActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_menu_utama); //inisialisasi tombol Button btn1 = (Button) findViewById (R.id.button1); Button btn2 = (Button) findViewById (R.id.button2); Button btn3 = (Button) findViewById (R.id.button3); Button btn4 = (Button) findViewById (R.id.button4); //set tombol info gaji btn1.setOnClickListener(new OnClickListener(){
http://digilib.mercubuana.ac.id/
@Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah1= new Intent(MenuUtamaActivity.this, InfoGajiActivity.class); startActivity(pindah1); } }); //set tombol info karyawan btn2.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah2= new Intent(MenuUtamaActivity.this, InfoKaryawanActivity.class); startActivity(pindah2); } }); //set tombol simulator btn3.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah3= new Intent(MenuUtamaActivity.this, SimulatorActivity.class); startActivity(pindah3); } }); //set tombol keluar btn4.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub Intent pindah4= new Intent(MenuUtamaActivity.this, LoginActivity.class); pindah4.putExtra("finish",true); pindah4.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(pindah4); finish(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_utama, menu); return true;
} }
http://digilib.mercubuana.ac.id/
<ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" >
http://digilib.mercubuana.ac.id/
android:textAppearance="?android:attr/textAppearanceMedium" />
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
android:textAppearance="?android:attr/textAppearanceMedium" />
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
android:layout_height="wrap_content" android:text=":" android:textAppearance="?android:attr/textAppearanceMedium" />
http://digilib.mercubuana.ac.id/
android:textAppearance="?android:attr/textAppearanceMedium" />
http://digilib.mercubuana.ac.id/
package com.example.simulatorgaji; import import import import import import import import import import
android.support.v7.app.ActionBarActivity; android.graphics.Bitmap; android.graphics.Color; android.os.Bundle; android.util.TypedValue; android.view.Menu; android.widget.TextView; android.widget.ImageView; android.view.Window; java.util.HashMap;
public class InfoKaryawanActivity extends ActionBarActivity { SessionManager session; TextView textView23, textView24, textView25, textView26, textView27, textView28, textView29, textView30, textView31, textView32, textView33; ImageView imageView1; String nik, nama, alamat, ttl, masuk, status, alpha, sakit, izin, tlt, knj, foto; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_info_karyawan); session = new SessionManager(getApplicationContext()); HashMap<String, String> karyawan = session.getUserDetails(); nik = karyawan.get(SessionManager.KEY_NIK); nama = karyawan.get(SessionManager.KEY_Nama); alamat = karyawan.get(SessionManager.KEY_Alamat); ttl = karyawan.get(SessionManager.KEY_TTL); masuk = karyawan.get(SessionManager.KEY_Masuk); status = karyawan.get(SessionManager.KEY_Status); alpha = karyawan.get(SessionManager.KEY_Alpha); sakit = karyawan.get(SessionManager.KEY_Sakit); izin = karyawan.get(SessionManager.KEY_Izin); tlt = karyawan.get(SessionManager.KEY_Terlambat); foto = karyawan.get(SessionManager.KEY_Foto); TextView textView23 = (TextView) textView23.setText(nik); TextView textView24 = (TextView) textView24.setText(nama); TextView textView25 = (TextView) textView25.setText(alamat); TextView textView26 = (TextView) textView26.setText(ttl); TextView textView27 = (TextView) textView27.setText(masuk); TextView textView28 = (TextView) textView28.setText(status); TextView textView29 = (TextView)
findViewById(R.id.textView23); findViewById(R.id.textView24); findViewById(R.id.textView25); findViewById(R.id.textView26); findViewById(R.id.textView27); findViewById(R.id.textView28); findViewById(R.id.textView29);
http://digilib.mercubuana.ac.id/
textView29.setText(sakit); TextView textView30 = (TextView) findViewById(R.id.textView30); textView30.setText(izin); TextView textView31 = (TextView) findViewById(R.id.textView31); textView31.setText(alpha); TextView textView32 = (TextView) findViewById(R.id.textView32); textView32.setText(tlt); ImageView imageView1 = (ImageView) findViewById(R.id.imageView1); Bitmap bmp = LoadImage(foto); imageView1.setImageBitmap(bmp); double knj = (Double.parseDouble(sakit)* 0.19484127) + (Double.parseDouble(izin)*0.149206349) + (Double.parseDouble(alpha)* 0.425396825 ) + (Double.parseDouble(tlt)*0.230555556); if(knj > 0.80515873){ TextView textView33 = (TextView) findViewById(R.id.textView33); textView33.setText("Buruk"); textView33.setTextSize(TypedValue.COMPLEX_UNIT_SP, 25); textView33.setTextColor(Color.rgb(255, 0, 0)); } else if (knj <= 0.70515873){ TextView textView33 = (TextView) findViewById(R.id.textView33); textView33.setText("Baik"); textView33.setTextSize(TypedValue.COMPLEX_UNIT_SP, 25); textView33.setTextColor(Color.rgb(0, 255, 0)); } else if (knj <= 0.80515873) { TextView textView33 = (TextView) findViewById(R.id.textView33); textView33.setText("Dalam Pengawasan"); textView33.setTextSize(TypedValue.COMPLEX_UNIT_SP, 25); textView33.setTextColor(Color.rgb(255, 255, 0)); } } private Bitmap LoadImage(String foto2) { // TODO Auto-generated method stub return null; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.info_karyawan, menu); return true; } }
http://digilib.mercubuana.ac.id/
android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:background="#f8f8f8" tools:context="com.example.simulatorgaji.SimulatorActivity" > <ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" >
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
android:textAppearance="?android:attr/textAppearanceSmall" /> <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView2" android:layout_toRightOf="@+id/textView17" android:ems="10" android:inputType="number" > <requestFocus /> <EditText android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView3" android:layout_alignParentRight="true"
http://digilib.mercubuana.ac.id/
android:layout_below="@+id/editText1" android:layout_toRightOf="@+id/textView10" android:inputType="number" android:ems="10" /> <EditText android:id="@+id/editText3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView4" android:layout_alignLeft="@+id/editText2" android:layout_alignParentRight="true" android:layout_below="@+id/editText2" android:inputType="number" android:ems="10" /> <EditText android:id="@+id/editText4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/textView12" android:layout_alignLeft="@+id/editText3" android:layout_alignParentRight="true" android:layout_below="@+id/textView3" android:inputType="number" android:ems="10" /> <EditText android:id="@+id/editText5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView6" android:layout_alignLeft="@+id/editText4" android:layout_alignParentRight="true" android:layout_below="@+id/textView12" android:inputType="number" android:ems="10" /> <EditText android:id="@+id/editText6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView7" android:layout_alignLeft="@+id/editText5" android:layout_alignParentRight="true" android:layout_below="@+id/textView5" android:inputType="number" android:ems="10" /> <EditText android:id="@+id/editText7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/textView15" android:layout_alignLeft="@+id/editText6" android:layout_alignParentRight="true" android:layout_below="@+id/textView14"
http://digilib.mercubuana.ac.id/
android:inputType="number" android:ems="10" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView8" android:layout_alignLeft="@+id/textView6" android:onClick="Hapus" android:text="HAPUS" />
http://digilib.mercubuana.ac.id/
android:id="@+id/textView22" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView19" android:layout_alignBottom="@+id/textView19" android:layout_alignLeft="@+id/editText1" android:text=":" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView7" android:layout_marginTop="29dp" android:layout_toRightOf="@+id/textView7" android:onClick="Hitung" android:text="HITUNG" />
http://digilib.mercubuana.ac.id/
android:text="*jam lembur tidak boleh kurang dari hari kerja" android:textSize="10dp" android:textAppearance="?android:attr/textAppearanceSmall" /> package com.example.simulatorgaji; import import import import import import import import import
android.support.v7.app.ActionBarActivity; android.os.Bundle; android.view.Menu; android.view.View; android.widget.EditText; android.widget.Toast; java.text.DecimalFormat; android.widget.TextView; android.view.Window;
public class SimulatorActivity extends ActionBarActivity { EditText editText1, editText2, editText3, editText4, editText5, editText6, editText7; TextView TextView19, TextView20, TextView21;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_simulator); editText1 = (EditText) findViewById(R.id.editText1); editText2 = (EditText) findViewById(R.id.editText2); editText3 = (EditText) findViewById(R.id.editText3); editText4 = (EditText) findViewById(R.id.editText4); editText5 = (EditText) findViewById(R.id.editText5); editText6 = (EditText) findViewById(R.id.editText6); editText7 = (EditText) findViewById(R.id.editText7); TextView19 = (TextView) findViewById(R.id.textView19); TextView20 = (TextView) findViewById(R.id.textView20); TextView21 = (TextView) findViewById(R.id.textView21); } public void Hitung(View view) { if((editText1.getText().toString().equalsIgnoreCase("")) || ((editText3.getText().toString()).equalsIgnoreCase("")) || ((editText5.getText().toString()).equalsIgnoreCase("")) || ((editText6.getText().toString()).equalsIgnoreCase("")) || ((editText7.getText().toString()).equalsIgnoreCase(""))) {
http://digilib.mercubuana.ac.id/
Toast.makeText(getApplicationContext(), "Kolom tidak boleh kosong.!!", Toast.LENGTH_LONG).show(); } else { Double a = Double.parseDouble(editText1.getText().toString()); Double b = Double.parseDouble(editText3.getText().toString()); Double d = Double.parseDouble(editText5.getText().toString()); Double e = Double.parseDouble(editText6.getText().toString()); Double f = Double.parseDouble(editText7.getText().toString()); double harian = a/173; double lembur = (b*1.5*harian)+((db)*2*harian)+(e*2*harian); double pot = f * (a/30); double gaber = (a + lembur) - pot; DecimalFormat df = new DecimalFormat("@@##"); TextView19.setText("Rp. " + df.format(lembur)); TextView20.setText("Rp. " + df.format(pot)); TextView21.setText("Rp. " + df.format(gaber)); } }
public void Hapus(View view) { editText1.setText(""); editText2.setText(""); editText3.setText(""); editText4.setText(""); editText5.setText(""); editText6.setText(""); editText7.setText(""); TextView19.setText(""); TextView20.setText(""); TextView21.setText(""); }
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.simulator, menu); return true; } }
http://digilib.mercubuana.ac.id/