From 4baaad76a19d7ac461964edff4d0dd12a2ca5687 Mon Sep 17 00:00:00 2001 From: TorNikeIn Date: Sun, 22 May 2022 21:33:09 +0400 Subject: [PATCH] Submitted home work for week 1. --- tornike_inalishvili/form.php | 62 +++++++++++++ tornike_inalishvili/form_style.css | 24 +++++ tornike_inalishvili/repos_index.php | 130 ++++++++++++++++++++++++++++ tornike_inalishvili/repos_style.css | 111 ++++++++++++++++++++++++ 4 files changed, 327 insertions(+) create mode 100644 tornike_inalishvili/form.php create mode 100644 tornike_inalishvili/form_style.css create mode 100644 tornike_inalishvili/repos_index.php create mode 100644 tornike_inalishvili/repos_style.css diff --git a/tornike_inalishvili/form.php b/tornike_inalishvili/form.php new file mode 100644 index 0000000..cc0e5ef --- /dev/null +++ b/tornike_inalishvili/form.php @@ -0,0 +1,62 @@ + + + + + + PHP Form + + + + + +
+
+ + +
+
+ +
+
+
+ + +
+
+ +
+
+ + + Please enter name and surname!"; + } + elseif (!preg_match ("/^[a-zA-Z\s]+$/", $_POST['name'] ) || !preg_match ("/^[a-zA-Z\s]+$/", $_POST['surname'] )){ + echo ""; + } + else{ + $upload_directory = getcwd() . "/uploads/"; + $profile_image_name = basename($_FILES["profile_photo"]['name']); + $profile_image_url = NULL; + + if (!file_exists($upload_directory)){ + mkdir($upload_directory); + } + + if (move_uploaded_file($_FILES["profile_photo"]["tmp_name"], $upload_directory . $profile_image_name)){ + $profile_image_url = $upload_directory . $profile_image_name; + } + } + ?> + + +
+ "> +
+
+
+
+ + + \ No newline at end of file diff --git a/tornike_inalishvili/form_style.css b/tornike_inalishvili/form_style.css new file mode 100644 index 0000000..b68af81 --- /dev/null +++ b/tornike_inalishvili/form_style.css @@ -0,0 +1,24 @@ +body { + background: linear-gradient(45deg, #FC466B, #3F5EFB); + height: 100vh; + font-family: 'Montserrat', sans-serif; +} + +.container{ + margin-top: 100px; + padding: 3em; + height: 320px; + border-radius: 20px; + backdrop-filter: blur(10px); + text-align: center; + position: relative; + box-shadow: 4px 4px 60px rgba(0,0,0,0.2); + color: #fff; + font-family: Montserrat, sans-serif; + font-weight: 500; + text-shadow: 2px 2px 4px rgba(0,0,0,0.2); +} + +#inputGroupFile02 { +width: 50%; +} \ No newline at end of file diff --git a/tornike_inalishvili/repos_index.php b/tornike_inalishvili/repos_index.php new file mode 100644 index 0000000..adf6179 --- /dev/null +++ b/tornike_inalishvili/repos_index.php @@ -0,0 +1,130 @@ + + + + + + + + Github Repositories and Followers + + +
+

Github User Repos and Followers

+
+ +
+ + +
+
+
+
    + 1, + CURLOPT_URL => "https://api.github.com/users/".$user_name."/repos?page={$page}", + CURLOPT_USERAGENT => 'User Repos' + ]); + + $data = curl_exec($curl); + + $result = json_decode($data, true); + + if (sizeof($result) == 0) { + $count = 0; + } + $page += 1; + + array_push($follsonse,...$result); + + } + ?> + '.$folls["name"].''; + } + } + + } + + + curl_close($curl); + } + + } + ?> +
+
    + 1, + CURLOPT_URL => "https://api.github.com/users/".$user_name."/followers?page={$followerPage}", + CURLOPT_USERAGENT => 'User Followers' + ]); + + $datA = curl_exec($curL); + + $resulT = json_decode($datA, true); + + if (sizeof($resulT) == 0) { + $followerCount = 0; + } + $followerPage += 1; + + array_push($follower_results,...$resulT); + } + + if (!empty($_GET['select'])) { + $selected = $_GET['select']; + if ($selected == "followers") { + foreach($follower_results as $folls){ + echo '
  1. '.$folls["login"].'
  2. '; + } + + } + + } + + curl_close($curL); + } + + } + ?> +
+
+
+ + \ No newline at end of file diff --git a/tornike_inalishvili/repos_style.css b/tornike_inalishvili/repos_style.css new file mode 100644 index 0000000..bc7bc07 --- /dev/null +++ b/tornike_inalishvili/repos_style.css @@ -0,0 +1,111 @@ +body { + background: linear-gradient(45deg, #FC466B, #3F5EFB); + height: 100vh; + font-family: 'Montserrat', sans-serif; +} + +h1 { + color: white; + text-align: center; + font-size: 30px; + padding-top: 20px; +} + +.container-1{ + margin-top: 100px; + padding: 3em; + height: 320px; + border-radius: 20px; + backdrop-filter: blur(10px); + text-align: center; + position: relative; + box-shadow: 4px 4px 60px rgba(0,0,0,0.2); + font-family: Montserrat, sans-serif; + font-weight: 500; + text-shadow: 2px 2px 4px rgba(0,0,0,0.2); +} + +.container-2{ + margin: 10px auto; + font-size: 18px; + text-align: left; + position: relative; + box-shadow: 4px 4px 60px rgba(0,0,0,0.2); + font-family: Montserrat, sans-serif; + font-weight: 500; + +} + +.form { + width: 500px; + margin: 5px; + padding: 10px; + border-radius: 10px; +} + +.user { + font-family: inherit; + width: 100%; + border: 0; + outline: 0; + font-size: 1.3rem; + padding: 7px 0; + font-size: 22px; + border-radius: 40px; + text-align: center; + box-shadow: 0 6px 20px -5px rgba(0,0,0,0.4); + overflow: hidden; + cursor: pointer; +} + +.followers{ + margin-top: 20px; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + +.repositories { + background-color: rgba(248, 242, 242); + border-radius: 30px; + padding: 7px 0; + width: 300px; + margin: 5px; +} + +#select{ + margin-bottom: 20px; + font-family: inherit; + width: 100%; + border: 0; + outline: 0; + font-size: 1.3rem; + padding: 7px 0; + font-size: 22px; + border-radius: 40px; + text-align: center; + box-shadow: 0 6px 20px -5px rgba(0,0,0,0.4); + overflow: hidden; + cursor: pointer; + +} + + + + +#submit{ + margin-top: 20px; + width: 200px; + height: 40px; + border: none; + outline: none; + font-size: 22px; + border-radius: 40px; + text-align: center; + box-shadow: 0 6px 20px -5px rgba(0,0,0,0.4); + position: relative; + overflow: hidden; + cursor: pointer; + + +} \ No newline at end of file