/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = ReturnBook::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Ejemplo n.º 2
0
$this->renderPartial('/settings/library_left');
?>
    
    </td>
    <td valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top" width="75%">
        <div class="cont_right">
<h1><?php 
echo Yii::t('library', 'Library Dashboard');
?>
</h1>
<?php 
$due = BorrowBook::model()->findAll('due_date=:x', array(':x' => date('Y-m-d')));
$return = ReturnBook::model()->findAll('return_date=:x', array(':x' => date('Y-m-d')));
$borrow = BorrowBook::model()->findAll('issue_date=:x', array(':x' => date('Y-m-d')));
?>
<div class="overview">
	<div class="overviewbox ovbox1">
    	<h1><strong><?php 
echo Yii::t('library', 'Due Today');
?>
</strong></h1>
        <div class="ovrBtm"><?php 
echo count($due);
?>
</div>
    </div>
    <div class="overviewbox ovbox2">
    	<h1><strong><?php