public function getDiagsCompare($user_1, $user_2)
 {
     // Load up diags for the evidence array.
     for ($i = 0; $i < count($this->evidence); $i++) {
         $this_evidence = new Evidence();
         $this_evidence->populateFromId($this->evidence[$i]);
         $this_evidence->diag = Evidence::getDiagCompare($this_evidence->id, $this, $user_1, $user_2);
         //$this_evidence->update();
     }
 }
**    the Free Software Foundation, either version 3 of the License, or
**    (at your option) any later version.
**
**    ACH is distributed in the hope that it will be useful,
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**    GNU General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////// */
?>

<?php 
$active_evidence = new Evidence();
$active_evidence->populateFromId($_REQUEST['evidence_id']);
$this_user = new User();
$this_user->populateFromId($active_evidence->user_id);
?>

<div id="nonEdit">
<p><a onClick="document.getElementById('edit').style.display='block'; document.getElementById('nonEdit').style.display='none';">Edit evidence information</a><?php 
if ($active_project->user_id == $active_user->id) {
    ?>
 |<a style="color: #FF0000; padding-left: 10px;" onclick="javascript:confirm_delete_evidence(<?php 
    echo $active_evidence->id;
    ?>
);">Delete evidence record</a><?php 
}
?>
</p>
    $this_hypothesis = new Hypothesis();
    $this_hypothesis->populateFromId($active_project->hypotheses[$j]);
    echo '<th class="hypothesis" onmouseover="return overlib(\'' . cleanForDisplay($this_hypothesis->description) . '\', CAPTION, \'Hypothesis\');" onmouseout="return nd();"><a href="' . $base_URL . 'project/' . $active_project->id . '/hypothesis/' . $this_hypothesis->id . '">' . $this_hypothesis->label . '</a> ';
    $rating_score = 0;
    for ($i = 0; $i < count($active_project->evidence); $i++) {
        $rating = $compare_user_2->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]);
        $rating_score += getHypoRatingScore($rating);
        $rating = $compare_user->getRating($active_project->evidence[$i], $active_project->hypotheses[$j]);
        $rating_score += getHypoRatingScore($rating);
    }
    echo '<br><i>' . $rating_score . '</i></th>';
}
echo '</tr></thead><tbody>';
for ($i = 0; $i < count($active_project->evidence); $i++) {
    $this_evidence = new Evidence();
    $this_evidence->populateFromId($active_project->evidence[$i]);
    echo '<tr><td class="evidence" onmouseover="return overlib(\'' . cleanForDisplay($this_evidence->details) . '\', CAPTION, \'Evidence\');" onmouseout="return nd();"><a href="' . $base_URL . 'project/' . $active_project->id . '/evidence/' . $this_evidence->id . '">' . $this_evidence->name . '</a></td>';
    ?>

	<td class="dcDateAdded" style="display: none;"><?php 
    echo $this_evidence->created;
    ?>
</td>
	<td class="dcDateOfSource" style="display: none;"><?php 
    echo substr($this_evidence->date_of_source, 0, 10);
    ?>
</td>
	<td class="dcType" style="display: none;"><?php 
    echo $this_evidence->type;
    ?>
</td>
$active_project->id = "";
$active_project->title .= " (Copy)";
//DEFAULT TITLE FOR DUPLICATED PROJECTS IS "[ORIGINAL PROJECT NAME] (Copy)"
$active_project->user_id = $active_user->id;
$active_project->insertNew();
$new_project_id = $active_project->id;
$old_evidence = array();
$old_hypotheses = array();
$new_evidence = array();
$new_hypotheses = array();
//GET ALL OF THE EVIDENCE FROM THIS MATRIX AND DUPLICATE IT
$result = mysql_do("SELECT id, deleted FROM evidence WHERE project_id='{$project_id}'");
while ($query_data = mysql_fetch_array($result)) {
    if ($query_data['deleted'] != "y") {
        $this_evidence = new Evidence();
        $this_evidence->populateFromId($query_data['id']);
        $this_evidence->project_id = $active_project->id;
        $this_evidence->user_id = $active_user->id;
        //this makes the duplicating user the creator of the new evidence, regardless of who originally created it
        $this_evidence->insertNew();
        $new_evidence[] = $this_evidence->id;
        $old_evidence[] = $query_data['id'];
    }
}
//GET ALL OF THE HYPOTHESES FROM THIS MATRIX AND DUPLICATE THEM
$result = mysql_do("SELECT id, deleted FROM hypotheses WHERE project_id='{$project_id}'");
while ($query_data = mysql_fetch_array($result)) {
    if ($query_data['deleted'] != "y") {
        $this_hypothesis = new Hypothesis();
        $this_hypothesis->populateFromId($query_data['id']);
        $this_hypothesis->project_id = $active_project->id;
 public function switchCred($toValue)
 {
     // Use this to change credibility.
     global $active_user;
     $return_value = "";
     $this_evidence = new Evidence();
     $this_evidence->populateFromId($this->evidence_id);
     if ($toValue == "y") {
         $return_value = "Credible";
     } else {
         $return_value = "Suspect";
     }
     if ($this_evidence->serial_number != "") {
         $result = mysql_do("SELECT id FROM evidence WHERE serial_number='{$this_evidence->serial_number}'");
         while ($query_data = mysql_fetch_array($result)) {
             $exists = FALSE;
             $this_evidence_id = $query_data['id'];
             $result2 = mysql_do("SELECT id FROM credibility WHERE user_id='{$active_user->id}' AND evidence_id='{$this_evidence_id}' LIMIT 1");
             while ($query_data2 = mysql_fetch_array($result2)) {
                 $exists = TRUE;
             }
             if (!$exists) {
                 mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('{$toValue}', '{$this_evidence_id}', '{$active_user->id}', '1')");
             }
         }
         mysql_do("UPDATE credibility SET value='{$toValue}' WHERE user_id='{$active_user->id}' AND evidence_id IN (SELECT id FROM evidence WHERE serial_number='{$this_evidence->serial_number}')");
     } else {
         mysql_do("UPDATE credibility SET value='{$toValue}' WHERE user_id='{$active_user->id}' AND evidence_id='{$this_evidence->id}'");
     }
     return $return_value;
 }