Example #1
0
 /**
  * attach the id of the created object at the end of back_url with the name, in attach the result in create_result
  * @param string $back_url contains the back url
  */
 function create($back_url)
 {
     $this->back_url = $back_url;
     unset($_SESSION['last_error']);
     require_once $GLOBALS['where_lms'] . '/modules/item/item.php';
     additem($this);
 }
Example #2
0
         echo "<br>";
     }
     if ($dimmak_sequence == 1) {
         //*
         echo "<form id=\"Buy_DimMak\" action=\"dojo.php?dimmak_sequence=2\" method=\"post\" name=\"buy_dimmak\">\n";
         echo "<div>\n";
         echo "<br>Trade your memories of " . $dimMakCost . " kills for the DimMak Scroll?  \n";
         echo "<input id=\"dimmak_sequence\" type=\"hidden\" value=\"2\" name=\"obtainscroll\">\n";
         echo "<input type=\"submit\" value=\"Obtain Dim Mak\" class=\"formButton\"><br>\n";
         echo "</div>\n";
         echo "</form>\n";
         //*/
     }
     if ($dimmak_sequence == 2) {
         subtractKills($username, $dimMakCost);
         additem($username, "Dim Mak", 1);
         echo "The monk meditates for a moment, then passes his hand over your forehead.  You feel a moment of dizziness.  \n";
         echo "He hands you a pure black scroll.<br>\n";
         $dimmak_sequence = '';
     }
     echo "<hr>\n";
     // *** End of Dim Mak Code. ***
 }
 //*/  Toggle Class Change Code On/Off
 if (getLevel($username) >= $classChangeLevelReq && getKills($username) >= $classChangeCost) {
     if ($classChangeSequence != 2) {
         echo "A white-robed monk stands near the entrance to the dojo.";
         if ($classChangeSequence != 1) {
             echo "  The white monk approaches you and offers to give you <a href=\"dojo.php?classChangeSequence=1\">the knowledge of your enemies</a> at the cost of your own memories.</a>\n";
         } else {
             echo "  The white monk approaches you and offers to give you the knowledge of your enemies at the cost of your own memories.\n";
Example #3
0
     die;
     break;
 case "chronicle":
     stdhead($lang_log['head_chronicle']);
     $query = mysql_real_escape_string(trim($_GET["query"]));
     if ($query) {
         $wherea = " WHERE txt LIKE '%{$query}%' ";
         $addparam = "query=" . rawurlencode($query) . "&";
     } else {
         $wherea = "";
         $addparam = "";
     }
     logmenu("chronicle");
     searchtable($lang_log['text_search_chronicle'], 'chronicle');
     if (get_user_class() >= $chrmanage_class) {
         additem($lang_log['text_add_chronicle'], 'chronicle');
     }
     if ($_GET['do'] == "del" || $_GET['do'] == 'edit' || $_POST['do'] == "add" || $_POST['do'] == "update") {
         $txt = $_POST['txt'];
         if (get_user_class() < $chrmanage_class) {
             permissiondeny();
         } elseif ($_POST['do'] == "add") {
             sql_query("INSERT INTO chronicle (userid,added, txt) VALUES ('" . $CURUSER["id"] . "', now(), " . sqlesc($txt) . ")") or sqlerr(__FILE__, __LINE__);
         } elseif ($_POST['do'] == "update") {
             $id = 0 + $_POST['id'];
             if (!$id) {
                 header("Location: log.php?action=chronicle");
                 die;
             } else {
                 sql_query("UPDATE chronicle SET txt=" . sqlesc($txt) . " WHERE id=" . $id) or sqlerr(__FILE__, __LINE__);
             }
Example #4
0
function copysub($items, $parent, &$addtoarr)
{
    global $checked, $blockcnt, $item, $questions, $qset;
    foreach ($items as $k => $anitem) {
        if (is_array($anitem)) {
            if (array_search($parent . '-' . ($k + 1), $checked) !== FALSE) {
                //copy block
                $newblock = array();
                $newblock['name'] = $anitem['name'];
                $newblock['id'] = $blockcnt;
                $blockcnt++;
                $newblock['startdate'] = $anitem['startdate'];
                $newblock['enddate'] = $anitem['enddate'];
                $newblock['avail'] = $anitem['avail'];
                $newblock['SH'] = $anitem['SH'];
                $newblock['colors'] = $anitem['colors'];
                $newblock['public'] = $anitem['public'];
                $newblock['fixedheight'] = $anitem['fixedheight'];
                $newblock['items'] = array();
                copysub($anitem['items'], $parent . '-' . ($k + 1), $newblock['items']);
                $addtoarr[] = $newblock;
            } else {
                copysub($anitem['items'], $parent . '-' . ($k + 1), $addtoarr);
            }
        } else {
            if (array_search($anitem, $checked) !== FALSE) {
                $addtoarr[] = additem($anitem, $item, $questions, $qset);
            }
        }
    }
}
Example #5
0
             if ($receipt['type'] != 'in') {
                 // sprawdzamy czy mamy tyle kasy w kasie ;)
                 $sum = 0;
                 if ($contents) {
                     foreach ($contents as $item) {
                         $sum += $item['value'];
                     }
                 }
                 $sum += $itemdata['value'];
                 if ($cash < $sum) {
                     $error['nocash'] = trans('There is no cash in selected registry! You can expense only $a.', moneyf($cash));
                     break;
                 }
             }
             if (!$error) {
                 additem($contents, $itemdata);
             }
         }
     }
     break;
 case 'deletepos':
     if (sizeof($contents)) {
         foreach ($contents as $idx => $row) {
             if ($row['posuid'] == $_GET['posuid']) {
                 unset($contents[$idx]);
             }
         }
     }
     break;
 case 'setcustomer':
     $oldreg = $receipt['regid'];
Example #6
0
 /**
  * function create( $back_url )
  * @param string $back_url contains the back url
  * @return bool TRUE if success FALSE if fail
  * attach the id of the created object at the end of back_url with the name id_lo
  *
  * static
  **/
 function create($back_url)
 {
     $this->back_url = $back_url;
     unset($_SESSION['last_error']);
     require_once Docebo::inc(_lms_ . '/modules/scorm/scorm.php');
     additem($this);
 }
Example #7
0
    //$cpm->RenderOrganization( '-resource-', $rdb );
    $so = new Scorm_Organization(addslashes($org_identifier), $new_idscorm_package, $GLOBALS['dbConn']);
    if ($so->err_code > 0) {
        $_SESSION['last_error'] = 'Error: ' . $so->getErrorText() . ' [' . $so->getErrorCode() . ']';
        return FALSE;
    } else {
        return $so->idscorm_organization;
    }
}
if (isset($GLOBALS['op'])) {
    switch ($GLOBALS['op']) {
        /*case "display": {
        			display();
        		}; break;*/
        case "additem":
            additem();
            break;
        case "insitem":
            insitem();
            break;
        case "deleteitem":
            deleteitem();
            break;
        case "dodelete":
            dodelete();
            break;
        case "category":
            category();
            break;
        case "categorysave":
            categorysave();