Exemplo n.º 1
0
 public function getItemStatus()
 {
     $status = array();
     $c = new Criteria();
     $c->add(ColItemPeer::CATALOG_ID, $this->getCatalogId(), Criteria::EQUAL);
     $status[0] = ColItemPeer::doCount($c);
     $c->add(ColItemPeer::COL_STATUS_ID, ColStatus::AVAILABLE, Criteria::EQUAL);
     $status[1] = ColItemPeer::doCount($c);
     $c->remove(ColItemPeer::COL_STATUS_ID);
     $c->add(ColItemPeer::COL_STATUS_ID, ColStatus::READ, Criteria::EQUAL);
     $status[2] = ColItemPeer::doCount($c);
     $c->remove(ColItemPeer::COL_STATUS_ID);
     $c->add(ColItemPeer::COL_STATUS_ID, ColStatus::LOAN, Criteria::EQUAL);
     $status[3] = ColItemPeer::doCount($c);
     return $status;
 }
Exemplo n.º 2
0
							</tr>
							<?php 
}
?>

                           <tr class='fo_cat_title_cont'>
								<td style="width: 18%; text-align: left;"><label><?php 
echo __('Copies');
?>
</label></td>
								<td style="width: 2%; text-align:center;">:</td> 
                                <td style="width: 80%; text-align: left;">
                                <?php 
$c = new Criteria();
$c->add(ColItemPeer::CATALOG_ID, $catalog->getId());
$copies = ColItemPeer::doCount($c);
echo $copies . ' &nbsp;eksemplar';
?>
                                </td>
							</tr>
                            <tr class='fo_cat_title_cont_odd'>
								<td style="width: 18%; text-align: left;"><label><?php 
echo __('Available');
?>
</label></td>
								<td style="width: 2%; text-align:center;">:</td> 
                                <td style="width: 80%; text-align: left;">
                                <?php 
$status = $catalog->getItemStatus();
echo $status[1] . ' &nbsp;eksemplar';
?>
Exemplo n.º 3
0
 public function countColItems($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseColItemPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(ColItemPeer::CATALOG_ID, $this->getId());
     return ColItemPeer::doCount($criteria, $distinct, $con);
 }
        echo $cat_category->getName() ? $cat_category->toString() : '-';
        ?>
</td>
			<td align="left">
			<?php 
        $c = new Criteria();
        $c->add(CatalogPeer::CAT_CATEGORY_ID, $cat_category->getId());
        $count_title = CatalogPeer::doCount($c);
        echo $count_title > 0 ? $count_title : '-';
        ?>
			</td>
            		<td align="left">
			<?php 
        $cw = new Criteria();
        $cw->add(CatalogPeer::CAT_CATEGORY_ID, $cat_category->getId());
        $cw->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID);
        $count_copies = ColItemPeer::doCount($cw);
        echo $count_copies > 0 ? $count_copies : '-';
        ?>
			</td>
		</tr>
		<?php 
    }
    ?>
	<?php 
}
?>
	</tbody>
</table>
</center>
Exemplo n.º 5
0
 public function executePrintLabel()
 {
     $c = new Criteria();
     $c->add(TempTablePeer::EMPLOYEE_ID, 1112);
     $c->addJoin(ColItemPeer::ID, TempTablePeer::COUNSELING_ID);
     $c->addDescendingOrderByColumn(ColItemPeer::ID);
     $col_items = ColItemPeer::doSelect($c);
     $total = ColItemPeer::doCount($c);
     $this->forward404Unless($col_items);
     $this->col_items = $col_items;
     $this->total = $total;
     $this->orientation = 'landscape';
     $this->papersize = 'label';
     $this->setViewClass('sfDomPDF');
 }