Skip to content

Commit 3007200

Browse files
committed
first commit
0 parents  commit 3007200

File tree

275 files changed

+5813
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+5813
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Overview
2+
Clothy is a simple ionic 3 ecommerce application.
3+
4+
Its simple and ergonomic interface allows the user a quick and easy handling.
5+
As a hybrid app, you can deploy it on Android and IOS effortlessly. The source code is perfectly reusable for other Ecommerce applications.
6+
No need to code, the platform already has all the necessary.
7+
8+
# Features
9+
- Signin/SignUp
10+
- forgotten password
11+
- blog
12+
- search items by category
13+
- sort items by price
14+
- hot deals
15+
- rate items
16+
- share items
17+
- checkout
18+
- my orders
19+
- pull to refresh
20+
- infinite scroll
21+
22+
# Requirements
23+
- ionic 3
24+
- Android 5 or latest
25+
- PHP
26+
- MySQL
27+
28+
# Instructions
29+
02 - Import the database, which is in the database folder in the DBMS (MySQL)
30+
03 - copy the api_clothy folder to the server
31+
04 - Enter the file /api_clothy/include/dbconfig.php
32+
05 - Modify the variable $host (server address), $db_name (database name), $username (username) and $password (password login to the database)
33+
06 - Modify the link that is in the service.ts file of the application
34+
07- the installation is complete

api-clothy/READ ME.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
READ ME
2+
01 - Unarchive the api_clothy.zip file
3+
4+
02 - Import the database, which is in the database folder in the DBMS (MySQL)
5+
6+
03 - copy the api_clothy folder to the server
7+
8+
04 - Enter the file /api_clothy/include/dbconfig.php
9+
10+
05 - Modify the variable $host (server address), $db_name (database name), $username (username) and $password (password login to the database)
11+
12+
06 - Modify the link that is in the service.ts file of the application
13+
14+
07- the installation is complete
15+

api-clothy/blog/create.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$postdata = file_get_contents("php://input");
7+
if (isset($postdata)) {
8+
$request = json_decode($postdata);
9+
$title = $request->title;
10+
$detail = $request->detail;
11+
$image = $request->image;
12+
$created_at = date("Y-m-d H:i:s");
13+
14+
$database = new Database();
15+
$db = $database->dbConnection();
16+
$con = $db;
17+
18+
//upload base64 image
19+
$target_path = "../uploads/blog/";
20+
$image_name= uniqid().".jpg";
21+
$target_path = $target_path . $image_name;
22+
23+
file_put_contents($target_path,base64_decode($image));
24+
25+
try
26+
{
27+
28+
$stmt = $con->prepare("INSERT INTO clothy_blog(title, detail, image, created_at, updated_at)
29+
VALUES(:name, :detail, :image, :created_at, :updated_at)");
30+
$stmt->bindparam(":name", $name);
31+
$stmt->bindparam(":detail", $detail);
32+
$stmt->bindparam(":image", $image_name);
33+
$stmt->bindparam(":created_at", $created_at);
34+
$stmt->bindparam(":updated_at", $created_at);
35+
$stmt->execute();
36+
echo '{"status": "success"}' ;
37+
}
38+
catch(PDOException $e)
39+
{
40+
echo $e->getMessage();
41+
}
42+
} else{
43+
echo '{"status": "error"}' ;
44+
}
45+
46+
?>

api-clothy/blog/delete.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$database = new Database();
7+
$db = $database->dbConnection();
8+
$con = $db;
9+
$id= $_GET['id'];
10+
11+
try
12+
{
13+
14+
$stmt = $con->prepare("DELETE FROM clothy_blog WHERE id=:id");
15+
$stmt->bindparam(":id", $id);
16+
$stmt->execute();
17+
echo '{"status": "success"}' ;
18+
}
19+
catch(PDOException $e)
20+
{
21+
echo '{"status": "nope"}' ;
22+
echo $e->getMessage();
23+
}
24+
25+
26+
?>

api-clothy/blog/list.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$database = new Database();
7+
$db = $database->dbConnection();
8+
$con = $db;
9+
$page= $_GET['page'];
10+
$limite= 20;
11+
$debut = ($page - 1) * $limite;
12+
$stmt = $con->query("SELECT * FROM clothy_blog ORDER BY created_at DESC LIMIT $limite OFFSET $debut ;");
13+
$list= array();
14+
while ($row= $stmt->fetch()) {
15+
array_push($list, $row);
16+
}
17+
18+
19+
$listall = array('blog' => $list);
20+
echo json_encode($listall);
21+
22+

api-clothy/blog/read.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$database = new Database();
7+
$db = $database->dbConnection();
8+
$con = $db;
9+
$id= $_GET['id'];
10+
11+
if(isset($id)){
12+
$stmt = $con->query("SELECT * FROM clothy_blog WHERE id=".$id." ;");
13+
$row= $stmt->fetchAll();
14+
echo json_encode($row[0]);
15+
}
16+
17+
18+
19+

api-clothy/blog/update.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$postdata = file_get_contents("php://input");
7+
if (isset($postdata)) {
8+
$request = json_decode($postdata);
9+
$title = $request->title;
10+
$detail = $request->detail;
11+
$image = $request->image;
12+
$updated_at = date("Y-m-d H:i:s");
13+
$id= $request->id;
14+
15+
16+
$database = new Database();
17+
$db = $database->dbConnection();
18+
$con = $db;
19+
20+
//upload base64 image
21+
$target_path = "../uploads/blog/";
22+
$image_name= uniqid().".jpg";
23+
$target_path = $target_path . $image_name;
24+
25+
file_put_contents($target_path,base64_decode($image));
26+
try
27+
{
28+
29+
$stmt=$con->prepare("UPDATE clothy_blog SET title=:name, detail=:detail, image=:image, updated_at=:updated_at, WHERE id=:id ");
30+
$stmt->bindparam(":name", $name);
31+
$stmt->bindparam(":detail", $detail);
32+
$stmt->bindparam(":image", $image_name);
33+
$stmt->bindparam(":updated_at", $updated_at);
34+
$stmt->bindparam(":id",$id);
35+
$stmt->execute();
36+
37+
echo '{"status": "success"}' ;
38+
}
39+
catch(PDOException $e)
40+
{
41+
echo '{"status": "nope"}' ;
42+
echo $e->getMessage();
43+
}
44+
} else{
45+
echo '{"status": "nope"}' ;
46+
}
47+
48+
?>

api-clothy/category/create.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$postdata = file_get_contents("php://input");
7+
if (isset($postdata)) {
8+
$request = json_decode($postdata);
9+
$name = $request->name;
10+
$image = $request->image;
11+
$created_at = date("Y-m-d H:i:s");
12+
13+
$database = new Database();
14+
$db = $database->dbConnection();
15+
$con = $db;
16+
17+
//upload base64 image
18+
$target_path = "../uploads/category/";
19+
$image_name= uniqid().".jpg";
20+
$target_path = $target_path . $image_name;
21+
22+
file_put_contents($target_path,base64_decode($image));
23+
24+
try
25+
{
26+
27+
$stmt = $con->prepare("INSERT INTO clothy_menu_category(menu_name, menu_image, created_at, updated_at)
28+
VALUES(:name, :image, :created_at, :updated_at)");
29+
$stmt->bindparam(":name", $name);
30+
$stmt->bindparam(":image", $image_name);
31+
$stmt->bindparam(":created_at", $created_at);
32+
$stmt->bindparam(":updated_at", $created_at);
33+
$stmt->execute();
34+
echo '{"status": "success"}' ;
35+
}
36+
catch(PDOException $e)
37+
{
38+
echo $e->getMessage();
39+
}
40+
} else{
41+
echo '{"status": "error"}' ;
42+
}
43+
44+
?>

api-clothy/category/delete.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$database = new Database();
7+
$db = $database->dbConnection();
8+
$con = $db;
9+
$id= $_GET['id'];
10+
11+
try
12+
{
13+
14+
$stmt = $con->prepare("DELETE FROM clothy_menu_category WHERE id=:id");
15+
$stmt->bindparam(":id", $id);
16+
$stmt->execute();
17+
echo '{"status": "success"}' ;
18+
}
19+
catch(PDOException $e)
20+
{
21+
echo '{"status": "nope"}' ;
22+
echo $e->getMessage();
23+
}
24+
25+
26+
?>

api-clothy/category/list.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
header('Access-Control-Allow-Origin: *');
3+
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
4+
require_once ("../include/dbconfig.php");
5+
6+
$database = new Database();
7+
$db = $database->dbConnection();
8+
$con = $db;
9+
10+
$stmt = $con->query("SELECT * FROM clothy_menu_category ORDER BY created_at DESC ;");
11+
$list= array();
12+
while ($row= $stmt->fetch()) {
13+
array_push($list, $row);
14+
}
15+
16+
17+
$listall = array('cat' => $list);
18+
echo json_encode($listall);
19+
20+
21+

0 commit comments

Comments
 (0)