Example #1
0
 <script type="text/javascript">window.history.pushState('updatePage', 'Mood', '/mood/viewOther.php');</script> <?php 
} else {
    if (!isset($_SESSION['userToView'])) {
        redir('/view.php');
    }
}
if (!checkViewPermission($_SESSION['userToView'])) {
    ?>
 <script type="text/javascript">displayNotice('danger', 'You do not have permission to view <?php 
    echo $_SESSION['userToView'];
    ?>
\'s account. <a href="/mood/view.php">Click here to go back to your account.</a>', 0, 0); </script><?php 
} else {
    ?>
<script type="text/javascript">displayNotice("info", 'You are viewing <?php 
    echo $_SESSION["userToView"];
    ?>
\'s account. <a href="/mood/view.php">Click here to go back to your account.</a>', 0, 0);</script><?php 
    generateView(true, $_SESSION['userToView']);
}
?>
<script type="text/javascript">
function onRequestFinish(result, funcData, urlEnd) {
	if (result['type'] == 'success') {
		location.reload();
	}
	else {
		showAlert(result['type'], result['msg']);
	}
}
</script>
Example #2
0
?>
			<input class="form-control" id="shareWithInput" type="text" placeholder="Share with a user by entering their email here">
			<a onclick="shareWithUser(this);">Share</a>
		</div>
	</div>
</div>

<!-- This is the div for the login form -->
<div style="display:none;">
<?php 
echoLoginForms(false);
?>
</div>

<?php 
generateView(false, $_SESSION['email']);
?>

<script type="text/javascript">

function unshare(sender) {
	request('unshare.php', {'userSharingWith': $(sender).attr('data-sharedWith')}, 'POST');
}

function shareWithUser(sender) {
	request('share.php', {'userSharingWith': $("#shareWithInput").val()}, 'POST');
}

function saveUpdates(sender) {
	$(sender).attr('disabled', 'true');
	$(sender).text('Loading...');