Exemple #1
0
     $body->set('classes', $classes);
     $body->set('specialattacks', $specialattacks);
     $body->set('special_abilities_max', $special_abilities_max);
     $vars = get_stats();
     if ($vars) {
         foreach ($vars as $key => $value) {
             $body->set($key, $value);
         }
     }
     break;
 case 26:
     // Insert npc
     check_authorization();
     add_npc();
     if (isset($_POST['pet']) && $_POST['pet'] == 1) {
         add_pet();
     }
     $npcid = $_POST['id'];
     header("Location: index.php?editor=npc&z={$z}&zoneid={$zoneid}&npcid={$npcid}");
     exit;
 case 27:
     // Search npcs
     //check_authorization();
     $body = new Template("templates/npc/npc.searchresults.tmpl.php");
     if (isset($_GET['npcid']) && $_GET['npcid'] != "ID") {
         $results = search_npc_by_id();
     } else {
         $results = search_npcs();
     }
     $body->set("results", $results);
     break;
Exemple #2
0
<?php

include "header.php";
//if the form has submitted
if (isset($_POST["submit"])) {
    //check for errors
    $error = check_addpet_form_error();
    if ($error == "") {
        // do something
        add_pet($con);
    } else {
        show_addpet_form($error);
    }
} else {
    show_addpet_form();
}
include "footer.php";