From 8f02a490bd6ad41eb9327aba0d8cadffa42388df Mon Sep 17 00:00:00 2001 From: Farcva9 Date: Tue, 24 May 2022 18:46:02 +0400 Subject: [PATCH 1/2] Week 1 --- Tsotne Phartsvania/Task1/_function.php | 36 +++++ Tsotne Phartsvania/Task1/index.php | 110 ++++++++++++++ Tsotne Phartsvania/Task2/_function.php | 30 ++++ Tsotne Phartsvania/Task2/form.php | 7 + Tsotne Phartsvania/Task2/home.php | 150 +++++++++++++++++++ Tsotne Phartsvania/Task2/index.php | 48 ++++++ Tsotne Phartsvania/Task2/logout.php | 9 ++ Tsotne Phartsvania/Task2/view_followers.php | 100 +++++++++++++ Tsotne Phartsvania/Task2/view_repositors.php | 100 +++++++++++++ oto_zakalshvili/form.php | 19 --- oto_zakalshvili/index.php | 9 -- 11 files changed, 590 insertions(+), 28 deletions(-) create mode 100644 Tsotne Phartsvania/Task1/_function.php create mode 100644 Tsotne Phartsvania/Task1/index.php create mode 100644 Tsotne Phartsvania/Task2/_function.php create mode 100644 Tsotne Phartsvania/Task2/form.php create mode 100644 Tsotne Phartsvania/Task2/home.php create mode 100644 Tsotne Phartsvania/Task2/index.php create mode 100644 Tsotne Phartsvania/Task2/logout.php create mode 100644 Tsotne Phartsvania/Task2/view_followers.php create mode 100644 Tsotne Phartsvania/Task2/view_repositors.php delete mode 100644 oto_zakalshvili/form.php delete mode 100644 oto_zakalshvili/index.php diff --git a/Tsotne Phartsvania/Task1/_function.php b/Tsotne Phartsvania/Task1/_function.php new file mode 100644 index 0000000..a18ab19 --- /dev/null +++ b/Tsotne Phartsvania/Task1/_function.php @@ -0,0 +1,36 @@ + + + + + + + + Document + + + + +
+
+
+
+
+

რეგისტრაცია

+
+
+ + + + + +
+
+ + +
+
+ + +
+
+ + მხოლოდ jpg და png გაფართოების ფოტო. + +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
User
+
+ Back +
+ Card image +
+

+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/Tsotne Phartsvania/Task2/_function.php b/Tsotne Phartsvania/Task2/_function.php new file mode 100644 index 0000000..77fd518 --- /dev/null +++ b/Tsotne Phartsvania/Task2/_function.php @@ -0,0 +1,30 @@ + true, + CURLOPT_URL => $url, + CURLOPT_USERAGENT => $name + ]); + $response = curl_exec($curl); + + curl_close($curl); + return json_decode($response,true); + } + + function auth($name){ + + $url = "https://api.github.com/users/$name"; + $response = getAPIDate($url,$name); + if(!isset($response['message'])): + session_start(); + $_SESSION['name'] = $name; + return header("Location: home.php"); + else: + return header("Location: index.php?error=ესეთი მომხმარებელი ვერ მოიძებნა."); + endif; + } + diff --git a/Tsotne Phartsvania/Task2/form.php b/Tsotne Phartsvania/Task2/form.php new file mode 100644 index 0000000..e3e9584 --- /dev/null +++ b/Tsotne Phartsvania/Task2/form.php @@ -0,0 +1,7 @@ + + + + + + + + Document + + + + +
+
+
+ +
+ +
+ + +
+
+
+
+ avatar +
+

Full Stack Developer

+

+
+ 0 || $response['public_repos'] > 0): + ?> + 0): + ?> + View Followers + + 0): + ?> + View Repositor + + + Logout +
+
+
+ +
+
+
+
+
+
+

Full Name

+
+
+

+
+
+
+
+
+

Following

+
+
+

+
+
+
+
+
+

Followers

+
+
+

+
+
+ +
+
+
+

Git Hub LInk

+
+
+

Here

+
+
+
+
+
+

Address

+
+
+

+
+
+
+
+ +
+
+ +

+ Logout + +
+
+
+ + + + \ No newline at end of file diff --git a/Tsotne Phartsvania/Task2/index.php b/Tsotne Phartsvania/Task2/index.php new file mode 100644 index 0000000..86c95c3 --- /dev/null +++ b/Tsotne Phartsvania/Task2/index.php @@ -0,0 +1,48 @@ + + + + + + + + Document + + + +
+
+
+
+
+ +
+ + + + +
+ +
+ +
+ +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/Tsotne Phartsvania/Task2/logout.php b/Tsotne Phartsvania/Task2/logout.php new file mode 100644 index 0000000..b1ed64b --- /dev/null +++ b/Tsotne Phartsvania/Task2/logout.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/Tsotne Phartsvania/Task2/view_followers.php b/Tsotne Phartsvania/Task2/view_followers.php new file mode 100644 index 0000000..539f377 --- /dev/null +++ b/Tsotne Phartsvania/Task2/view_followers.php @@ -0,0 +1,100 @@ + 0){ + include "_function.php"; + $url_followers = "https://api.github.com/users/{$_SESSION['name']}/followers?per_page={$_GET['per_page']}&page={$_GET['page']}"; + $response = getAPIDate($url_followers,$_SESSION['name']); + + $n=1; + $followers = $_SESSION['followers']; + while($followers > 10 ) { + $followers -= 10; + $n++; + } + } + else{ + header('Location: home.php?warning=Sorry, Not Found Follower'); + } +?> + + + + + + + Document + + + + +
+
+
+
+
+ Back +

+
+
+ + + + + + + + + + + + + + + + + + + + +
IDPhotoUser NameGithub Link
+ + + User + +
+
+ Link +
+
    + +
  • >
  • + +
+ + {$decode_user['message']}"; ?> + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/Tsotne Phartsvania/Task2/view_repositors.php b/Tsotne Phartsvania/Task2/view_repositors.php new file mode 100644 index 0000000..63e0522 --- /dev/null +++ b/Tsotne Phartsvania/Task2/view_repositors.php @@ -0,0 +1,100 @@ + 0): + $url_repositor = "https://api.github.com/users/{$_SESSION['name']}/repos?per_page={$_GET['per_page']}&page={$_GET['page']}"; + + $n = 1; + $repos = $_SESSION['repos']; + while($repos > 10 ): + $repos -= 10 ; + $n++; + endwhile; + + include '_function.php'; + + $response = getAPIDate($url_repositor,$_SESSION['name']); + + else: + header('Location: home.php?warning=სამწუხაროდ ვერ მოიძებნა Repositor'); + endif +?> + + + + + + + Document + + + + +
+
+
+
+
+ Back + +

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
IDRepositor's NameRepositor's LinkFull Name
+ Link +
+
    + +
  • >
  • + +
+ + {$decode_repos['message']}"; ?> + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/oto_zakalshvili/form.php b/oto_zakalshvili/form.php deleted file mode 100644 index ceaa4bb..0000000 --- a/oto_zakalshvili/form.php +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - -
- - - -
- - - - \ No newline at end of file diff --git a/oto_zakalshvili/index.php b/oto_zakalshvili/index.php deleted file mode 100644 index 3940001..0000000 --- a/oto_zakalshvili/index.php +++ /dev/null @@ -1,9 +0,0 @@ - Date: Tue, 24 May 2022 20:23:30 +0400 Subject: [PATCH 2/2] Week1 --- Tsotne Phartsvania/Task1/_function.php | 6 +----- Tsotne Phartsvania/Task2/_function.php | 3 +-- Tsotne Phartsvania/Task2/home.php | 1 - Tsotne Phartsvania/Task2/view_repositors.php | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Tsotne Phartsvania/Task1/_function.php b/Tsotne Phartsvania/Task1/_function.php index a18ab19..208c3dc 100644 --- a/Tsotne Phartsvania/Task1/_function.php +++ b/Tsotne Phartsvania/Task1/_function.php @@ -1,6 +1,5 @@ diff --git a/Tsotne Phartsvania/Task2/view_repositors.php b/Tsotne Phartsvania/Task2/view_repositors.php index 63e0522..998640e 100644 --- a/Tsotne Phartsvania/Task2/view_repositors.php +++ b/Tsotne Phartsvania/Task2/view_repositors.php @@ -27,7 +27,6 @@ Document -