/**
 * Liefert das Userprofil zur klein-Anzeige (neben Posts)
 * 
 * @param $id           ID des Users
 */
function getUserprofileForUserId($id)
{
    $sql = "SELECT * FROM user where id = '" . $id . "' ";
    $res = $_SESSION['config']->DBCONNECT->executeQuery($sql);
    $retRow = mysql_fetch_array($res);
    $ft = new FontType();
    $ft->setBold(true);
    $ft->setFontsize(3);
    $picLnk = new Link("includes/user/show_userprofil.php?showUserId=" . $id, getUserImageSourceByPicname($retRow['pic'], 80));
    $picLnk->setPopup(true);
    $status = new Text("<b>Status:</b> " . $retRow['Status']);
    $status->setFilter(false);
    $posts = new Text("<b>Posts:</b> " . $retRow['Posts']);
    $posts->setFilter(false);
    $tbl = new Table(array(""));
    $r1 = $tbl->createRow();
    $r1->setFonttype($ft);
    $r1->setAttribute(0, $retRow['Vorname'] . " " . $retRow['Nachname']);
    $tbl->addRow($r1);
    $r2 = $tbl->createRow();
    $r2->setAttribute(0, $picLnk);
    $tbl->addRow($r2);
    $r3 = $tbl->createRow();
    $r3->setAttribute(0, $status);
    $tbl->addRow($r3);
    $r4 = $tbl->createRow();
    $r4->setAttribute(0, $posts);
    $tbl->addRow($r4);
    return $tbl;
}
Esempio n. 2
0
 function Text($t, $s = 2, $b = false, $i = false, $u = false, $f = true)
 {
     $this->NAME = "Text";
     $this->border = 0;
     $this->TEXT = $t;
     $this->setFILTER($f);
     $ftX = new FontType();
     $ftX->setBold($b);
     $ftX->setItalic($i);
     $ftX->setUnderline($u);
     $ftX->setFontsize($s);
     $this->setFonttype($ftX);
 }
Esempio n. 3
0
 function getSingleUpdateMask($rowId)
 {
     $tblAll = new Table(array(""));
     if ($rowId == null || $rowId == "") {
         return $tblAll;
     }
     $f1 = new FontType();
     $f1->setFontSize(2);
     $f1->setBold(true);
     $f2 = new FontType();
     $fts = array($f1, $f2);
     $table = new Table(array("", ""));
     $table->setHeadEnabled(false);
     $table->setBorder(0);
     $table->setFontTypes($fts);
     $table->setAlign($this->getAlign());
     $table->setVAlign($this->getVAlign());
     $table->setAlignments($this->getAlignments());
     if ($this->WIDTH > 0) {
         $table->setWidth($this->WIDTH);
     }
     if ($this->HEIGHT > 0) {
         $table->setHeight($this->HEIGHT);
     }
     if ($this->BORDER != null && strlen($this->BORDER) > 0) {
         $table->setBorder($this->BORDER);
     }
     if ($this->PADDING >= 0) {
         $table->setPadding($this->PADDING);
     }
     if ($this->HEAD_ENABLED) {
         $table->setHeadEnabled($this->HEAD_ENABLED);
     }
     if ($this->SPACING >= 0) {
         $table->setSpacing($this->SPACING);
     }
     if ($this->XPOS > 0 && $this->YPOS > 0) {
         $table->setXPos($this->XPOS);
         $table->setYPos($this->YPOS);
     }
     $chk = 0;
     $stmnt = "SELECT ";
     foreach ($this->COLNAMES as $cn) {
         if ($stmnt != "SELECT ") {
             $stmnt .= ", ";
         }
         $stmnt .= $cn;
         $chk++;
     }
     $stmnt .= ", id as rowid ";
     $stmnt .= " FROM " . $this->TABLENAME . "  where id = " . $rowId . " " . $this->ORDERBY . " LIMIT 1 ";
     $result = $this->DBCONNECT->executeQuery($stmnt);
     $rowEdit = mysql_fetch_array($result);
     for ($i = 0; $i < mysql_num_fields($result) - 1; $i++) {
         $fieldName = mysql_field_name($result, $i);
         $arrChk = array_search($fieldName, $this->NOUPDATECOLS);
         if (strlen($arrChk) == 0) {
             $r = $table->createRow();
             $o = "";
             $lookups = getLookupWerte($_SESSION['config']->DBCONNECT, $this->TABLENAME, $fieldName);
             // in der Datenbank für dieses Datenbankfeld
             // definierte Combobox laden (wenn vorhanden)
             $dbCombo = getDbComboArray($this->TABLENAME, $fieldName, $rowEdit);
             $val = "";
             if (isset($rowEdit[$fieldName]) && strlen($rowEdit[$fieldName]) > 0) {
                 $val = $rowEdit[$fieldName];
             }
             if (mysql_num_rows($lookups) == 0 && !$this->isDbComboSet($this->TABLENAME, $fieldName)) {
                 /*if (strpos(" " . $this->DEFAULTS, $fieldName) > 0) {
                                     $tmpval = substr($this->DEFAULTS, strpos($this->DEFAULTS, "=") + 1);
                                     $o = new HiddenField($fieldName, $tmpval);
                 
                                     } else*/
                 if (strpos(mysql_field_flags($result, $i), "enum") > 0) {
                     $ev = $this->getEnumValues($fieldName);
                     if (count($ev) == 2 && (in_array('J', $ev) && in_array('N', $ev))) {
                         $o = new Checkbox($fieldName . $rowId, "", "J");
                         if ($rowEdit[$fieldName] == "J") {
                             $o->setSelected(true);
                         }
                     } else {
                         $o = new ComboBox($fieldName . $rowId, $this->getComboboxEnumArray($fieldName));
                     }
                 } else {
                     if (mysql_field_type($result, $i) == "blob") {
                         $o = new TextArea($fieldName . $rowId, $val, 80, 10);
                         $o->setTextEditor($this->TEXTEDITOR_ENABLED);
                     } else {
                         if (mysql_field_type($result, $i) == "date") {
                             $o = new DateTextfield($fieldName . $rowId, $val);
                             $o->setToolTip("Bitte im Format:  <b>YYYY-MM-TT</b>  angeben");
                         } else {
                             if (mysql_field_type($result, $i) == "int") {
                                 $o = new TextField($fieldName . $rowId, $val);
                             } else {
                                 if (mysql_field_type($result, $i) == "timestamp") {
                                     $o = new TextField($fieldName . $rowId, $val);
                                 } else {
                                     $o = new TextField($fieldName . $rowId, $val);
                                 }
                             }
                         }
                     }
                 }
             } else {
                 if (mysql_num_rows($lookups) > 0) {
                     $o = new LookupCombo($_SESSION['config']->DBCONNECT, $fieldName . $rowId, $this->TABLENAME, $fieldName, $rowEdit[$fieldName]);
                 } else {
                     if (count($dbCombo) > 0) {
                         if (!strpos(" " . $this->DEFAULTS, $fieldName) > 0) {
                             $o = new ComboBox($fieldName . $rowId, $dbCombo, $val);
                         } else {
                             $o = new HiddenField($fieldName . $rowId, $val);
                         }
                     }
                 }
             }
             if ($i < count($this->LABELS)) {
                 $r->setAttribute(0, $this->LABELS[$i]);
             } else {
                 $r->setAttribute(0, "");
             }
             $arrChk = array_search($fieldName, $this->READONLYCOLS);
             if (strlen($arrChk) != 0) {
                 $o->setReadOnly(true);
             }
             $r->setAttribute(1, $o);
             $table->addRow($r);
         }
     }
     foreach ($this->ADDITIONAL_UPDATE_FIELDS as $label => $field) {
         $r = $table->createRow();
         $r->setAttribute(0, $label);
         $r->setAttribute(1, $field);
         $table->addRow($r);
     }
     $okButton = new Button("DbTableUpdate" . $this->TABLENAME, "Speichern");
     $r = $table->createRow();
     $r->setSpawnAll(true);
     $r->setAttribute(0, $okButton);
     $table->addRow($r);
     $rowAll1 = $tblAll->createRow();
     $rowAll2 = $tblAll->createRow();
     $rowAll1->setAttribute(0, $table);
     $tblAll->addRow($rowAll1);
     $tblAll->addRow($rowAll2);
     $f = new Form($_SERVER['SCRIPT_NAME']);
     $f->add($tblAll);
     $f->add(new Hiddenfield("SingleUpdateRowId", $rowId));
     $f->add($this->DEFAULT_HIDDEN_FIELDS);
     return $f;
 }
 function getPageNavigation()
 {
     if ($this->getPageCount() <= 1) {
         return;
     }
     $maxPage = $this->getPageCount();
     $label = new Text("Seite: ");
     $label->setFontsize(2);
     $label->show();
     for ($i = 1; $i <= $maxPage; $i++) {
         $txt = new Text($i);
         //$txt = "<font color='" .$_SESSION['config']->COLORS['hover'] ."' >" .$txt ."</font>";
         if ($this->CURRENT_PAGE == $i) {
             $ft = new FontType();
             $ft->setBold(true);
             $ft->setColor($_SESSION['config']->COLORS['hover']);
             $txt->setFonttype($ft);
         }
         if ($this->LINKPREFIX != "" && substr($this->LINKPREFIX, strlen($this->LINKPREFIX) - 1, 1) != "&") {
             $this->LINKPREFIX = $this->LINKPREFIX . "&";
         }
         $link = new Link($this->PARENT_PAGE . "?" . $this->LINKPREFIX . "changeBbPage=" . $i . "&Current_BB_Path=" . substr($this->PATH, strlen($_SERVER['DOCUMENT_ROOT'])), $txt, false);
         $link->show();
         if ($i < $maxPage) {
             $label = new Text(", ");
             $label->setFontsize(2);
             $label->show();
         }
     }
 }