Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Donthuocnt::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'maNT' => $this->maNT, 'ngayKeDon' => $this->ngayKeDon]);
     $query->andFilterWhere(['like', 'donthuoc', $this->donthuoc])->andFilterWhere(['like', 'cachSD', $this->cachSD]);
     return $dataProvider;
 }
Exemplo n.º 2
0
        var printcontent = document.getElementById(el).innerHTML;
        document.body.innerHTML = printcontent;
        window.print();
        document.body.innerHTML = restorepage;
    }
</script>
<a href='javascript:history.go(-1)' class="btn btn-warning">Quay lại trang trước</a>
<!--this.style.display ='none'; window.print()-->
<input type="button" class="btn btn-default" id="print_button"  value="In hóa đơn" onclick="printContent('donthuoc')" />
<div class="col-md-10 col-md-offset-1" id="donthuoc">
    <center><h3>ĐƠN THUỐC</h3></center>
    <br /><br />
    <?php 
$maNT = \app\models\Noitru::findOne(['id' => $_GET['noitru']]);
$benhnhan = \app\models\Benhnhan::findOne(['id' => $maNT->maBN]);
$donthuoc = \app\models\Donthuocnt::findOne(['maNT' => $maNT->id]);
?>
    <h4>
        <table>
            <tr>
                <td>Bệnh nhân :</td>
                <td><?php 
echo $benhnhan->tenBN;
?>
</td>
            </tr>
            <tr></tr>
            <tr>
                <td>Đơn thuốc :</td>
                <td><?php 
echo $donthuoc->donthuoc;
Exemplo n.º 3
0
 /**
  * Finds the Donthuocnt model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Donthuocnt the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Donthuocnt::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 4
0
<div class="noitru-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>


    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'maBN', ['label' => 'Tên bệnh nhân', 'format' => 'raw', 'value' => function ($data) {
    $url = \app\models\Benhnhan::findOne(['id' => $data->maBN]);
    return $url->tenBN;
}], 'soPhong', 'soGiuong', ['label' => 'Kê đơn thuốc', 'format' => 'raw', 'value' => function ($data) {
    $url = Yii::$app->request->baseUrl . "/donthuocnt/create?noitru={$data->id}";
    return Html::a('Kê đơn thuốc', $url, ['title' => 'Go']);
}], ['label' => 'In đơn thuốc', 'format' => 'raw', 'value' => function ($data) {
    $model1 = \app\models\Donthuocnt::findOne(['maNT' => $data->id]);
    if (!empty($model1)) {
        $url = Yii::$app->request->baseUrl . "/donthuocnt/indonthuoc?noitru={$data->id}";
        return Html::a('In đơn thuốc', $url, ['title' => 'Go']);
    } else {
        return '';
    }
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>