Skip to content

Instantly share code, notes, and snippets.

View kalvian1060's full-sized avatar

kalvian1060 kalvian1060

View GitHub Profile
<?php
include "../koneksi.php";
$fullname = $_POST['fullname'];
$username = $_POST['username'];
$password = $_POST['password'];
$sql ="INSERT INTO user VALUES (null,'$fullname','$username','$password')";
$query=mysql_query($sql);
$result = mysql_num_rows($query);
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
GetDataHistory data = getDataHistory.get(position);
holder.setData(data);
}
public void setData(GetDataHistory data){
holder.ID.setText(data.getID());
holder.IDSpace.setText(data.getIdSpace());
holder.IDCompany.setText(data.getIdCompany());
holder.EmailUser.setText(data.getEmailUser());
holder.Name.setText(data.getName());
holder.Company.setText(data.getCompany());
holder.Location.setText(data.getLocation());
holder.LocationUrl.setText(data.getLocationUrl());
holder.Facility.setText(data.getFacility());
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btnLoadData"
android:layout_width="match_parent"
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
//retrofit
compile 'com.squareup.retrofit2:retrofit:2.3.0'
//butterknife
compile 'com.jakewharton:butterknife:8.6.0'
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="id.kalviansofian.belajarretrofitbasic">
<!-- permision intenet -->
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
public static ClientResponse SendEmailGun(String to) {
WebResource webresource = null;
MultivaluedMapImpl formData = new MultivaluedMapImpl();
try {
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter("api", MAILGUN_API_KEY));
webresource = client.resource(MAILGUN_HOST + "/messages");
formData.add("from", "Excited User <[email protected]> ");
formData.add("to", to);
formData.add("subject", "Struk Belanja Anda");
<?
include"koneksi.php";
$id = $_GET['id'];
$q = "select * from user where No = $id";
$h = mysql_query($q);
$row=mysql_fetch_array($h);
?>
<form method=post action=prosesedit.php>
<input type=hidden name="id" value="<?echo $row['No'];?>">
<table width="200" border="1">
for (int i = 0; i < data.length(); i++) {
JSONObject getData = data.getJSONObject(i);
int location_id = getData.getInt("location_id");
int product_id = getData.getInt("product_id");
int qty = getData.getInt("sum");
stock_quant dataStok = new stock_quant(qty, product_id, location_id);
dataStok.save();
@kalvian1060
kalvian1060 / MainActivity.java
Created May 20, 2017 08:54
Hasil Akhir MainActivity
package id.kalviansofian.belajarfragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;