当前位置: 首页>>代码示例>>PHP>>正文


PHP ciniki_core_loadMethod函数代码示例

本文整理汇总了PHP中ciniki_core_loadMethod函数的典型用法代码示例。如果您正苦于以下问题:PHP ciniki_core_loadMethod函数的具体用法?PHP ciniki_core_loadMethod怎么用?PHP ciniki_core_loadMethod使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ciniki_core_loadMethod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ciniki_conferences_attendeeList

function ciniki_conferences_attendeeList($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner, or sys admin.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.attendeeList');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Get the list of attendees
    //
    $strsql = "SELECT ciniki_conferences_attendees.id, " . "ciniki_conferences_attendees.conference_id, " . "ciniki_conferences_attendees.customer_id, " . "ciniki_conferences_attendees.status " . "FROM ciniki_conferences_attendees " . "WHERE ciniki_conferences_attendees.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "";
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
    $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.conferences', array(array('container' => 'attendees', 'fname' => 'id', 'fields' => array('id', 'conference_id', 'customer_id', 'status'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (isset($rc['attendees'])) {
        $attendees = $rc['attendees'];
    } else {
        $attendees = array();
    }
    return array('stat' => 'ok', 'attendees' => $attendees);
}
开发者ID:ciniki,项目名称:conferences,代码行数:35,代码来源:attendeeList.php

示例2: ciniki_conferences_presentationHistory

function ciniki_conferences_presentationHistory($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'presentation_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Presentation'), 'field' => array('required' => 'yes', 'blank' => 'no', 'name' => 'field')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner, or sys admin
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.presentationHistory');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if ($args['field'] == 'registration') {
        $strsql = "SELECT ciniki_conferences_attendees.id " . "FROM ciniki_conferences_presentations, ciniki_conferences_attendees " . "WHERE ciniki_conferences_presentations.id = '" . ciniki_core_dbQuote($ciniki, $args['presentation_id']) . "' " . "AND ciniki_conferences_presentations.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND ciniki_conferences_presentations.customer_id = ciniki_conferences_attendees.customer_id " . "AND ciniki_conferences_presentations.conference_id = ciniki_conferences_attendees.conference_id " . "AND ciniki_conferences_attendees.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "";
        $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.conferences', 'attendee');
        if ($rc['stat'] != 'ok') {
            return $rc;
        }
        ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetModuleHistory');
        return ciniki_core_dbGetModuleHistory($ciniki, 'ciniki.conferences', 'ciniki_conferences_history', $args['business_id'], 'ciniki_conferences_attendees', $rc['attendee']['id'], 'status');
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetModuleHistory');
    return ciniki_core_dbGetModuleHistory($ciniki, 'ciniki.conferences', 'ciniki_conferences_history', $args['business_id'], 'ciniki_conferences_presentations', $args['presentation_id'], $args['field']);
}
开发者ID:ciniki,项目名称:conferences,代码行数:31,代码来源:presentationHistory.php

示例3: ciniki_merchandise_imageList

function ciniki_merchandise_imageList($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner, or sys admin.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'merchandise', 'private', 'checkAccess');
    $rc = ciniki_merchandise_checkAccess($ciniki, $args['business_id'], 'ciniki.merchandise.imageList');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Get the list of images
    //
    $strsql = "SELECT ciniki_merchandise_images.id, " . "ciniki_merchandise_images.product_id, " . "ciniki_merchandise_images.name, " . "ciniki_merchandise_images.permalink, " . "ciniki_merchandise_images.sequence, " . "ciniki_merchandise_images.flags, " . "ciniki_merchandise_images.image_id, " . "ciniki_merchandise_images.description " . "FROM ciniki_merchandise_images " . "WHERE ciniki_merchandise_images.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "";
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
    $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(array('container' => 'images', 'fname' => 'id', 'fields' => array('id', 'product_id', 'name', 'permalink', 'sequence', 'flags', 'image_id', 'description'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (isset($rc['images'])) {
        $images = $rc['images'];
    } else {
        $images = array();
    }
    return array('stat' => 'ok', 'images' => $images);
}
开发者ID:ciniki,项目名称:merchandise,代码行数:35,代码来源:imageList.php

示例4: ciniki_library_itemTags

function ciniki_library_itemTags($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'item_type' => array('required' => 'yes', 'blank' => 'yes', 'name' => 'Item Type')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Make sure this module is activated, and
    // check permission to run this function for this business
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'library', 'private', 'checkAccess');
    $rc = ciniki_library_checkAccess($ciniki, $args['business_id'], 'ciniki.library.itemTags');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $modules = $rc['modules'];
    //
    // Load the tags
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'library', 'private', 'loadTags');
    $rc = ciniki_library_loadTags($ciniki, $args['business_id'], $args['item_type']);
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    return $rc;
}
开发者ID:ciniki,项目名称:library,代码行数:31,代码来源:itemTags.php

示例5: ciniki_artistprofiles_settingsGet

function ciniki_artistprofiles_settingsGet($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Make sure this module is activated, and
    // check permission to run this function for this business
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'artistprofiles', 'private', 'checkAccess');
    $rc = ciniki_artistprofiles_checkAccess($ciniki, $args['business_id'], 'ciniki.artistprofiles.settingsGet');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Grab the settings for the business from the database
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQuery');
    $rc = ciniki_core_dbDetailsQuery($ciniki, 'ciniki_artistprofiles_settings', 'business_id', $args['business_id'], 'ciniki.artistprofiles', 'settings', '');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (!isset($rc['settings'])) {
        return array('stat' => 'ok', 'settings' => array());
    }
    return array('stat' => 'ok', 'settings' => $rc['settings']);
}
开发者ID:ciniki,项目名称:artistprofiles,代码行数:33,代码来源:settingsGet.php

示例6: ciniki_library_loadTags

function ciniki_library_loadTags($ciniki, $business_id, $item_type)
{
    //
    // Get the list of genres
    //
    $strsql = "SELECT DISTINCT CONCAT_WS('-', tag_type, tag_name) AS fname, tag_type, tag_name " . "FROM ciniki_library_items, ciniki_library_tags " . "WHERE ciniki_library_items.business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . "AND ciniki_library_items.item_type = '" . ciniki_core_dbQuote($ciniki, $item_type) . "' " . "AND ciniki_library_items.id = ciniki_library_tags.item_id " . "AND ciniki_library_tags.business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . "";
    $strsql .= "GROUP BY fname ";
    $strsql .= "ORDER BY tag_type, tag_name ";
    $rsp = array('stat' => 'ok', 'genres' => array(), 'tags' => array(), 'lists' => array());
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');
    $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.library', array(array('container' => 'types', 'fname' => 'tag_type', 'name' => 'type', 'fields' => array('type' => 'tag_type')), array('container' => 'tags', 'fname' => 'fname', 'name' => 'tag', 'fields' => array('type' => 'tag_type', 'name' => 'tag_name'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (isset($rc['types'])) {
        foreach ($rc['types'] as $tid => $type) {
            if ($type['type']['type'] == '20') {
                $rsp['genres'] = $type['type']['tags'];
            } elseif ($type['type']['type'] == '40') {
                $rsp['tags'] = $type['type']['tags'];
            } elseif ($type['type']['type'] == '60') {
                $rsp['lists'] = $type['type']['tags'];
            }
        }
    }
    return $rsp;
}
开发者ID:ciniki,项目名称:library,代码行数:27,代码来源:loadTags.php

示例7: ciniki_conferences_roomUpdate

function ciniki_conferences_roomUpdate(&$ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'room_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Conference Room'), 'conference_id' => array('required' => 'no', 'blank' => 'no', 'name' => 'Conference'), 'name' => array('required' => 'no', 'blank' => 'no', 'name' => 'Name'), 'sequence' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Order')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Make sure this module is activated, and
    // check permission to run this function for this business
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.roomUpdate');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Start transaction
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');
    $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Update the Conference Room in the database
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');
    $rc = ciniki_core_objectUpdate($ciniki, $args['business_id'], 'ciniki.conferences.room', $args['room_id'], $args, 0x4);
    if ($rc['stat'] != 'ok') {
        ciniki_core_dbTransactionRollback($ciniki, 'ciniki.conferences');
        return $rc;
    }
    //
    // Commit the transaction
    //
    $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Update the last_change date in the business modules
    // Ignore the result, as we don't want to stop user updates if this fails.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'businesses', 'private', 'updateModuleChangeDate');
    ciniki_businesses_updateModuleChangeDate($ciniki, $args['business_id'], 'ciniki', 'conferences');
    //
    // Update the web index if enabled
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');
    ciniki_core_hookExec($ciniki, $args['business_id'], 'ciniki', 'web', 'indexObject', array('object' => 'ciniki.conferences.room', 'object_id' => $args['room_id']));
    return array('stat' => 'ok');
}
开发者ID:ciniki,项目名称:conferences,代码行数:60,代码来源:roomUpdate.php

示例8: ciniki_conferences_sessionAdd

function ciniki_conferences_sessionAdd(&$ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'conference_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Conference'), 'room_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Room'), 'name' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Name'), 'session_start' => array('required' => 'yes', 'blank' => 'no', 'type' => 'datetimetoutc', 'name' => 'Start'), 'session_end' => array('required' => 'yes', 'blank' => 'no', 'type' => 'datetimetoutc', 'name' => 'End')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.sessionAdd');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Start transaction
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');
    $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Add the conference session to the database
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');
    $rc = ciniki_core_objectAdd($ciniki, $args['business_id'], 'ciniki.conferences.session', $args, 0x4);
    if ($rc['stat'] != 'ok') {
        ciniki_core_dbTransactionRollback($ciniki, 'ciniki.conferences');
        return $rc;
    }
    $session_id = $rc['id'];
    //
    // Commit the transaction
    //
    $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Update the last_change date in the business modules
    // Ignore the result, as we don't want to stop user updates if this fails.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'businesses', 'private', 'updateModuleChangeDate');
    ciniki_businesses_updateModuleChangeDate($ciniki, $args['business_id'], 'ciniki', 'conferences');
    //
    // Update the web index if enabled
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');
    ciniki_core_hookExec($ciniki, $args['business_id'], 'ciniki', 'web', 'indexObject', array('object' => 'ciniki.conferences.session', 'object_id' => $session_id));
    return array('stat' => 'ok', 'id' => $session_id);
}
开发者ID:ciniki,项目名称:conferences,代码行数:60,代码来源:sessionAdd.php

示例9: ciniki_artistprofiles_web_subMenuItems

function ciniki_artistprofiles_web_subMenuItems(&$ciniki, $settings, $business_id, $args)
{
    if (!isset($ciniki['business']['modules']['ciniki.artistprofiles'])) {
        return array('stat' => '404', 'err' => array('pkg' => 'ciniki', 'code' => '3040', 'msg' => "I'm sorry, the file you requested does not exist."));
    }
    //
    // Return nothing if the page format doesn't have a submenu
    //
    if (isset($settings['page-artistprofiles-submenu']) && $settings['page-artistprofiles-submenu'] != 'yes') {
        return array('stat' => 'ok', 'submenu' => array());
    }
    $submenu = array();
    //
    // Check if Categories is enabled
    //
    if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x100)) {
        //
        // Load the settings for categories
        //
        ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');
        $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_artistprofiles_settings', 'business_id', $business_id, 'ciniki.artistprofiles', 'settings', 'tag-category');
        if ($rc['stat'] != 'ok') {
            return $rc;
        }
        if (isset($rc['settings'])) {
            $psettings = $rc['settings'];
        } else {
            $psettings = array();
        }
        if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x200)) {
            $submenu['featured'] = array('sequence' => 1, 'title' => 'Featured', 'sequence' => isset($psettings['tag-category-sequence-featured']) && $psettings['tag-category-sequence-featured'] != '' ? $psettings['tag-category-sequence-featured'] : 1, 'title' => isset($psettings['tag-category-title-featured']) && $psettings['tag-category-title-featured'] != '' ? $psettings['tag-category-title-featured'] : 'Featured', 'image_id' => isset($args['content']) && $args['content'] == 'yes' && isset($psettings['tag-category-image-featured']) ? $psettings['tag-category-image-featured'] : '', 'content' => isset($args['content']) && $args['content'] == 'yes' && isset($psettings['tag-category-content-featured']) ? $psettings['tag-category-content-featured'] : '', 'permalink' => 'featured');
        }
        //
        // Load the list of tags
        //
        $strsql = "SELECT DISTINCT tag_name, permalink " . "FROM ciniki_artistprofiles_tags " . "WHERE business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . "AND tag_type = 10 " . "";
        $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.artistprofiles', 'category');
        if ($rc['stat'] != 'ok') {
            return $rc;
        }
        if (isset($rc['rows'])) {
            $categories = $rc['rows'];
            foreach ($categories as $cat) {
                $submenu[$cat['permalink']] = array('sequence' => isset($psettings['tag-category-sequence-' . $cat['permalink']]) && $psettings['tag-category-sequence-' . $cat['permalink']] != '' ? $psettings['tag-category-sequence-' . $cat['permalink']] : 10, 'title' => isset($psettings['tag-category-title-' . $cat['permalink']]) && $psettings['tag-category-title-' . $cat['permalink']] != '' ? $psettings['tag-category-title-' . $cat['permalink']] : $cat['tag_name'], 'image_id' => isset($args['content']) && $args['content'] == 'yes' && isset($psettings['tag-category-image-' . $cat['permalink']]) ? $psettings['tag-category-image-' . $cat['permalink']] : '', 'content' => isset($args['content']) && $args['content'] == 'yes' && isset($psettings['tag-category-content-' . $cat['permalink']]) ? $psettings['tag-category-content-' . $cat['permalink']] : '', 'permalink' => $cat['permalink']);
            }
        }
        //
        // Sort the submenu
        //
        uasort($submenu, function ($a, $b) {
            if ($a['sequence'] == $b['sequence']) {
                return strcmp($b['title'], $a['title']);
            }
            return $a['sequence'] < $b['sequence'] ? -1 : 1;
        });
    }
    return array('stat' => 'ok', 'submenu' => $submenu);
}
开发者ID:ciniki,项目名称:artistprofiles,代码行数:58,代码来源:subMenuItems.php

示例10: ciniki_library_itemListWanted

function ciniki_library_itemListWanted($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'item_type' => array('required' => 'yes', 'blank' => 'yes', 'name' => 'Item Type'), 'item_format' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Item Format'), 'tag_type' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Tag Type'), 'tag_permalink' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Tag Permalink'), 'flags' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Flags'), 'purchased_place' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Purchased Place')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Make sure this module is activated, and
    // check permission to run this function for this business
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'library', 'private', 'checkAccess');
    $rc = ciniki_library_checkAccess($ciniki, $args['business_id'], 'ciniki.library.itemListWanted');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'businesses', 'private', 'intlSettings');
    $rc = ciniki_businesses_intlSettings($ciniki, $args['business_id']);
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $intl_timezone = $rc['settings']['intl-default-timezone'];
    $intl_currency_fmt = numfmt_create($rc['settings']['intl-default-locale'], NumberFormatter::CURRENCY);
    $intl_currency = $rc['settings']['intl-default-currency'];
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'datetimeFormat');
    $datetime_format = ciniki_users_datetimeFormat($ciniki);
    ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');
    $date_format = ciniki_users_dateFormat($ciniki);
    //
    // Get the number of faqs in each status for the business,
    // if no rows found, then return empty array
    //
    $strsql = "SELECT ciniki_library_items.id, " . "ciniki_library_items.item_type, " . "ciniki_library_items.item_format, " . "ciniki_library_items.title, " . "ciniki_library_items.author_display, " . "ciniki_library_items.author_sort, " . "ciniki_library_items.year, " . "DATE_FORMAT(ciniki_library_items.purchased_date, '" . ciniki_core_dbQuote($ciniki, $date_format) . "') AS purchased_date, " . "ciniki_library_items.purchased_price, " . "ciniki_library_items.purchased_place, " . "IF(ciniki_library_items.flags&0x01>0, 'yes', 'no') AS owned, " . "IF(ciniki_library_items.flags&0x02>0, 'yes', 'no') AS wanted, " . "ciniki_library_reviews.user_id, " . "IFNULL(ciniki_library_reviews.rating, 0) AS rating " . "FROM ciniki_library_items " . "LEFT JOIN ciniki_library_reviews ON (" . "ciniki_library_items.id = ciniki_library_reviews.item_id " . "AND ciniki_library_items.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . ") " . "WHERE ciniki_library_items.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND item_type = '" . ciniki_core_dbQuote($ciniki, $args['item_type']) . "' " . "AND (flags&0x02) > 0 " . "";
    $strsql .= "ORDER BY author_sort, title COLLATE latin1_general_cs " . "";
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');
    $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.library', array(array('container' => 'items', 'fname' => 'title', 'name' => 'item', 'fields' => array('id', 'item_type', 'item_format', 'title', 'author_display', 'author_sort', 'year', 'purchased_date', 'purchased_price', 'purchased_place', 'owned', 'wanted')), array('container' => 'ratings', 'fname' => 'user_id', 'name' => 'rating', 'fields' => array('user_id', 'rating'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (!isset($rc['items']) || !is_array($rc['items'])) {
        return array('stat' => 'ok', 'items' => array());
    }
    $items = $rc['items'];
    foreach ($items as $iid => $item) {
        if (isset($item['item']['ratings'])) {
            foreach ($item['item']['ratings'] as $rid => $rating) {
                $items[$iid]['item']['user-' . $rating['rating']['user_id'] . '-rating'] = $rating['rating']['rating'];
            }
            unset($items[$iid]['item']['ratings']);
        }
    }
    return array('stat' => 'ok', 'items' => $items);
}
开发者ID:ciniki,项目名称:library,代码行数:58,代码来源:itemListWanted.php

示例11: ciniki_library_purchasedStats

function ciniki_library_purchasedStats($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'item_type' => array('required' => 'yes', 'blank' => 'yes', 'name' => 'Item Type')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Make sure this module is activated, and
    // check permission to run this function for this business
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'library', 'private', 'checkAccess');
    $rc = ciniki_library_checkAccess($ciniki, $args['business_id'], 'ciniki.library.purchasedStats');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'businesses', 'private', 'intlSettings');
    $rc = ciniki_businesses_intlSettings($ciniki, $args['business_id']);
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $intl_timezone = $rc['settings']['intl-default-timezone'];
    $intl_currency_fmt = numfmt_create($rc['settings']['intl-default-locale'], NumberFormatter::CURRENCY);
    $intl_currency = $rc['settings']['intl-default-currency'];
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'datetimeFormat');
    $datetime_format = ciniki_users_datetimeFormat($ciniki);
    ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');
    $date_format = ciniki_users_dateFormat($ciniki);
    //
    // Get the number of faqs in each status for the business,
    // if no rows found, then return empty array
    //
    $strsql = "SELECT purchased_place AS name, " . "SUM(purchased_price) AS total_amount " . "FROM ciniki_library_items " . "WHERE business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND purchased_place <> '' " . "AND item_type = '" . ciniki_core_dbQuote($ciniki, $args['item_type']) . "' " . "AND (flags&0x01) = 1 " . "GROUP BY purchased_place " . "ORDER BY purchased_place " . "";
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');
    $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.library', array(array('container' => 'places', 'fname' => 'name', 'name' => 'place', 'fields' => array('name', 'total_amount'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (!isset($rc['places']) || !is_array($rc['places'])) {
        return array('stat' => 'ok', 'places' => array());
    }
    $places = $rc['places'];
    $totals = array('total_amount' => 0);
    foreach ($places as $pid => $place) {
        $place = $place['place'];
        $totals['total_amount'] = bcadd($totals['total_amount'], $place['total_amount'], 4);
        $places[$pid]['place']['total_amount'] = numfmt_format_currency($intl_currency_fmt, $place['total_amount'], $intl_currency);
    }
    $totals['total_amount'] = numfmt_format_currency($intl_currency_fmt, $totals['total_amount'], $intl_currency);
    return array('stat' => 'ok', 'places' => $places, 'totals' => $totals);
}
开发者ID:ciniki,项目名称:library,代码行数:56,代码来源:purchasedStats.php

示例12: ciniki_artistprofiles_artistList

function ciniki_artistprofiles_artistList($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'category_permalink' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Category')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner, or sys admin.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'artistprofiles', 'private', 'checkAccess');
    $rc = ciniki_artistprofiles_checkAccess($ciniki, $args['business_id'], 'ciniki.artistprofiles.artistList');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Get the list of artists
    //
    if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x100) && isset($args['category_permalink']) && $args['category_permalink'] != '') {
        if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x200) && $args['category_permalink'] == 'featured') {
            $strsql = "SELECT ciniki_artistprofiles.id, " . "ciniki_artistprofiles.name, " . "ciniki_artistprofiles.sort_name, " . "ciniki_artistprofiles.permalink, " . "ciniki_artistprofiles.status, " . "ciniki_artistprofiles.flags " . "FROM ciniki_artistprofiles " . "WHERE ciniki_artistprofiles.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND (flags&0x01) = 0x01 " . "ORDER BY sort_name " . "";
        } else {
            $strsql = "SELECT ciniki_artistprofiles.id, " . "ciniki_artistprofiles.name, " . "ciniki_artistprofiles.sort_name, " . "ciniki_artistprofiles.permalink, " . "ciniki_artistprofiles.status, " . "ciniki_artistprofiles.flags " . "FROM ciniki_artistprofiles_tags, ciniki_artistprofiles " . "WHERE ciniki_artistprofiles_tags.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND ciniki_artistprofiles_tags.tag_type = 10 " . "AND ciniki_artistprofiles_tags.permalink = '" . ciniki_core_dbQuote($ciniki, $args['category_permalink']) . "' " . "AND ciniki_artistprofiles_tags.artist_id = ciniki_artistprofiles.id " . "AND ciniki_artistprofiles.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "ORDER BY sort_name " . "";
        }
    } else {
        $strsql = "SELECT ciniki_artistprofiles.id, " . "ciniki_artistprofiles.name, " . "ciniki_artistprofiles.sort_name, " . "ciniki_artistprofiles.permalink, " . "ciniki_artistprofiles.status, " . "ciniki_artistprofiles.flags " . "FROM ciniki_artistprofiles " . "WHERE ciniki_artistprofiles.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "ORDER BY sort_name " . "";
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
    $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.artistprofiles', array(array('container' => 'artists', 'fname' => 'id', 'fields' => array('id', 'name', 'sort_name', 'permalink', 'status', 'flags'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (isset($rc['artists'])) {
        $artists = $rc['artists'];
    } else {
        $artists = array();
    }
    $rsp = array('stat' => 'ok', 'artists' => $artists);
    //
    // Return list of categories
    //
    if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x100)) {
        ciniki_core_loadMethod($ciniki, 'ciniki', 'artistprofiles', 'web', 'subMenuItems');
        $rc = ciniki_artistprofiles_web_subMenuItems($ciniki, array(), $args['business_id'], array());
        if ($rc['stat'] != 'ok') {
            return $rc;
        }
        $rsp['categories'] = $rc['submenu'];
    }
    return $rsp;
}
开发者ID:ciniki,项目名称:artistprofiles,代码行数:55,代码来源:artistList.php

示例13: ciniki_conferences_presentationReviewAdd

function ciniki_conferences_presentationReviewAdd(&$ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'conference_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Conference'), 'presentation_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Presentation'), 'customer_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Reviewer'), 'vote' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Vote'), 'notes' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Notes')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.presentationReviewAdd');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Start transaction
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');
    $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Add the presentation review to the database
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');
    $rc = ciniki_core_objectAdd($ciniki, $args['business_id'], 'ciniki.conferences.presentationreview', $args, 0x4);
    if ($rc['stat'] != 'ok') {
        ciniki_core_dbTransactionRollback($ciniki, 'ciniki.conferences');
        return $rc;
    }
    $review_id = $rc['id'];
    //
    // Commit the transaction
    //
    $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.conferences');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Update the last_change date in the business modules
    // Ignore the result, as we don't want to stop user updates if this fails.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'businesses', 'private', 'updateModuleChangeDate');
    ciniki_businesses_updateModuleChangeDate($ciniki, $args['business_id'], 'ciniki', 'conferences');
    return array('stat' => 'ok', 'id' => $review_id);
}
开发者ID:ciniki,项目名称:conferences,代码行数:55,代码来源:presentationReviewAdd.php

示例14: ciniki_conferences_presentationList

function ciniki_conferences_presentationList($ciniki)
{
    //
    // Find all the required and optional arguments
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');
    $rc = ciniki_core_prepareArgs($ciniki, 'no', array('business_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Business'), 'conference_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Conference'), 'status' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Status')));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $args = $rc['args'];
    //
    // Check access to business_id as owner, or sys admin.
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'checkAccess');
    $rc = ciniki_conferences_checkAccess($ciniki, $args['business_id'], 'ciniki.conferences.presentationList');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Load conference maps
    //
    ciniki_core_loadMethod($ciniki, 'ciniki', 'conferences', 'private', 'maps');
    $rc = ciniki_conferences_maps($ciniki);
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $maps = $rc['maps'];
    //
    // Get the list of presentations
    //
    $strsql = "SELECT ciniki_conferences_presentations.id, " . "ciniki_conferences_presentations.conference_id, " . "ciniki_conferences_presentations.customer_id, " . "ciniki_customers.display_name, " . "ciniki_customer_emails.email, " . "ciniki_conferences_presentations.presentation_number, " . "ciniki_conferences_presentations.presentation_type, " . "ciniki_conferences_presentations.status, " . "ciniki_conferences_presentations.status AS status_text, " . "ciniki_conferences_presentations.submission_date, " . "ciniki_conferences_presentations.field, " . "ciniki_conferences_presentations.title, " . "ciniki_conferences_presentations.permalink, " . "ciniki_conferences_presentations.description " . "FROM ciniki_conferences_presentations " . "LEFT JOIN ciniki_customers ON (" . "ciniki_conferences_presentations.customer_id = ciniki_customers.id " . "AND ciniki_customers.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . ") " . "LEFT JOIN ciniki_customer_emails ON (" . "ciniki_customers.id = ciniki_customer_emails.id " . "AND ciniki_customer_emails.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . ") " . "WHERE ciniki_conferences_presentations.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "";
    if (isset($args['status']) && $args['status'] > 0) {
        $strsql .= "AND ciniki_conferences_presentations.status = '" . ciniki_core_dbQuote($ciniki, $args['status']) . "' ";
    }
    $strsql .= "ORDER BY submission_date ";
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
    $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.conferences', array(array('container' => 'presentations', 'fname' => 'id', 'fields' => array('id', 'conference_id', 'customer_id', 'presentation_number', 'presentation_type', 'status', 'status_text', 'submission_date', 'field', 'title', 'display_name', 'permalink', 'description'), 'maps' => array('status_text' => $maps['presentation']['status']))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    $email_list = '';
    if (isset($rc['presentations'])) {
        $presentations = $rc['presentations'];
        foreach ($presentations as $pid => $presentation) {
            $presentations[$pid]['display_title'] = sprintf("#%03d: ", $presentation['presentation_number']) . $presentation['title'];
            $email_list .= ($email_list != '' ? ', ' : '') . '"' . $presentation['display_name'] . '" ' . $presentation['email'];
        }
    } else {
        $presentations = array();
    }
    return array('stat' => 'ok', 'presentations' => $presentations, 'emails' => $email_list);
}
开发者ID:ciniki,项目名称:conferences,代码行数:53,代码来源:presentationList.php

示例15: ciniki_library_itemUpdateReviews

function ciniki_library_itemUpdateReviews($ciniki, $business_id, $item_id)
{
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryIDTree');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');
    //
    // Get the existing ratings and employees
    //
    $strsql = "SELECT ciniki_business_users.user_id, " . "IFNULL(ciniki_library_reviews.id, 0) AS review_id, " . "IFNULL(ciniki_library_reviews.rating, 0) AS rating " . "FROM ciniki_business_users " . "LEFT JOIN ciniki_library_reviews ON (" . "ciniki_business_users.user_id = ciniki_library_reviews.user_id " . "AND ciniki_library_reviews.item_id = '" . ciniki_core_dbQuote($ciniki, $item_id) . "' " . "AND ciniki_library_reviews.business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . ") " . "WHERE ciniki_business_users.business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . "AND ciniki_business_users.status = 10 " . "";
    $rc = ciniki_core_dbHashQueryIDTree($ciniki, $strsql, 'ciniki.customers', array(array('container' => 'employees', 'fname' => 'user_id', 'fields' => array('user_id', 'review_id', 'rating'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (!isset($rc['employees'])) {
        return array('stat' => 'ok');
    }
    $employees = $rc['employees'];
    //
    // Check the args for each employee rating
    //
    foreach ($employees as $user_id => $user) {
        $args = array();
        if (isset($ciniki['request']['args']['user-' . $user_id . '-rating'])) {
            if ($ciniki['request']['args']['user-' . $user_id . '-rating'] != $user['rating']) {
                $args['rating'] = $ciniki['request']['args']['user-' . $user_id . '-rating'];
            }
        }
        if (count($args) > 0) {
            //
            // Update the review member
            //
            if ($user['review_id'] > 0) {
                $rc = ciniki_core_objectUpdate($ciniki, $business_id, 'ciniki.library.review', $user['review_id'], $args, 0x4);
                if ($rc['stat'] != 'ok') {
                    return $rc;
                }
            } else {
                $args['item_id'] = $item_id;
                $args['user_id'] = $user_id;
                if (!isset($args['review'])) {
                    $args['review'] = '';
                }
                $rc = ciniki_core_objectAdd($ciniki, $business_id, 'ciniki.library.review', $args, 0x4);
                if ($rc['stat'] != 'ok') {
                    return $rc;
                }
            }
        }
    }
    return array('stat' => 'ok');
}
开发者ID:ciniki,项目名称:library,代码行数:52,代码来源:itemUpdateReviews.php


注:本文中的ciniki_core_loadMethod函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。