Ejemplo n.º 1
0
 function updateEvent($STATUS, $ID)
 {
     $u = new events();
     $this->getAllByPK($ID);
     $row = $this->getNext();
     $ret[$this->table] = $row;
     $u->broadcast(json_encode($ret));
 }
Ejemplo n.º 2
0
function init_events()
{
    $serverTimeFormat = "\\I\\t \\i\\s g:i a T \\o\\n l, F jS \\o\\f Y";
    $uptime = `uptime`;
    $events = new events();
    $parts = explode("average: ", $uptime, 2);
    $load = $parts[count($parts) - 1];
    //Keep Alive Ping
    $pingData = ["id" => uniqid("kuhl-"), "server-time" => date($serverTimeFormat), "server-load" => $load, "server" => $_SERVER];
    $events->add("ping", $pingData);
    //Send Pending Events for Session
    $events->sendEvents();
}
Ejemplo n.º 3
0
 function view()
 {
     events::observe('save', 'pages', 'settings', 'save');
     events::observer();
     $settings = settings::get('pages');
     f::set($settings);
 }
Ejemplo n.º 4
0
 function view()
 {
     events::observe('save', 'feedback');
     events::observer();
     $settings = settings::get('feedback');
     f::set($settings);
 }
Ejemplo n.º 5
0
 function edit()
 {
     events::observe('save', 'templates', 'apps', '_save');
     events::observer();
     $tmpl_file = events::get('tmpl_file');
     $app = events::get('app');
     if (events::detect('restore')) {
         self::restoreVersion($app, $tmpl_file, events::get('restore'));
     }
     admin::components('tabs', 'validator');
     f::set('app', $app);
     f::set('tmpl_file', $tmpl_file);
     s::set('app', $app);
     s::set('tmpl_file', $tmpl_file);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     $code = files::get($file);
     f::set('tmpl_code', $code);
     self::getApps();
     /*
     	Load versions
     */
     db::table('templates_versions');
     db::where('app', $app);
     db::where('tmpl_file', $tmpl_file);
     db::order('version_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']);
         $row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
         s::roll('versions', $row);
     }
 }
Ejemplo n.º 6
0
 function view()
 {
     events::observe('save', 'system', 'users', 'saveProfile');
     events::observer();
     admin::components('validator');
     admin::addHeader(' ' . adminUser::get('user_login'));
     f::set(adminUser::gets());
 }
Ejemplo n.º 7
0
 function isCheck($name, $index = false)
 {
     if (events::get($name, $index) === false) {
         return false;
     } else {
         return true;
     }
 }
Ejemplo n.º 8
0
 function edit()
 {
     events::observe('save', 'mails', 'saveMail');
     events::observer();
     admin::components('redactor', 'validator');
     db::table('mails');
     db::where('mail_id', admin::get('id'));
     $row = db::assoc();
     f::set($row);
 }
Ejemplo n.º 9
0
 function view()
 {
     events::observe('save', 'system', 'settings', 'save');
     events::observer(true);
     f::set('system_style', SYS_STYLE);
     f::set('system_lang', LANG_INDEX);
     appManage::rollApps();
     if (GLOBAL_CACHE === true) {
         f::set('global_cache', 1);
     }
     f::set('global_cache_time', GLOBAL_CACHE_TIME);
 }
Ejemplo n.º 10
0
 function view()
 {
     events::observe('upload', 'index');
     events::observer();
     $dir = IMAGES_PATH . 'index/';
     db::table('images');
     $r = db::select();
     while ($a = mysql_fetch_assoc($r)) {
         $a = filter::get('img_set', array('unpub', 'pub'), $a);
         $a['thumb'] = $dir . $a['img_id'] . '_m.jpg';
         s::roll('images', $a);
     }
 }
Ejemplo n.º 11
0
   /**
    * @function getAllLocations()
    *
    * Returns everything necessary to build a map/modal in frontend 
    * TODO: Response-data, especially those regarding additional Html-Head-files,
    * should be caplsulated in a more native function/automated process (in both, JS and Drupal)
    */
   public function getAllLocations()
   {
       $akteure = new akteure();
       $events = new events();
       # We only want future events to be shown...
       $start = array('0' => array('date' => (new \DateTime(date()))->format('Y-m-d 00:00:00'), 'operator' => '>='));
       $resultAkteure = $akteure->getAkteure(array('filter' => array('mustHaveGps' => 1)), 'minimal');
       $resultEvents = $events->getEvents(array('start' => $start, 'filter' => array('mustHaveGps' => 1), 'parent_EID' => NULL), 'complete');
       drupal_add_http_header('Content-Type', 'application/json');
       echo '{ "response" :
 {
  "akteure" : ' . json_encode($resultAkteure) . ',
  "events"  : ' . json_encode($resultEvents) . ',
  "htmlHeaders" :
  {
   "css" : "' . $this->mapboxCss . '",
   "js"  : "' . $this->mapboxJs . '",
   "jsInline" : "' . $this->mapboxJsInline . '",
   "mapName" : "' . $this->mapboxMap . '"
  }
  }}';
       drupal_exit();
   }
Ejemplo n.º 12
0
 public function action_get()
 {
     $lec = session::get('last_events_check');
     //юзеров и обновлений не много - просто смотрим менялось что то или нет.
     //если менялось, то просто загрузим полностью список постов.
     $sql = 'SELECT COUNT(id) as count, NOW() as now  FROM events WHERE action != \'draft\' AND event_on >= \'' . $lec . '\'';
     $count = events::find_by_sql($sql);
     session::set('last_events_check', $count[0]->now);
     //echo $sql; die;
     if ($count[0]->count > 0) {
         $this->_response = controller::execute('/posts/list');
         return;
     }
     $this->_response = json_encode(array('_ok' => 1));
 }
Ejemplo n.º 13
0
 function edit($id)
 {
     if ($this->data['users']->role != "admin") {
         exit;
     }
     $events = events::find($id);
     $events->eventTitle = Input::get('eventTitle');
     $events->eventDescription = htmlspecialchars(Input::get('eventDescription'), ENT_QUOTES);
     $events->eventFor = Input::get('eventFor');
     $events->enentPlace = Input::get('enentPlace');
     $events->eventDate = Input::get('eventDate');
     $events->save();
     $events->eventDescription = strip_tags(htmlspecialchars_decode($events->eventDescription));
     return $this->panelInit->apiOutput(true, $this->panelInit->language['editEvent'], $this->panelInit->language['eventModified'], $events->toArray());
 }
Ejemplo n.º 14
0
 function view()
 {
     events::observe('clear_pages_versions', 'system', 'base', 'clear_pages_versions');
     events::observe('clear_templates_versions', 'system', 'base', 'clear_templates_versions');
     events::observe('delete_dump', 'system', 'base', 'delete_dump');
     events::observe('restore', 'system', 'base', 'restore');
     events::observe('reserve', 'system', 'base', 'reserve');
     events::observe('optimize', 'system', 'base', 'optimize');
     events::observe('repair', 'system', 'base', 'repair');
     events::observer();
     $sql = "SHOW TABLE STATUS";
     $res = db::query($sql);
     $data_length = 0;
     while ($row = mysql_fetch_array($res)) {
         $vol = $row['Data_length'] + $row['Index_length'];
         $data_length += $vol;
     }
     if ($data_length > 1000000) {
         s::set('base_volume', round($data_length / 1000000, 2) . ' MB');
     } else {
         s::set('base_volume', round($data_length / 1024, 2) . ' KB');
     }
     if ($data_length > 1000000) {
         s::set('base_damp_need', round($data_length / 1000000 / 4.6) . ' MB');
     } else {
         s::set('base_damp_need', round($data_length / 1024 / 4.6) . ' KB');
     }
     $files = files::listDir(SYS_ROOT . 'var/backup/');
     if (count($files)) {
         foreach ($files as $v) {
             s::roll('restore_files', array('value' => $v, 'file' => $v));
         }
     } else {
         s::roll('restore_files', array('value' => 0, 'file' => 'нет файла'), 0);
     }
 }
Ejemplo n.º 15
0
 public static function deleteItem($pack)
 {
     $item = dbconnection::queryObject("SELECT * FROM items WHERE item_id = '{$pack->item_id}'");
     $pack->auth->game_id = $item->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("DELETE FROM items WHERE item_id = '{$pack->item_id}' LIMIT 1");
     //cleanup
     $options = dbconnection::queryArray("SELECT * FROM dialog_options WHERE link_type = 'EXIT_TO_ITEM' AND link_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($options); $i++) {
         $pack->dialog_option_id = $options[$i]->dialog_option_id;
         dialogs::deleteDialogOption($pack);
     }
     $tabs = dbconnection::queryArray("SELECT * FROM tabs WHERE type = 'ITEM' AND content_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($tabs); $i++) {
         $pack->tab_id = $tabs[$i]->tab_id;
         tabs::deleteTab($pack);
     }
     $tags = dbconnection::queryArray("SELECT * FROM object_tags WHERE object_type = 'ITEM' AND object_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($tags); $i++) {
         $pack->object_tag_id = $tags[$i]->object_tag_id;
         tags::deleteObjectTag($pack);
     }
     $instances = dbconnection::queryArray("SELECT * FROM instances WHERE object_type = 'ITEM' AND object_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($instances); $i++) {
         $pack->instance_id = $instances[$i]->instance_id;
         instances::deleteInstance($pack);
     }
     $factories = dbconnection::queryArray("SELECT * FROM factories WHERE object_type = 'ITEM' AND object_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($factories); $i++) {
         $pack->factory_id = $factories[$i]->factory_id;
         factories::deleteFactory($pack);
     }
     $events = dbconnection::queryArray("SELECT * FROM events WHERE (event = 'GIVE_ITEM_PLAYER' OR event = 'TAKE_ITEM_PLAYER' OR event = 'GIVE_ITEM_GAME' OR event = 'TAKE_ITEM_GAME') AND content_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($events); $i++) {
         $pack->event_id = $events[$i]->event_id;
         events::deleteEvent($pack);
     }
     $reqAtoms = dbconnection::queryArray("SELECT * FROM requirement_atoms WHERE requirement = 'PLAYER_VIEWED_ITEM' AND content_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($reqAtoms); $i++) {
         $pack->requirement_atom_id = $reqAtoms[$i]->requirement_atom_id;
         requirements::deleteRequirementAtom($pack);
     }
     $reqAtoms = dbconnection::queryArray("SELECT * FROM requirement_atoms WHERE requirement = 'PLAYER_HAS_ITEM' AND content_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($reqAtoms); $i++) {
         $pack->requirement_atom_id = $reqAtoms[$i]->requirement_atom_id;
         requirements::deleteRequirementAtom($pack);
     }
     $reqAtoms = dbconnection::queryArray("SELECT * FROM requirement_atoms WHERE requirement = 'GAME_HAS_ITEM' AND content_id = '{$pack->item_id}'");
     for ($i = 0; $i < count($reqAtoms); $i++) {
         $pack->requirement_atom_id = $reqAtoms[$i]->requirement_atom_id;
         requirements::deleteRequirementAtom($pack);
     }
     games::bumpGameVersion($pack);
     return new return_package(0);
 }
Ejemplo n.º 16
0
 function add()
 {
     events::observe('installApp', 'manage', 'installApp');
     events::observe('installModule', 'manage', 'installModule');
     events::observer();
 }
Ejemplo n.º 17
0
 /**
  * Remove event
  *
  * @param Event $event
  */
 public function removeEvent(Event $event)
 {
     $this->events->removeElement($event);
 }
Ejemplo n.º 18
0
 function _save()
 {
     $tmpl_file = params::get('tmpl_file');
     $tmpl_id = params::get('tmpl_id');
     if (empty($tmpl_file)) {
         $tmpl_file = 'tmpl' + $tmpl_id + '.html';
     }
     db::table('templates');
     db::where('tmpl_id', $tmpl_id);
     db::update(array('tmpl_pub' => '1', 'tmpl_name' => params::get('tmpl_name'), 'tmpl_file' => $tmpl_file));
     /*
     	Code write
     */
     $code = stripslashes(params::get('tmpl_code'));
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $tmpl_file;
     header("Content-Type: text/plain; charset=UTF-8");
     files::write($file, $code);
     $allPages = params::get('allPages');
     $pages = params::get('pages');
     if ($allPages !== false) {
         db::table('pages');
         db::where('site_id', ADMIN_SITE_ID);
         db::update('tmpl_id', $tmpl_id);
     } else {
         if ($pages) {
             foreach ($pages as $v) {
                 db::table('pages');
                 db::where('page_id', $v);
                 db::update('tmpl_id', $tmpl_id);
             }
         }
     }
     if (events::detect('save')) {
         self::saveVersion($tmpl_id, $code);
     }
 }
Ejemplo n.º 19
0
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * Also add information on how to contact you by electronic and paper mail.
 *
 * Greenfield Technologies Ltd., hereby disclaims all copyright interest in
 * the library `phpari' (a library for creating smart telephony applications)
 * written by Nir Simionovich and its respective list of contributors.
 */
require_once "../vendor/autoload.php";
try {
    $conn = new phpari("hello-world");
    //create new object
    $event = new events($conn);
    $valiables = array("var1" => "cool");
    $response = $event->event_generate('justName', "hello-world", "141", NULL, 'SIP/7008', "leosip", $valiables);
    echo json_encode($response);
    exit(0);
} catch (Exception $e) {
    echo json_encode(array('status' => $e->getCode(), 'message' => $e->getMessage()));
}
Ejemplo n.º 20
0
 function edit()
 {
     events::observe('save', 'menus', '_save');
     events::observer();
     admin::components('tabs', 'validator');
     appPages::getPagesSelect(ADMIN_SITE_ID);
     appMenus::getMenus(ADMIN_SITE_ID);
     $menu_id = admin::get('id');
     $pages_in = conf::getPagesIn('menus', $menu_id);
     $pages_out = conf::getPagesOut('menus', $menu_id);
     if (conf::testPages($pages_in) && conf::testPages($pages_out)) {
         f::set('allPages', 1);
         f::set('allPagesOut', 0);
     } else {
         if (conf::testPages($pages_in) && !conf::testPages($pages_out)) {
             f::set('allPages', 0);
             f::set('allPagesOut', 1);
             f::set('pages', $pages_out);
         } else {
             if (!conf::testPages($pages_in) && !conf::testPages($pages_out)) {
                 f::set('allPages', 0);
                 f::set('allPagesOut', 0);
                 f::set('pages', $pages_in);
             } else {
                 if (!conf::testPages($pages_in) && conf::testPages($pages_out)) {
                     f::set('allPages', 0);
                     f::set('allPagesOut', 0);
                     f::set('pages', $pages_in);
                 }
             }
         }
     }
     db::table('menus');
     db::where('menu_id', $menu_id);
     $row = db::assoc();
     f::set($row);
 }
Ejemplo n.º 21
0
 function addsection()
 {
     admin::components('validator');
     events::observe('add', 'info', '_addsection');
     events::observer();
     f::set('section_year', 2009);
 }
Ejemplo n.º 22
0
 function add()
 {
     events::observe('add', 'blocks', '_save');
     events::observer();
     admin::components('tabs', 'validator');
     appPages::getPagesSelect(ADMIN_SITE_ID);
     appBlocks::getBlocks(ADMIN_SITE_ID);
     // test reserved
     db::table('admin_reserved');
     db::where('`table`', 'blocks');
     db::where('user_id', ADMIN_USER_ID);
     $block_id = db::get('id');
     if (db::rows() == 0) {
         db::table('blocks');
         db::smartInsert(array('block_pub' => '2', 'site_id' => ADMIN_SITE_ID));
         $block_id = mysql_insert_id();
         db::table('admin_reserved');
         db::insert('', 'blocks', $block_id, ADMIN_USER_ID);
     }
     f::set('block_id', $block_id);
 }
Ejemplo n.º 23
0
 public function getEventsbyGroup($GroupID)
 {
     global $db;
     $db->select('groups', array('Gid' => $GroupID), $limit = false, $order = false, $where_mode = "AND", $print_query = false, $What = "*", $innerJoin = "");
     $Group = $db->row_array();
     $Page_Title = "مناسبات قبيله  " . $Group['Gname'];
     $where = array('members`.`groupID' => $GroupID);
     $myFunctions = new TableView();
     $myFunctions->addF("عرض", "ViewEvent", "v");
     $myFunctions->addF("تعديل", "Edit", "e");
     events::ViewList($where, $Page_Title, $myFunctions);
 }
Ejemplo n.º 24
0
 function addsection()
 {
     admin::components('validator');
     events::observe('add', 'catalog', '_addsection');
     events::observer();
 }
Ejemplo n.º 25
0
 function add()
 {
     events::observe('add', 'news', '_add');
     events::observer();
     admin::components('validator', 'redactor');
 }
Ejemplo n.º 26
0
 function view()
 {
     if (!self::$menu) {
         self::loadSiteMenu();
     }
     $menu_name = params::get('menu');
     if (!isset(self::$menu[$menu_name])) {
         return false;
     }
     $menu_id = self::$menu_id[$menu_name];
     /*
     	Menu conf
     */
     if (!self::$menu_conf) {
         self::$menu_conf = conf::parse('menus');
     }
     $menu = self::$menu[$menu_name][0];
     if (self::$menu_conf) {
         /*
         	Menu pages
         */
         $menu_conf_pages_in = conf::get('menus', 'in', $menu_id);
         $menu_conf_pages_out = conf::get('menus', 'out', $menu_id);
         if (!conf::testPages($menu_conf_pages_out)) {
             if (in_array(PAGE_ID, $menu_conf_pages_out)) {
                 return true;
             }
         } else {
             if (!conf::testPages($menu_conf_pages_in)) {
                 if (!in_array(PAGE_ID, $menu_conf_pages_in)) {
                     return true;
                 }
             }
         }
         /*
         	Menu events
         */
         if (conf::get('menus', 'events', $menu_id)) {
             foreach (conf::get('menus', 'events', $menu_id) as $v) {
                 $arr = explode('::', trim($v));
                 if (events::targetDetect($arr[0], $arr[1], $arr[2])) {
                     /*
                     	:TODO: добавить передачу в params события, его названия и его значения
                     */
                     if ($arr[3] == 'replace') {
                         $menu_id = $arr[4];
                         $menu_name = self::$menu_by_id[$menu_id];
                         $menu = self::$menu[$menu_name][0];
                     } else {
                         if ($arr[3] == 'hide') {
                             return true;
                         }
                     }
                 }
             }
         }
     }
     // $points_conf = conf::parse('points');
     $points = '';
     $i = 0;
     foreach ($menu as $k => $v) {
         $i++;
         /*
         	Points conf
         
         $conf_index = $menu_id.'.'.$v['point_id'];
         
         if ($points_conf)
         {
         	$points_conf_pages = conf::get('points', 'pages', $conf_index);
         
         	if ($points_conf_pages && $points_conf_pages[0] != 0)
         	{
         		if (!in_array(PAGE_ID, $points_conf_pages)) continue;
         	}
         }
         */
         $v = self::getPointLink($v, $menu_name);
         $v['index'] = $i;
         /*
         	Check parents
         */
         if (strstr($v['menu_tmpl_link'], '{POINTS}')) {
             if (isset(self::$menu[$menu_name][$v['point_id']])) {
                 $parent_points = '';
                 foreach (self::$menu[$menu_name][$v['point_id']] as $d => $f) {
                     $f = self::getPointLink($f, $menu_name);
                     $parent_points .= s::parseVars($f['menu_tmpl_link'], $f);
                 }
                 $v['menu_tmpl_link'] = str_replace('{POINTS}', $parent_points, $v['menu_tmpl_link']);
             }
         }
         $points .= s::parseVars($v['menu_tmpl_link'], $v);
         $menu_tmpl = $v['menu_tmpl'];
     }
     buffer::set(str_replace('{POINTS}', $points, $menu_tmpl));
 }
Ejemplo n.º 27
0
<?php 
require_once 'shab.php';
require_once 'class_events.php';
?>
 <div class="container">  
 <?php 
if (isset($_SESSION['valid_user'])) {
    $user_email = $_SESSION['valid_user'];
    echo '<h1>События</h1>';
    $ev = new events();
    $ev->getEvents() . '<br/>';
} else {
    echo '<p>Вы не вошли в систему.</p>';
}
echo '<a href="index.php">На главную страницу</a>';
?>
 </div>
Ejemplo n.º 28
0
<?php

/**
 * phpari - A PHP Class Library for interfacing with Asterisk(R) ARI
 * Copyright (C) 2014  Nir Simionovich
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * Also add information on how to contact you by electronic and paper mail.
 *
 * Greenfield Technologies Ltd., hereby disclaims all copyright interest in
 * the library `phpari' (a library for creating smart telephony applications)
 * written by Nir Simionovich and its respective list of contributors.
 */
require_once "../vendor/autoload.php";
$conn = new phpari("hello-world");
//create new object
$efa = new events($conn);
echo json_encode($efa->events('hello-world'));
exit(0);
Ejemplo n.º 29
0
 public function readNewsEvent($type, $id)
 {
     if ($type == "news") {
         return newsboard::where('id', $id)->first();
     }
     if ($type == "event") {
         return events::where('id', $id)->first();
     }
 }
Ejemplo n.º 30
0
 public static function deleteEventPackage($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM event_packages WHERE event_package_id = '{$pack->event_package_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("DELETE FROM event_packages WHERE event_package_id = '{$pack->event_package_id}' LIMIT 1");
     //cleanup
     $events = dbconnection::queryArray("SELECT * FROM events WHERE event_package_id = '{$pack->event_package_id}'");
     for ($i = 0; $i < count($events); $i++) {
         $pack->event_id = $events[$i]->event_id;
         events::deleteEvent($pack);
     }
     dbconnection::query("UPDATE dialog_scripts SET event_package_id = 0 WHERE event_package_id = '{$pack->event_package_id}'");
     dbconnection::query("UPDATE plaques SET event_package_id = 0 WHERE event_package_id = '{$pack->event_package_id}'");
     dbconnection::query("UPDATE quests SET active_event_package_id = 0 WHERE active_event_package_id = '{$pack->event_package_id}'");
     dbconnection::query("UPDATE quests SET complete_event_package_id = 0 WHERE complete_event_package_id = '{$pack->event_package_id}'");
     $instances = dbconnection::queryArray("SELECT * FROM instances WHERE object_type = 'EVENT_PACKAGE' AND object_id = '{$pack->event_package_id}'");
     for ($i = 0; $i < count($instances); $i++) {
         $pack->instance_id = $instances[$i]->instance_id;
         instances::deleteInstance($pack);
     }
     games::bumpGameVersion($pack);
     return new return_package(0);
 }