Exemplo n.º 1
0
<?php

if (!session_start()) {
    session_start();
}
require_once "../aClass/sysDB.php";
include "../aClass/profileSettings.php";
$handler = new sysDB();
$handler->connect();
if ($_GET['uName']) {
    // CHECK USER NAME
    $uName = $_GET['uName'];
    $handler->setRquery("SELECT uName from amistiUser WHERE uName=?", array($uName));
    $res = $handler->getRquery();
    if (count($res[0]['uName']) > 0) {
        echo 1;
    } else {
        echo 0;
    }
}
if ($_GET['email']) {
    //check email
    $email = $_GET['email'];
    if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $handler->setRquery("SELECT email from amistiUser WHERE email=?", array($email));
        $res = $handler->getRquery();
        if (count($res[0]['email']) > 0) {
            echo 2;
        } else {
            echo 0;
        }
Exemplo n.º 2
0
}
header('Access-Control-Allow-Origin: *');
include_once "./libs/aClass/sysDB.php";
include_once "./libs/aClass/profileSettings.php";
$topHand = new sysDB();
$topHand->connect();
$getUser = trim($_GET['user']);
$confUser;
$USERCHECK;
if (empty($getUser) || !isset($_GET['user'])) {
    if (!$_SERVER['SCRIPT_NAME'] == "/index.php") {
        header('Location:http:/');
    }
} else {
    $topHand->setRquery(" SELECT * FROM amistiUser WHERE uName=?", array($getUser));
    $USERCHECK = $topHand->getRquery();
    if (count($USERCHECK[0]['uName']) > 0) {
        $confUser = $USERCHECK[0]['uName'];
        $_SESSION['curUser'] = $confUser;
        $_SESSION['curUserID'] = $USERCHECK[0]['userID'];
    } else {
        header('Location:http:/');
    }
}
/* First if check to see if the url user is empty. 

if Its empty, do nothing. 

If not empty then emter the first else clause.

check in DATA base if the user exists, 
Exemplo n.º 3
0
<?php

if (!session_start()) {
    session_start();
}
require_once "libs/aClass/sysDB.php";
require_once "libs/aFunctions/timeFunc.php";
$dbHandle = new sysDB();
$dbHandle->connect();
$RegEmail = base64_decode($_GET['conf']);
$userName = $_GET['user'];
$passWord = $_GET['token'];
header('Location:https://amisti.com');
$dbHandle->setRquery("SELECT * FROM amistiUser WHERE uName=?\n\t                          AND password=? \n\t\t\t\t\t\t\t     AND email=? ", array($userName, $passWord, $RegEmail));
$resultData = $dbHandle->getRquery();
if (!count($resultData) > 0) {
    header('Location:https://amisti.com');
    exit;
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Confirm Registration </title>
 <link rel="stylesheet" type="text/css" href="css/amisti.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
Exemplo n.º 4
0
        
        <div id="topMenuNtn" >
            <img src="../libs/libImages/icons/basic_world.png" class="allIcons" alt="bell"></div>  <!-- General other notification -->
       
        <div id="topMenuHome" class="tooltip" >Discover</div> <!-- top menu home ----->
        
        </div>
        
        
        <div id="topUserControl"> <!-- user pic space --->
         
       
        <?php 
    //get profile pic now
    $topHand->setRquery("SELECT * FROM amistiProfilePic WHERE userID=? AND profilePicCurrent=?", array($_SESSION['userID'], 1));
    $tRes = $topHand->getRquery();
    if (!count($tRes) > 0) {
        $tRes = "../libs/libImages/icons/Man.png";
    } else {
        $tRes = str_replace($_SERVER['DOCUMENT_ROOT'], "", $tRes[0]['profileImgPath']);
    }
    ?>
 
         <a href="/<?php 
    echo $_SESSION['uName'];
    ?>
">
        <div id="uTopIcon"> <!-- user icon-->
        <img src="<?php 
    echo $tRes;
    ?>
Exemplo n.º 5
0
<?php

if (!session_start()) {
    session_start();
}
require_once "./libs/aClass/sysDB.php";
?>

<?php 
$dpHandle = new sysDB();
$dpHandle->connect();
$dpHandle->setRquery("SELECT * from amistiUser ");
//get everything out from amisti user for now.
$dbRes = $dpHandle->getRquery();
for ($x = 0; $x < count($dbRes); $x++) {
    if ($_SESSION['uName'] == $dbRes[$x]['uName']) {
    } else {
        ?>
      <a href="/<?php 
        echo $dbRes[$x]['uName'];
        ?>
">   
    <div style="width:176px; height:176px; display:block; float:left; margin:5px; background-color:brown;">
	<?php 
        echo $dbRes[$x]['fName'];
        ?>
    </div>
    </a>
  <?php 
    }
}
Exemplo n.º 6
0
function getComments($imgID, $theID, $picOrPost)
{
    $topHand = new sysDB();
    $topHand->connect();
    $topHand->setRquery("SELECT * FROM amistiUser WHERE uName=?", array($_SESSION['curUser']));
    $USERCHECK = $topHand->getRquery();
    // DECLARE VARIABLES
    $PPComText;
    $PPComID;
    $PPComTime;
    //CHECK IF THERE IS POST /PIC COMMEMTS FOR THE POST/PIC
    $topHand->setRquery("SELECT * from amistiComment INNER JOIN amistiUser ON amistiComment.userID = amistiUser.userID\n\t\t\t\t\t\t WHERE amistiComment.commentItemID=?", array($theID));
    //set variables
    $PPComText = "commentText";
    $PPComID = "commentID";
    $PPComTime = "commentTime";
    $commentRes = $topHand->getRquery();
    //$commentRes = count($commentRes ); // comment count here
    // get comments from database
    ?>
<!--- show comments -->
	   <div class="ccShowComments">

	  
	  <!-- COMMENTS PANE HERE -->
	  <div class="ccshowCommentsBoxMain">
  <?php 
    // first check if the user is registered or login
    if (count($commentRes) > 0) {
        for ($n = 0; $n < count($commentRes); $n++) {
            //get user icon
            $topHand->setRquery("SELECT * FROM amistiUser WHERE userID=?", array($commentRes[$n]['userID']));
            $uIconRes = $topHand->getRquery();
            $topHand->setRquery("SELECT * FROM amistiProfilePic WHERE profilePicCurrent=? AND userID=?", array(1, $commentRes[$n]['userID']));
            $userIco = $topHand->getRquery();
            $uIcon = $userIco[0]['profileImgPath'] == "" || 0 ? "/libs/libImages/icons/Man.png" : getImgPath($userIco[0]['profileImgPath']);
            $topHand->setRquery("SELECT * FROM amistiComment WHERE userID=? AND commentItemID=? AND commentShow=?", array($commentRes[$n]['userID'], $theID, 1));
            $comData = $topHand->getRquery();
            // get query results
            for ($X = 0; $X < count($comData); $X++) {
            }
            ?>
	  
	  <div class="ccShowCommentInner"  id="comm_<?php 
            echo $commentRes[$n][$PPComID];
            ?>
">


	  <a href="/<?php 
            echo $commentRes[$n]['uName'];
            ?>
" >
	  <div class="ccShowCommentUIcon showUserPopUpPic" style="background-image:url( '<?php 
            echo $uIcon;
            ?>
')">   </div>
	  </a>
	  <div class="ccShowCommentTextAllCon" >
	  
	  <div class="ccShowCommentText"> 		 
	  <a href="/<?php 
            echo $commentRes[$n]['uName'];
            ?>
" class="showUserPopUpName"><?php 
            echo $uIconRes[0]['fName'] . " " . $uIconRes[0]['sName'];
            ?>
</a>  
		   
		  <?php 
            echo $commentRes[$n][$PPComText];
            ?>
	   </div>
	   
		
		 
		 <?php 
            if (isset($_SESSION['userID'])) {
                //only show menu to login users
                ?>
			  <div class="ccShowCommentMenuDHR">...</div> 
			 <?php 
                if ($_SESSION['curUserID'] == $_SESSION['curUserID']) {
                    if ($_SESSION['userID'] == $commentRes[$n]['userID']) {
                        ?>

<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comEdit"> Edit...</li>
<li class="comDelete"> Delete...</li>
</div>
<span class="ccCommentMenuArrowBot"></span>
</div>

<?php 
                    } else {
                        ?>
  <div  class ="ccCommentMenu">
  <span class="ccCommentMenuArrowTop"></span>
  <div class="ccCommentMenuData" >
  <li class="comDelete"> Remove...</li>
  <li class="comReport"> Report...</li>
  </div>
  <span class="ccCommentMenuArrowBot"></span>
  </div>
	  
  <?php 
                    }
                } elseif ($commentRes[$n]['userID'] == $_SESSION['userID']) {
                    ?>
<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comEdit"> Edit...</li>
<li class="comDelete"> Delete...</li>
</div>
<span class="ccCommentMenuArrowBot"></span>
</div>  
  
  <?php 
                } else {
                    ?>
<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comReport"> Report...</li>

</div>
<span class="ccCommentMenuArrowBot"></span>
</div>    
	  
	  <?php 
                }
            }
            ?>
		  
		   
		 <div class="ccCommentTLLCBoxMain" >   
		 <div class=" ccCommentTime"><?php 
            echo relativeTime($commentRes[$n][$PPComTime]);
            ?>
 </div> 
		 <div class ="ccCommentMidDot">&middot;</div>
		 
		<div class=" ccCommentApprove">
		<?php 
            // if($picOrPost == true){
            $topHand->setRquery("SELECT * FROM amistiApprove WHERE approveItemID=?", array($commentRes[$n][$PPComID]));
            /*		  }else{
            			
            		  $topHand->setRquery("SELECT * FROM amistiPicApprove WHERE picID=?",array($commentRes [$n][$PPComID]));  
            		}*/
            $conR = $topHand->getRquery();
            $appCountN = count($conR) == 0 ? "" : count($conR);
            // get the approve count
            $foundYes;
            if (isset($_SESSION['logIn'])) {
                for ($cA = 0; $cA < count($conR); $cA++) {
                    if ($conR[$cA]['userID'] == $_SESSION['userID']) {
                        $foundYes = true;
                    }
                }
                if ($foundYes) {
                    echo ' <a href="#">Approve</a> ' . $appCountN;
                } else {
                    echo ' <a href="#">approve</a> ' . $appCountN;
                }
                $foundYes = false;
            } else {
                echo ' <a href="#">approve</a> ' . $appCountN;
            }
            ?>
	   <!-- <a href="#">approve</a>-->
		</div>

		</div>
		 
		 

	 
	  </div>
	  </div>

	  <?php 
        }
    }
    ?>
	  
	  </div>
	  </div>
		 <?php 
    if (!isset($_SESSION['logIn']) || !isset($_SESSION['userID'])) {
        echo "login to post comment...";
    } else {
        ?>


 
  <!-- text area ----->
<textarea placeholder="Post a comment..." class="commentPost autoExpand" ></textarea>

<!-- text area inner images -->
<div class="ccTxtAreaIcons"> <img src="/libs/libImages/smilies/angel.png" alt="chat icon"> </div>

<!-- text area icon -->
<?php 
        $topHand->setRquery("SELECT * FROM amistiUser  INNER JOIN amistiProfilePic ON amistiUser.userID = amistiProfilePic.userID\n\t\t\t WHERE amistiUser.userID=? AND amistiProfilePic.profilePicCurrent=?", array($_SESSION['userID'], 1));
        $pIconRes = $topHand->getRquery();
        $imgP = count($pIconRes) == 0 ? "/libs/libImages/icons/Man.png" : getImgPath($pIconRes[0]['profileImgPath']);
        ?>
<div class="ccPostCommentIcon" style="background-image:url('<?php 
        echo $imgP;
        ?>
')"> </div>
<?php 
    }
}
Exemplo n.º 7
0
    ?>
<li> <div class="allPhotoReportInnerData">Report image</div></li>
<?php 
}
?>
</div>
</div>

<!-- Ajax loader -->
 <div id="allPhotoAjaxLoader"> 
 <img src="../libs/libImages/loader.gif" alt="loader"> 
</div>

<?php 
$topHand->setRquery("SELECT * FROM amistiUser WHERE amistiUser.uName=? ", array($_SESSION['curUser']));
$topDataRes = $topHand->getRquery();
$lFullName = $topDataRes[0]['fName'] . " " . $topDataRes[0]['sName'];
$topHand->setRquery("SELECT * FROM amistiProfilePic WHERE userID=? AND profilePicCurrent=?", array($topDataRes[0]['userID'], 1));
$profilePicC = $topHand->getRquery();
$lProfileIcon = count($profilePicC) == 0 ? "/libs/libImages/icons/Man.png " : getImgPath($profilePicC[0]['profileImgPath']);
?>
<!-- ALL PHOTO COMENTS RIGHT PANE -->
<div class="allPhotoPageCCInnerRight" id="" >

<!-- ALL PHOTOS RIGHT PROFILE TOP -->
<div id="allPhotoRightProfileTop" >

<!-- ALL PHOTOS RIGHT INNER USER PROFILE ICON -->
<span id="allPhotoRightInnerUPI" style="background-image:url('<?php 
echo $lProfileIcon;
?>