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


PHP ciniki_core_dbQuote函数代码示例

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


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

示例1: 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

示例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_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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: ciniki_artistprofiles_linkGet

function ciniki_artistprofiles_linkGet($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'), 'link_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Link')));
    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.linkGet');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Load business settings
    //
    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', 'users', 'private', 'datetimeFormat');
    $datetime_format = ciniki_users_datetimeFormat($ciniki, 'php');
    //
    // Return default for new Link
    //
    if ($args['link_id'] == 0) {
        $link = array('id' => 0, 'artist_id' => '', 'name' => '', 'link_type' => '1000', 'url' => '', 'description' => '');
    } else {
        $strsql = "SELECT ciniki_artistprofiles_links.id, " . "ciniki_artistprofiles_links.artist_id, " . "ciniki_artistprofiles_links.name, " . "ciniki_artistprofiles_links.link_type, " . "ciniki_artistprofiles_links.url, " . "ciniki_artistprofiles_links.description " . "FROM ciniki_artistprofiles_links " . "WHERE ciniki_artistprofiles_links.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND ciniki_artistprofiles_links.id = '" . ciniki_core_dbQuote($ciniki, $args['link_id']) . "' " . "";
        ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');
        $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.artistprofiles', 'link');
        if ($rc['stat'] != 'ok') {
            return array('stat' => 'fail', 'err' => array('pkg' => 'ciniki', 'code' => '2910', 'msg' => 'Link not found', 'err' => $rc['err']));
        }
        if (!isset($rc['link'])) {
            return array('stat' => 'fail', 'err' => array('pkg' => 'ciniki', 'code' => '2911', 'msg' => 'Unable to find Link'));
        }
        $link = $rc['link'];
    }
    return array('stat' => 'ok', 'link' => $link);
}
开发者ID:ciniki,项目名称:artistprofiles,代码行数:52,代码来源:linkGet.php

示例12: ciniki_merchandise_imageGet

function ciniki_merchandise_imageGet($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'), 'productimage_id' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Image')));
    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', 'merchandise', 'private', 'checkAccess');
    $rc = ciniki_merchandise_checkAccess($ciniki, $args['business_id'], 'ciniki.merchandise.imageGet');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Load business settings
    //
    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', 'users', 'private', 'datetimeFormat');
    $datetime_format = ciniki_users_datetimeFormat($ciniki, 'php');
    //
    // Return default for new Image
    //
    if ($args['productimage_id'] == 0) {
        $image = array('id' => 0, 'product_id' => '', 'name' => '', 'permalink' => '', 'sequence' => '', 'flags' => '1', 'image_id' => 0, 'description' => '');
    } else {
        $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']) . "' " . "AND ciniki_merchandise_images.id = '" . ciniki_core_dbQuote($ciniki, $args['productimage_id']) . "' " . "";
        ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');
        $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'image');
        if ($rc['stat'] != 'ok') {
            return array('stat' => 'fail', 'err' => array('code' => 'ciniki.merchandise.7', 'msg' => 'Image not found', 'err' => $rc['err']));
        }
        if (!isset($rc['image'])) {
            return array('stat' => 'fail', 'err' => array('code' => 'ciniki.merchandise.8', 'msg' => 'Unable to find Image'));
        }
        $image = $rc['image'];
    }
    return array('stat' => 'ok', 'image' => $image);
}
开发者ID:ciniki,项目名称:merchandise,代码行数:52,代码来源:imageGet.php

示例13: ciniki_merchandise_productSearch

function ciniki_merchandise_productSearch($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'), 'start_needle' => array('required' => 'yes', 'blank' => 'no', 'name' => 'Search String'), 'limit' => array('required' => 'no', 'blank' => 'yes', 'name' => 'Limit')));
    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.productList');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Get the list of products
    //
    $strsql = "SELECT ciniki_merchandise.id, " . "ciniki_merchandise.code, " . "ciniki_merchandise.name, " . "ciniki_merchandise.permalink, " . "ciniki_merchandise.status, " . "ciniki_merchandise.sequence, " . "ciniki_merchandise.flags, " . "ciniki_merchandise.unit_amount, " . "ciniki_merchandise.unit_discount_amount, " . "ciniki_merchandise.unit_discount_percentage, " . "ciniki_merchandise.taxtype_id, " . "ciniki_merchandise.inventory, " . "ciniki_merchandise.shipping_other, " . "ciniki_merchandise.shipping_CA, " . "ciniki_merchandise.shipping_US, " . "ciniki_merchandise.primary_image_id, " . "ciniki_merchandise.synopsis, " . "ciniki_merchandise.description " . "FROM ciniki_merchandise " . "WHERE ciniki_merchandise.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "";
    if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.merchandise', 0x1)) {
        $strsql .= "AND (code LIKE '" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . "OR code LIKE '% " . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . "OR name LIKE '" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . "OR name LIKE '% " . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . ") ";
    } else {
        $strsql .= "AND (name LIKE '" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . "OR name LIKE '% " . ciniki_core_dbQuote($ciniki, $args['start_needle']) . "%' " . ") ";
    }
    if (isset($args['limit']) && is_numeric($args['limit']) && $args['limit'] > 0) {
        $strsql .= "LIMIT " . ciniki_core_dbQuote($ciniki, $args['limit']) . " ";
    } else {
        $strsql .= "LIMIT 25 ";
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');
    $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(array('container' => 'products', 'fname' => 'id', 'fields' => array('id', 'code', 'name', 'permalink', 'status', 'sequence', 'flags', 'unit_amount', 'unit_discount_amount', 'unit_discount_percentage', 'taxtype_id', 'inventory', 'shipping_other', 'shipping_CA', 'shipping_US', 'primary_image_id', 'synopsis', 'description'))));
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    if (isset($rc['products'])) {
        $products = $rc['products'];
        foreach ($products as $pid => $product) {
            if (ciniki_core_checkModuleFlags($ciniki, 'ciniki.merchandise', 0x1) && $product['code'] != '') {
                $products[$pid]['display_name'] = $product['code'] . ' - ' . $product['name'];
            } else {
                $products[$pid]['display_name'] = $product['name'];
            }
        }
    } else {
        $products = array();
    }
    return array('stat' => 'ok', 'products' => $products);
}
开发者ID:ciniki,项目名称:merchandise,代码行数:52,代码来源:productSearch.php

示例14: ciniki_conferences_roomGet

function ciniki_conferences_roomGet($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')));
    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.roomGet');
    if ($rc['stat'] != 'ok') {
        return $rc;
    }
    //
    // Load business settings
    //
    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', 'users', 'private', 'datetimeFormat');
    $datetime_format = ciniki_users_datetimeFormat($ciniki, 'php');
    //
    // Return default for new Conference Room
    //
    if ($args['room_id'] == 0) {
        $room = array('id' => 0, 'conference_id' => '', 'name' => '', 'sequence' => '1');
    } else {
        $strsql = "SELECT ciniki_conferences_rooms.id, " . "ciniki_conferences_rooms.conference_id, " . "ciniki_conferences_rooms.name, " . "ciniki_conferences_rooms.sequence " . "FROM ciniki_conferences_rooms " . "WHERE ciniki_conferences_rooms.business_id = '" . ciniki_core_dbQuote($ciniki, $args['business_id']) . "' " . "AND ciniki_conferences_rooms.id = '" . ciniki_core_dbQuote($ciniki, $args['room_id']) . "' " . "";
        ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');
        $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.conferences', 'room');
        if ($rc['stat'] != 'ok') {
            return array('stat' => 'fail', 'err' => array('pkg' => 'ciniki', 'code' => '3593', 'msg' => 'Conference Room not found', 'err' => $rc['err']));
        }
        if (!isset($rc['room'])) {
            return array('stat' => 'fail', 'err' => array('pkg' => 'ciniki', 'code' => '3594', 'msg' => 'Unable to find Conference Room'));
        }
        $room = $rc['room'];
    }
    return array('stat' => 'ok', 'room' => $room);
}
开发者ID:ciniki,项目名称:conferences,代码行数:52,代码来源:roomGet.php

示例15: ciniki_merchandise_web_productLoad

function ciniki_merchandise_web_productLoad($ciniki, $business_id, $args)
{
    $strsql = "SELECT ciniki_merchandise.id, " . "ciniki_merchandise.uuid, " . "ciniki_merchandise.name, " . "ciniki_merchandise.permalink, " . "ciniki_merchandise.flags, " . "ciniki_merchandise.primary_image_id, " . "'' AS primary_image_caption, " . "ciniki_merchandise.synopsis, " . "ciniki_merchandise.description " . "FROM ciniki_merchandise " . "WHERE ciniki_merchandise.business_id = '" . ciniki_core_dbQuote($ciniki, $business_id) . "' " . "";
    if (isset($args['permalink']) && $args['permalink'] != '') {
        $strsql .= "AND ciniki_merchandise.permalink = '" . ciniki_core_dbQuote($ciniki, $args['permalink']) . "' ";
    } elseif (isset($args['id']) && $args['id'] > 0) {
        $strsql .= "AND ciniki_merchandise.id = '" . ciniki_core_dbQuote($ciniki, $args['id']) . "' ";
    } else {
        return array('stat' => 'fail', 'err' => array('code' => 'ciniki.merchandise.27', 'msg' => 'No product specified'));
    }
    ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');
    $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'product');
    if ($rc['stat'] != 'ok') {
        return array('stat' => 'fail', 'err' => array('code' => 'ciniki.merchandise.28', 'msg' => 'Product not found', 'err' => $rc['err']));
    }
    if (!isset($rc['product'])) {
        return array('stat' => 'fail', 'err' => array('code' => 'ciniki.merchandise.29', 'msg' => 'Unable to find Product'));
    }
    $product = $rc['product'];
    //
    // Get the images
    //
    if (isset($args['images']) && $args['images'] == 'yes') {
        $strsql = "SELECT id, " . "name AS title, " . "permalink, " . "flags, " . "image_id, " . "description " . "FROM ciniki_merchandise_images " . "WHERE product_id = '" . ciniki_core_dbQuote($ciniki, $product['id']) . "' " . "AND business_id = '" . ciniki_core_dbQuote($ciniki, $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', 'title', 'permalink', 'flags', 'image_id', 'description'))));
        if ($rc['stat'] != 'ok') {
            return $rc;
        }
        if (isset($rc['images'])) {
            $product['images'] = $rc['images'];
        } else {
            $product['images'] = array();
        }
        if ($product['primary_image_id'] > 0) {
            $found = 'no';
            foreach ($product['images'] as $image) {
                if ($image['image_id'] == $product['primary_image_id']) {
                    $found = 'yes';
                }
            }
            if ($found == 'no') {
                array_unshift($product['images'], array('title' => '', 'flags' => 1, 'permalink' => $product['uuid'], 'image_id' => $product['primary_image_id'], 'description' => ''));
            }
        }
    }
    return array('stat' => 'ok', 'product' => $product);
}
开发者ID:ciniki,项目名称:merchandise,代码行数:48,代码来源:productLoad.php


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