Esempio n. 1
0
 /**
  * get the static database access object
  * somewhat like singleton design.
  * 
  * @return database_whatever_class dao
  */
 private static function _getDAO()
 {
     if (!isset(self::$_dao)) {
         $db = PVars::getObj('config_rdbms');
         if (!$db) {
             throw new PException('DB config error!');
         }
         self::$_dao = PDB::get($db->dsn, $db->user, $db->password);
     }
     return self::$_dao;
 }
Esempio n. 2
0
 /**
  * returns the notification's text
  *
  * @access public
  * @return string
  */
 public function getText()
 {
     $words = new MOD_words();
     if (!$this->isLoaded() || !$this->WordCode) {
         return '';
     } elseif ($this->WordCode == '' && ($text_params = unserialize($this->TranslateParams)) !== false) {
         return call_user_func_array(array($words, 'get'), $text_params);
     } else {
         $member = MOD_member::getMember_userId($item->IdRelMember);
         return $words->get($this->WordCode, $member->getUsername());
     }
 }
Esempio n. 3
0
    protected function tableCell_idrelmember($note)
    {
        ?>
        <?php 
        echo $note->IdRelMember;
        ?>
 (<a href="members/<?php 
        echo MOD_member::getUsername($note->IdRelMember);
        ?>
"><?php 
        echo MOD_member::getUsername($note->IdRelMember);
        ?>
</a>)
        <?php 
    }
<?php

$words = new MOD_words();
$request = PRequest::get()->request;
$gallery_ctrl = new GalleryController();
$image = $this->image;
if ($member = $this->model->getLoggedInMember()) {
    $callbackId = $gallery_ctrl->editProcess($image);
    $vars =& PPostHandler::getVars($callbackId);
}
$GalleryRight = MOD_right::get()->hasRight('Gallery');
$d = $image;
$d->user_handle = MOD_member::getUserHandle($d->user_id_foreign);
$canEdit = $member && $member->Username == $d->user_handle ? true : false;
if (!isset($vars['errors'])) {
    $vars['errors'] = array();
}
Esempio n. 5
0
echo "<tr><th>", $words->get("DateDonation"), "</th><th>", $words->get("AmountDonation"), "</th><th>", $words->get("CommentDonation"), "</th><th>", $words->get("PlaceDonation"), "</th>";
if ($hasRight) {
    echo "<th>For treasurer eyes only</th>";
}
echo "</tr>\n";
$max = count($TDonationArray);
for ($ii = 0; $ii < $max; $ii++) {
    $info_styles = array(0 => "class=\"blank\"", 1 => "class=\"highlight\"");
    static $iii = 0;
    $T = $TDonationArray[$ii];
    $string = $info_styles[$iii++ % 2];
    // this displays the <tr>
    if (isset($_SESSION["IdMember"]) and $T->IdMember == $_SESSION["IdMember"]) {
        $string .= "bgcolor=\"yellow\"";
    }
    echo "<tr ", $string, " align=left><td>", date("y/m/d", strtotime($T->created)), "</td>";
    echo "<td>";
    printf("%s %3.2f", $T->Money, $T->Amount);
    echo "</td>";
    echo "<td>", $T->SystemComment, "</td>";
    echo "<td>", $T->CountryName, "</td>";
    echo "</td>";
    if ($hasRight) {
        $m = MOD_member::getMember_userId($T->IdMember);
        if ($m) {
            echo "<td>", $m->getUsername(), " ", $T->referencepaypal, "</td>";
        }
    }
    echo "</tr>\n";
}
echo "</table>";
    ?>
<td><?php 
    echo date("Y-m-d", strtotime($donation->created));
    ?>
</td>
<td>€ <?php 
    printf("%3.2f", $donation->Amount);
    ?>
</td>
<td><?php 
    echo $donation->SystemComment;
    ?>
</td>
<td><?php 
    echo $donation->CountryName;
    ?>
</td>
<td><?php 
    echo MOD_member::getUsername($donation->IdMember) . " " . $donation->referencepaypal;
    ?>
</td>
<td><?php 
    echo '<a href="admin/treasurer/edit/' . $donation->id . '">' . $words->get('AdminTreasurerOverviewEdit') . '</a>';
    ?>
</td>
</tr>
<?php 
    $ii++;
}
?>
</table>
Esempio n. 7
0
        $page = $matches[1];
        $requestStr = preg_replace('%/=page(\\d+)%', '', $requestStr);
    } else {
        $page = 1;
    }
    if (!isset($itemsPerPage)) {
        $itemsPerPage = 6;
    }
    $p = PFunctions::paginate($galleries, $page, $itemsPerPage);
    $galleriesonpage = $p[0];
    echo '<div class="floatbox">';
    foreach ($galleriesonpage as $g) {
        static $ii = 0;
        $d = $Gallery->getLatestGalleryItem($g->id);
        $s = $Gallery->getGalleryItems($g->id, 1);
        $username = MOD_member::getUserHandle($g->user_id_foreign);
        $this->myself = $this->loggedInMember && $username == $this->loggedInMember->Username;
        $num_rows = $s ? $s : 0;
        // Only show the galleries with pictures. The belonging user might see them anyway.
        if ($d || $this->myself) {
            ?>
        <div class="gallery_container float_left">
            <a href="gallery/show/sets/<?php 
            echo $g->id;
            ?>
">
                <img class="framed" src="<?php 
            echo $d ? 'gallery/thumbimg?id=' . $d : 'images/lightview/blank.gif';
            ?>
" alt="image"/>
            </a>
Esempio n. 8
0
 /**
  * handles showing a page for a single gallery
  *
  * @param Gallery $gallery - gallery to work on
  *
  * @access public
  * @return object $page
  */
 public function gallery(Gallery $gallery, $upload = false)
 {
     $page = new GallerySetPage();
     // TODO: Deal with the PageNames. We could easily name this GalleryPage but this reminds of the name of the app itself. How to proceed with this?
     $page->loggedInMember = $this->loggedInMember;
     $page->myself = $this->loggedInMember && $this->loggedInMember->get_userId() == $gallery->user_id_foreign ? $this->loggedInMember->Username : false;
     $page->username = MOD_member::getUserHandle($gallery->user_id_foreign);
     $page->gallery = $gallery;
     $page->statement = $this->_model->getLatestItems('', $gallery->id);
     $page->cnt_pictures = $page->statement ? $page->statement->numRows() : 0;
     $page->upload = ($upload or !$page->cnt_pictures) ? true : false;
     $page->member = $this->_model->getMemberWithUserId($gallery->user_id_foreign);
     $page->d = $this->_model->getLatestGalleryItem($gallery->id);
     $page->num_rows = $this->_model->getGalleryItems($gallery->id, 1);
     return $page;
 }