Example #1
0
 protected function getGoogleContacts()
 {
     $objContacts = new GetContacts();
     $arrContacts = $objContacts->GetGContacts($this->txtUser, $this->txtPassword);
     $contactCount = sizeof($arrContacts);
     foreach ($arrContacts as $person) {
         $count = Peopledetails::QueryCount(QQ::Equal(QQN::Peopledetails()->Email, $person['contactMail']));
         if ($count != 0) {
             $objPerson = Peopledetails::QuerySingle(QQ::Equal(QQN::Peopledetails()->Email, $person['contactMail']));
         } else {
             $objPerson = new Peopledetails();
         }
         $objPerson->FullName = $person['contactName'];
         $objPerson->Phone = $person['contactPhone'];
         $objPerson->Address = $person['contactAddr'];
         $objPerson->Email = $person['contactMail'];
         $objPerson->Save();
     }
     QApplication::DisplayAlert('Successfully imported ' . $contactCount . 'contacts from Google Contacts');
 }
 public function MetaDataBinder()
 {
     $condition = QQ::Equal(QQN::Peopledetails()->Owner, $_SESSION['User']);
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = Peopledetails::QueryCount($condition);
     }
     // 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 Peopledetails, given the clauses above
     //$condition = QQ::Equal(QQN::Peopledetails()->Owner,$_SESSION['User']);
     $this->DataSource = Peopledetails::QueryArray($condition, $objClauses);
     //$this->DataSource = Peopledetails::LoadAll($objClauses);
 }
Example #3
0
 protected function GetPeopleData()
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Peopledetails()->FullName));
     if ($objClause = $this->dtrPeople->LimitClause) {
         array_push($objClauses, $this->dtrPeople->LimitClause);
     }
     if ($this->txtSearchPeople->Text != '') {
         $condition = QQ::OrCondition(QQ::Like(QQN::Peopledetails()->FullName, '%' . $this->txtSearchPeople->Text . '%'), QQ::Like(QQN::Peopledetails()->Email, '%' . $this->txtSearchPeople->Text . '%'), QQ::Like(QQN::Peopledetails()->Phone, '%' . $this->txtSearchPeople->Text . '%'));
         $result = Peopledetails::QueryArray($condition, $objClause);
         $this->dtrPeople->DataSource = $result;
         $this->dtrPeople->TotalItemCount = Peopledetails::QueryCount($condition);
     } else {
         $result = Peopledetails::QueryArray(QQ::All(), $objClause);
         $this->dtrPeople->DataSource = $result;
         $this->dtrPeople->TotalItemCount = Peopledetails::QueryCount(QQ::All());
     }
 }
 /**
  * Count all Peopledetailses
  * @return int
  */
 public static function CountAll()
 {
     // Call Peopledetails::QueryCount to perform the CountAll query
     return Peopledetails::QueryCount(QQ::All());
 }