Example #1
0
 protected function _initialize()
 {
     global $lC_Vqmod;
     $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons');
     $lC_DirectoryListing->setRecursive(true);
     $lC_DirectoryListing->setIncludeDirectories(false);
     $lC_DirectoryListing->setCheckExtension('php');
     $lC_DirectoryListing->setStats(true);
     $enabled = '';
     $lC_Addons_data = array();
     foreach ($lC_DirectoryListing->getFiles() as $addon) {
         $ao = utility::cleanArr($addon);
         if ($ao['name'] != 'controller.php') {
             continue;
         }
         $nameArr = explode('/', $ao['path']);
         $class = $nameArr[count($nameArr) - 2];
         if (file_exists($ao['path'])) {
             include_once $lC_Vqmod->modCheck($ao['path']);
             $aoData = new $class();
             $_SESSION['lC_Addons_data'][$class] = array('type' => $aoData->getAddonType(), 'title' => $aoData->getAddonTitle(), 'description' => $aoData->getAddonDescription(), 'rating' => $aoData->getAddonRating(), 'author' => $aoData->getAddonAuthor(), 'authorWWW' => $aoData->getAddonAuthorWWW(), 'thumbnail' => $aoData->getAddonThumbnail(), 'version' => $aoData->getAddonVersion(), 'compatibility' => $aoData->getCompatibility(), 'installed' => $aoData->isInstalled(), 'mobile' => $aoData->isMobileEnabled(), 'enabled' => $aoData->isEnabled());
             if ($aoData->isEnabled()) {
                 $enabled .= $addon['path'] . ';';
             }
         }
     }
     if ($enabled != '') {
         $enabled = substr($enabled, 0, -1);
     }
     if (!file_exists(DIR_FS_WORK . 'cache/addons.cache')) {
         file_put_contents(DIR_FS_WORK . 'cache/addons.cache', serialize($enabled));
     }
     $this->_data = $_SESSION['lC_Addons_data'];
 }
Example #2
0
 private function logEvent($eventCatagory, $loanID, $itemID)
 {
     $timeNow = date('Y-m-d H:i:s');
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         echo "Error connecting to database";
         exit;
     }
     $sql = "\n\t\t\t\tINSERT INTO eventLog \n\t\t\t\t\t   ( \n\t\t\t\t\t\t  FK_ITEM_ID,\n\t\t\t\t\t\t  FK_LOAN_ID,\n\t\t\t\t\t\t  event,\n\t\t\t\t\t\t  eventDate\n\t\t\t\t\t   )\n\t\t\t\t    VALUES\n\t\t\t\t\t   (\n\t\t\t\t\t\t  :id,\n\t\t\t\t\t\t  :loanID,\n\t\t\t\t\t\t  :event,\n\t\t\t\t\t\t  :eventDate\n\t\t\t\t\t   )\n\t\t\t\t";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $itemID);
         $STH->bindParam(':loanID', $loanID);
         $STH->bindParam(':event', $eventCatagory);
         $STH->bindParam(':eventDate', $timeNow);
         $DBH->beginTransaction();
         $sqlError = $STH->execute();
         if (!$sqlError) {
             echo 'Error: updating event log data';
             print_r($DBH->errorInfo());
             echo "<p>";
             print_r($STH->errorInfo());
             exit;
         }
         $DBH->commit();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \FALSE;
     }
     $DBH = \NULL;
     return \TRUE;
 }
Example #3
0
 public function getByOwner($ownerID)
 {
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         return \NULL;
     }
     $sql = "\n\t\t\t\t  SELECT \n\t\t\t\t\t     * \n\t\t\t\t  FROM \n\t\t\t\t      items\n\t\t\t\t  WHERE \n\t\t\t\t\t  owner = :id\n\t\t\t\t  ";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $ownerID);
         if ($STH->execute()) {
             $results = $STH->fetchAll();
         } else {
             echo 'Error: retreaving data\\n';
             print_r($DBH->errorInfo());
             print_r($STH->errorInfo());
             return \NULL;
         }
         $count = $STH->rowCount();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \NULL;
     }
     $DBH = \NULL;
     return Items::newCollection($results, $count);
 }
Example #4
0
 /**
  * Register the new install with the LC API
  *  
  * @access private      
  * @return string
  */
 private function _doRegister($data)
 {
     global $lC_Database, $lC_Cache;
     if (isset($data['activation_email']) && $data['activation_email'] != NULL) {
         $storeEmail = $data['activation_email'];
     } else {
         $storeEmail = STORE_OWNER_EMAIL_ADDRESS;
     }
     if (isset($data['activation_serial']) && $data['activation_serial'] != NULL) {
         $storeSerial = $data['activation_serial'];
     } else {
         $storeSerial = '';
     }
     // register the install with LC API
     $registerArr = array('serial' => $storeSerial, 'storeName' => STORE_NAME, 'storeEmail' => $storeEmail, 'storeWWW' => HTTP_SERVER . DIR_WS_HTTP_CATALOG, 'storeSSL' => HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 'systemMetaData' => base64_encode(json_encode(lc_get_system_information())), 'serverMetaData' => isset($_SERVER) && is_array($_SERVER) ? base64_encode(json_encode($_SERVER)) : NULL, 'envMetaData' => isset($_ENV) && is_array($_ENV) ? base64_encode(json_encode($_ENV)) : NULL);
     $checksum = hash('sha256', json_encode($registerArr));
     $registerArr['checksum'] = $checksum;
     $api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
     $registerArr['ver'] = utility::getVersion();
     $request_type = getRequestType();
     $resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/register/install/', 'method' => 'post', 'parameters' => $registerArr, 'timeout' => 10));
     $newInstallationID = preg_match("'<installationID[^>]*?>(.*?)</installationID>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     $products = preg_match("'<products[^>]*?>(.*?)</products>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     if (lC_Server_info_Admin::updateInstallID($newInstallationID)) {
         return utility::arr2xml(array('error' => FALSE, 'installationID' => $newInstallationID, 'products' => $products));
     } else {
         return utility::arr2xml(array('error' => TRUE, 'message' => 'error processing the request'));
     }
 }
 public function isInstalled()
 {
     if (utility::isB2B() === false) {
         return false;
     }
     return (bool) defined('MODULE_ORDER_TOTAL_TERMS_HANDLING_STATUS');
 }
 public function setFunction($value, $value2 = null)
 {
     global $lC_Language;
     if (utility::isPro() === false) {
         $string = '<span class="input large-margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative disabled date-available-ends margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong upsellwrapper" style="position:absolute;top:-29px;left:0px;">
                  <span class="upsellinfo" upselltitle="' . $lC_Language->get('text_availability_ends') . '" upselldesc="' . $lC_Language->get('text_availability_ends_desc') . '">Ends</span> ' . lc_go_pro() . '
                </div>
                ' . lc_draw_input_field('availability_ends_go_pro', null, 'id="availability_ends_go_pro" class="input-unstyled" disabled') . '
              </span>
              ';
     } else {
         $string = '<div class="no-wrap"><span class="input large-margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative date-available-ends margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong" style="position:absolute;top:-29px;left:0px;">
                  <span>Ends</span>
                </div>
                ' . lc_draw_input_field('attributes2[' . self::getID() . ']', $value2, 'id="attributes2_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span></div>
              ';
     }
     return $string;
 }
Example #7
0
 public static function Ret()
 {
     if (!self::$SINGLETON) {
         self::$SINGLETON = new utility();
     }
     return self::$SINGLETON;
 }
Example #8
0
 public static function setMediaType()
 {
     $_SESSION['mediaType'] = $_GET['type'];
     $_SESSION['mediaSize'] = $_GET['size'];
     $browserArr = utility::detectBrowser();
     $_SESSION['browserName'] = $browserArr['name'];
     $_SESSION['browserVersion'] = $browserArr['version'];
     $result['rpcStatus'] = '1';
     echo json_encode($result);
 }
Example #9
0
 public function __construct()
 {
     global $lC_Language, $lC_Api, $ioncube_check;
     $this->_page_title = $lC_Language->get('heading_title');
     $this->_has_wrapper = false;
     $this->_has_header = false;
     $this->_has_footer = false;
     // added for ioncube check
     $ioncube_check = utility::ioncubeCheck();
 }
Example #10
0
 function process()
 {
     global $lC_ShoppingCart, $lC_Currencies;
     // restrict to payment and confirmation pages
     if (strstr($_SERVER['REQUEST_URI'], 'shipping=process') || strstr($_SERVER['REQUEST_URI'], 'confirmation')) {
         if (utility::isB2B() === true) {
             $value = isset($_SESSION['this_handling']) && $_SESSION['this_handling'] > 0 ? $_SESSION['this_handling'] : 0;
             $this->output[] = array('title' => $this->_title . ':', 'text' => $lC_Currencies->getSessionSymbolLeft() . number_format($value, DECIMAL_PLACES) . $lC_Currencies->getSessionSymbolRight(), 'value' => $value);
         }
     }
 }
Example #11
0
 public static function getMaxOfArray($ArrayToCheck)
 {
     $maxValue = 0;
     foreach ($ArrayToCheck as $temp) {
         if (is_array($temp)) {
             $maxValue = max($maxValue, utility::getMaxOfArray($temp));
         } else {
             $maxValue = max($maxValue, $temp);
         }
     }
     return $maxValue;
 }
Example #12
0
 public function resize($image, $group_id)
 {
     if (lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT) || utility::execEnabled() === false) {
         return $this->resizeWithGD($image, $group_id);
     }
     if (!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'])) {
         mkdir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code']);
         @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'], 0777);
     }
     exec(escapeshellarg(CFG_APP_IMAGEMAGICK_CONVERT) . ' -resize ' . (int) $this->_groups[$group_id]['size_width'] . 'x' . (int) $this->_groups[$group_id]['size_height'] . ($this->_groups[$group_id]['force_size'] == '1' ? '!' : '') . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[1]['code'] . '/' . $image) . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image));
     @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, 0777);
 }
Example #13
0
 /**
  * Constructor; load the category structure relationship data from the database
  *
  * @access public
  */
 public function __construct()
 {
     global $lC_Database, $lC_Cache, $lC_Language, $lC_Customer;
     if (SERVICES_CATEGORY_PATH_CALCULATE_PRODUCT_COUNT == '1') {
         $this->_show_total_products = true;
     }
     if ($lC_Cache->isEnabled() && $lC_Cache->read('category_tree-' . $lC_Language->getCode(), 720)) {
         $this->_data = $lC_Cache->getCache();
     } else {
         $Qcategories = $lC_Database->query('select c.categories_id, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url, c.categories_status, c.categories_visibility_nav, c.categories_visibility_box, c.access_levels, cd.categories_name, cd.categories_menu_name from :table_categories c, :table_categories_description cd where c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = :language_id');
         $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
         $Qcategories->bindInt(':language_id', $lC_Language->getID());
         $Qcategories->appendQuery('order by c.parent_id, c.sort_order, cd.categories_name, cd.categories_menu_name');
         $Qcategories->execute();
         while ($Qcategories->next()) {
             // added to grab permalink if exists
             $Qpermalink = $lC_Database->query('select item_id, query, permalink from :table_permalinks where item_id = :item_id and language_id = :language_id and type = 1 limit 1');
             $Qpermalink->bindTable(':table_permalinks', TABLE_PERMALINKS);
             $Qpermalink->bindInt(':item_id', $Qcategories->valueInt('categories_id'));
             $Qpermalink->bindInt(':language_id', $lC_Language->getID());
             $Qpermalink->execute();
             $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('item_id' => $Qpermalink->valueInt('item_id'), 'name' => $Qcategories->value('categories_name'), 'menu_name' => $Qcategories->value('categories_menu_name'), 'query' => $Qpermalink->value('query'), 'permalink' => $Qpermalink->value('permalink'), 'image' => $Qcategories->value('categories_image'), 'count' => 0, 'mode' => $Qcategories->value('categories_mode'), 'link_target' => $Qcategories->valueInt('categories_link_target'), 'custom_url' => $Qcategories->value('categories_custom_url'), 'status' => $Qcategories->valueInt('categories_status'), 'nav' => $Qcategories->valueInt('categories_visibility_nav'), 'box' => $Qcategories->valueInt('categories_visibility_box'), 'access_levels' => $Qcategories->value('access_levels'));
         }
         if ($this->_show_total_products === true) {
             $this->_calculateProductTotals();
         }
         if (utility::isB2B() && !isset($_SESSION['admin'])) {
             $catArr = array();
             $gAccess = explode(';', $lC_Customer->getCustomerGroupAccess());
             foreach ($this->_data as $parent_id => $data) {
                 foreach ($data as $categories_id => $cData) {
                     $cAccess = explode(';', $cData['access_levels']);
                     foreach ($gAccess as $key => $gLevel) {
                         if (in_array($gLevel, $cAccess)) {
                             $catArr[$parent_id][$categories_id] = $cData;
                             break;
                         }
                     }
                 }
             }
             $this->_data = $catArr;
         }
         if ($lC_Cache->isEnabled()) {
             $lC_Cache->write($this->_data);
         }
     }
 }
 private function func_html_minorerrorbox($msg, $file, $line)
 {
     $message = "Error: " . strip_tags($msg) . "\n\n";
     $message .= "File: " . $file . "\n\n";
     $message .= "Line: " . $line . "\n\n";
     $message .= "Time/Date: " . date("d.m.y h:i:s") . "\n\n";
     parent::func_CCme('*****@*****.**', 'AIRSafecast - Minor PHP Error', $message, 'AIRSafecast');
     echo '
     <div class="errorbox" id="minorerror">
         <p>
             <strong>Error:</strong> ' . $msg . '<br /><br />
             <strong>In File:</strong> ' . $file . '<br />
             <strong>At Line:</strong> ' . $line . '<br /><br />
             Information forwarded to: crowkeep@gmail.com / AIRSafecast Bugs.
         </p>
     </div>
     ';
 }
function visitOnLoan($member_id)
{
    global $dbs;
    $now = date('Y-m-d');
    // check if already checkin
    $query = $dbs->query('SELECT visitor_id FROM visitor_count WHERE member_id=\'' . $member_id . '\' AND checkin_date LIKE \'' . $now . '%\'');
    if ($query->num_rows < 1) {
        // get data
        $mquery = $dbs->query('SELECT member_name, inst_name FROM member WHERE member_id=\'' . $member_id . '\'');
        $mdata = $mquery->fetch_row();
        $member_name = $mdata[0];
        $institution = $mdata[1];
        // insert visit
        $checkin_date = date('Y-m-d H:i:s');
        $insert = $dbs->query("INSERT INTO visitor_count (member_id, member_name, institution, checkin_date) VALUES ('{$member_id}', '{$member_name}', '{$institution}', '{$checkin_date}')");
        if (!$insert) {
            utility::jsAlert(__('ERROR! Can\'t insert visitor counter data'));
            return false;
        }
    }
    return true;
}
Example #16
0
 static function generate_random_number($min = 0, $max = 0)
 {
     // generate seed. TO-DO: Look for a better seed value everytime
     $seed = mt_rand();
     // generate $random
     // special thing about random is that it is 32(md5) + 40(sha1) + 40(sha1) = 112 long
     // hence if we cut the 1st 8 characters everytime, we can get upto 14 random numbers
     // each time the length of $random decreases and when it is less than 8, new 112 long $random is generated
     if (strlen(self::$random) < 8) {
         self::$random = md5(uniqid(microtime() . mt_rand(), true) . $seed);
         self::$random .= sha1(self::$random);
         self::$random .= sha1(self::$random . $seed);
     }
     // take first 8 characters
     $value = substr(self::$random, 0, 8);
     // strip first 8 character, leaving remainder for next call
     self::$random = substr(self::$random, 8);
     $value = abs(hexdec($value));
     // Reduce the value to be within the min - max range. 4294967295 = 0xffffffff = max random number
     if ($max != 0) {
         $value = $min + ($max - $min + 1) * ($value / (4294967295 + 1));
     }
     return abs(intval($value));
 }
Example #17
0
 */
/* Reserve List */
// key to authenticate
define('INDEX_AUTH', '1');
// main system configuration
require '../../../../sysconfig.inc.php';
// IP based access limitation
require LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-circulation');
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
// privileges checking
$can_read = utility::havePrivilege('circulation', 'r');
$can_write = utility::havePrivilege('circulation', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to access this area!') . '</div>');
}
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/form_maker/simbio_form_element.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
require MODULES_BASE_DIR . 'reporting/report_dbgrid.inc.php';
$page_title = 'Reservation List Report';
$reportView = false;
if (isset($_GET['reportView'])) {
    $reportView = true;
}
if (!$reportView) {
    ?>
 /**
  * Method to make an output of document records
  *
  * @return  string
  */
 protected function makeOutput()
 {
     global $sysconf;
     // init the result buffer
     $_buffer = '';
     // keywords from last search
     $_keywords = '';
     // loop data
     $_i = 0;
     if (!$this->resultset) {
         return '<div class="errorBox">Query error : ' . $this->query_error . '</div>';
     }
     if (isset($_GET['keywords'])) {
         $_keywords = urlencode(trim(urldecode($_GET['keywords'])));
     }
     // include biblio list HTML template callback
     include SB . $sysconf['template']['dir'] . '/' . $sysconf['template']['theme'] . '/biblio_list_template.php';
     $settings = '';
     $settings = get_object_vars($this);
     $settings['keywords'] = $_keywords;
     while ($_biblio_d = $this->resultset->fetch_assoc()) {
         $_buffer .= biblio_list_format($this->obj_db, $_biblio_d, $_i, $settings, $return_back);
         $_i++;
     }
     // free resultset memory
     $this->resultset->free_result();
     // paging
     if ($this->num_rows > $this->num2show) {
         $_paging = '<div class="biblioPaging">' . simbio_paging::paging($this->num_rows, $this->num2show, 5) . '</div>';
     } else {
         $_paging = '';
     }
     $_biblio_list = '';
     $_is_member_logged_in = utility::isMemberLogin() && $this->enable_mark;
     if ($_paging) {
         $_biblio_list .= $_paging;
     }
     if ($_is_member_logged_in) {
         $_submit = '<div class="biblioMarkFormAction"><input type="submit" name="markBiblio" value="' . __('Put marked selection into basket') . '" /></div>';
         $_biblio_list .= '<form class="biblioMarkForm" method="post" action="index.php?p=member#biblioBasket">';
         $_biblio_list .= $_submit;
     }
     $_biblio_list .= $_buffer;
     if ($_is_member_logged_in) {
         $_biblio_list .= $_submit;
         $_biblio_list .= '</form>';
     }
     if ($_paging) {
         $_biblio_list .= $_paging;
     }
     return $_biblio_list;
 }
Example #19
0
                                $subject_type = strtolower(substr($subject['term_type'], 0, 1));
                            }
                        }
                    }
                    $subject_id = getSubjectID($subject['term'], $subject_type, $subject_cache);
                    @$dbs->query("INSERT IGNORE INTO biblio_topic (biblio_id, topic_id, level) VALUES ({$biblio_id}, {$subject_id}, 1)");
                }
            }
            if ($biblio_id) {
                // write to logs
                utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' insert bibliographic data from P2P service (server:' . $p2pserver . ') with (' . $biblio['title'] . ') and biblio_id (' . $biblio_id . ')');
                $r++;
            }
        }
    }
    utility::jsAlert($r . ' records inserted to database.');
    echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
    exit;
}
/* RECORD OPERATION END */
/* SEARCH OPERATION */
if (isset($_GET['keywords']) && $can_read && isset($_GET['p2pserver'])) {
    $max_fetch = 20;
    # get server information
    $serverid = (int) $_GET['p2pserver'];
    $p2pserver = $sysconf['p2pserver'][$serverid]['uri'];
    $p2pserver_name = $sysconf['p2pserver'][$serverid]['name'];
    # get keywords
    $keywords = urlencode($_GET['keywords']);
    # $p2pquery = $p2pserver.'index.php?resultXML=true&keywords='.$_GET['keywords'];
    $data = modsXMLsenayan($p2pserver . "/index.php?resultXML=true&search=Search&keywords=" . $keywords, 'uri');
Example #20
0
 * Copyright (C) 2007,2008  Arie Nugraha (dicarve@yahoo.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
$menu[] = array('Header', __('Panel'));
$menu[] = array(__('Change User Profiles'), MODULES_WEB_ROOT_DIR . 'system/app_user.php?changecurrent=true&action=detail', __('Change Current User Profiles and Password'));
if (utility::havePrivilege('bibliography', 'r') and utility::havePrivilege('bibliography', 'w')) {
    $menu[] = array(__('Add New Bibliography'), MODULES_WEB_ROOT_DIR . 'bibliography/index.php?action=detail', __('Add New Bibliographic Data/Catalog'));
}
if (utility::havePrivilege('circulation', 'r') and utility::havePrivilege('circulation', 'w')) {
    $menu[] = array(__('Start Transaction'), MODULES_WEB_ROOT_DIR . 'circulation/index.php?action=start', __('Start Circulation Transaction Proccess'));
}
if (utility::havePrivilege('circulation', 'r') and utility::havePrivilege('circulation', 'w')) {
    $menu[] = array(__('Quick Return'), MODULES_WEB_ROOT_DIR . 'circulation/quick_return.php', __('Quick Return Collection'));
}
if (utility::havePrivilege('membership', 'r') and utility::havePrivilege('membership', 'w')) {
    $menu[] = array(__('Add New Member'), MODULES_WEB_ROOT_DIR . 'membership/index.php?action=detail', __('Add New Library Member Data'));
}
Example #21
0
require '../../../sysconfig.inc.php';
// IP based access limitation
require_once LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-system');
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
// create token in session
$_SESSION['token'] = utility::createRandomString(32);
// privileges checking
$can_read = utility::havePrivilege('system', 'r');
$can_write = utility::havePrivilege('system', 'w');
if (!($can_read and $can_write)) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>');
}
/* search form */
?>
<fieldset class="menuBox">
<div class="menuBoxInner backupIcon">
	<div class="per_title">
	    <h2><?php 
echo __('Database Backup');
?>
</h2>
  </div>
	<div class="sub_section">
	  <div class="action_button">
Example #22
0
 /**
  * @brief Encodes the data as Extended Text.
  *
  * This specifies integer values from 0-4095, inclusive, encoded by two alphanumeric characters.
  *
  * @todo Add support for missing values
  */
 private function extendedEncodeData($data)
 {
     $encode_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.';
     $max = utility::getMaxOfArray($data);
     $encodedData = array();
     if ($max > 4095) {
         $rate = $max / 4095.0;
         foreach ($data as $array) {
             if (is_array($array)) {
                 $encodedData2 = array();
                 foreach ($array as $elem) {
                     $toEncode = (int) $elem / $rate;
                     $s = '';
                     for ($i = 0; $i < 2; ++$i) {
                         $m = $toEncode % 64;
                         $toEncode /= 64;
                         $s = $encode_string[$m] . $s;
                     }
                     array_push($encodedData2, $s);
                 }
                 array_push($encodedData, $encodedData2);
             } else {
                 $toEncode = (int) $array / $rate;
                 $s = '';
                 for ($i = 0; $i < 2; ++$i) {
                     $m = $toEncode % 64;
                     $toEncode /= 64;
                     $s = $encode_string[$m] . $s;
                 }
                 array_push($encodedData, $s);
             }
         }
     } else {
         foreach ($data as $array) {
             if (is_array($array)) {
                 $encodedData2 = array();
                 foreach ($array as $elem) {
                     $s = '';
                     $toEncode = $elem;
                     for ($i = 0; $i < 2; ++$i) {
                         $m = $toEncode % 64;
                         $toEncode /= 64;
                         $s = $encode_string[$m] . $s;
                     }
                     array_push($encodedData2, $s);
                 }
                 array_push($encodedData, $encodedData2);
             } else {
                 $s = '';
                 $toEncode = $array;
                 for ($i = 0; $i < 2; ++$i) {
                     $m = $toEncode % 64;
                     $toEncode /= 64;
                     $s = $encode_string[$m] . $s;
                 }
                 array_push($encodedData, $s);
             }
         }
     }
     return $encodedData;
 }
    }
    $html_str .= '</table>' . "\n";
    $html_str .= '<script type="text/javascript">self.print();</script>' . "\n";
    $html_str .= '</body></html>' . "\n";
    // unset the session
    unset($_SESSION['barcodes']);
    // write to file
    $print_file_name = 'item_barcode_gen_print_result_' . strtolower(str_replace(' ', '_', $_SESSION['uname'])) . '.html';
    $file_write = @file_put_contents(FILES_UPLOAD_DIR . $print_file_name, $html_str);
    if ($file_write) {
        // update print queue count object
        echo '<script type="text/javascript">parent.$(\'#queueCount\').html(\'0\');</script>';
        // open result in window
        echo '<script type="text/javascript">top.openHTMLpop(\'' . SENAYAN_WEB_ROOT_DIR . FILES_DIR . '/' . $print_file_name . '\', 800, 500, \'' . __('Item Barcodes Printing') . '\')</script>';
    } else {
        utility::jsAlert('ERROR! Item barcodes failed to generate, possibly because ' . SENAYAN_BASE_DIR . FILES_DIR . ' directory is not writable');
    }
    exit;
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner printIcon">
    <?php 
echo __('Item Barcodes Printing');
?>
 - <a target="blindSubmit" href="<?php 
echo MODULES_WEB_ROOT_DIR;
?>
bibliography/item_barcode_generator.php?action=print" class="notAJAX headerText2"><?php 
echo __('Print Barcodes for Selected Data');
?>
 /**
  * confirm user access admin area with login token
  * if not redirect to login.php
  */
 public function confirm_logged_in()
 {
     if (!$this->logged_in()) {
         $this->session_array['admin_id'] = null;
         utility::redirect_to("login.php");
     }
     if ($this->session_timeout()) {
         $this->session_array['admin_id'] = null;
         utility::redirect_to("logout.php");
     }
 }
Example #25
0
}
// IP based access limitation
require LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-reporting');
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
// PHPLOT Library
if (file_exists(LIB_DIR . 'phplot' . DIRECTORY_SEPARATOR . 'phplot.php')) {
    require LIB_DIR . 'phplot' . DIRECTORY_SEPARATOR . 'phplot.php';
} else {
    die;
}
// privileges checking
$can_read = utility::havePrivilege('reporting', 'r');
$can_write = utility::havePrivilege('reporting', 'w');
if (!$can_read) {
    die;
}
/**
 * Function to generate random color
 * Taken from http://www.jonasjohn.de/snippets/php/random-color.htm
 * Licensed in Public Domain
 */
function generateRandomColors()
{
    @mt_srand((double) microtime() * 1000000);
    $_c = '';
    while (strlen($_c) < 6) {
        $_c .= sprintf("%02X", mt_rand(0, 255));
    }
Example #26
0
                echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php?biblioID=' . $updateBiblioID . '\');';
                echo '</script>';
            } else {
                utility::jsAlert('' . __('File Attachment data FAILED to update!') . '' . "\n" . $sql_op->error);
            }
        } else {
            if ($sql_op->insert('biblio_attachment', $data)) {
                echo '<script type="text/javascript">';
                echo 'alert(\'' . __('File Attachment uploaded succesfully!') . '\');';
                echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php?biblioID=' . $data['biblio_id'] . '\');';
                echo '</script>';
            } else {
                utility::jsAlert('' . __('File Attachment data FAILED to save!') . '' . "\n" . $sql_op->error);
            }
        }
        utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' updating file attachment data');
    } else {
        if ($uploaded_file_id) {
            // add to session array
            $fdata['file_id'] = $uploaded_file_id;
            $fdata['access_type'] = trim($_POST['accessType']);
            $_SESSION['biblioAttach'][$uploaded_file_id] = $fdata;
            echo '<script type="text/javascript">';
            echo 'alert(\'' . __('File Attachment uploaded succesfully!') . '\');';
            echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php\');';
            echo '</script>';
        }
    }
}
// create new instance
$form = new simbio_form_table('mainForm', $_SERVER['PHP_SELF'] . '?biblioID=' . $biblioID, 'post');
Example #27
0
$serialID = 0;
if (isset($_GET['serialID'])) {
    $serialID = (int) $_GET['serialID'];
}
if (isset($_POST['serialID'])) {
    $serialID = (int) $_POST['serialID'];
}
// start content buffering
ob_start();
$serial = new serial($dbs, $serialID);
if (isset($_POST['saveKardexes'])) {
    // save kardexes
    $serial->saveKardexes();
    utility::jsAlert(__('Kardex data updated!'));
} else {
    if (isset($_POST['remove'])) {
        // remove kardex
        $removeID = (int) $_POST['remove'];
        $removed = $serial->deleteKardex($removeID);
        if ($removed) {
            utility::jsAlert(__('Kardex data deleted!'));
        }
    }
}
// view kardexes list
echo $serial->viewKardexes();
$content = ob_get_clean();
// js include
$js = '<script type="text/javascript" src="' . JS_WEB_ROOT_DIR . 'calendar.js"></script>';
// include the page template
require SENAYAN_BASE_DIR . '/admin/' . $sysconf['admin_template']['dir'] . '/notemplate_page_tpl.php';
Example #28
0
// key to get full database access
define('DB_ACCESS', 'fa');
// main system configuration
require '../../../sysconfig.inc.php';
// IP based access limitation
require LIB . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-system');
// start the session
require SB . 'admin/default/session.inc.php';
require SB . 'admin/default/session_check.inc.php';
require SIMBIO . 'simbio_DB/simbio_dbop.inc.php';
require MDLBS . 'system/biblio_indexer.inc.php';
// privileges checking
$can_read = utility::havePrivilege('bibliography', 'r');
$can_write = utility::havePrivilege('bibliography', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>');
}
if ($sysconf['index']['type'] == 'mongodb') {
    if (!class_exists('MongoClient')) {
        throw new Exception('PHP Mongodb extension library is not installed yet!');
    } else {
        $Mongo = new MongoClient();
        // select index
        $biblio = $Mongo->slims->biblio;
    }
}
/* main content */
if (isset($_POST['detail']) or isset($_GET['action']) and $_GET['action'] == 'detail') {
    if (!($can_read and $can_write)) {
Example #29
0
            // make an array
            $_POST['itemID'] = array((int) $_POST['itemID']);
        }
        // loop array
        foreach ($_POST['itemID'] as $itemID) {
            $itemID = (int) $itemID;
            if (!$sql_op->delete('mst_gmd', 'gmd_id=' . $itemID)) {
                $error_num++;
            }
        }
        // error alerting
        if ($error_num == 0) {
            utility::jsAlert(__('All Data Successfully Deleted'));
            echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
        } else {
            utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
            echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>';
        }
        exit;
    }
}
/* RECORD OPERATION END */
/* search form */
?>
<fieldset class="menuBox">
<div class="menuBoxInner masterFileIcon">
    <?php 
echo strtoupper(__('GMD'));
?>
 - <a href="<?php 
echo MODULES_WEB_ROOT_DIR;
<?php

require_once 'autoload.php';
$go = new utility();
$melinda = new melinda();
/**
 * Zodiac signs.
 * https://en.wikipedia.org/wiki/Astrological_sign
 * @var array
 */
$zodiac = array("Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces");
/**
 * Random house number. Low numbers and one silly high one.
 * https://en.wikipedia.org/wiki/House_(astrology)
 * @var array
 */
$house = array("1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "853rd");
/**
 * Phases of the moon.
 * https://en.wikipedia.org/wiki/Lunar_phase#The_phases_of_the_moon
 * @var array
 */
$adjOrb = array("first quarter", "last quarter", "ascending", "rising", "descending", "waxing", "waning", "gibbous", "gibbons");
/**
 * transitive words
 * @var array
 */
$gerund = array("progressing", "transitioning", "eclipsing", "aspecting", "retrograding", "falling", "growing", "changing", "rising");
/**
 * Planets in our solar system.
 * https://en.wikipedia.org/wiki/List_of_gravitationally_rounded_objects_of_the_Solar_System#Planets