addCacheToPowerTrail($cacheId, $projectId, $db, $ptAPI); print 'cacheAddedToPt'; } if ($ptDbRow['conquestedCount'] > 0) { // cache bellongs to PT wchcich was 'completed' print "this cache cannot be removed"; } if ($projectId <= 0 && $ptDbRow['conquestedCount'] == 0) { removeCacheFromPowerTrail($cacheId, $resultPowerTrailId, $db, $ptAPI); recalculate($resultPowerTrailId['PowerTrailId']); print 'removed'; } if ($projectId > 0 && $caheIsAttaschedToPt === true && $ptDbRow['conquestedCount'] == 0) { removeCacheFromPowerTrail($cacheId, $resultPowerTrailId, $db, $ptAPI); addCacheToPowerTrail($cacheId, $projectId, $db, $ptAPI); recalculate($resultPowerTrailId['PowerTrailId']); print 'cacheAddedToPt'; } function addCacheToPowerTrail($cacheId, $projectId, $db, $ptAPI) { $query = 'INSERT INTO `powerTrail_caches`(`cacheId`, `PowerTrailId`, `points`) VALUES (:1,:2,:3) ON DUPLICATE KEY UPDATE PowerTrailId=VALUES(PowerTrailId)'; $db->multiVariableQuery($query, $cacheId, $projectId, getCachePoints($cacheId)); $queryInsertedCacheData = 'SELECT longitude, latitude FROM caches WHERE cache_id = :1 LIMIT 1'; $db->multiVariableQuery($queryInsertedCacheData, $cacheId); $insertedCacheData = $db->dbResultFetch(); $query = 'SELECT centerLatitude, centerLongitude FROM PowerTrail WHERE `id` = :1 LIMIT 1'; $db->multiVariableQuery($query, $projectId); $result = $db->dbResultFetch(); $cachePoints = getCachePoints($cacheId); if ($result['centerLatitude'] == 0 && $result['centerLongitude'] == 0) { $query = ' UPDATE `PowerTrail` SET `cacheCount`=`cacheCount`+1, `centerLatitude` = :2, `centerLongitude` = :3, `points` = :4
$err_message = " Unable to process your request due to the following problems: <br>\n"; do_html_header("Admin Recalculate Evaluation Score", &$err_message); //Establish database connection $db = adodb_connect(); if (!$db) { echo "Could not connect to database server - please try later."; exit; } if ($_POST["submit"] === "Recalculate all Papers") { // user wants recalculation to happen $appropriate = intval($_POST["appropriate"]); $originality = intval($_POST["originality"]); $technical = intval($_POST["technical"]); $presentation = intval($_POST["presentation"]); $overall = intval($_POST["overall"]); recalculate($db, $appropriate, $originality, $technical, $presentation, $overall); } else { $appropriate = 5; $originality = 5; $technical = 5; $presentation = 5; $overall = 80; } ?> <p>The standard evaluation is computed as: <strong>80% weighting for Overall Evaluation + 5% weighting for each of the other criteria</strong></p> <p>This can be changed here. Pay attention to the fact, that this function will change the entry <i>OverallRating</i> in the <i>Paper</i> table, but not the calculation procedure itself. Thus, if a paper is reviewed again, the standard calculation scheme applies for that paper.</p> <p>Therefore use this function only after all reviewers are finished.</p>
} else { $sql = "UPDATE dynamic\n SET short=" . $i1 . ", lshort=" . $i2 . ", longg=" . $i3 . ", llong=" . $i4 . ", p1='" . $problems1 . "', p2='" . $problems2 . "', p3='" . $problems3 . "', p4='" . $problems4 . "' \n WHERE handle='" . $user . "'"; echo $sql; $retval = mysql_query($sql); return true; } } else { //header("Location: add.php?error=1"); return false; } } $month = $_GET['month']; $lmonth = $_GET['lmonth']; $short = $_GET['short']; $lshort = $_GET['lshort']; //recalculate($user,$month,$lmonth,$short,$lshort); $sql = "SELECT handle FROM detail"; $result = mysql_query($sql); if (empty($_GET['work'])) { echo 'You should learn some more hacking, or try reading more piece of codes..!'; echo "<br>" + realpath(''); } else { while ($row = mysql_fetch_assoc($result)) { if (recalculate($row['handle'], $month, $lmonth, $short, $lshort) == false) { echo 'error in calculating of ' . $row['handle']; } echo 'calculated of ' . $row['handle'] . "<br><br><br>"; } } ?>
case "GroupIssueWrit": GroupIssueWrit(); case "GroupCancelWrit": GroupCancelWrit(); case "selectPossibleTransferWrits": selectPossibleTransferWrits(); case "selectArrearTransferWrits": selectArrearTransferWrits(); case "transferAction": transferAction(); case "ArrearTransferAction": ArrearTransferAction(); case "confirmAction": confirmAction(); case "recalculate": recalculate(); case "calculate": calculate(); case "Prior_Corrective_Writ": Prior_Corrective_Writ(); case "Next_Corrective_Writ": Next_Corrective_Writ(); } function selectPersonWrt() { $query = "DROP TABLE IF EXISTS temp_sum_item_writs2"; PdoDataAccess::runquery($query); $qry = " CREATE TEMPORARY TABLE temp_sum_item_writs2 AS\n select sum(w.value) sumValue ,w.writ_id , w.writ_ver, w.staff_id\n\t\t\t\tfrom writ_salary_items w\n\t\t\t\t\tjoin staff s on(w.staff_id=s.staff_id)\n\t\t\t\t\tjoin persons p on(p.PersonID=? AND s.PersonID=p.PersonID)\n group by writ_id , writ_ver, staff_id"; PdoDataAccess::runquery($qry, array($_GET["Q0"])); //if($_SESSION['UserID'] == 'jafarkhani') { echo PdoDataAccess::GetLatestQueryString(); die() ; } $query = " ALTER TABLE temp_sum_item_writs2 ADD INDEX(writ_id,writ_ver,staff_id) ";
function delete_operation($operation_id, $wallet_id) { mysql_query("DELETE FROM operations WHERE id = " . $operation_id); recalculate($wallet_id); }
if (stripos($to_check, $fun) > 0) { $add = 1; } } foreach ($final[$value] as $fun) { if (stripos($to_check2, $fun) > 0) { $add = 1; } } echo $add; if ($add == 0) { // INSIDE IT IF THE USER IS NOT OF THE INSITUTION NAME SUPPLIED IN COOKIE header("Location: add.php?error=4"); } else { // FINALLY ADDING THE USER INTO THE DATABASE recalculate($user, $month, $lmonth, $short, $lshort, $html); $sql = 'INSERT INTO detail (handle, name, country, rank1, rank2, rank3, rank4, college) VALUES("' . $user . '", "' . $naam[0] . '", "' . $country[0] . '", ' . $rank[0] . ', ' . $rank[1] . ', ' . $rank[2] . ', ' . $rank[3] . ', ' . $value . ')'; $retval = mysql_query($sql) or die("cannot select db"); mysql_error(); header("Location: add.php?error=9&user="******""); //echo 'Thank you '; } } else { header("Location: add.php?error=1"); } } else { header("Location: add.php?error=2"); } mysql_close($conn); } ?>