Пример #1
0
 public function printData($id)
 {
     $transaksi = Transaksi::where('kode', $id)->firstOrFail();
     $angsuran = Angsuran::where('kode', $id)->orderBy('created_at', 'desc')->firstOrFail();
     $pdf = PDF::loadView('laporan.index', compact('angsuran', 'transaksi'));
     return $pdf->stream();
 }
Пример #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Transaksi::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, 'tanggal' => $this->tanggal, 'id_pelanggan' => $this->id_pelanggan, 'id_teknisi' => $this->id_teknisi]);
     return $dataProvider;
 }
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransaksis()
 {
     return $this->hasMany(Transaksi::className(), ['id_pelanggan' => 'id_pelanggan']);
 }
Пример #4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id, $idtransaksi)
 {
     Transaksi::findOrFail($idtransaksi)->delete();
     return redirect('admin/debitur/' . $id);
 }
Пример #5
0
 protected function findModel($id)
 {
     if (($model = Transaksi::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransaksis()
 {
     return $this->hasMany(Transaksi::className(), ['id_teknisi' => 'id']);
 }
Пример #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransaksi()
 {
     return $this->hasOne(Transaksi::className(), ['id' => 'transaksi_id']);
 }