$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; $this_hypothesis->user_id = $active_user->id; //this makes the duplicating user the creator of the new hypothesis, regardless of who originally created it $this_hypothesis->insertNew(); $new_hypotheses[] = $this_hypothesis->id;
** ** 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/>. //////////////////////////////////////////////////////////////////////////////// */ include "code/includes.php"; $active_evidence = new Evidence(); foreach ($_REQUEST as $field => $value) { $active_evidence->{$field} = addslashes($value); } $active_evidence->user_id = $active_user->id; $active_evidence->insertNew(); $cred = $_REQUEST['credibility']; if ($cred == "credible") { mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('y', '{$active_evidence->id}', '{$active_user->id}', '1')"); } else { if ($cred == "suspect") { mysql_do("INSERT INTO credibility (value, evidence_id, user_id, weight) VALUES ('n', '{$active_evidence->id}', '{$active_user->id}', '1')"); } } setStatusMessage("Added!"); ?> <html> <head> <title>Updating...</title> <meta http-equiv=Refresh content="0; url=project/<?php