protected function GetShareDetails() { $objClauses = array(); array_push($objClauses, QQ::OrderBy(QQN::Sharedetails()->ReturnDate)); if ($objClause = $this->dtrShareDetails->LimitClause) { array_push($objClauses, $this->dtrShareDetails->LimitClause); } if ($this->txtSearchTerm->Text == "") { $objCondition = QQ::Equal(QQN::Sharedetails()->Owner, $_SESSION['User']); $myassets = Sharedetails::QueryArray($objCondition, $objClauses); } else { $objCondition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Sharedetails()->Asin, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Sharedetails()->Email, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Sharedetails()->TakenDate, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Sharedetails()->ReturnDate, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Sharedetails()->Title, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Sharedetails()->FullName, '%' . $this->txtSearchTerm->Text . '%')), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User'])); $objDbResult = Sharedetails::QueryArray($objCondition, $objClauses); $myassets = $objDbResult; } //$this->dtrShareDetails->TotalItemCount = Sharedetails::QueryCount($condition); $this->arrShareDetails = $myassets; return $objCondition; }
protected function LendBasket() { foreach ($this->objBasket->GetBasket() as $item) { $objItem = Myassets::QuerySingle(QQ::Equal(QQN::Myassets()->Id, $item->Id)); $objPerson = Peopledetails::QuerySingle(QQ::Equal(QQN::Peopledetails()->Id, $this->strBorrower)); $objShareDetails = new Sharedetails(); $objShareDetails->Asin = $objItem->Asin; $objShareDetails->Email = $objPerson->Email; /*Logic to get the return date*/ $today = new QDateTime(QDateTime::Now); $daySpan = new QDateTimeSpan(); $daySpan->AddDays(30); $returnDate = $today->Add($daySpan); $objShareDetails->TakenDate = QDateTime::Now(false); $objShareDetails->ReturnDate = $returnDate; $objShareDetails->Title = $objItem->Title; $objShareDetails->FullName = $objPerson->FullName; $objShareDetails->Save(); } }
<br/> <?php include_once 'prepend.inc.php'; $name = ''; $chkCondition = new QQConditionEqual(QQN::Sharedetails()->Asin, $_ITEM->Asin); $cnt = Sharedetails::QueryCount($chkCondition); $objShare = Sharedetails::QueryArray($chkCondition); foreach ($objShare as $val) { $name = $val->FullName; } /* * If the item is shared so not show it. */ if ($cnt == 0) { ?> <table> <tr> <td> <div> <?php if ($_ITEM->ImageURL != '') { $img = $_ITEM->ImageURL; } else { $img = '../assets/images/48x48/help.png'; } ?> <img src='<?php _p($img); ?>
<div>Number of Discs: <?php isset($_ITEM->NumberOfDiscs) ? _p($_ITEM->NumberOfDiscs) : _p(''); ?> </div> <?php } ?> <?php $btnLend = new QLinkButton($this); $btnLend->Text = 'Lend this to...'; $btnLend->AddAction(new QClickEvent(), new QServerAction('LendThis_Click')); $btnLend->ActionParameter = $_ITEM->Id; $objCondition = array(); $objCondition = QQ::Equal(QQN::Sharedetails()->Asin, $_ITEM->Asin); $result = Sharedetails::QuerySingle($objCondition); ?> <br/><br/><br/><br/><br/> <div> <?php if (sizeof($result) != 0) { ?> <img src = '../assets/images/32x32/tag_green.png' /> <?php _p('This item is shared with ' . $result->FullName); } ?> </div> </td> </tr>
/** * Default / simple DataBinder for this Meta DataGrid. This can easily be overridden * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). */ public function MetaDataBinder() { // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = Sharedetails::CountAll(); } // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from Sharedetails, given the clauses above $this->DataSource = Sharedetails::LoadAll($objClauses); }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, Sharedetails::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this SharedetailsMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Sharedetails object creation - defaults to CreateOrEdit * @return SharedetailsMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objSharedetails = Sharedetails::Load($intId); // Sharedetails was found -- return it! if ($objSharedetails) { return new SharedetailsMetaControl($objParentObject, $objSharedetails); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Sharedetails object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new SharedetailsMetaControl($objParentObject, new Sharedetails()); }