This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'db_con.php'; | |
$idbarang = $_GET['id_barang']; //mendapatkan informasi id barang dari file index.php | |
//melakukan query pada tabel penjualan sesaui dengan informasi id barang yang didapat dari metode GET | |
$sql = "select * from penjualan where id_barang = '".$idbarang."' "; | |
$query = mysql_query($sql); | |
//membuat kolom pada tabel | |
$tabel = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try{ | |
$conn = mysql_connect("localhost","root",""); //isikan sesuai dengan alamat server,username, dan password | |
mysql_select_db("gchart",$conn); | |
} | |
catch(Exception $e) | |
{ | |
echo $e->getMessage("koneksi gagal"); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//memanggil db_con.php untuk melakukan koneksi ke database | |
include "db_con.php"; | |
?> | |
<html> | |
<head> | |
<title>Laporan Penjualan</title> | |
</head> | |
<body> | |
<h1>Laporan Penjualan</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="4dp" | |
tools:context=".MainActivity"> | |
<WebView | |
android:id="@+id/webView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Define URL | |
private static final String URL = "http://updatesepati.blogspot.com/"; | |
//Define WebView | |
private WebView webView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
webView = (WebView)findViewById(R.id.webView); //get webView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event) { | |
if(keyCode == KeyEvent.KEYCODE_BACK && webView.canGoBack()) { | |
//back to previous url | |
webView.goBack(); | |
return true; | |
} | |
return super.onKeyDown(keyCode, event); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> | |
<item android:id="@+id/action_exit" | |
android:title="@string/action_exit" | |
android:orderInCategory="100" | |
app:showAsAction="never" /> | |
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.menu_main, menu); | |
return true; | |
} | |
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
int id = item.getItemId(); | |
if (id == R.id.action_exit) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.webview; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.KeyEvent; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.webkit.WebSettings; | |
import android.webkit.WebView; | |
import android.webkit.WebViewClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.webview" > | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
OlderNewer