From ca580d8856a245a2f8d1db94d2d8421dbb234dcf Mon Sep 17 00:00:00 2001 From: 17ssyanmoufu <37589015+17ssyanmoufu@users.noreply.github.com> Date: Sat, 19 May 2018 19:51:58 +0800 Subject: [PATCH 1/4] commit --- .idea/fdu-17ss-web-lab.iml | 12 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 574 +++++++++++++++++++++++++++++++++++++ Lab04.html | 89 +++++- Lab06.html | 3 +- Lab08.php | 5 +- functions.inc.php | 47 +++ js/data.js | 92 +++++- 10 files changed, 829 insertions(+), 13 deletions(-) create mode 100644 .idea/fdu-17ss-web-lab.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/fdu-17ss-web-lab.iml b/.idea/fdu-17ss-web-lab.iml new file mode 100644 index 00000000..24643cc3 --- /dev/null +++ b/.idea/fdu-17ss-web-lab.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..d688db2a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..d722b324 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..96d7f7b5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,574 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ +
+
+
+ Attribution
+ Noncommercial
+ No Derivative Works
+
+ + + + +
+ +
+ + + + +
+
+
+ + +
+
+
+
+ +
+ + + + +
+ + +
+ + + + + diff --git a/Lab06.html b/Lab06.html index 6c15b947..dfa2acb5 100644 --- a/Lab06.html +++ b/Lab06.html @@ -4,7 +4,7 @@ Lab06 - + @@ -15,4 +15,5 @@

Share Your Travels

+ \ No newline at end of file diff --git a/Lab08.php b/Lab08.php index 7982419d..ee768be5 100644 --- a/Lab08.php +++ b/Lab08.php @@ -18,13 +18,13 @@ - +
- +

Posts

@@ -43,6 +43,7 @@ ?>
+
diff --git a/functions.inc.php b/functions.inc.php index c7b6f38a..fa95548f 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -10,6 +10,53 @@ function generateLink($url, $label, $class) { function outputPostRow($number) { include("travel-data.inc.php"); + $postId = 1; + $userId = 2; + $userName = "Leonie Kohler"; + $date = "2/8/2017"; + $thumb = "8710320515.jpg"; + $title = "Ekklisia Agii Isidori Church"; + $excerpt = "At the end of the hot climb up to the top Lycabettus Hill you are greeted with the oasis that is the Ekklisia Agii Isidori church."; + $reviewsNum = 15; + $reviewsRating = 3; + switch ($number){ + case 1: + $postId = 1; + $userId = 2; + $userName = "Leonie Kohler"; + $date = "2/8/2017"; + $thumb = "8710320515.jpg"; + $title = "Ekklisia Agii Isidori Church"; + $excerpt = "At the end of the hot climb up to the top Lycabettus Hill you are greeted with the oasis that is the Ekklisia Agii Isidori church."; + $reviewsNum = 15; + $reviewsRating = 3;break; + case 2: + $postId = 3; + $userId = 5; + $userName = "Frantisek Wichterlova"; + $date = "9/9/2017"; + $thumb = "8710247776.jpg"; + $title = "Santorini Sunset"; + $excerpt = "Every evening as the sun sets in Fira, it seems that everyone who is not drinking or eating is rushing with their camera to the most picturesque locations in order to capture that famous Aegean sunset."; + $reviewsNum = 38; + $reviewsRating = 5;break; + case 3: + $postId = 9; + $userId = 13; + $userName = "Edward Francis"; + $date = "10/19/2017"; + $thumb = "8710289254.jpg"; + $title = "Looking towards Fira"; + $excerpt = "The steamer Mongolia, belonging to the Peninsular and Oriental Company, built of iron, of two thousand eight hundred tons burden, and five hundred horse-power, was due at eleven o'clock a.m. on Wednesday, the 9th of October, at Suez."; + $reviewsNum = 3; + $reviewsRating = 2;break; + } + $content = '
'; + $content.=''.$title.''; + $content.='

'.$title.'

Posted by'.$userName.''.$date.''; + $content.='

'.constructRating($reviewsRating).$reviewsNum.'Reviews

'; + $content.=$excerpt.'

Read more


'; + echo $content; } /* diff --git a/js/data.js b/js/data.js index 6a285076..16925aa7 100644 --- a/js/data.js +++ b/js/data.js @@ -1,6 +1,86 @@ -const countries = [ - { name: "Canada", continent: "North America", cities: ["Calgary","Montreal","Toronto"], photos: ["canada1.jpg","canada2.jpg","canada3.jpg"] }, - { name: "United States", continent: "North America", cities: ["Boston","Chicago","New York","Seattle","Washington"], photos: ["us1.jpg","us2.jpg"] }, - { name: "Italy", continent: "Europe", cities: ["Florence","Milan","Naples","Rome"], photos: ["italy1.jpg","italy2.jpg","italy3.jpg","italy4.jpg","italy5.jpg","italy6.jpg"] }, - { name: "Spain", continent: "Europe", cities: ["Almeria","Barcelona","Madrid"], photos: ["spain1.jpg","spain2.jpg"] } -]; \ No newline at end of file +window.onload=function () { + const countries = [ + { name: "Canada", continent: "North America", cities: ["Calgary","Montreal","Toronto"], photos: ["canada1.jpg","canada2.jpg","canada3.jpg"] }, + { name: "United States", continent: "North America", cities: ["Boston","Chicago","New York","Seattle","Washington"], photos: ["us1.jpg","us2.jpg"] }, + { name: "Italy", continent: "Europe", cities: ["Florence","Milan","Naples","Rome"], photos: ["italy1.jpg","italy2.jpg","italy3.jpg","italy4.jpg","italy5.jpg","italy6.jpg"] }, + { name: "Spain", continent: "Euroe", cities: ["Almeria","Barcelona","Madrid"], photos: ["spain1.jpg","spain2.jpg"] } + ]; + document.getElementsByClassName("flex-container justify").innerHTML = + '
'+ + '

'+ + '

'+ + '
'+ + '

'+ + '
    '+ + '
    '+ + '
    '+ + '

    '+ + '
    '+ + '
    '+ + ''+ + '
    '+ + '
    '+ + '

    '+ + '

    '+ + '
    '+ + '

    '+ + '
      '+ + '
      '+ + '
      '+ + '

      '+ + '
      '+ + '
      '+ + ''+ + '
      '+ + '
      '+ + '

      '+ + '

      '+ + '
      '+ + '

      '+ + '
        '+ + '
        '+ + '
        '+ + '

        '+ + '
        '+ + '
        '+ + ''+ + '
        '+ + '
        '+ + '

        '+ + '

        '+ + '
        '+ + '

        '+ + '
          '+ + '
          '+ + '
          '+ + '

          '+ + '
          '+ + '
          '+ + ''+ + '
          '; + + for (let x = 0; x < 4; x++){ + document.getElementsByClassName("name")[x].innerHTML = countries[x].name; + document.getElementsByClassName("continent")[x].innerHTML= countries[x].continent; + document.getElementsByClassName("cities_title")[x].innerHTML = "Cities"; + document.getElementsByClassName("photo_title")[x].innerHTML = "Popular Photos"; + + + let cities = ""; + for (let y = 0; y< countries[x].cities.length; y++) + { + cities += countries[x].cities[y]; + cities+="
          "; + } + document.getElementsByClassName("city")[x].innerHTML=cities; + let photos=""; + for (let y = 0; y< countries[x].photos.length; y++) + { + let source = "images/" + countries[x].photos[y]; + photos +=''; + } + document.getElementsByClassName("photos")[x].innerHTML=photos; + document.getElementsByClassName("button")[x].innerHTML ="Visit"; + } + +} From e276025da863c0f2e1cabac03d5e9708ae0aaa15 Mon Sep 17 00:00:00 2001 From: 17ssyanmoufu <37589015+17ssyanmoufu@users.noreply.github.com> Date: Thu, 24 May 2018 19:15:40 +0800 Subject: [PATCH 2/4] lab09 --- .idea/workspace.xml | 68 ++++++++++++++++----------------- Lab09.php | 48 ++++++++++++++--------- functions.inc.php | 92 +++++++++++++++++++++++++-------------------- 3 files changed, 114 insertions(+), 94 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 96d7f7b5..f21baf97 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -14,30 +14,16 @@
          - - + + - - + + - - - - - - - - - - - - - - @@ -61,8 +47,7 @@ @@ -80,6 +65,8 @@ + + @@ -107,8 +94,6 @@ + @@ -115,9 +134,6 @@ - - @@ -142,61 +158,62 @@ + + + + + + +
          - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -209,82 +226,29 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + @@ -298,7 +262,7 @@ - + @@ -312,156 +276,112 @@ - + - + - + - + - + - + - - - - - + - + - - - - - + - - - - - + - + - - - - - + - - - - - + - + - - - - - + - - - - - + - + - - - - - + - - - - - + - + - - - - - + - - - - - + @@ -471,30 +391,15 @@ - - - - - + - - - - - + - - - - - - - - + @@ -508,39 +413,34 @@ - + - - - + - + - + - - - + - - + @@ -548,7 +448,6 @@ - @@ -556,17 +455,42 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + +
          \ No newline at end of file diff --git a/Lab07.html b/Lab07.html new file mode 100644 index 00000000..2a6285df --- /dev/null +++ b/Lab07.html @@ -0,0 +1,31 @@ + + + + + Lab07 + + + +
          +
          +
          +
          +
          +
          + +
          + +
          +
          +
          + + + diff --git a/Lab10.php b/Lab10.php index 69db89d7..4aaa9d60 100755 --- a/Lab10.php +++ b/Lab10.php @@ -3,7 +3,7 @@ //****** Hint ****** //connect database and fetch data here - +$con = mysqli_connect("localhost",'root','','travel'); ?> @@ -43,10 +43,10 @@ fetch_assoc()) { echo ''; } @@ -58,9 +58,14 @@ fetch_assoc()) { + echo ''; + } ?> @@ -74,8 +79,32 @@