Esempio n. 1
0
 public function updateSupportEmail($email_record)
 {
     if ($email_record["current_pos"] >= 30) {
         $strSql = global_common::prepareQuery(global_common::SQL_UPDATE_BY_CONDITION, array(global_common::TBL_EMAIL_SUPPORT, "current_pos='0',times='" . ($email_record["times"] + 1) . "'", "email='" . $email_record["email"] . "'"));
     } else {
         $strSql = global_common::prepareQuery(global_common::SQL_UPDATE_BY_CONDITION, array(global_common::TBL_EMAIL_SUPPORT, "current_pos='" . ($email_record["current_pos"] + 1) . "'", "email='" . $email_record["email"] . "'"));
     }
     $result = $this->objConnection->executeSQL($strSql);
     if ($result == -1) {
         return false;
     }
     return true;
 }
Esempio n. 2
0
    public function getListNotificationType($intPage, $orderBy = 'NotificationTypeID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_NOTIFICATION_TYPE, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
                    <thead>
						<td>NotificationTypeID</td>
						<td>NotificationTypeName</td>
						<td>CreatedBy</td>
						<td>CreatedDate</td>
						<td>ModifiedBy</td>
						<td>ModifiedDate</td>
						<td>DeletedBy</td>
						<td>DeletedDate</td>
						<td>IsDeleted</td>
						<td>Status</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['NotificationTypeID'] . '</td>
						<td>' . $arrResult[$i]['NotificationTypeName'] . '</td>
						<td>' . $arrResult[$i]['CreatedBy'] . '</td>
						<td>' . $arrResult[$i]['CreatedDate'] . '</td>
						<td>' . $arrResult[$i]['ModifiedBy'] . '</td>
						<td>' . $arrResult[$i]['ModifiedDate'] . '</td>
						<td>' . $arrResult[$i]['DeletedBy'] . '</td>
						<td>' . $arrResult[$i]['DeletedDate'] . '</td>
						<td><input type="checkbox" onclick="_objNotificationType.showHide(\'' . $arrResult[$i]['NotificationTypeID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
						<td class="lastCell">' . $arrResult[$i]['Status'] . '</td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_NOTIFICATION_TYPE, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Esempio n. 3
0
    public function getListEvaluation($intPage, $orderBy = 'EvaluationID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_EVALUATION, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
                    <thead>
						<td>ArticleID</td>
						<td>EvaluationID</td>
						<td>NumEvaluation</td>
						<td>EvaluatedBy</td>
						<td>LastEvaluated</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['ArticleID'] . '</td>
						<td>' . $arrResult[$i]['EvaluationID'] . '</td>
						<td>' . $arrResult[$i]['NumEvaluation'] . '</td>
						<td>' . $arrResult[$i]['EvaluatedBy'] . '</td>
						<td class="lastCell">' . $arrResult[$i]['LastEvaluated'] . '</td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_EVALUATION, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Esempio n. 4
0
 function displayAllCategory()
 {
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_ARTICLE_TYPE, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     //echo 'sql:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     //print_r($arrResult);
 }
Esempio n. 5
0
    public function getListPartner($intPage, $orderBy = 'ParterID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_PARTNER, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
                    <thead>
						<td>ParterID</td>
						<td>UserID</td>
						<td>PartnerName</td>
						<td>Company</td>
						<td>Address1</td>
						<td>AddressName1</td>
						<td>Address2</td>
						<td>AddressName2</td>
						<td>Address3</td>
						<td>AddressName3</td>
						<td>Address4</td>
						<td>AddressName4</td>
						<td>Address5</td>
						<td>AddressName5</td>
						<td>Email1</td>
						<td>EmailName1</td>
						<td>Email2</td>
						<td>EmailName2</td>
						<td>Email3</td>
						<td>EmailName3</td>
						<td>Email4</td>
						<td>EmailName4</td>
						<td>Email5</td>
						<td>EmailName5</td>
						<td>Phone1</td>
						<td>PhoneName1</td>
						<td>Phone2</td>
						<td>PhoneName2</td>
						<td>Phone3</td>
						<td>PhoneName3</td>
						<td>Phone4</td>
						<td>PhoneName4</td>
						<td>Phone5</td>
						<td>PhoneName5</td>
						<td>Fax1</td>
						<td>FaxName1</td>
						<td>Fax2</td>
						<td>FaxName2</td>
						<td>Fax3</td>
						<td>FaxName3</td>
						<td>Fax4</td>
						<td>FaxName4</td>
						<td>Fax5</td>
						<td>FaxName5</td>
						<td>Website1</td>
						<td>WebsiteName1</td>
						<td>Website2</td>
						<td>WebsiteName2</td>
						<td>Website3</td>
						<td>WebsiteName3</td>
						<td>Website4</td>
						<td>WebsiteName4</td>
						<td>Website5</td>
						<td>WebsiteName5</td>
						<td>TaxNumber</td>
						<td>AccountNumber</td>
						<td>CreatedBy</td>
						<td>CreatedDate</td>
						<td>ModifiedBy</td>
						<td>ModifiedDate</td>
						<td>DeletedBy</td>
						<td>DeletedDate</td>
						<td>Status</td>
						<td>IsDeleted</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['ParterID'] . '</td>
						<td>' . $arrResult[$i]['UserID'] . '</td>
						<td>' . $arrResult[$i]['PartnerName'] . '</td>
						<td>' . $arrResult[$i]['Company'] . '</td>
						<td>' . $arrResult[$i]['Address1'] . '</td>
						<td>' . $arrResult[$i]['AddressName1'] . '</td>
						<td>' . $arrResult[$i]['Address2'] . '</td>
						<td>' . $arrResult[$i]['AddressName2'] . '</td>
						<td>' . $arrResult[$i]['Address3'] . '</td>
						<td>' . $arrResult[$i]['AddressName3'] . '</td>
						<td>' . $arrResult[$i]['Address4'] . '</td>
						<td>' . $arrResult[$i]['AddressName4'] . '</td>
						<td>' . $arrResult[$i]['Address5'] . '</td>
						<td>' . $arrResult[$i]['AddressName5'] . '</td>
						<td>' . $arrResult[$i]['Email1'] . '</td>
						<td>' . $arrResult[$i]['EmailName1'] . '</td>
						<td>' . $arrResult[$i]['Email2'] . '</td>
						<td>' . $arrResult[$i]['EmailName2'] . '</td>
						<td>' . $arrResult[$i]['Email3'] . '</td>
						<td>' . $arrResult[$i]['EmailName3'] . '</td>
						<td>' . $arrResult[$i]['Email4'] . '</td>
						<td>' . $arrResult[$i]['EmailName4'] . '</td>
						<td>' . $arrResult[$i]['Email5'] . '</td>
						<td>' . $arrResult[$i]['EmailName5'] . '</td>
						<td>' . $arrResult[$i]['Phone1'] . '</td>
						<td>' . $arrResult[$i]['PhoneName1'] . '</td>
						<td>' . $arrResult[$i]['Phone2'] . '</td>
						<td>' . $arrResult[$i]['PhoneName2'] . '</td>
						<td>' . $arrResult[$i]['Phone3'] . '</td>
						<td>' . $arrResult[$i]['PhoneName3'] . '</td>
						<td>' . $arrResult[$i]['Phone4'] . '</td>
						<td>' . $arrResult[$i]['PhoneName4'] . '</td>
						<td>' . $arrResult[$i]['Phone5'] . '</td>
						<td>' . $arrResult[$i]['PhoneName5'] . '</td>
						<td>' . $arrResult[$i]['Fax1'] . '</td>
						<td>' . $arrResult[$i]['FaxName1'] . '</td>
						<td>' . $arrResult[$i]['Fax2'] . '</td>
						<td>' . $arrResult[$i]['FaxName2'] . '</td>
						<td>' . $arrResult[$i]['Fax3'] . '</td>
						<td>' . $arrResult[$i]['FaxName3'] . '</td>
						<td>' . $arrResult[$i]['Fax4'] . '</td>
						<td>' . $arrResult[$i]['FaxName4'] . '</td>
						<td>' . $arrResult[$i]['Fax5'] . '</td>
						<td>' . $arrResult[$i]['FaxName5'] . '</td>
						<td>' . $arrResult[$i]['Website1'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName1'] . '</td>
						<td>' . $arrResult[$i]['Website2'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName2'] . '</td>
						<td>' . $arrResult[$i]['Website3'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName3'] . '</td>
						<td>' . $arrResult[$i]['Website4'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName4'] . '</td>
						<td>' . $arrResult[$i]['Website5'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName5'] . '</td>
						<td>' . $arrResult[$i]['TaxNumber'] . '</td>
						<td>' . $arrResult[$i]['AccountNumber'] . '</td>
						<td>' . $arrResult[$i]['CreatedBy'] . '</td>
						<td>' . $arrResult[$i]['CreatedDate'] . '</td>
						<td>' . $arrResult[$i]['ModifiedBy'] . '</td>
						<td>' . $arrResult[$i]['ModifiedDate'] . '</td>
						<td>' . $arrResult[$i]['DeletedBy'] . '</td>
						<td>' . $arrResult[$i]['DeletedDate'] . '</td>
						<td>' . $arrResult[$i]['Status'] . '</td>
						<td class="lastCell"><input type="checkbox" onclick="_objPartner.showHide(\'' . $arrResult[$i]['ParterID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_PARTNER, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Esempio n. 6
0
    public function getListUser($intPage, $orderBy = 'UserID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_USER, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
				<thead>
				<td>UserID</td>
				<td>UserName</td>
				<td>Password</td>
				<td>Fullname</td>
				<td>BirthDate</td>
				<td>Address</td>
				<td>Phone</td>
				<td>Email</td>
				<td>Sex</td>
				<td>Identity</td>
				<td>RoleID</td>
				<td>UserRankID</td>
				<td>Avatar</td>
				<td>AccountID</td>
				<td>IsActived</td>
				</thead>
				<tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
					<td>' . $arrResult[$i]['UserID'] . '</td>
					<td>' . $arrResult[$i]['UserName'] . '</td>
					<td>' . $arrResult[$i]['Password'] . '</td>
					<td>' . $arrResult[$i]['Fullname'] . '</td>
					<td>' . $arrResult[$i]['BirthDate'] . '</td>
					<td>' . $arrResult[$i]['Address'] . '</td>
					<td>' . $arrResult[$i]['Phone'] . '</td>
					<td>' . $arrResult[$i]['Email'] . '</td>
					<td>' . $arrResult[$i]['Sex'] . '</td>
					<td>' . $arrResult[$i]['Identity'] . '</td>
					<td>' . $arrResult[$i]['RoleID'] . '</td>
					<td>' . $arrResult[$i]['UserRankID'] . '</td>
					<td>' . $arrResult[$i]['Avatar'] . '</td>
					<td>' . $arrResult[$i]['AccountID'] . '</td>
					<td class="lastCell"><input type="checkbox" onclick="_objUser.showHide(\'' . $arrResult[$i]['UserID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
					</tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_USER, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
 /**
  * get lits articles form table summary by contentID (articleID, article type ID,...) and type (article, category) by multi IDs
  *
  * @param object $objConnection connect to db
  * @param string $contentIDs
  * @param string $type value of type: article, category
  * @return array 
  * GiaTran
  */
 public function getContentInfoByIDs($objConnection, $contentIDs, $type)
 {
     $whereTemp = 'WHERE ' . global_mapping::ContentID . ' IN(' . $contentIDs . ') and ' . global_mapping::Type . '=\'' . $type . '\'';
     $orderTemp = 'ORDER BY ' . global_mapping::PeriodTime . ' DESC ';
     $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', global_common::TBL_SL_CONTENT_SUMMARY, $whereTemp . $orderTemp));
     //echo $strSQL;
     return $objConnection->selectCommand($strSQL);
 }
 /**
  * Get Aticles By Type (Categories)
  *
  * @param mixed $articleTypeIDs This is a description
  * @return mixed This is the return value description
  *
  */
 public function getArticleTypesByID($articleID)
 {
     $whereClause = 'WHERE ' . global_mapping::ArticleID . ' = \'' . $articleID . '\'';
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_ARTICLE_TYPE_ID, $whereClause));
     //return $strSQL;
     $articleTypes = $this->_objConnection->selectCommand($strSQL);
     return global_common::getArrayColumn($articleTypes, global_mapping::ArticleTypeID);
 }
Esempio n. 9
0
 /**
  * get sql select articles from multi tables
  *
  * @param mixed $arrSummary This is a description
  * @param mixed $intPage This is a description
  * @param mixed $topRow top of article, 0: get all
  * @param mixed $selectField This is a description
  * @param mixed $whereClause This is a description
  * @param mixed $orderBy This is a description
  * @return mixed This is the return value description
  *
  */
 private function getSQLSelectByTableName($arrSummary, $intPage, $topRow, $selectField, $whereClause, $orderBy)
 {
     if ($orderBy) {
         $orderBy = ' ORDER BY ' . $orderBy;
     }
     $listArticleID = '';
     foreach ($arrSummary as $item) {
         $listArticleID = $item[global_mapping::SubContents] . $listArticleID;
     }
     $arrDocInTable = global_common::getListTableName($listArticleID, $intPage, Model_Article::NUM_PER_PAGE, global_common::SEPARATE_BY_MONTH);
     $strSQL = '';
     $condition = '';
     foreach ($arrDocInTable as $key => $iDoc) {
         //print_r($iDoc);
         //check endWith ',' and then remove it
         if (global_common::endsWith($iDoc, ',')) {
             $strDocInTable = global_common::cutLast($iDoc, 1);
         }
         $strTableName = Model_Article::TBL_SL_ARTICLE . '_' . $key;
         if ($whereClause) {
             $condition = 'WHERE (' . global_mapping::IsDeleted . ' IS NULL or ' . global_mapping::IsDeleted . ' = \'0\') and `' . global_mapping::ArticleID . '` IN (' . $strDocInTable . ') and ' . $whereClause;
         } else {
             $condition = 'WHERE (' . global_mapping::IsDeleted . ' IS NULL or ' . global_mapping::IsDeleted . ' = \'0\') and `' . global_mapping::ArticleID . '` IN (' . $strDocInTable . ')';
         }
         if ($topRow > 0) {
             $strSQL .= "(" . global_common::prepareQuery(global_common::SQL_SELECT_FREE_LIMIT, array($selectField, $strTableName, $condition . $orderBy, 0, $topRow)) . " ) UNION ALL ";
         } else {
             $strSQL .= "(" . global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, $strTableName, $condition . $orderBy)) . " ) UNION ALL ";
         }
     }
     //xóa bỏ đoạn text UNION ALL cuối chuỗi $strSQL
     $strSQL = global_common::cutLast($strSQL, strlen('UNION ALL '));
     //echo $strSQL;
     return $strSQL;
 }
Esempio n. 10
0
    public function getListProductPrice($intPage, $orderBy = 'ProductPriceID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_PRODUCT_PRICE, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
				<thead>
				<td>ProductPriceID</td>
				<td>ProductID</td>
				<td>Retailer</td>
				<td>ProductLink</td>
				<td>TypeID</td>
				<td>Order</td>
				<td>StatusID</td>
				<td>Status</td>
				</thead>
				<tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
					<td>' . $arrResult[$i]['ProductPriceID'] . '</td>
					<td>' . $arrResult[$i]['ProductID'] . '</td>
					<td>' . $arrResult[$i]['Retailer'] . '</td>
					<td>' . $arrResult[$i]['ProductLink'] . '</td>
					<td>' . $arrResult[$i]['TypeID'] . '</td>
					<td>' . $arrResult[$i]['Order'] . '</td>
					<td>' . $arrResult[$i]['StatusID'] . '</td>
					<td class="lastCell">' . $arrResult[$i]['Status'] . '</td>
					</tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_PRODUCT_PRICE, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Esempio n. 11
0
    public function getListRetailer($intPage, $orderBy = 'RetailerID', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_RETAILER, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
				<thead>
				<td>RetailerID</td>
				<td>ProductID</td>
				<td>ProductStatusID</td>
				<td>Price</td>
				<td>Amount</td>
				<td>Remaining</td>
				<td>ImageLink</td>
				<td>ShipTypeID</td>
				<td>ShipingCost</td>
				<td>ShippingDay</td>
				<td>PaymentModeID</td>
				<td>Description</td>
				<td>CreatedBy</td>
				<td>CreatedDate</td>
				<td>ModifiedBy</td>
				<td>ModifiedDate</td>
				<td>DeletedBy</td>
				<td>DeletedDate</td>
				<td>IsDeleted</td>
				<td>StatusID</td>
				<td>Status</td>
				</thead>
				<tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
					<td>' . $arrResult[$i]['RetailerID'] . '</td>
					<td>' . $arrResult[$i]['ProductID'] . '</td>
					<td>' . $arrResult[$i]['ProductStatusID'] . '</td>
					<td>' . $arrResult[$i]['Price'] . '</td>
					<td>' . $arrResult[$i]['Amount'] . '</td>
					<td>' . $arrResult[$i]['Remaining'] . '</td>
					<td>' . $arrResult[$i]['ImageLink'] . '</td>
					<td>' . $arrResult[$i]['ShipTypeID'] . '</td>
					<td>' . $arrResult[$i]['ShipingCost'] . '</td>
					<td>' . $arrResult[$i]['ShippingDay'] . '</td>
					<td>' . $arrResult[$i]['PaymentModeID'] . '</td>
					<td>' . $arrResult[$i]['Description'] . '</td>
					<td>' . $arrResult[$i]['CreatedBy'] . '</td>
					<td>' . $arrResult[$i]['CreatedDate'] . '</td>
					<td>' . $arrResult[$i]['ModifiedBy'] . '</td>
					<td>' . $arrResult[$i]['ModifiedDate'] . '</td>
					<td>' . $arrResult[$i]['DeletedBy'] . '</td>
					<td>' . $arrResult[$i]['DeletedDate'] . '</td>
					<td><input type="checkbox" onclick="_objRetailer.showHide(\'' . $arrResult[$i]['RetailerID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
					<td>' . $arrResult[$i]['StatusID'] . '</td>
					<td class="lastCell">' . $arrResult[$i]['Status'] . '</td>
					</tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_RETAILER, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Esempio n. 12
0
 public function getTrackerUserType($userID, $type, $intPage)
 {
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('`Value` as StoreID' . ',count(*) as Count', self::TBL_SL_TRACKER, 'WHERE  UserID = ' . $userID . ' And  TrackType = \'' . $type . '\' GROUP BY `Value`' . ' ORDER BY MAX(' . global_mapping::TrackDate . ') DESC ' . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     //echo $strSQL;
     //return;
     $arrTrackStores = $this->_objConnection->selectCommand($strSQL);
     $arrStoreIDs = global_common::getArrayColumn($arrTrackStores, 'StoreID');
     return $arrStoreIDs;
 }
Esempio n. 13
0
    public function getListStore($intPage, $orderBy = '', $whereClause)
    {
        if ($whereClause) {
            $whereClause = 'WHERE' + $whereClause;
        }
        if ($orderBy) {
            $orderBy = 'ORDER BY' + $orderBy;
        }
        $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_STORE, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
        //echo 'sql:'.$strSQL;
        $arrResult = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrResult);
        $strHTML = '<table class="tbl-list">
                    <thead>
						<td>StoreID</td>
						<td>Name</td>
						<td>Address</td>
						<td>DistictID</td>
						<td>CityID</td>
						<td>Phone</td>
						<td>SpecialDesc</td>
						<td>Latitude</td>
						<td>Longitude</td>
						<td>WorkingDay</td>
						<td>MainCategoryId</td>
						<td>StoreIcon</td>
						<td>StoreImage</td>
						<td>Status</td>
						<td>CreatedBy</td>
						<td>CreateDate</td>
						<td>UpdatedBy</td>
						<td>UpdatedDate</td>
						<td>DeletedBy</td>
						<td>DeletedDate</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['StoreID'] . '</td>
						<td>' . $arrResult[$i]['Name'] . '</td>
						<td>' . $arrResult[$i]['Address'] . '</td>
						<td>' . $arrResult[$i]['DistictID'] . '</td>
						<td>' . $arrResult[$i]['CityID'] . '</td>
						<td>' . $arrResult[$i]['Phone'] . '</td>
						<td>' . $arrResult[$i]['SpecialDesc'] . '</td>
						<td>' . $arrResult[$i]['Latitude'] . '</td>
						<td>' . $arrResult[$i]['Longitude'] . '</td>
						<td>' . $arrResult[$i]['WorkingDay'] . '</td>
						<td>' . $arrResult[$i]['MainCategoryId'] . '</td>
						<td>' . $arrResult[$i]['StoreIcon'] . '</td>
						<td>' . $arrResult[$i]['StoreImage'] . '</td>
						<td>' . $arrResult[$i]['Status'] . '</td>
						<td>' . $arrResult[$i]['CreatedBy'] . '</td>
						<td>' . $arrResult[$i]['CreateDate'] . '</td>
						<td>' . $arrResult[$i]['UpdatedBy'] . '</td>
						<td>' . $arrResult[$i]['UpdatedDate'] . '</td>
						<td>' . $arrResult[$i]['DeletedBy'] . '</td>
						<td class="lastCell">' . $arrResult[$i]['DeletedDate'] . '</td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_STORE, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }