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..2cfcbc26 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/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/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/Lab09.php b/Lab09.php index 6599d57e..ecfd2308 100755 --- a/Lab09.php +++ b/Lab09.php @@ -27,7 +27,7 @@ - + @@ -37,13 +37,17 @@
All - $x_value){ + $thetitle =''.$x_value.''; + echo $thetitle; + } /* you will need to fill this place with appropriate PHP */ /* hint: use array and loop */ //the next line is an example - // Canada - - + // Canada ?>
@@ -52,25 +56,33 @@ diff --git a/Lab10.php b/Lab10.php index 69db89d7..76fa5803 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,13 @@ fetch_assoc()) { + echo ''; + } ?> @@ -74,8 +78,32 @@
    fetch_assoc()) { + $INPUT= '
  • + + '.$row[ +
    +
    +
    +

    '.$row["Title"].'

    +
    +
    +
    +
  • '; + if(isset($_GET["country"]) && $_GET["country"] != "0"){ + if($row["CountryCodeISO"] === $_GET["country"]){ + echo $INPUT; + } + }else if(isset($_GET["continent"]) && $_GET["continent"] != "0"){ + if($row["ContinentCode"] === $_GET["continent"]){ + echo $INPUT; + } + }else{ + echo $INPUT; + } + } //****** Hint ****** /* use while loop to display images that meet requirements ... sample below ... replace ???? with field data
  • diff --git a/css/Lab07.css b/css/Lab07.css new file mode 100644 index 00000000..b0082d29 --- /dev/null +++ b/css/Lab07.css @@ -0,0 +1,24 @@ +body { + text-align: center; +} + +.select1, .commit, .select2 { + width: 300px; +} + +table { + margin: 0 auto; +} + +th { + background-color: grey; + color: whitesmoke; +} + +tr:nth-child(odd) td { + background-color: lightgrey; +} + +td { + padding: 0 0.5em; +} diff --git a/css/captions.css b/css/captions.css index ec26da5f..5657ac12 100755 --- a/css/captions.css +++ b/css/captions.css @@ -1,5 +1,6 @@ /* css image captions adapted from hasinhayder.github.io */ + .caption-style-2{ list-style-type: none; margin: 0px; @@ -63,6 +64,6 @@ position: absolute; width: 225px; height: 225px; - text-align: center; - top:20px; + text-align: left; + top:0; } diff --git a/functions.inc.php b/functions.inc.php index c7b6f38a..38fcb8f0 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -10,6 +10,63 @@ function generateLink($url, $label, $class) { function outputPostRow($number) { include("travel-data.inc.php"); + $postId = ${"postID".$number}; + $userId = ${"userId".$number}; + $userName = ${"userName".$number}; + $date = ${"date".$number}; + $thumb = ${"thumb".$number}; + $title = ${"title".$number}; + $excerpt = ${"excerpt".$number}; + $reviewsNum = ${"reviewsNum".$number}; + $reviewsRating = ${"reviewRating".$number}; + +// $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/Lab07.js b/js/Lab07.js new file mode 100644 index 00000000..2dd2e132 --- /dev/null +++ b/js/Lab07.js @@ -0,0 +1,60 @@ +let container =document.getElementsByClassName('container'); +let button = document.getElementsByClassName('LayButton'); +let Table =[]; + +/*第一个表格*/ +function TheFirstSelect(o){ + switch(o){ + case "SelectOne": + container[0].innerHTML = ''; + button[0].innerHTML = ''; + break; + case "CreateTable": + container[0].innerHTML = + ''+ + ''; + showbutton(); + break; + case "AddRow": + container[0].innerHTML = ''; + button[0].innerHTML = ''; + break; + case "DeleteRow": + container[0].innerHTML = ''; + button[0].innerHTML = ''; + break; + case "DeleteTable": + container[0].innerHTML = '

    WARNING: You cannot undo this action!

    '; + button[0].innerHTML = ''; + break; + } +} + +function Creat(x) { + let TableHead = document.getElementsByClassName('LayTH'); + if(TableHead[0] !==""){ + TableHead[0].innerHTML =''; + } + else return; + for (let i=0;i'+ + '

    '+ + '

    '+ + '
    '+ + '

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

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

      '+ + '

      '+ + '
      '+ + '

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

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

        '+ + '

        '+ + '
        '+ + '

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

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

          '+ + '

          '+ + '
          '+ + '

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

            '+ + '
            '+ + '
            '+ + ''+ + '
            '; + + 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"; + } + +}