function get_responsibles($dbh, $event_id) { //get names of all users on event $q = $dbh->prepare("SELECT * FROM cm_events_responsibles\n\t\tWHERE event_id = '{$event_id}'"); $q->execute(); $users = $q->fetchAll(PDO::FETCH_ASSOC); $responsibles = array(); foreach ($users as $user) { $lastname = username_to_lastname($dbh, $user['username']); $fullname = username_to_fullname($dbh, $user['username']); $user_id = username_to_userid($dbh, $user['username']); $thumb = return_thumbnail($dbh, $user['username']); $responsibles[] = array('user_id' => $user_id, 'last_name' => $lastname, 'full_name' => $fullname, 'thumb' => $thumb, 'username' => $user['username']); } return $responsibles; }
$user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']); $user_registerd_in_course_as_student = $user_registerd_in_course && !$user_registerd_in_course_as_teacher; $course_public = $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD; $course_open = $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM; $course_private = $course['visibility'] == COURSE_VISIBILITY_REGISTERED; $course_closed = $course['visibility'] == COURSE_VISIBILITY_CLOSED; $course_subscribe_allowed = $course['subscribe'] == 1; $course_unsubscribe_allowed = $course['unsubscribe'] == 1; $count_connections = $course['count_connections']; $creation_date = substr($course['creation_date'], 0, 10); $icon_title = null; $html = null; // display the course bloc $html .= '<div class="col-md-3"><div class="items-course">'; // display thumbnail $html .= return_thumbnail($course, $icon_title); // display course title and button bloc $html .= '<div class="items-course-info">'; $html .= return_title($course); // display button line $html .= '<div class="toolbar">'; $html .= '<div class="btn-group">'; // if user registered as student $html .= return_description_button($course, $icon_title); if ($user_registerd_in_course_as_student) { $html .= return_already_registered_label('student'); if (!$course_closed) { if ($course_unsubscribe_allowed) { $html .= return_unregister_button($course, $stok, $search_term, $code); } }
$sql = "SELECT * FROM cm_journals WHERE username LIKE '{$user}'"; } else { die("Sorry, you do not have permission to read or write journals."); } //Get column names $c = $dbh->prepare("DESCRIBE cm_journals"); $c->execute(); $cols = $c->fetchAll(PDO::FETCH_COLUMN); //Get output $q = $dbh->prepare($sql); $q->execute(); $error = $q->errorInfo(); while ($result = $q->fetch(PDO::FETCH_ASSOC)) { $rows = array(); //Add user picture $pic = "<img class='thumbnail-mask' src='" . return_thumbnail($dbh, $result['username']) . "' border='0'>"; $rows[] = $pic; //Format data $result['username'] = username_to_fullname($dbh, $result['username']); $result['date_added'] = extract_date_time_sortable($result['date_added']); //Check to see if this user has read or archived this journal if (in_string($user, $result['read'])) { $result['read'] = 'yes'; } else { $result['read'] = ''; } if (in_string($user, $result['archived'])) { $result['archived'] = 'yes'; } else { $result['archived'] = ''; }
<th>Observations</th> </tr> </thead> <tbody> <?php $count = 0; //print "<tr class='delboxtr'>"; $user_tree_table_settings = mysql_query("SELECT trees.tree_id, tree_nickname, species_scientific_name, species_primary_common_name, user_tree_table.user_tree_id, species_master.species_id, user_tree_table.last_observation_date FROM species_master INNER JOIN (trees INNER JOIN user_tree_table ON trees.tree_id = user_tree_table.tree_id AND user_tree_table.user_id='{$_SESSION['user_id']}') ON species_master.species_id = trees.species_id ORDER BY user_tree_table.last_observation_date ASC LIMIT 0 , 5"); while ($row_settings = mysql_fetch_array($user_tree_table_settings)) { print "<tr>"; $count++; $result3 = mysql_query("SELECT path_name,file_name FROM species_images WHERE species_id='{$row_settings['species_id']}'"); $image_names = mysql_fetch_array($result3); $species_pic1 = $image_names['path_name'] . '/' . $image_names['file_name']; print "<td><a href='{$species_pic1}?TB_iframe=true' title='click for larger image' alt='click to view larger image' class='thickbox'><img src='" . return_thumbnail($species_pic1) . "' width='70px'></a></td>"; print "<td>" . $row_settings['species_primary_common_name'] . "</td>"; print "<td>" . $row_settings['tree_nickname'] . "</td>"; print "<td bgcolor>" . $row_settings['last_observation_date'] . "</td>"; $treeLinkBegin = "<a class=thickbox rel=gallery-plants href=\"userobservations.php?usertreeid=" . $row_settings['user_tree_id'] . "&TB_iframe=true&height=500&width=700\">Add</a>"; print "<td style='text-align: center;'>{$treeLinkBegin}</td>"; print "</tr>"; } echo "</tbody></table>"; echo "<table id='table1' cellspacing='0' cellpadding='3' style='width: 330px; margin-left: auto; margin-right: auto;'>\n<thead>\n<colgroup>\n<col style='width: 750px;'/>\n<col style='width: 750px;'/>\n<col style='width: 750px;'/>\n</colgroup>\n</thead>\n<tr><td></td><td></td><td><a href='listtree_for_observation.php'>view all trees</a></td></tr></table>"; ?> </td> <!-- For GMap <td class="cms" style="width: 65%; padding-left: 15px;"> <h3>My Trees</h3>
} $result3 = mysql_query("SELECT * FROM species_master WHERE species_id > '{$q}' ORDER BY species_id ASC LIMIT 1"); echo " | "; if ($result3) { echo "<a id='next_link' onClick=getSpecies('" . strval(intval($q) + 1) . "');>Next</a>"; } else { echo "Next"; } ?> </td> </tr> <tr> <td> <?php print "<a href='{$species_pic1}?TB_iframe=true' title='click to view larger image' class='thickbox' ><img src ='" . return_thumbnail($species_pic1) . "' /></a>"; ?> </td> <?php $result = mysql_query("SELECT * FROM species_master WHERE species_id='{$q}'"); while ($row_settings = mysql_fetch_array($result)) { print "<td style='text-align: top;'>Tree Name: " . $row_settings['species_primary_common_name'] . "<br/>"; print "Scientific Name:<i> " . $row_settings['species_scientific_name'] . "</i><br/>"; print "Family: " . $row_settings['family'] . "</td>"; } ?> </tr> </table> <?php
} } else { foreach ($msgs as $msg) { extract($msg); //these are replies ?> <div class = "msg_reply" data-id = "<?php echo $id; ?> "> <div class = "msg_reply_left"> <img class="thumbnail-mask" src = "<?php echo return_thumbnail($dbh, $from); ?> "> <?php echo username_to_fullname($dbh, $from); ?> </div> <div class = "msg_reply_right"> <?php echo extract_date_time($time_sent); ?>
</div> </div> </span> <?php } else { //this is an edit ?> <div class = "user_detail_control"> <p class="top_row"> <img class="thumbnail-mask" src="<?php echo return_thumbnail($dbh, $username) . '?' . rand(); ?> "> <span class="name_display"><?php echo $first_name . " " . $last_name; ?> </span> </p> <button>Close</button> </div> <span class="user_data_display_area" data-id = "<?php
} //Add board posts if ($_SESSION['permissions']['view_board'] == '1') { $this_users_groups = user_which_groups($dbh, $_SESSION['login']); $grps = implode("','", $this_users_groups); $q = $dbh->prepare("SELECT * FROM `cm_board` as all_posts\n\tJOIN\n\t(SELECT * FROM cm_board_viewers WHERE viewer IN ('{$grps}') GROUP BY cm_board_viewers.post_id) AS this_user\n\tON\n\tall_posts.id = this_user.post_id AND all_posts.time_added >= '{$mysqldate}'"); $q->execute(); $posts = $q->fetchAll(PDO::FETCH_ASSOC); foreach ($posts as $post) { $activity_type = 'new_board_post'; if ($post['author'] === $username) { $by = 'You'; } else { $by = username_to_fullname($dbh, $post['author']); } $thumb = return_thumbnail($dbh, $post['author']); $action_text = " posted on your Board "; $time_done = $post['time_added']; $time_formatted = extract_date_time($post['time_added']); $what = $post['title']; $follow_url = 'index.php?i=Board.php'; $mobile_url = 'index.php?i=Board.php'; $casename = "(view here)"; $id = null; $item = array('activity_type' => $activity_type, 'by' => $by, 'thumb' => $thumb, 'action_text' => $action_text, 'casename' => $casename, 'id' => $id, 'what' => $what, 'follow_url' => $follow_url, 'time_done' => $time_done, 'time_formatted' => $time_formatted, 'mobile_url' => $mobile_url); $activities[] = $item; } } if (!empty($activities)) { sortBySubkey($activities, 'time_done'); }
?> <div class="row"> <form class="navbar-search"> <input type="text" class="board-search search-query" placeholder="Search"> </form> </div> <div class="row board-container"> <?php if ($_SESSION['permissions']['view_board'] === '1') { if (empty($posts)) { echo "<p class='end'>There have been no posts to your Board yet.</p>"; die; } else { foreach ($posts as $p) { extract($p); echo "<div class='container board-item' style='background-color:rgb({$color})'>" . "<h3><img class='img-rounded' src='" . return_thumbnail($dbh, $author) . "'><span class='searchable'> {$title}</span></h3>" . "<div class='searchable'>{$body}</div>" . "<br /><div class='muted searchable'>Posted By " . username_to_fullname($dbh, $author) . " on " . extract_date_time($time_added) . "</div>"; $attach = check_attachments($dbh, $post_id); if ($attach == true) { echo "<br /><div class='searchable'><label>Attachments:</label>{$attach}</div>"; } echo "</div>"; } } } else { echo "<p>You do not have permission to view the board."; } ?> </div> </div> </body> </html>
</div> <?php } } ?> <?php if ($view !== 'edit') { ?> <div class = "comment"> <img class="thumbnail-mask" src="<?php echo return_thumbnail($dbh, $_SESSION['login']); ?> " border="0"> <textarea class="expand">Your comment</textarea> <a href="#" class="comment_save">Save</a> </div> <?php } ?> </div>
echo $color; ?> ,0.5)" data-id="<?php echo $post_id; ?> " data-viewers = "<?php echo get_viewers($dbh, $post_id); ?> " data-color = "<?php echo $color; ?> "> <img class="thumbnail-mask" src="<?php echo return_thumbnail($dbh, $author); ?> " border="0"> <h3><?php echo $title; ?> </h3> <div class="body_text"> <?php echo $body; ?> </div>