예제 #1
0
 private function GetAssetsData()
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Myassets()->Title));
     if ($objClause = $this->dtrAssets->LimitClause) {
         array_push($objClauses, $this->dtrAssets->LimitClause);
     }
     if ($this->txtSearchAssets->Text != '') {
         $condition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Myassets()->Title, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Author, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Artist, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Actor, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Director, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Publisher, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Label, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Isbn, '%' . $this->txtSearchAssets->Text . '%')), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
     } else {
         $condition = QQ::AndCondition(QQ::NotEqual(QQN::Myassets()->Asin, ''), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
     }
     $arrResult = Myassets::QueryArray($condition, $objClauses);
     $this->dtrAssets->TotalItemCount = Myassets::QueryCount($condition);
     $this->dtrAssets->DataSource = $arrResult;
 }
예제 #2
0
<?php

include_once 'prepend.inc.php';
$cndASIN = QQ::AndCondition(QQ::Equal(QQN::Myassets()->Asin, $_ITEM->ASIN), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
$cndTitle = QQ::AndCondition(QQ::Equal(QQN::Myassets()->Title, $_ITEM->ASIN), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
$cntASIN = Myassets::QueryCount($cndASIN);
$cntTitle = Myassets::QueryCount($cndTitle);
if ($cntASIN != 0 || $cntTitle != 0) {
    $owned = true;
} else {
    $owned = false;
}
?>
<table>
	<tr>
		<td><?php 
try {
    if (isset($_ITEM->MediumImage->Url)) {
        $img = $_ITEM->MediumImage->Url;
    } else {
        $img = '../assets/images/48x48/help.png';
    }
} catch (Exception $e) {
    $img = '../../assets/images/48x48/help.png';
}
?>
 <img src='<?php 
_p($img);
?>
' width=108px height=160px></img></td>
		<td>
예제 #3
0
 /**
  * Count all Myassetses
  * @return int
  */
 public static function CountAll()
 {
     // Call Myassets::QueryCount to perform the CountAll query
     return Myassets::QueryCount(QQ::All());
 }
예제 #4
0
 private function GetAssetsData($productgroup)
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Myassets()->Title));
     if ($objClause = $this->dtrMyLibrary->LimitClause) {
         array_push($objClauses, $this->dtrMyLibrary->LimitClause);
     }
     if ($this->txtSearchTerm->Text == "") {
         $condition = QQ::AndCondition(QQ::Equal(QQN::Myassets()->ProductGroup, $productgroup), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
         $arrResult = Myassets::QueryArray($condition, $objClauses);
         $this->dtrMyLibrary->TotalItemCount = Myassets::QueryCount($condition);
         $this->dtrMyLibrary->DataSource = $arrResult;
     } else {
         $objCondition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Myassets()->Title, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Author, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Artist, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Actor, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Director, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Publisher, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Label, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Isbn, '%' . $this->txtSearchTerm->Text . '%')), QQ::Equal(QQN::Myassets()->ProductGroup, $productgroup), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
         $objDbResult = Myassets::QueryArray($objCondition, $objClauses);
         $myassets = $objDbResult;
         $this->dtrMyLibrary->TotalItemCount = Myassets::QueryCount($objCondition);
         if ($this->dtrMyLibrary->TotalItemCount > 0) {
             $this->dtrMyLibrary->DataSource = $myassets;
         } else {
             QApplicationBase::DisplayAlert('No ' . $productgroup . 's exists for the searched term');
         }
     }
 }