Esempio n. 1
0
$locationManager = new LocationManager();
$EntryManager = new EntryManager();
$Rating = new RatingManager();
$userId = intval($_GET["id"]);
// for profile update permission
$user_id = 0;
//    if ($userId =="")
//    {
//        //redirect to homepage
//        header("Location: http://localhost/tarboz/");
//    }
if (isset($_SESSION['user'])) {
    $user = $_SESSION['user'];
    $user_id = $user->getUserId();
}
$User_Login = $userManager->getUserByUserId($userId);
$id = $User_Login->getUserId();
$fname = $User_Login->getFirstName();
$lname = $User_Login->getLastName();
$email = $User_Login->getEmail();
$language = $User_Login->getUserLanguage();
$regdate = $User_Login->getRegistrationDate();
$locationId = $User_Login->getLocation();
$birth = $User_Login->getDOB();
$mediaId = $User_Login->getMediaId();
// get location
$location = $locationManager->getLocationBylocationId($locationId);
foreach ($location as $loc) {
    $Address = $loc->getAddress();
    $PostalCode = $loc->getPostalCode();
    $cityid = $loc->getCityId();
Esempio n. 2
0
<?php

require_once '../../config.php';
require_once BUSINESS_DIR_USER . 'User.php';
require_once BUSINESS_DIR_USER . 'UserManager.php';
require_once BUSINESS_DIR_LOCATION . 'LocationManager.php';
$userManager = new UserManager();
// check and update user
if ($_POST) {
    $userId = $_POST['id'];
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $birth = $_POST['birth'];
    $language = $_POST['language'];
    $email = $_POST['email'];
    $user_update = $userManager->getUserByUserId($userId);
    $user_update->setFirstName($fname);
    $user_update->setLastName($lname);
    $user_update->setEmail($email);
    $user_update->setUserLanguage($language);
    $user_update->setDOB($birth);
    $updated = $userManager->updateUser($user_update);
    if (!$updated) {
        echo "Updating " . $userId . " failed.";
    } else {
        header("Location: ../../profile.php");
    }
} else {
    header("Location: ../../profile.php");
}
Esempio n. 3
0
function browse_kid_room($i_kid)
{
    $e_m = new EntryManager();
    $u_m = new UserManager();
    $kid_array['id'] = $i_kid->getEntryId();
    $kid_array['text'] = substr($i_kid->getEntryText(), 0, 72);
    $kid_array['authen_status'] = "Translation";
    $kid_array['kid_votes'] = $e_m->getEntryLikeNumByEntry($kid_array['id']);
    $kid_array['user'] = $u_m->getUserByUserId($i_kid->getEntryUserId())->getLogin();
    ?>
		 <div class="kid_room">
			<div class="kid_text">
			  <a href="entryview.php?id=<?php 
    echo $kid_array['id'];
    ?>
"><?php 
    echo $kid_array['text'];
    ?>
</a>
			</div>
			<div class="kid_profile_link"><?php 
    echo $kid_array['authen_status'];
    ?>
</div>
		<!--    <div class="kid_dad_link">O</div>-->
			<div class="kid_votes"><span style="cursor: alias;" title="<?php 
    echo $kid_array['kid_votes'];
    ?>
 users like"><?php 
    if ($kid_array['kid_votes'] > 0) {
        echo '+' . $kid_array['kid_votes'];
    }
    ?>
</span> 
		<!--        <span style="cursor: alias;" title="3 users dislike">-3</span> -->
			</div>
			<div class="kid_added_by">
			  <a href="profile.php?id=<?php 
    echo $kid_array['user'];
    ?>
"><?php 
    echo $kid_array['user'];
    ?>
</a>
			</div>
		<!--	<div class="is_mom">A</div>  -->
		 </div>
<?php 
    return $kid_array;
}
Esempio n. 4
0
        <?php 
    }
    // end of foreach loop
}
// end of if statement
echo "<br/><br/><b>SELECT USER BY NAME</b><br/>";
$userManager = new UserManager();
$US = $userManager->getUserByName("JOHN", "SMITH");
foreach ($US as $user) {
    $email = $user->getEmail();
    echo "The Email is: " . $email . "<BR>";
}
//getUserByLanguage
echo "<br/><br/><b>===USER BY ID</b><br/>";
$userManager = new UserManager();
$US = $userManager->getUserByUserId(2);
//foreach ($US as $user) {
$email = $user->getEmail();
$loc = $user->getLocation();
$db = $user->getDOB();
echo "The Email is: " . $email . "<BR>";
echo "LOCATION ID: " . $loc . "<BR>";
echo "brith ID: " . $db . "<BR>";
//}
//$userManager = new UserManager();
$Users = $userManager->getUserByLanguage("English");
echo "<br/><br/><br/><b>USERS BY LANGUAGE</b><br>";
$userCount = count($Users);
if ($userCount > 0) {
    foreach ($Users as $users) {
        $uid = $users->getUserId();
Esempio n. 5
0
      <div class="entry_record_title">Comments</div>
      <div class="entry_record_value">
      <?php 
$commentManager = new CommentManager();
$commentsByEntry = $commentManager->getCommentByEntry($entryId);
$commentCount = count($commentsByEntry);
if ($commentCount > 0) {
    foreach ($commentsByEntry as $coms) {
        $id = $coms->getId();
        $text = $coms->getText();
        $rating_id = $coms->getRatingId();
        $created_by = $coms->getCreatedBy();
        //echo "comment text: ". $text."<br/>";
        //get the username who created the comment
        $userManager = new UserManager();
        $created_user = $userManager->getUserByUserId($created_by);
        $created_user_name = $created_user->getLogin();
        //define ids for html tags in the loop
        $edit_icon_id = "editIcon_" . $id;
        $edit_area_id = "edit_area_" . $id;
        $edit_comment_text_id = "comment_text_id_" . $id;
        $form_name = "formEditComment_" . $id;
        $edit_comment_textarea = "editCommentText_" . $id;
        $edit_comment_input_hidden = "editCommentId_" . $id;
        $edit_comment_submit = "editCommentSub_" . $id;
        $delete_icon_id = "deleteIcon_" . $id;
        $comment_like_id = $loggedIn_userId . "_commentLike_" . $id;
        $comment_likeNum_id = $loggedIn_userId . "_commentLikeNum_" . $id;
        //ratings
        $ratingManager = new RatingManager();
        $rating_content = "";
Esempio n. 6
0
 public function email($report)
 {
     $report_reason = $report->getReason();
     $entity_for_report = $report->getEntityForReport();
     $entity_id = $report->getEntityId();
     $reported_by_user_id = $report->getReportedBy();
     $reported_on = $report->getReportedOn();
     $userManager = new UserManager();
     $report_user = $userManager->getUserByUserId($reported_by_user_id);
     $report_user_name = $report_user->getLogin();
     $returnMsg = "";
     //  echo $body_text;
     $mail = new PHPMailer();
     $body = "Dear Admin, <br>User who has the login name of " . $report_user_name . " has a report for a " . $entity_for_report . " having id#: " . $entity_id . " with the reason of " . $report_reason . ", on " . $reported_on . ".<br>Please process this report at your earliest convienence. Thank you!<br><br>Tarboz Team";
     $mail->isSMTP();
     $mail->Host = "ssl://smtp.gmail.com";
     $mail->SingleTo = true;
     $mail->SMTPSecure = 'ssl';
     $mail->Port = 465;
     $mail->SMTPAuth = true;
     $mail->Username = '******';
     $mail->Password = '******';
     $mail->setFrom('*****@*****.**', 'Tarboz.com Report Team');
     $mail->addReplyTo('*****@*****.**', 'Tarboz.com Report Team');
     $mail->addAddress('*****@*****.**', 'Tarboz Admin Team');
     $mail->WordWrap = 50;
     $mail->isHTML(true);
     $mail->Subject = 'User Report for a ' . $entity_for_report;
     $mail->Body = $body;
     //if Email was not sent it should return a true bool to the user
     if (!$mail->send()) {
         //$mail->ClearAddresses();
         $returnMsg = "Mailer Error!";
     } else {
         $returnMsg = "Message sent!";
     }
     //successfully sent, then it should sent a true bool
     return $returnMsg;
 }
Esempio n. 7
0
function make_family_dad_room($ary)
{
    ?>
        <!--<div id="dad_house">-->
            <!--<div class="dad_door"><span><?php 
    echo $ary['language'];
    ?>
</span></div>-->
            <div id="dad_room">
              <div id="dad_text">
                <a href="entryview.php?id=<?php 
    echo $ary['id'];
    ?>
"><?php 
    echo $ary['text'];
    ?>
</a>
              </div>
              <div id="dad_profile_link"><span class="question" id="orig">O</span></div>
              <div id="kids_num" 
                   title="There are <?php 
    echo $ary['kidsnum'];
    ?>
 translations for this phrase">
                <?php 
    echo $ary['kidsnum'];
    ?>
              </div>
              <div id="add_kid">
                <a href="entrycreate.php?id=<?php 
    echo $ary['id'];
    ?>
&a=t" 
                   title="Add a new translation">+</a>
              </div>
              <div style="display:inline-block;width:50px"></div>
              <div class="kid_added_by">
                <a href="other_user.php?id=<?php 
    echo $ary['user'];
    ?>
">
                    <?php 
    $userMan = new UserManager();
    echo $userMan->getUserByUserId($ary['user'])->getLogin();
    //echo $userMan->getUserByUserId($ary['user'])->getFirstName()." ".$userMan->getUserByUserId($ary['user'])->getLastName();
    ?>
                </a>
              </div>
              <div class="en_creadate"
                   title="When this entry was added">
                     <?php 
    echo $ary['creadate'];
    ?>
              </div>
            </div>
         <!--</div> dad_house -->

<?php 
}