Example #1
0
                $error = true;
                $errors[] = 'Your comment could not be inserted. There may be a server error.';
            }
            // and our work here is done!
            if ($error) {
                output_errors($errors);
            } else {
                header("Location: {$_SERVER['REQUEST_URI']}");
                exit;
            }
        }
        // add to views
        db_query("UPDATE issues SET num_views = num_views + 1 WHERE id = '{$id}'");
        // who is the issue assigned to?
        if ($issue['assign'] > 0) {
            $issue['assignedto'] = getuinfo($issue['assign']);
        } else {
            $issue['assignedto'] = 'nobody';
        }
        // Get assignable users (for now, just admins)
        $assignsarr = array(array(0, 'nobody'), array(0, '----------------------'));
        foreach ($users->from_admins() as $uid) {
            $assignsarr[] = array($uid, getunm($uid), $uid == $issue['assign'] ? true : false);
        }
        $issue['assigns'] = $assignsarr;
        // get the comments
        $result_comments = db_query_toarray("SELECT * FROM comments WHERE issue = {$id} ORDER BY when_posted ASC", "Retrieving comments for issue {$id} from database");
        // output the page
        $page->include_template('ticket', array('issue' => $issue, 'comments' => $result_comments));
    }
}
Example #2
0
</a>
			
			<?php 
    echo_tags($issue['tags']);
    ?>
			
		</td>
		<td class="replies"><?php 
    echo $ticket['num_comments'];
    ?>
</td>
		<td class="assigned<?php 
    echo $ticket['assign'] == $_SESSION['uid'] && $ticket['status'] < 3 ? ' you' : '';
    ?>
"><?php 
    echo $ticket['assign'] > 0 ? '<a href="profile.php?id=' . $ticket['assign'] . '">' . getunm($ticket['assign']) . '</a>' : '--';
    ?>
</td>
		<td class="last"><?php 
    echo timeago($ticket['when_updated'], false, true);
    ?>
</td>
                <td class="status"><?php 
    echo getstatusnm($ticket["status"]);
    ?>
</td>
	</tr>
	
	<?php 
}
?>