/**
  * 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 $id the ID of the model to be loaded
  * @return AlmabCustomerupdate the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = AlmabCustomerupdate::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #2
0
 function getInstalledVersion($t)
 {
     if (!empty(getExpirationInfo("updateto"))) {
         $username = Yii::app()->user->name;
         $record = AlmabCustomerupdate::model()->find(array('select' => 'customerid', 'condition' => 'customerid=:customerid', 'params' => array(':customerid' => $username)));
         if ($record === null) {
             return;
         } else {
             $InstalledVersion = Yii::app()->db->createCommand()->select($t)->from('almab_customerupdate cup')->join('almab_customers ac', 'ac.id=cup.customerid')->join('almab_updates au', 'au.id=cup.updateid')->where('cup.customerid=:username')->bindValue(':username', $username)->queryRow();
             return $InstalledVersion;
         }
     }
 }