Skip to content

Commit

Permalink
update contact page
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaohong Zhang committed Nov 11, 2020
1 parent 832c517 commit 0837c1c
Show file tree
Hide file tree
Showing 180 changed files with 195 additions and 20 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Scripts/AC_ActiveX.js
100644 → 100755
Empty file.
Empty file modified Scripts/AC_RunActiveContent.js
100644 → 100755
Empty file.
Empty file modified about.html
100644 → 100755
Empty file.
Empty file modified account/profile.php
100644 → 100755
Empty file.
Empty file modified account/profile_update.php
100644 → 100755
Empty file.
Empty file modified account/profile_update_check.php
100644 → 100755
Empty file.
Empty file modified assets/css/bootstrap-theme.css
100644 → 100755
Empty file.
Empty file modified assets/css/bootstrap.min.css
100644 → 100755
Empty file.
Empty file modified assets/css/camera.css
100644 → 100755
Empty file.
Empty file modified assets/css/contact_table.css
100644 → 100755
Empty file.
Empty file modified assets/css/font-awesome.css
100644 → 100755
Empty file.
Empty file modified assets/css/font-awesome.min.css
100644 → 100755
Empty file.
Empty file modified assets/css/isotope.css
100644 → 100755
Empty file.
Empty file modified assets/css/simple-sidebar.css
100644 → 100755
Empty file.
Empty file modified assets/css/style.css
100644 → 100755
Empty file.
Empty file modified assets/fonts/KEEP-fontawesome-webfont.eot
100644 → 100755
Empty file.
Empty file modified assets/fonts/KEEP-fontawesome-webfont.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/fonts/KEEP-fontawesome-webfont.ttf
100644 → 100755
Empty file.
Empty file modified assets/fonts/KEEP-fontawesome-webfont.woff
100644 → 100755
Empty file.
Empty file modified assets/fonts/KEEP-fontawesome.otf
100644 → 100755
Empty file.
Empty file modified assets/fonts/fontawesome-webfont.eot
100644 → 100755
Empty file.
Empty file modified assets/fonts/fontawesome-webfont.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/fonts/fontawesome-webfont.ttf
100644 → 100755
Empty file.
Empty file modified assets/fonts/fontawesome-webfont.woff
100644 → 100755
Empty file.
Empty file modified assets/fonts/fontawesome-webfont.woff2
100644 → 100755
Empty file.
Empty file modified assets/images/1.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/about.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/arrows.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/bg.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/bg_header.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/blank.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/camera-loader.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/camera_skins.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/favicon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/news1.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/news2.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/news3.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/news4.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/photo-1.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/photo-2.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/photo-3.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/photo-4.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/portfolio/img1.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/portfolio/img2.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/portfolio/img3.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/portfolio/img4.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/images/portfolio/img5.jpg
100644 → 100755
Empty file modified assets/images/portfolio/img6.jpg
100644 → 100755
Empty file modified assets/images/portfolio/img7.jpg
100644 → 100755
Empty file modified assets/images/portfolio/img8.jpg
100644 → 100755
Empty file modified assets/images/portfolio/img9.jpg
100644 → 100755
Empty file modified assets/images/slides/img1.jpg
100644 → 100755
Empty file modified assets/images/slides/img2.jpg
100644 → 100755
Empty file modified assets/images/slides/img3.jpg
100644 → 100755
Empty file modified assets/js/bootstrap.min.js
100644 → 100755
Empty file.
Empty file modified assets/js/camera.min.js
100644 → 100755
Empty file.
36 changes: 36 additions & 0 deletions assets/js/contact_table.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ function contact_process($contact_type, $accountid1, $accountid2) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.location.reload();
alert(xmlhttp.responseText);

}
}
var contact_type = $contact_type; //must predefine variable to be used in $_POST in contact_process.php
Expand All @@ -11,19 +13,53 @@ function contact_process($contact_type, $accountid1, $accountid2) {
xmlhttp.open("GET","add_contact.php?contact_type="+$contact_type
+"&accountid1="+$accountid1+"&accountid2="+accountid2,true);
xmlhttp.send();

}


function block_user($accountid1, $accountid2) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.location.reload();
alert(xmlhttp.responseText);
}
}
var accountid1 = $accountid1;
var accountid2 = $accountid2;
xmlhttp.open("GET", "add_block.php?accountid1="+$accountid1+"&accountid2="+accountid2, true);
xmlhttp.send();
}


function contact_remove($contact_type,$accountid1,$accountid2) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.location.reload();
alert(xmlhttp.responseText);
}
}
var contact_type = $contact_type;
var accountid1 = $accountid1;
var accountid2 = $accountid2;
xmlhttp.open("GET", "remove_contact.php?contact_type="+$contact_type+"&accountid1="+$accountid1+"&accountid2="+accountid2, true);
xmlhttp.send();
}




function unblock_user($accountid1,$accountid2) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.location.reload();
alert(xmlhttp.responseText);
}
}
var accountid1 = $accountid1;
var accountid2 = $accountid2;
xmlhttp.open("GET", "unblock.php?accountid1="+$accountid1+"&accountid2="+accountid2, true);
xmlhttp.send();
}
Empty file modified assets/js/custom.js
100644 → 100755
Empty file.
Empty file modified assets/js/fancybox/blank.gif
100644 → 100755
Empty file modified assets/js/fancybox/descr.wd3
100644 → 100755
Empty file.
Empty file modified assets/js/fancybox/fancybox_loading.gif
100644 → 100755
Empty file modified assets/js/fancybox/fancybox_loading_402x.gif
100644 → 100755
Empty file modified assets/js/fancybox/fancybox_overlay.png
100644 → 100755
Empty file modified assets/js/fancybox/fancybox_sprite.png
100644 → 100755
Empty file modified assets/js/fancybox/fancybox_sprite_402x.png
100644 → 100755
Empty file modified assets/js/fancybox/jquery.fancybox.css
100644 → 100755
Empty file.
Empty file modified assets/js/fancybox/jquery.fancybox.pack.js
100644 → 100755
Empty file.
Empty file modified assets/js/google-map.js
100644 → 100755
Empty file.
Empty file modified assets/js/html5shiv.js
100644 → 100755
Empty file.
Empty file modified assets/js/jquery.cslider.js
100644 → 100755
Empty file.
Empty file modified assets/js/jquery.easing.1.3.js
100644 → 100755
Empty file.
Empty file modified assets/js/jquery.isotope.min.js
100644 → 100755
Empty file.
Empty file modified assets/js/jquery.min.js
100644 → 100755
Empty file.
Empty file modified assets/js/jquery.mobile.customized.min.js
100644 → 100755
Empty file.
Empty file modified assets/js/modernizr-latest.js
100644 → 100755
Empty file.
Empty file modified assets/js/respond.min.js
100644 → 100755
Empty file.
Empty file modified assets/js/sidebar_menu.js
100644 → 100755
Empty file.
Empty file modified browse.php
100644 → 100755
Empty file.
Empty file modified comment/comment_process.php
100644 → 100755
Empty file.
Empty file modified config.php
100644 → 100755
Empty file.
Empty file modified contact.html
100644 → 100755
Empty file.
7 changes: 6 additions & 1 deletion contact/add_block.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
$accountid1 = $_GET['accountid1'];
$accountid2 = $_GET['accountid2'];

$result = mysql_query( "select * from account where accountid='$accountid2'" );
$contact_name = mysql_fetch_row($result)[1];

add_block($accountid1, $accountid2);
echo "User blocked";
echo "User $contact_name is blocked";

mysql_free_result($result);
?>
11 changes: 8 additions & 3 deletions contact/add_contact.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
$accountid1 = $_GET['accountid1'];
$accountid2 = $_GET['accountid2'];

$result = mysql_query( "select * from account where accountid='$accountid2'" );
$contact_name = mysql_fetch_row($result)[1];

add_contact($contact_type, $accountid1, $accountid2);

if ($contact_type == '') {
echo "Remove from contact list";
echo "Removed $contact_name from contact list";
}
else {
echo "Added to $contact_type list";
echo "Added $contact_name to $contact_type list";
}
?>

mysql_free_result($result);
?>
106 changes: 91 additions & 15 deletions contact/contact.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,63 @@
or die ("get_all_users failed. Could not query the database: <br />". mysql_error());
while($row = mysql_fetch_row($result)) {
$accountid2 = $row[0];
$result_contact = mysql_query( "select * from contact where accountid1='$accountid1' && accountid2='$accountid2'" );
$row_contact = mysql_fetch_row($result_contact);
if (mysql_num_rows($result_contact) != 0) {
$contact_type = $row_contact[3];
$block_status = $row_contact[4];
}
else {
$contact_type = 0;
$block_status = 0;
}

echo "
<tr>
<td class='td1'>$row[1]</td>
<td class='td2'>$row[3]</td>
<td class='td3'>$row[4]</td>
<td class='td4'>
<select name='addContact' onchange='contact_process(this.value,$accountid1,$accountid2)'>
<option value=''>Add</option>
<option value='Family'>Family</option>;
<option value='Friend'>Friend</option>;
</select><br></td>
<td class='td5'><a href='#' onclick='block_user($accountid1,$accountid2)' style='color:#cc0000'>Block</a></td>
</tr>
";
if ($contact_type == 0) {
echo "
<option value='' selected>Add</option>
<option value='Family'>Family</option>
<option value='Friend'>Friend</option>
</select><br></td>
";
}
elseif ($contact_type == 1) {
echo "
<option value=''>Add</option>
<option value='Family' selected>Family</option>
<option value='Friend'>Friend</option>
</select><br></td>
";
}
elseif ($contact_type == 2) {
echo "
<option value=''>Add</option>
<option value='Family'>Family</option>
<option value='Friend' selected>Friend</option>
</select><br></td>
";
}

if ($block_status == 0) {
echo "
<td class='td5'><a href='#' onclick='block_user($accountid1,$accountid2)' style='color:#cc0000'>Block</a></td>
</tr>
";
}
else {
echo "
<td class='td5' ><i>Blocked</i></td>
</tr>
";
}
mysql_free_result($result_contact);
}
mysql_free_result($result);
?>
Expand All @@ -157,7 +200,7 @@

<div class="wrap2" style="margin:0 auto;"> <!--margin:0 auto doesn't work here,but work on below <table>-->
<table class="head">
<caption style="font-size:16px;margin-bottom:5px;">Family Contact</caption>
<caption style="font-size:16px;margin-bottom:5px;">Family List</caption>
<tr>
<th class="th1">Name</th>
<th class="th2">Email</th>
Expand All @@ -168,20 +211,20 @@
<div>
<table >
<?php
$query = "select * from contact WHERE accountid1='$accountid1'
&& type=1 && block=0";
$query = "select * from contact WHERE accountid1='$accountid1' && type=1";
$result = mysql_query( $query )
or die ("get_family_contact failed. Could not query the database: <br />". mysql_error());
while($row = mysql_fetch_row($result)) {
$accountid2 = $row[2];
$result_contact = mysql_query( "select * from account WHERE accountid='$accountid2'" );
$row_contact = mysql_fetch_row($result_contact);
$contact_type = "Family";
echo "
<tr>
<td class='td1'> $row_contact[1] </td>
<td class='td2'> $row_contact[3] </td>
<td class='td3'> $row_contact[4] </td>
<td class='td4'><a href='#' onclick='remove_contact($accountid1,$accountid2)'> Remove </a></td>
<td class='td4'><a href='#' onclick='contact_remove(1,$accountid1,$accountid2)'> Remove </a></td>
</tr>
";
mysql_free_result($result_contact);
Expand All @@ -196,7 +239,7 @@

<div class="wrap2" style="margin:0 auto;"> <!--margin:0 auto doesn't work here,but work on below <table>-->
<table class="head">
<caption style="font-size:16px;margin-bottom:5px;">Friend Contact</caption>
<caption style="font-size:16px;margin-bottom:5px;">Friend List</caption>
<tr>
<th class="th1">Name</th>
<th class="th2">Email</th>
Expand All @@ -207,20 +250,20 @@
<div>
<table >
<?php
$query = "select * from contact WHERE accountid1='$accountid1'
&& type=2 && block=0";
$query = "select * from contact WHERE accountid1='$accountid1' && type=2";
$result = mysql_query( $query )
or die ("get_family_contact failed. Could not query the database: <br />". mysql_error());
while($row = mysql_fetch_row($result)) {
$accountid2 = $row[2];
$result_contact = mysql_query( "select * from account WHERE accountid='$accountid2'" );
$row_contact = mysql_fetch_row($result_contact);
$contact_type = "Friend";
echo "
<tr>
<td class='td1'> $row_contact[1] </td>
<td class='td2'> $row_contact[3] </td>
<td class='td3'> $row_contact[4] </td>
<td class='td4'><a href='#' onclick='remove_contact($accountid1,$accountid2)'> Remove </a></td>
<td class='td4'><a href='#' onclick='contact_remove(2,$accountid1,$accountid2)'> Remove </a></td>
</tr>
";
mysql_free_result($result_contact);
Expand All @@ -233,7 +276,40 @@
<br><br>



<div class="wrap2" style="margin:0 auto;"> <!--margin:0 auto doesn't work here,but work on below <table>-->
<table class="head">
<caption style="font-size:16px;margin-bottom:5px;">Blocked List</caption>
<tr>
<th class="th1">Name</th>
<th class="th2">Email</th>
<th class="th3">Sex</th>
<th class="th4">Unblock</th>
</tr>
</table>
<div>
<table >
<?php
$query = "select * from contact WHERE accountid1='$accountid1' && block=1";
$result = mysql_query( $query );
while($row = mysql_fetch_row($result)) {
$accountid2 = $row[2];
$result_contact = mysql_query( "select * from account WHERE accountid='$accountid2'" );
$row_contact = mysql_fetch_row($result_contact);
echo "
<tr>
<td class='td1'> $row_contact[1] </td>
<td class='td2'> $row_contact[3] </td>
<td class='td3'> $row_contact[4] </td>
<td class='td4'><a href='#' onclick='unblock_user($accountid1,$accountid2)'> Unblock </a></td>
</tr>
";
}
mysql_free_result($result);
?>
</table>
</div>
</div>
<br><br>



Expand Down
19 changes: 19 additions & 0 deletions contact/remove_contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
include_once "../function.php";
$contact_type = $_GET['contact_type'];
$accountid1 = $_GET['accountid1'];
$accountid2 = $_GET['accountid2'];

$result = mysql_query( "select * from account where accountid='$accountid2'" );
$contact_name = mysql_fetch_row($result)[1];

remove_contact($accountid1, $accountid2);

if ($contact_type == 1) {
echo "Removed $contact_name from the Family list";
}
elseif ($contact_type == 2) {
echo "Removed $contact_name from the Friend list";
}
mysql_free_result($result);
?>
13 changes: 13 additions & 0 deletions contact/unblock.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include_once "../function.php";
$accountid1 = $_GET['accountid1'];
$accountid2 = $_GET['accountid2'];

$result = mysql_query( "select * from account where accountid='$accountid2'" );
$contact_name = mysql_fetch_row($result)[1];

unblock($accountid1, $accountid2);
echo "Unblock $contact_name";

mysql_free_result($result);
?>
Empty file modified css/default.css
100644 → 100755
Empty file.
Empty file modified css/uploadstyle.css
100644 → 100755
Empty file.
23 changes: 22 additions & 1 deletion function.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<?php
include "mysqlClass.inc.php";

//used by unblock.php
function unblock($accountid1, $accountid2) {
mysql_query("UPDATE contact SET block=0 WHERE accountid1='$accountid1' && accountid2='$accountid2'");
}



//used by add_block.php
function add_block($accountid1, $accountid2) {
$query = "select * from contact where accountid1='$accountid1' && accountid2='$accountid2'";
$result = mysql_query( $query )
Expand Down Expand Up @@ -46,7 +53,7 @@ function block_or_not($current_user, $uploaded_by)
mysql_free_result($result);
}

//used by contact_process.php, unidirectional relationship: from accountid1 to accountid2
//used by add_contact.php, unidirectional relationship: from accountid1 to accountid2
function add_contact($contact_type, $accountid1, $accountid2) {
$query = "select * from contact where accountid1='$accountid1' && accountid2='$accountid2'";
$result = mysql_query( $query )
Expand All @@ -70,6 +77,20 @@ function add_contact($contact_type, $accountid1, $accountid2) {
mysql_free_result($result);
}


//used by remove_contact.php
function remove_contact($accountid1, $accountid2) {
$query = "select * from contact where accountid1='$accountid1' && accountid2='$accountid2'";
$result = mysql_query( $query )
or die ("remove_contact() failed. Could not query the database: <br />". mysql_error());
$count = mysql_num_rows($result);

mysql_query("UPDATE contact SET type=0 WHERE accountid1='$accountid1' && accountid2='$accountid2'");
mysql_free_result($result);
}



//used by profile.php
function get_user_profile($username) {
$query = "select * from account where username='$username'";
Expand Down
Loading

0 comments on commit 0837c1c

Please sign in to comment.