Skip to content

Commit

Permalink
Android Studio / PHP / JSON / Application
Browse files Browse the repository at this point in the history
  • Loading branch information
KwonDeockHo committed Jan 8, 2019
0 parents commit 4d2c9b1
Show file tree
Hide file tree
Showing 169 changed files with 12,917 additions and 0 deletions.
Binary file added FTP(PHP Data)/kiki_/.DS_Store
Binary file not shown.
46 changes: 46 additions & 0 deletions FTP(PHP Data)/kiki_/check_email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

require_once 'include/DB_Functions.php';
$db = new DB_Functions();

// json response array
$response = array("error" => FALSE);

if (isset($_POST['email_check']))
{
$email = $_POST['email_check'];


// get the user by email
if ($db->isCheckEmail($email))
{
// user already existed
$response["error"] = TRUE;
$response["error_msg"] = true;
$response["error_position"] = 1;
echo json_encode($response);
}else{
$user = $db->isCheckEmail($email);
if($user){
$response["user"]["email"] = $user["_email"];
$response["error"] = false;
$response["error_msg"] = false;
$response["error_position"] = 2;
echo json_encode($response);
}else{
$response["error"] = TRUE;
$response["error_msg"] = false;
$response["error_position"] = 3;
echo json_encode($response);
}
}
}else{
// required post params is missing
$response["error"] = TRUE;
$response["error_msg"] = false;
$response["error_position"] = 4;

echo json_encode($response);
}

?>
21 changes: 21 additions & 0 deletions FTP(PHP Data)/kiki_/count_AD_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$con = mysqli_connect("localhost","id2558345_root", "korea0504", "id2558345_kiki");



$result = mysqli_query($con, "select * from vendor_advertisement where _number");
$response = array();


$i=0;
while($row = mysqli_fetch_array($result)){
array_push($response, array("_number_check$i"=>$row[0]));
$i++;
}

echo json_encode(array("response"=>$response));
mysqli_close($con);

?>

Binary file added FTP(PHP Data)/kiki_/dd.zip
Binary file not shown.
24 changes: 24 additions & 0 deletions FTP(PHP Data)/kiki_/email_validate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

require_once 'include/DB_Functions.php';
$db = new DB_Functions();

$_email = $_POST["_email"];

$statement = mysqli_prepare($conn, "select * from vendor_info where _email = ?");
mysqli_stmt_bind_param($statement, "s", $_email);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $_email);

$response = array();
$response["success"] = true;

while(mysqli_stmt_fetch($statement)){
$response["success"] = false;
$response["_email"] = $_email;
}

echo json_encode($response);

?>
21 changes: 21 additions & 0 deletions FTP(PHP Data)/kiki_/find_title_image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$con = mysqli_connect("localhost","id2558345_root", "korea0504", "id2558345_kiki");
//$con = mysqli_connect("localhost","root", "1234", "kiki");


$Name = $_GET['_number'];

$result = mysqli_query($con, "select title_image from vendor_product_info where _number = '$Name'");

$response = array();


while($row = mysqli_fetch_array($result)){
array_push($response, array("title_image"=>$row[0]));
}

echo json_encode(array("response"=>$response));
mysqli_close($con);

?>
Binary file added FTP(PHP Data)/kiki_/include/.DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions FTP(PHP Data)/kiki_/include/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

/**
* Database config variables
*/
define("DB_HOST", "localhost");
define("DB_USER", "id2558345_root");
define("DB_PASSWORD", "korea0504");
define("DB_DATABASE", "id2558345_kiki");
?>
22 changes: 22 additions & 0 deletions FTP(PHP Data)/kiki_/include/DB_Connect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @author Ravi Tamada
* @link http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ Complete tutorial
*/

class DB_Connect {
private $conn;

// Connecting to database
public function connect() {
require_once 'include/Config.php';

// Connecting to mysql database
$this->conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);

// return database handler
return $this->conn;
}
}

?>
Loading

0 comments on commit 4d2c9b1

Please sign in to comment.