Пример #1
0
             $rubric = array_pop($row);
             if (isset($gbcats[$row[3]])) {
                 $row[3] = $gbcats[$row[3]];
             } else {
                 $row[3] = 0;
             }
             $ins = "('{$cid}','" . implode("','", addslashes_deep($row)) . "')";
             $query = "INSERT INTO imas_gbitems (courseid,name,points,showdate,gbcategory,cntingb,tutoredit) VALUES {$ins}";
             mysql_query($query) or die("Query failed :{$query} " . mysql_error());
             if ($rubric > 0) {
                 $offlinerubrics[mysql_insert_id()] = $rubric;
             }
         }
     }
     if (isset($_POST['copyrubrics'])) {
         copyrubrics($offlinerubrics);
     }
     mysql_query("COMMIT") or die("Query failed :{$query} " . mysql_error());
     if (isset($_POST['selectcalitems'])) {
         $_GET['action'] = 'selectcalitems';
         $calitems = array();
         $query = "SELECT id,date,tag,title FROM imas_calitems WHERE courseid='{$_POST['ctc']}' ORDER BY date";
         $result = mysql_query($query) or die("Query failed : {$query}" . mysql_error());
         while ($row = mysql_fetch_row($result)) {
             $calitems[] = $row;
         }
     } else {
         header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/course.php?cid={$cid}");
         exit;
     }
 } elseif (isset($_GET['action']) && $_GET['action'] == "select") {
Пример #2
0
         				$insarr = array();
         				while ($row = mysql_fetch_row($result)) {
         					$rubric = array_pop($row);
         					if (isset($gbcats[$row[3]])) {
         						$row[3] = $gbcats[$row[3]];
         					} else {
         						$row[3] = 0;
         					}
         					$ins = "('$cid','".implode("','",addslashes_deep($row))."')";
         					$query = "INSERT INTO imas_gbitems (courseid,name,points,showdate,gbcategory,cntingb,tutoredit) VALUES $ins";
         					mysql_query($query) or die("Query failed :$query " . mysql_error());
         					if ($rubric>0) {
         						$offlinerubrics[mysql_insert_id()] = $rubric;
         					}
         				}*/
         copyrubrics();
         mysql_query("COMMIT") or die("Query failed :{$query} " . mysql_error());
     }
     $query = "INSERT INTO imas_lti_courses (org,contextid,courseid) VALUES ";
     $query .= "('{$_SESSION['ltiorg']}','{$_SESSION['lti_context_id']}',{$destcid})";
     mysql_query($query) or die("Query failed : " . mysql_error());
 } else {
     $destcid = mysql_result($result, 0, 0);
 }
 if ($destcid == $aidsourcecid) {
     //aid is in destination course - just make placement
     $aid = $_SESSION['place_aid'];
 } else {
     //aid is in source course.  Let's see if we already copied it.
     $query = "SELECT id FROM imas_assessments WHERE ancestors REGEXP '^" . intval($_SESSION['place_aid']) . "[[:>:]]' AND courseid=" . intval($destcid);
     $result = mysql_query($query) or die("Query failed : " . mysql_error());