/** * function getQuestionOptionList: * Returns the list of options for the given question */ function getQuestionOptionList($quizId, $sectionId, $questionId) { return getItemList('quiz_objectiveoptions', "`page_modulecomponentid` = '{$quizId}' AND `quiz_sectionid` = '{$sectionId}' AND `quiz_questionid` = '{$questionId}' ORDER BY `quiz_optionrank`"); }
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; protect_page(); admin_only($user_data); $orders = mysql_select_multi('SELECT * FROM `znote_shop_orders` ORDER BY `id` DESC;'); $order_types = array(1 => 'Item', 2 => 'Premium Days', 3 => 'Gender Change', 4 => 'Name Change', 5 => 'Custom'); $items = getItemList(); ?> <h1>Shop Logs</h1> <h2>Pending Orders</h2> <p>These are pending orders, like items bought, but not received or used yet.</p> <table> <thead> <th>Id</th> <th>Account</th> <th>Type</th> <th>Item</th> <th>Count</th> <th>Date</th> </thead> <tbody> <?php foreach ($orders ? $orders : array() as $order) { ?> <tr> <td><?php echo $order['id']; ?>
function process_get() { global $page; global $MySelf; $ajax = 0; switch ($_GET['action']) { // Maintenance! case "maintenance": $page = maintenance(); break; // a specific run is requested. // a specific run is requested. case "show": $page = listRun(); $ajax = 20; break; // a profile is requested. // a profile is requested. case "profile": $page = profile(); break; // a profile change is requested. // a profile change is requested. case "modprofile": $page = modProfile(); break; // Admin request to delete an api key (NOT user deleting own!) // Admin request to delete an api key (NOT user deleting own!) case "delapi": $page = deleteAPIKey(); break; // Quick toggle of login capabilities. // Quick toggle of login capabilities. case "toggleLogin": $page = toggleLogin(); break; // Quick confirm an account. // Quick confirm an account. case "quickconfirm": $page = quickConfirm(); break; // Change of eMail requested // Change of eMail requested case "changeemail": $page = makeEmailChangeForm(); break; // Show corp hierarchy // Show corp hierarchy case "hierarchy": $page = showHierarchy(); break; // Browser solar Systems // Browser solar Systems case "browse": $page = browser(); break; // User wants to delete a run. // User wants to delete a run. case "deleterun": deleteRun(); break; // User wants to see the preferences page. // User wants to see the preferences page. case "preferences": $page = makePreferences(); break; // A banker wants to see the transaction log for a user. // A banker wants to see the transaction log for a user. case "showTransactions": $page = showTransactions(); break; // User wants to manage his cans. // User wants to manage his cans. case "cans": $page = makeCanPage(); break; // Print out fancy global statistics // Print out fancy global statistics case "globstats": $page = globalStatistics(); break; // User wants to re-validate his email. // User wants to re-validate his email. case "revalidate": validate(); break; // User wants to pop a can. // User wants to pop a can. case "popcan": $page = popCan(); break; // Kick a user. // Kick a user. case "kickban": $page = kick(); break; // User wants to toggle the empty/full setting of a can. // User wants to toggle the empty/full setting of a can. case "togglecan": $page = toggleCan(); break; // close a run. // close a run. case "endrun": endrun(); break; // Show ore values // Show ore values case "showorevalue": $page = showOreValue(); break; // Show ship values // Show ship values case "showshipvalue": $page = showShipValue(); break; // Show Corp Hierarchy // Show Corp Hierarchy case "hier": $page = showHierarchy(); break; // manage payouts // manage payouts case "payout": $page = payout(); break; // set/view the online time // set/view the online time case "onlinetime": $page = onlineTime(); break; // Mods a template // Mods a template case "edittemplate": $page = editTemplate(); break; // Some Admin wants to change the ore values. // Some Admin wants to change the ore values. case "changeow": $page = makeOreWorth(); break; // Some Admin wants to change the ore values. // Some Admin wants to change the ore values. case "changesv": $page = makeShipValue(); break; // Password change request. We wont touch that. // Password change request. We wont touch that. case "changepw": $page = makePWChangeForm(); break; // User wants to join the selected run. // User wants to join the selected run. case "joinrun": $page = joinRun(); break; // User wants to part the selected run. // User wants to part the selected run. case "partrun": $page = leaveRun(); break; // Password change request. We wont touch that. // Password change request. We wont touch that. case "lostpass": $page = makeLostPassForm(); break; // Lotto: Create group // Lotto: Create group case "lotto_createGroup": $page = lotto_createGroup(); break; // add ore from a haul to an open run. // add ore from a haul to an open run. case "addhaul": $page = addHaulPage(); break; // Edit site configuration // Edit site configuration case "configuration": $page = configuration(); break; // Add an event. // Add an event. case "addevent": $page = addEvent(); break; // Show all events. // Show all events. case "showevents": $page = showEvents(); break; // Join an Event // Join an Event case "joinevent": $page = joinEvent(); break; // Show an event. // Show an event. case "showevent": $page = showEvent(); break; // lists all ore runs. // lists all ore runs. case "list": $page = listRuns(); $ajax = 60; break; // Manage wallet // Manage wallet case "manageWallet": $page = manageWallet(); break; // Show current ranks // Show current ranks case "showranks": $page = showRanks(); break; // delete a rank // delete a rank case "deleterank": $page = delRank(); break; // delete an event from the database. // delete an event from the database. case "deleteevent": $page = deleteEvent(); break; // lists all users. // lists all users. case "editusers": $page = listUsers(); break; // lists one user. // lists one user. case "edituser": $page = listUser(); break; // prints the form for a new run. // prints the form for a new run. case "newrun": $page = makeNewOreRunPage(); break; // add a new user. // add a new user. case "newuser": $page = makeAddUserForm(); break; // Toggle the charity flag. // Toggle the charity flag. case "toggleCharity": toggleCharity(); break; /* Locking unlocking */ /* Locking unlocking */ case "lockrun": toggleLock(); break; // prints the main welcome page. // prints the main welcome page. default: $page = makeWelcome(); break; /* LOTTO STUFF */ /* LOTTO STUFF */ case "editLotto": $page = lotto_editLottery(); break; case "lotto": $page = lotto_playLotto(); break; case "claimTicket": lotto_claimTicket(); break; case "drawLotto": lotto_draw(); break; case "buycredits": $page = lotto_buyTickets(); break; case "style": $page = style(); break; case "getItemList": $page = getItemList(); break; case "switch": $MySelf = null; $_SESSION['MySelf'] = null; unset($_SERVER[QUERY_STRING]); makeLoginPage($SUPPLIED_USERNAME); break; } if ($ajax > 1) { $ajaxHtml = "<script>window.setTimeout(function(){\$.ajax({"; if (isset($_REQUEST['ajax'])) { $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "',"; } else { $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "&ajax',"; } $ajaxHtml .= "success: function(data) {\$('#content').html(data);}"; $ajaxHtml .= "});},(" . $ajax * 1000 . "));</script>"; $page .= $ajaxHtml; } if (isset($_REQUEST['ajax'])) { $html = new html(); $page = $html->clean($page); print $page; } else { // Clean & Print the page. $html = new html(); $html->addBody($page); print $html->flush(); } }
} switch ($task) { case 'getCountryName': getCountryName($conn); break; case 'getYear': getYear($conn); break; case "getMonthList": getMonthList($conn); break; case 'getItemGroup': getItemGroup($conn); break; case 'getItemList': getItemList($conn); break; case 'getShipmentStatus': getShipmentStatus($conn); break; case "getFundingSource": getFundingSource($conn); break; case "getYearList": getYearList($conn); break; case "getUnit": getUnit($conn); break; case "getDosesForm": getDosesForm($conn);
function ajax_loadTree($selector = 1, $collection_id = '', $package_id = '', $part_id = '', $item_id = '', $what = '') { $resultText = ''; if (DCTL_EXT_IMT) { } else { switch ($what) { case 'lnk': break; case 'map': $resultText .= '<script>'; $resultText .= '$(\'img#img_edit\').attr(\'src\', \'\').imgAreaSelect({disable:true, hide:true});'; $resultText .= '$(\':input[name=xml_id1]\').removeClass(\'active\').val(\'\');'; $resultText .= '$(\':input[name=xml_id2]\').removeClass(\'active\').val(\'\');'; $resultText .= '$(\':input[name=xml_label]\').removeClass(\'active\').val(\'\');'; $resultText .= '$(\':input[name=xml_lnk1id]\').removeClass(\'active\').val(\'\');'; $resultText .= '$(\'#xml_tree2\').html(\'\');'; $resultText .= '</script>'; break; default: $resultText .= 'ERROR: CASE UNIMPLEMENTED IN ' . __FUNCTION__; break; } } // BEGIN $basePath = DCTL_PROJECT_PATH; $collectionPath = $basePath . $collection_id . SYS_PATH_SEP; if ($collection_id == '') { /* // ALL COLLECTIONS $resultText .= '<ul>'; getCollectionList($basePath, &$collectionList); foreach ($collectionList['path'] as $key=>$fPath) { getCollectionRecord($fPath, &$collectionRecord); $resultText .= '<li>'; $resultText .= '<span class="text">'.cleanWebString($collectionRecord['collection_short'].' - '.$collectionRecord['collection_work'], FIELD_STRING_LENGTH).'</span>'; $resultText .= '<ul class="ajax">'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadTree&selector='.$selector.'&collection_id='.$collectionRecord['collection_id'].'}</li>'; $resultText .= '</ul>'; $resultText .= '</li>'; }; $resultText .= '</ul>'; */ } else { if ($package_id == '') { $resultText .= '<ul class="simpleTree">'; getCollectionRecord($collectionPath, &$collectionRecord); $resultText .= '<li class="root">'; $resultText .= '<span class="text">' . $collectionRecord['collection_full'] . '</span>'; } $basePath = $collectionPath; $packagePath = $basePath . $package_id . SYS_PATH_SEP; // ONE COLLECTION if ($package_id == '') { // ALL PACKAGES $resultText .= '<ul>'; getPackageList($basePath, &$packageList); foreach ($packageList['path'] as $key => $fPath) { getPackageRecord($fPath, &$packageRecord); $resultText .= '<li>'; $resultText .= '<span class="text">' . $packageRecord['package_full'] . '</span>'; $resultText .= '<ul class="ajax">'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadTree&selector=' . $selector . '&collection_id=' . $collection_id . '&package_id=' . $packageRecord['package_id'] . '&what=' . $what . '}</li>'; $resultText .= '</ul>'; $resultText .= '</li>'; } $resultText .= '</ul>'; } else { // ONE PACKAGE $basePath = $packagePath; $partPath = $basePath . $part_id . SYS_PATH_SEP; if ($part_id == '') { // ALL PARTS $resultText .= '<ul>'; getPartList($basePath, &$partList); foreach ($partList['path'] as $key => $fPath) { getPartRecord($fPath, &$partRecord); $resultText .= '<li>'; if (DCTL_EXT_IMT && $what == 'map') { $resultText .= '<span class="text"><a href="javascript:void(0);" onclick="'; $resultText .= 'doProgress();$.post(\'indexAjax.php\',{action:\'ajax_loadTree\', selector:\'' . $selector . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $partRecord['part_id'] . '\', what:\'' . $what . '\'},'; $resultText .= ' function(' . DCTL_EXT_IMT_CBP . '){ commdodoro_initializeIMT(' . DCTL_EXT_IMT_CBP . '); killProgress();});'; $resultText .= '">' . cleanWebString($partRecord['part_short'] . ': ' . $partRecord['part_work'], FIELD_STRING_LENGTH) . ' </a></span>'; } else { $resultText .= '<span class="text" onclick="doProgress();$(this).next().load(\'indexAjax.php\',{action:\'ajax_loadTree\', selector:\'' . $selector . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $partRecord['part_id'] . '\', what:\'' . $what . '\'},function(){ $(\'#xml_tree' . $selector . ' .simpleTree\').get(0).setTreeNodes(this, false); killProgress(); }).insertAfter(this);">' . cleanWebString($partRecord['part_short'] . ': ' . $partRecord['part_work'], FIELD_STRING_LENGTH) . ' </span>'; $resultText .= '<img src="' . DCTL_IMAGES . 'refresh.gif" class="refresh" alt="(refresh)" onclick="doProgress();$(this).next().load(\'indexAjax.php\',{action:\'ajax_loadTree\', selector:\'' . $selector . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $partRecord['part_id'] . '\', what:\'' . $what . '\'},function(){ $(\'#xml_tree' . $selector . ' .simpleTree\').get(0).setTreeNodes(this, false); killProgress(); }).insertAfter(this);" />'; $resultText .= '<ul class="ajax">'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadTree&selector=' . $selector . '&collection_id=' . $collection_id . '&package_id=' . $package_id . '&part_id=' . $partRecord['part_id'] . '&what=' . $what . '}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; } $resultText .= '</ul>'; } else { $basePath = $partPath; $itemPath = $basePath . $item_id . SYS_PATH_SEP; // ONE PART if ($item_id == '') { // ALL ITEMS if (DCTL_EXT_IMT && $what == 'map') { $resultText .= '<?xml version="1.0" encoding="UTF-8"?>'; $resultText .= '<dctl_ext_init>'; $resultText .= '<xml>'; if (getItemList($basePath, &$itemList, $what) > 0) { $thePath = DCTL_PROJECT_PATH . $collection_id . SYS_PATH_SEP . DCTL_FILE_MAPPER; if (is_file($thePath)) { forceUTF8($thePath); $simplexml = simplexml_load_file($thePath, 'SimpleXMLElement', DCTL_XML_LOADER); $namespaces = $simplexml->getDocNamespaces(); foreach ($namespaces as $nsk => $ns) { if ($nsk == '') { $nsk = 'tei'; } $simplexml->registerXPathNamespace($nsk, $ns); } $simplexml = simplexml_load_string(str_ireplace('xml:id', 'id', $simplexml->asXML()), 'SimpleXMLElement'); foreach ($itemList['path'] as $key => $fPath) { $uri = 'xml://' . $collection_id . '/' . $package_id . '/' . $itemList['item_id'][$key]; $content = $itemList['item_short'][$key]; $ref = ''; $target = ''; $label = ''; $fullItem = $uri; $fullItem = preg_replace('/(\\.\\d\\d\\d)/', '.001', $fullItem); $resultXML = $simplexml->xpath('//*[contains(@target,\'' . $fullItem . '\') and substring(substring-after(@target,\'' . $fullItem . '\'),1,1) != "."]'); if (count($resultXML) > 0) { foreach ($resultXML as $n => $link) { $attrs = $link->attributes(); foreach (explode(' ', $link['target']) as $k => $v) { if ($v != '') { if ($v != $fullItem) { $ref = $attrs['id']; $target = $v; $label = $attrs['n']; } } } } } $resultText .= '<a'; $resultText .= ' r="' . $ref . '"'; $resultText .= ' s="' . $uri . '"'; $resultText .= ' t="' . $target . '"'; $resultText .= ' l="' . $label . '"'; $resultText .= ' c="' . $content . '"'; $resultText .= ' />'; } } else { dump('ERRORE'); } } $resultText .= '</xml>'; $resultText .= '<img>'; if (getImageList($basePath, &$imageList) > 0) { $key = 0; if (isset($imageList['path'][$key])) { $uri = 'img://' . $imageList['image_id'][$key]; $url = DCTL_EXT_URL . '/indexAjax.php?&action=get_file&collection_id=' . $collection_id . '&url=' . DCTL_MEDIA_MED . $imageList['image_id'][$key]; $label = $imageList['image_short'][$key]; $resultText .= '<a'; $resultText .= ' s="' . $uri . '"'; $resultText .= ' u="' . $url . '"'; $resultText .= ' l="' . $label . '"'; $resultText .= ' />'; } } $resultText .= '</img>'; $resultText .= '<cb'; $resultText .= ' u="' . DCTL_EXT_IMT_CB . '"'; $resultText .= ' p="' . DCTL_EXT_IMT_CBP . '"'; $resultText .= ' />'; $resultText .= '</dctl_ext_init>'; $resultText = base64_encode($resultText); //base64_encode } else { $resultText .= '<script>'; switch ($what) { case 'lnk': break; case 'map': $resultText .= '$(\'#xml_tree' . ($selector + 1) . '\').load(\'indexAjax.php\', {action:\'ajax_loadImageList\', selector:\'' . ($selector + 1) . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $part_id . '\', what:\'' . $what . '\'});'; break; default: $resultText .= 'alert(\'ERROR: CASE UNIMPLEMENTED IN ...' . __FUNCTION__ . '\');'; break; } $resultText .= '</script>'; if (getItemList($basePath, &$itemList, $what) > 0) { $resultText .= '<ul>'; foreach ($itemList['path'] as $key => $fPath) { getItemRecord($fPath, &$itemRecord, $itemList['item_short'][$key]); $resultText .= '<li>'; $resultText .= '<span class="text">'; if ($itemRecord['item_id'] != '') { $resultText .= '<a href="javascript:void(0);" onclick="'; // carica XML $resultText .= '$(\'#xml_chunk\').load(\'indexAjax.php\', {action:\'ajax_loadChunk\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $part_id . '\', item_id:\'' . $itemRecord['item_short'] . '\', what:\'' . $what . '\'});'; // carica ID $resultText .= '$(\':input[name=xml_id' . $selector . ']\').addClass(\'active\').attr({value:\'' . 'xml://' . $collection_id . SYS_PATH_SEP . $package_id . SYS_PATH_SEP . $itemRecord['item_short'] . '\'});'; switch ($what) { case 'lnk': // carica LINK $resultText .= '$(\'#xml_lnk' . $selector . '\').load(\'indexAjax.php\', {action:\'ajax_loadLinkList\', selector:\'' . $selector . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $part_id . '\', item_id:\'' . $itemRecord['item_short'] . '\', what:\'' . $what . '\'}, function(){$(\'#xml_lnk' . $selector . ' .simpleTree\').simpleTree({activeLeaf: false}); });'; $resultText .= '" title="#">'; $resultText .= cleanWebString($itemRecord['item_short'] . ': ' . $itemRecord['item_work'], FIELD_STRING_LENGTH); break; case 'map': $mapped = ajax_loadLinkList($selector, $collection_id, $package_id, $part_id, $itemRecord['item_id'], $what); $mapped = preg_match('/(.*)\\?(.*)\\#(.*)\\@(.*)/', $mapped, $matches); if ($mapped) { $ref = $matches[1]; $label = $matches[2]; } else { $ref = ''; $label = $itemRecord['item_work']; } $resultText .= '$(\':input[name=xml_label]\').removeClass(\'active\').val(\'' . str_ireplace(''', "\\'", $label) . '\');'; $resultText .= '$(\':input[name=xml_id2]\').removeClass(\'active\').val(\'\');'; $resultText .= '$(\':input[name=xml_lnk1id]\').addClass(\'active\').attr({value:\'' . $ref . '\'});'; $resultText .= '$(\'#xml_tree' . ($selector + 1) . '\').load(\'indexAjax.php\', {action:\'ajax_loadImageList\', selector:\'' . ($selector + 1) . '\', collection_id:\'' . $collection_id . '\', package_id:\'' . $package_id . '\', part_id:\'' . $part_id . '\', item_id:\'' . $itemRecord['item_short'] . '\', what:\'' . $what . '\'}'; if ($mapped) { $uri = $matches[3]; $img = str_ireplace('img://', $collection_id . SYS_PATH_SEP . DCTL_MEDIA_BIG, $uri); $coord = explode(',', $matches[4]); $resultText .= ', function () {'; $img = ajax_loadImage($img, $dim, $what); $resultText .= ajax_loadImageMap($selector, $itemRecord['item_id'], $uri, $img, $dim, $coord, $what); $resultText .= '}'; } $resultText .= ');'; $resultText .= '" title="#">'; if ($mapped) { $resultText .= '<span class="dctl_ok">'; $resultText .= cleanWebString($itemRecord['item_short'] . ': ' . $itemRecord['item_work'], FIELD_STRING_LENGTH); $resultText .= '</span>'; $resultText .= '  <img src="' . DCTL_IMAGES . 'published_no.png" alt="delete" onclick="deleteLink(\'' . $matches[1] . '\',\'' . $matches[3] . '@' . $matches[4] . '\',\'' . $matches[2] . '\', \'' . $what . '\')" />'; } else { $resultText .= cleanWebString($itemRecord['item_short'] . ': ' . $itemRecord['item_work'], FIELD_STRING_LENGTH); } break; default: $resultText .= 'alert(\'ERROR: CASE UNIMPLEMENTED IN ...' . __FUNCTION__ . '\');'; $resultText .= '" title="#">'; $resultText .= cleanWebString($itemRecord['item_short'] . ': ' . $itemRecord['item_work'], FIELD_STRING_LENGTH); break; } $resultText .= '</a>'; } else { $resultText .= '<em class="dctl_ko">'; $resultText .= cleanWebString($itemRecord['item_short'] . ': ' . $itemRecord['item_work'], FIELD_STRING_LENGTH); $resultText .= '</em>'; } $resultText .= '</span>'; $resultText .= '</li>'; } $resultText .= '</ul>'; } else { $resultText .= '<li><i>nessun id</i></li>'; } } } else { $resultText .= 'UNIMPLEMENTED'; } } } if (DCTL_EXT_IMT && $what == 'map') { // nothing } else { $resultText .= '</li>'; $resultText .= '</ul>'; } } return $resultText; }