示例#1
0
 /**
  * Creates a new user account if all inputs are valid.
  * This method responds to the OnClick event of the "create" button.
  * @param mixed event sender
  * @param mixed event parameter
  */
 public function createButtonClicked($sender, $param)
 {
     if ($this->IsValid) {
         // populates a UserRecord object with user inputs
         $userRecord = new UserRecord();
         $userRecord->user_username = $this->Username->Text;
         $userRecord->user_password = $this->Password->Text;
         $userRecord->user_mail = $this->Email->Text;
         $userRecord->idtm_user_role = (int) $this->Role->SelectedValue;
         $userRecord->user_vorname = $this->FirstName->Text;
         $userRecord->user_name = $this->LastName->Text;
         // saves to the database via Active Record mechanism
         $userRecord->save();
         $parteiRecord = new ParteiRecord();
         $parteiRecord->idtm_user = $userRecord->idtm_user;
         $parteiRecord->partei_name = $this->FirstName->Text . " " . $this->LastName->Text;
         //save the partei
         $parteiRecord->save();
         $adressRecord = new AdresseRecord();
         $adressRecord->adresse_street = $this->adresse_street->Text;
         $adressRecord->adresse_zip = $this->adresse_zip->Text;
         $adressRecord->adresse_town = $this->adresse_town->Text;
         $adressRecord->idtm_country = 1;
         //lets add the coordinates
         $myGTranslator = new GoogleAdressTranslator();
         $mapparams = $myGTranslator->getLatAndLong(implode(",", array($this->adresse_street->Text, $this->adresse_town->Text)));
         $myLatandLong = explode(",", $mapparams);
         //here we check, if the coordinates have been found
         if ($myLatandLong[1] != 0) {
             $adressRecord->adresse_lat = $myLatandLong[1];
             $adressRecord->adresse_long = $myLatandLong[0];
         } else {
             $adressRecord->adresse_lat = "48.189950";
             $adressRecord->adresse_long = "16.377319";
         }
         $adressRecord->save();
         $parteiadresseRecord = new ParteiAdresseRecord();
         $parteiadresseRecord->idta_partei = $parteiRecord->idta_partei;
         $parteiadresseRecord->idta_adresse = $adressRecord->idta_adresse;
         //save adress to partei
         $parteiadresseRecord->save();
         // redirects the browser to the homepage
         $this->Response->redirect($this->Service->DefaultPageUrl);
     }
 }
示例#2
0
 private function bindListed()
 {
     $SQL1 = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN ta_partei_has_ta_adresse ON ta_adresse.idta_adresse = ta_partei_has_ta_adresse.idta_adresse INNER JOIN ta_partei ON ta_partei_has_ta_adresse.idta_partei = ta_partei.idta_partei WHERE ta_partei.idtm_user = "******" LIMIT " . $this->AdresseListe->PageSize * $this->AdresseListe->CurrentPageIndex . "," . $this->AdresseListe->PageSize;
     $this->edAdresseListe->DataKeyField = 'edlstidta_adresse';
     $validate = PFH::checkCountStatement(AdresseRecord::finder()->findBySql($SQL1));
     if ($validate) {
         $this->edAdresseListe->VirtualItemCount = AdresseRecord::finder()->findBySql($SQL1)->Count();
     } else {
         $this->edAdresseListe->VirtualItemCount = 0;
     }
     $this->edAdresseListe->DataSource = $adressen = AdresseRecord::finder()->findAllBySql($SQL1);
     $this->edAdresseListe->dataBind();
 }
示例#3
0
 public function bindListKommunikation($sender, $param)
 {
     $item = $param->Item;
     if ($item->ItemType === 'Item' || $item->ItemType === 'AlternatingItem') {
         $criteria = new TActiveRecordCriteria();
         $criteria->Condition = "idtm_organisation = :suchtext1 AND kom_information <> ''";
         $criteria->Parameters[':suchtext1'] = $this->idtm_organisation;
         $item->KomListe->DataSource = KommunikationRecord::finder()->findAll($criteria);
         $item->KomListe->dataBind();
         $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $this->idtm_organisation . " AND adresse_street <> ''";
         $item->AdressListe->DataSource = AdresseRecord::finder()->findAllBySQL($sql);
         $item->AdressListe->dataBind();
         $criteria = new TActiveRecordCriteria();
         $criteria->Condition = "idtm_organisation = :suchtext1";
         $criteria->Parameters[':suchtext1'] = $this->idtm_organisation;
         $item->BankListe->DataSource = BankkontoRecord::finder()->findAll($criteria);
         $item->BankListe->dataBind();
     }
 }
示例#4
0
 public function onInit($param)
 {
     //first i like to get all records...
     $mydata = array();
     // populates post data into the repeater
     $companies = $this->buildData();
     foreach ($companies as $companie) {
         $criteria_p = new TActiveRecordCriteria();
         $criteria_p->Condition = 'idta_partei = :idta_partei';
         $criteria_p->Parameters[':idta_partei'] = $companie->idta_partei;
         $templisteadresse = ParteiAdresseRecord::finder()->findAll($criteria_p);
         $listeadresse = (array) $templisteadresse;
         //print_r($listeadresse);
         foreach ($listeadresse as $walker) {
             $conditionx = new TActiveRecordCriteria();
             $conditionx->Condition = 'idta_adresse = :idta_adresse';
             $conditionx->Parameters[':idta_adresse'] = $walker->idta_adresse;
             array_push($mydata, AdresseRecord::finder()->find($conditionx));
         }
     }
     //print_r($mydata);
     $ii = 0;
     foreach ($mydata as $mylocaladress) {
         $marker = prado::createComponent('BActiveGoogleMapMarker');
         $marker->setID("p" . $ii);
         //$marker->setTitle('Adress:'.$mylocaladress->adresse_town."-".$mylocaladress->adresse_street);
         $marker->setTitle('Standort');
         $marker->setPoint(array($mylocaladress->adresse_lat, $mylocaladress->adresse_long));
         $marker->setVisible(true);
         $infobulle = prado::createComponent('TLabel');
         $infobulle->setID('greentradeinfo' . $mylocaladress->idta_adresse);
         $infobulle->setText("Klappt");
         $marker->addedControl($infobulle);
         $this->GoogleMap->addMarker($marker);
         if ($ii == 0) {
             $this->GoogleMap->setCenter("(" . implode(",", array($mylocaladress->adresse_lat, $mylocaladress->adresse_long)) . ")");
         }
         $ii++;
     }
 }
示例#5
0
 private function AdressHeader($idtm_organisation)
 {
     $Organisation = OrganisationRecord::finder()->findBy_idtm_organisation($idtm_organisation);
     $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $idtm_organisation . " AND adresse_ismain = 1";
     $Adresse = AdresseRecord::finder()->findBySQL($sql);
     $this->pdf->SetY(48);
     $this->pdf->SetX(24);
     $this->pdf->SetFont('Arial', '', 7);
     $this->pdf->Cell(85, 4, 'Philipp Frenzel, Biberstrasse 8/23, 1010 Wien', 'B', 1);
     $this->pdf->SetX(28);
     $this->pdf->SetFont('Arial', 'B', 12);
     $this->pdf->Cell(0, 10, utf8_decode($Organisation->org_name));
     $this->pdf->Ln(5);
     $this->pdf->SetX(28);
     $this->pdf->SetFont('Arial', '', 11);
     $this->pdf->Cell(0, 10, utf8_decode($Adresse->adresse_street));
     $this->pdf->Ln(5);
     $this->pdf->SetX(28);
     $this->pdf->SetFont('Arial', '', 11);
     $this->pdf->Cell(0, 10, utf8_decode($Adresse->adresse_zip) . " " . utf8_decode($Adresse->adresse_town));
     $this->pdf->Ln(9);
 }
示例#6
0
 public function editButtonClicked($sender, $param)
 {
     $ar = AdresseRecord::finder()->findByPK($this->edidta_adresse->Data);
     $ar->adresse_street = $this->edStreet->Text;
     $ar->adresse_town = $this->edTown->Text;
     $ar->adresse_zip = $this->edZip->Text;
     $ar->idtm_country = $this->edCountry->Text;
     $ar->idta_adresse = $this->edidta_adresse->Data;
     //lets add the coordinates
     $myGTranslator = new GoogleAdressTranslator();
     $mapparams = $myGTranslator->getLatAndLong(implode(",", array($this->edStreet->Text, $this->edTown->Text)));
     $myLatandLong = explode(",", $mapparams);
     //here we check, if the coordinates have been found
     if ($myLatandLong[1] != 0) {
         $ar->adresse_lat = $myLatandLong[1];
         $ar->adresse_long = $myLatandLong[0];
     } else {
         $ar->adresse_lat = "48.189950";
         $ar->adresse_long = "16.377319";
     }
     $ar->save();
     $this->Response->redirect($this->getRequest()->constructUrl('page', "logik.partei"));
 }
示例#7
0
 public function lstAdressSave($sender, $param)
 {
     $item = $param->Item;
     $Record = AdresseRecord::finder()->findByPK($this->lstAdress->DataKeys[$item->ItemIndex]);
     $Record->adresse_street = $item->lst_adresse_street->TextBox->Text;
     $Record->adresse_zip = $item->lst_adresse_zip->TextBox->Text;
     $Record->adresse_town = $item->lst_adresse_town->TextBox->Text;
     //lets add the coordinates
     $myGTranslator = new GoogleAdressTranslator();
     $mapparams = $myGTranslator->getLatAndLong(implode(",", array($item->lst_adresse_street->TextBox->Text, $item->lst_adresse_town->TextBox->Text)));
     $myLatandLong = explode(",", $mapparams);
     //here we check, if the coordinates have been found
     if ($myLatandLong[1] != 0) {
         $Record->adresse_lat = $myLatandLong[1];
         $Record->adresse_long = $myLatandLong[0];
     } else {
         $Record->adresse_lat = $item->lst_adresse_lat->TextBox->Text;
         $Record->adresse_long = $item->lst_adresse_long->TextBox->Text;
     }
     $Record->adresse_ismain = $item->lst_adresse_ismain->ATB_lst_adresse_ismain->Checked ? 1 : 0;
     $Record->save();
     $this->lstAdress->EditItemIndex = -1;
     $this->bindListAdress();
 }
示例#8
0
 public function dataBindRepeater2($sender, $param)
 {
     $item = $param->Item;
     if ($item->ItemType === 'Item' || $item->ItemType === 'AlternatingItem') {
         $criteria_p = new TActiveRecordCriteria();
         $criteria_p->Condition = 'idta_partei = :idta_partei';
         $criteria_p->Parameters[':idta_partei'] = $item->data->idta_partei;
         $templisteadresse = ParteiAdresseRecord::finder()->findAll($criteria_p);
         $listeadresse = (array) $templisteadresse;
         //print_r($listeadresse);
         $mydata = array();
         foreach ($listeadresse as $walker) {
             $conditionx = new TActiveRecordCriteria();
             $conditionx->Condition = 'idta_adresse = :idta_adresse';
             $conditionx->Parameters[':idta_adresse'] = $walker->idta_adresse;
             array_push($mydata, AdresseRecord::finder()->find($conditionx));
         }
         //print_r($mydata);
         $item->Repeater2->DataSource = $mydata;
         $item->Repeater2->dataBind();
     }
 }
示例#9
0
 private function importPARTEI($data)
 {
     $Organisation = OrganisationRecord::finder()->findorg_fk_internal("HTC" . trim($data[0]));
     if (count($Organisation) != 1) {
         $Organisation = new OrganisationRecord();
     }
     $Organisation->org_fk_internal = trim("HTC" . trim($data[0]));
     $Organisation->parent_idtm_organisation = OrganisationRecord::finder()->findByorg_fk_internal('08500')->idtm_organisation;
     $Organisation->idta_organisation_type = 8;
     $Organisation->idtm_ressource = 1;
     $Organisation->org_anrede = utf8_encode($data[3]);
     $Organisation->org_briefanrede = utf8_encode("");
     $Organisation->org_name = utf8_encode($data[1]);
     $Organisation->org_vorname = utf8_encode($data[2]);
     $Organisation->org_name1 = utf8_encode("");
     $Organisation->org_matchkey = utf8_encode($data[1] . " " . $data[2]);
     $Organisation->org_uid = "";
     $Organisation->org_aktiv = $data[19] == "ja" ? 1 : 0;
     $Organisation->save();
     //Bankkonto laden
     $Bankkonto = BankkontoRecord::finder()->findByidtm_organisation($Organisation->idtm_organisation);
     if (count($Bankkonto) != 1) {
         $Bankkonto = new BankkontoRecord();
     }
     $Bankkonto->idtm_organisation = $Organisation->idtm_organisation;
     //$Bankkonto->bak_kontowortlaut = utf8_encode($data["38"]);
     $Bankkonto->bak_geldinstitut = utf8_encode("");
     $Bankkonto->bak_blz = "";
     $Bankkonto->bak_konto = "";
     $Bankkonto->bak_bic = "";
     $Bankkonto->bak_iban = "";
     $Bankkonto->save();
     //Kommunikation 1 Telefon
     $Kommunikation = KommunikationRecord::finder()->find("kom_type = 1 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation);
     if (count($Kommunikation) != 1) {
         $Kommunikation = new KommunikationRecord();
     }
     $Kommunikation->kom_type = 1;
     $Kommunikation->kom_information = $data[9];
     $Kommunikation->kom_ismain = 1;
     $Kommunikation->idtm_organisation = $Organisation->idtm_organisation;
     $Kommunikation->save();
     //Kommunikation 1 Fax2
     $Kommunikation = KommunikationRecord::finder()->find("kom_type = 2 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation);
     if (count($Kommunikation) != 1) {
         $Kommunikation = new KommunikationRecord();
     }
     $Kommunikation->kom_type = 2;
     $Kommunikation->kom_information = $data[10];
     $Kommunikation->kom_ismain = 1;
     $Kommunikation->idtm_organisation = $Organisation->idtm_organisation;
     $Kommunikation->save();
     //Kommunikation 1 Mail
     $Kommunikation = KommunikationRecord::finder()->find("kom_type = 3 AND kom_ismain = 1 AND idtm_organisation = ?", $Organisation->idtm_organisation);
     if (count($Kommunikation) != 1) {
         $Kommunikation = new KommunikationRecord();
     }
     $Kommunikation->kom_type = 3;
     $Kommunikation->kom_information = $data[11];
     $Kommunikation->kom_ismain = 1;
     $Kommunikation->idtm_organisation = $Organisation->idtm_organisation;
     $Kommunikation->save();
     //adresse 1
     $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $Organisation->idtm_organisation . " AND ta_adresse.adresse_ismain = 1";
     $Adresse = AdresseRecord::finder()->findBySQL($sql);
     if (count($Adresse) != 1) {
         $Adresse = new AdresseRecord();
     }
     $Adresse->adresse_street = utf8_encode($data[6]);
     $Adresse->adresse_zip = $data[7];
     $Adresse->adresse_town = $data[8];
     $Adresse->adresse_ismain = 1;
     $Adresse->idtm_country = 1;
     $Adresse->save();
     $OrganisationAdresse = OrganisationAdresseRecord::finder()->find('idtm_organisation = ? AND idta_adresse = ?', $Organisation->idtm_organisation, $Adresse->idta_adresse);
     if (count($OrganisationAdresse) != 1) {
         $OrganisationAdresse = new OrganisationAdresseRecord();
     }
     $OrganisationAdresse->idta_adresse = $Adresse->idta_adresse;
     $OrganisationAdresse->idtm_organisation = $Organisation->idtm_organisation;
     $OrganisationAdresse->save();
     unset($Organisation, $Bankkonto, $Kommunikation, $Adresse, $OrganisationAdresse, $sql);
 }
示例#10
0
 public function lstAdressSave($sender, $param)
 {
     $item = $param->Item;
     $Record = AdresseRecord::finder()->findByPK($this->lstAdress->DataKeys[$item->ItemIndex]);
     $Record->adresse_street = $item->lst_adresse_street->TextBox->Text;
     $Record->adresse_zip = $item->lst_adresse_zip->TextBox->Text;
     $Record->adresse_town = $item->lst_adresse_town->TextBox->Text;
     $Record->save();
     $this->lstAdress->EditItemIndex = -1;
     $this->bind_lstAdress();
 }
 private function ProtokollHeader($idtm_organisation)
 {
     $komType = array(1 => 'Telefon', 'Fax', 'Mail');
     $Organisation = OrganisationRecord::finder()->findBy_idtm_organisation($idtm_organisation);
     //Criteria for selection in joins
     $criteria = new TActiveRecordCriteria();
     $criteria->Condition = "idtm_organisation = :suchtext";
     $criteria->Parameters[':suchtext'] = $idtm_organisation;
     $this->pdf->SetY(38);
     //$this->pdf->SetX(20);
     $this->pdf->SetFillColor(234, 242, 220);
     $this->pdf->SetDrawColor(234, 242, 220);
     $this->pdf->SetFont('Helvetica', 'B', 12);
     $this->pdf->Cell(185, 6, utf8_decode($Organisation->org_name) . ' ' . utf8_decode($Organisation->org_vorname), 1, 0, 'B', 1);
     $this->pdf->Ln(7);
     //$this->pdf->SetX(28);
     $this->pdf->SetFont('Arial', '', 10);
     $this->pdf->Cell(30, 5, 'Matchcode: ', 0);
     $this->pdf->SetFont('Arial', 'B', 10);
     $this->pdf->Cell(60, 5, utf8_decode($Organisation->org_matchkey), 0);
     $this->pdf->Ln();
     //$this->pdf->SetX(20);
     $this->pdf->SetFillColor(234, 242, 220);
     $this->pdf->SetDrawColor(234, 242, 220);
     $this->pdf->SetFont('Arial', 'B', 12);
     $this->pdf->Cell(185, 6, 'Adressen ', 1, 0, 'B', 1);
     $this->pdf->Ln(7);
     $Adressen = OrganisationAdresseRecord::finder()->findAll($criteria);
     foreach ($Adressen as $Adresse) {
         $Adr = AdresseRecord::finder()->findByidta_adresse($Adresse->idta_adresse);
         $this->pdf->SetX(20);
         $this->pdf->SetFont('Arial', '', 10);
         $this->pdf->Cell(20, 5, utf8_decode($Adr->adresse_zip), 0);
         $this->pdf->SetFont('Arial', '', 10);
         $this->pdf->Cell(60, 5, utf8_decode($Adr->adresse_town), 0);
         $this->pdf->SetFont('Arial', '', 10);
         $this->pdf->Cell(60, 5, utf8_decode($Adr->adresse_street), 0);
         $this->pdf->Ln();
         unset($Adr);
     }
     //$this->pdf->SetX(20);
     $this->pdf->SetFillColor(234, 242, 220);
     $this->pdf->SetDrawColor(234, 242, 220);
     $this->pdf->SetFont('Arial', 'B', 12);
     $this->pdf->Cell(185, 6, 'Kommunikation ', 1, 0, 'B', 1);
     $this->pdf->Ln(7);
     $criteria->OrdersBy["idtm_organisation"] = 'asc';
     $Kommunikation = KommunikationRecord::finder()->findAll($criteria);
     foreach ($Kommunikation as $Komm) {
         $this->pdf->SetX(20);
         $this->pdf->SetFont('Arial', '', 10);
         $this->pdf->Cell(30, 5, utf8_decode($komType[$Komm->kom_type]), 0);
         $this->pdf->SetFont('Arial', 'B', 10);
         $this->pdf->Cell(60, 5, utf8_decode($Komm->kom_information), 0);
         $this->pdf->Ln();
     }
 }
示例#12
0
 private function importOBJ($data)
 {
     $Organisation = OrganisationRecord::finder()->findByorg_fk_internal(trim($data[6]));
     if (count($Organisation) != 1) {
         $Organisation = new OrganisationRecord();
     }
     $Organisation->org_fk_internal = trim($data["6"]);
     $Organisation->parent_idtm_organisation = OrganisationRecord::finder()->findByorg_fk_internal('Objekt')->idtm_organisation;
     $Organisation->idtm_ressource = 1;
     $Organisation->idta_organisation_type = 7;
     $Organisation->org_name = utf8_encode($data["7"]);
     $Organisation->org_matchkey = $data["4"];
     $Organisation->org_uid = $data["18"];
     $Organisation->org_finanzamt = $data["19"];
     $Organisation->org_referat = $data["20"];
     $Organisation->org_gemeinde = $data["23"];
     $Organisation->org_katastragemeinde = $data["24"];
     $Organisation->org_grundstuecksnummer = $data["25"];
     $Organisation->org_einlagezahl = $data["26"];
     $Organisation->org_baujahr = $data["27"];
     $Organisation->org_wohnungen = $data["28"];
     $Organisation->org_aktiv = 1;
     $Organisation->save();
     $Bankkonto = BankkontoRecord::finder()->findByidtm_organisation($Organisation->idtm_organisation);
     if (count($Bankkonto) != 1) {
         $Bankkonto = new BankkontoRecord();
     }
     $Bankkonto->idtm_organisation = $Organisation->idtm_organisation;
     $Bankkonto->bak_kontowortlaut = $data["10"];
     $Bankkonto->bak_geldinstitut = $data["11"];
     $Bankkonto->bak_blz = $data["12"];
     $Bankkonto->bak_konto = $data["13"];
     $Bankkonto->bak_bic = $data["14"];
     $Bankkonto->bak_iban = $data["15"];
     $Bankkonto->save();
     $sql = "SELECT ta_adresse.* FROM ta_adresse INNER JOIN tm_organisation_has_ta_adresse ON ta_adresse.idta_adresse = tm_organisation_has_ta_adresse.idta_adresse WHERE tm_organisation_has_ta_adresse.idtm_organisation = " . $Organisation->idtm_organisation . " AND ta_adresse.adresse_ismain = 1";
     $Adresse = AdresseRecord::finder()->findBySQL($sql);
     if (count($Adresse) != 1) {
         $Adresse = new AdresseRecord();
     }
     $Adresse->adresse_street = utf8_encode($data["8"]);
     $Adresse->adresse_town = $data["9"];
     $Adresse->adresse_ismain = 1;
     $Adresse->idtm_country = 1;
     $Adresse->save();
     $OrganisationAdresse = OrganisationAdresseRecord::finder()->find('idtm_organisation = ? AND idta_adresse = ?', $Organisation->idtm_organisation, $Adresse->idta_adresse);
     if (count($OrganisationAdresse) != 1) {
         $OrganisationAdresse = new OrganisationAdresseRecord();
     }
     $OrganisationAdresse->idta_adresse = $Adresse->idta_adresse;
     $OrganisationAdresse->idtm_organisation = $Organisation->idtm_organisation;
     $OrganisationAdresse->save();
     unset($Organisation, $Bankkonto, $Adresse, $OrganisationAdresse, $sql);
 }
示例#13
0
 protected function getSelectedAdresse($key)
 {
     $SQL = "SELECT adresse_lat, adresse_long, adresse_zip, adresse_town, adresse_street FROM ta_adresse INNER JOIN ta_waren ON ta_waren.idta_adresse = ta_adresse.idta_adresse WHERE ta_waren.idta_waren = " . $key;
     $item = AdresseRecord::finder()->findBySQL($SQL);
     return $item;
 }