Exemple #1
0
 public static function getImgAddressById($id)
 {
     $query = "SELECT ia.id, r.id AS region_id, r.code AS rcode, r.name AS rname, ia.sity, ia.street, ia.house \n\t\t\tFROM img_address AS ia \n\t\t\tJOIN addr_region AS r on ia.region_id = r.id\n\t\t\tWHERE ia.id = ?";
     $imgAddreses = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $id);
     return $imgAddreses[0];
 }
Exemple #2
0
 public static function getSysNewsCatByID($sysNewsCatID)
 {
     $query = "SELECT  `id`,  `name`,  `pid`  FROM `sys_news_cat` WHERE `id` = ?";
     $sysNewsCats = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $sysNewsCatID);
     return $sysNewsCats[0];
 }
Exemple #3
0
 public static function getImgBlogCatsByAccountId($account_id)
 {
     $query = "SELECT  `id`, `account_id`, `name`,  `pid` FROM `img_blog_cat` WHERE `account_id` = ?";
     $imgBlogCats = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $account_id);
     return $imgBlogCats;
 }
Exemple #4
0
 public static function getImgCurrencies()
 {
     $query = "SELECT  `id`,  `name`,  `weight` FROM  `img_currency`";
     $imgCurrencies = DBUtil::getResultRowsOfPrepatedQuery($query);
     return $imgCurrencies;
 }
Exemple #5
0
 public static function getOrderById($orderID, $accountID)
 {
     $query = "SELECT  o.id,  o.u_email, o.u_name, o.u_phone, o.u_comment,  o.c_date , oacc.sended\n                    FROM `order` as o\n                    JOIN order_account_sended as oacc ON oacc.order_id = o.id\n                    WHERE o.`id` = ? AND oacc.img_account_id = ?";
     $orders = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $orderID, $accountID);
     return $orders[0];
 }
Exemple #6
0
 public static function getSysNewsArtsByFilter($sys_news_cat_id, $ptile, $start, $lenght)
 {
     $query = "SELECT `id`,  `sys_news_cat_id`,  `title`,  `preview`,  `c_date`,  `main_pict_id`\n\t\t\tFROM `sys_news_art` WHERE 1 = 1 ";
     $ptile = trim($ptile);
     if (NULL != $sys_news_cat_id) {
         $query .= "AND `sys_news_cat_id` = ? ";
     }
     if (0 != strcmp("", $ptile)) {
         $query .= "AND upper(`title`) LIKE upper(?) ";
     }
     $query .= "ORDER BY `c_date` DESC LIMIT ?, ?";
     if (NULL != $sys_news_cat_id && 0 != strcmp("", $ptile)) {
         $ptile = "%" . $ptile . "%";
         $sysNewsArts = DBUtil::getResultRowsOfPrepatedQuery($query, "isii", $sys_news_cat_id, $ptile, $start, $lenght);
     } else {
         if (NULL != $sys_news_cat_id) {
             $sysNewsArts = DBUtil::getResultRowsOfPrepatedQuery($query, "iii", $sys_news_cat_id, $start, $lenght);
         } else {
             if (0 != strcmp("", $ptile)) {
                 $ptile = "%" . $ptile . "%";
                 $sysNewsArts = DBUtil::getResultRowsOfPrepatedQuery($query, "sii", $ptile, $start, $lenght);
             } else {
                 $sysNewsArts = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $start, $lenght);
             }
         }
     }
     return $sysNewsArts;
 }
Exemple #7
0
 private static function findImgGdsCatIdByProductId($account_id, $productId)
 {
     $query = "SELECT  igc.id as id FROM img_gds_cat igc JOIN img_gds ig ON igc.id = ig.img_gds_cat_id \n\t\tWHERE igc.account_id = ? AND ig.id = ?";
     $imgGdsCatIds = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $account_id, $productId);
     return $imgGdsCatIds[0]['id'];
 }
Exemple #8
0
 public static function getPropertyValue($key)
 {
     $query = "SELECT `value` FROM `sys_properties` WHERE `name` = ?";
     $props = DBUtil::getResultRowsOfPrepatedQuery($query, "s", $key);
     return $props[0]['value'];
 }
Exemple #9
0
 public static function getImgBlogArtBlocksByArtId($artId)
 {
     $query = "SELECT  `id`,  `img_blog_art_id`,  `block_type`,  `text_content`,  \n            `img_picture_id`,  `pict_desc`,  `order_in_art` \n            FROM `img_blog_art_block`\n            WHERE `img_blog_art_id` = ? ORDER BY `order_in_art` ASC";
     $imgBlogArtBlocks = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $artId);
     return $imgBlogArtBlocks;
 }
Exemple #10
0
 public static function getOrderAccsToMailMessage($orderID)
 {
     $query = "select DISTINCT o.id as oid, iacc.id as accid, iacc.email as accemail, o.u_email as oemail from img_gds as igds \n                    join img_account iacc on igds.img_account_id = iacc.id\n                    join order_gds ogds on ogds.img_gds_id = igds.id\n                    join `order` o on ogds.order_id = o.id\n                    where o.id = ?";
     $orderAccs = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $orderID);
     return $orderAccs;
 }
 public static function getSysStaticPageBlocksByPageId($pageId)
 {
     $query = "SELECT  `id`,  `sys_static_page_id`,  `block_type_id`,  `image_id`,  `image_title`,  `text_content`,  `order_in_page`  FROM  `sys_static_page_blocks` WHERE `sys_static_page_id` = ? ORDER BY `order_in_page` ASC";
     $sysStaticPageBlocks = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $pageId);
     return $sysStaticPageBlocks;
 }
Exemple #12
0
 public static function getImgGdsProps($imgGdsId)
 {
     $query = "SELECT  `id`,  `img_gds_id`,  `name`,  `value` FROM `img_gds_prop` WHERE `img_gds_id` = ?";
     $imgGdsProps = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $imgGdsId);
     return $imgGdsProps;
 }
Exemple #13
0
 public static function getSysAdminByLastUUID($lastUUID)
 {
     $query = "SELECT  `id`,  `login`,  `password`,  `lastuuid` FROM `sys_admins` WHERE `lastuuid` LIKE ?";
     $sysAdmins = DBUtil::getResultRowsOfPrepatedQuery($query, "s", $lastUUID);
     return $sysAdmins[0];
 }
Exemple #14
0
 public static function getImgGdssForOrder($accountID, $orderID)
 {
     $query = "select igds.id, igds.name, igds.UUID, igds.main_pict_id, igds.price, \n                ic.name as price_name, ogds.count_gds from img_gds igds\n                    join order_gds ogds on igds.id = ogds.img_gds_id\n                    join `order` o on o.id = ogds.order_id\n                    join img_currency ic on ic.id = igds.currency_id\n                where o.id = ? and igds.img_account_id = ?";
     $imgGdss = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $orderID, $accountID);
     return $imgGdss;
 }
Exemple #15
0
 public static function getSysNewsArtBlockById($sysNewsArtId)
 {
     $query = "SELECT  `id`,  `sys_news_art_id`,  `image_id`,  `image_title`,  `text_content`,  `block_type`,  `order_in_art` FROM `sys_news_art_block` WHERE `id` = ? ";
     $sysNewsArtBlocks = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $sysNewsArtId);
     return $sysNewsArtBlocks[0];
 }
Exemple #16
0
 public static function getImgBlogArtById($img_account_id, $img_blog_art_id)
 {
     $query = "SELECT `id`,  `img_blog_cat_id`,  `name`,  `creation_date`,  `main_pict_id`,  `preview`\n\t\t\tFROM `img_blog_art` WHERE `img_account_id` = ? AND `id` = ?";
     $imgBlogArts = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $img_account_id, $img_blog_art_id);
     return $imgBlogArts[0];
 }
Exemple #17
0
 public static function countImgPicturesByAlbumId($id)
 {
     $query = "SELECT  COUNT(*) as cnt FROM `img_picture` WHERE `album_id` = ?";
     $cntResults = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $id);
     return $cntResults[0]['cnt'];
 }
Exemple #18
0
 public static function getRegionByCode($code)
 {
     $query = "SELECT  `id`,  `name`,  `code` FROM `addr_region` WHERE `code` = ?";
     $regions = DBUtil::getResultRowsOfPrepatedQuery($query, "i", $code);
     return $regions[0];
 }
Exemple #19
0
 public static function getImgAlbumByID($album_id, $account_id)
 {
     $query = "SELECT  `id`,  `account_id`,  `name`,  `description` FROM `img_album` WHERE `id` = ? AND `account_id` = ?";
     $imgAlbums = DBUtil::getResultRowsOfPrepatedQuery($query, "ii", $album_id, $account_id);
     return $imgAlbums[0];
 }
Exemple #20
0
 public static function getSysStaticPageByName($namePage)
 {
     $query = "SELECT  `id`,  `name`,  `title` FROM `sys_static_pages` WHERE upper(`name`) LIKE upper(?)";
     $sysStaticPages = DBUtil::getResultRowsOfPrepatedQuery($query, "s", $namePage);
     return $sysStaticPages[0];
 }
Exemple #21
0
 public static function getImgAccountByEmailAndHashPass($email, $hashpass)
 {
     $query = "SELECT  `id`, `email`,  `hashpass`,  `show_email`,  `check_code`,  `active`,  `cookie_code`,  \n\t\t\t\t`img_name`,  `img_slog`,  `img_phone`,  `show_phone`,  `img_skype`,  `show_skype`,  \n\t\t\t\t`img_icq`,  `show_icq`,  `img_address_id`,  `show_address` \n\t\t\t\tFROM `img_account` WHERE `email` = ? AND `hashpass` = ? AND NOT `active` = 0";
     $imgAccounts = DBUtil::getResultRowsOfPrepatedQuery($query, "ss", $email, $hashpass);
     return $imgAccounts[0];
 }