<html>

<head>
	<title>Danil Jaya Auto Service</title>
	<style type="text/css">
		html {
			font-family: "Arial, Helvetica, sans-serif";
		}

		.content {
			width: 210mm;
			font-size: 14px;
			padding: 10px;
			text-align: center;
		}

		.title {
			text-align: center;
			font-size: 16px;
			padding-bottom: 5px;
			border-bottom: 1px dashed;
		}

		.klinik {
			text-align: center;
			font-size: 35px;

		}

		.head {
			margin-top: 10px;
			margin-left: 10px;
			margin-bottom: 5px;
			padding-bottom: 5px;
			border-bottom: 1px solid;
			font-size: 12px;
			text-align: left;
			text-transform: uppercase;
		}

		.head1 {
			border-bottom: 1px solid;
		}

		.table {
			width: 100%;

		}

		.thanks {
			margin-top: 3px;
			padding-top: 3px;
			text-align: center;
			border-top: 1px dashed;
		}

		.thankshead {
			margin-top: 3px;
			font-size: 14px;

			padding-top: 3px;
			text-align: center;
			text-decoration: bold;
			border-top: 1px dashed;

		}

		@media print {
			@page {
				width: 210mm;
				margin: 0mm;
			}
		}
	</style>
</head>

<body onload=" window.print();setTimeout(window.close, 0);">
	<div class="content">
		<div class="tittle">
			<div class="klinik text-danger fa-4x"><b> Danil Jaya Auto Service
				</b></div>
			Jl. KH. Nasution / jl. penerbangan<br>
			Support by Klinik Mobil App <br>
		</div>
		<div class="head">
			<?php foreach ($get_id->result() as $am => $data) : ?>
				<table style="width: 100%">
					<tr>
						<td style="width: 50%"> Tanggal Perbaikan &nbsp;: &nbsp;<b><?= $data->sell_tgl ?></b></td>
						<td style="width: 50%"> Custumer &nbsp; &nbsp; &nbsp; : &nbsp; <b><?= $data->pel_nama ?></b> </td>
					</tr>
					<tr>
						<td> Tanggal Selesai &nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;<b><?= $data->sell_tgl_byr ?></b> </td>
						<td> Plat No &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : &nbsp; <b><?= $data->car_plat ?></b></td>
					</tr>
					<tr>
						<td> Tanggal Cetak &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;<b><?php echo Date("d / m / Y") ?> - <?php echo date("h : i") ?> Wib</b></td>
						<td> Mobil &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : &nbsp;<b><?= $data->car_merek ?> <?= $data->car_model ?> <?= $data->car_th ?> - <?= $data->car_color ?></b></td>
					</tr>
					<tr>
						<td>Invoice No &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; : &nbsp; <b><?= $data->invoice_no ?></b></td>
						<td>Volume &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : &nbsp; <b><?= $data->car_volume ?></b> </td>
					</tr>
				</table>
			<?php endforeach ?>
		</div>

		<div class="thankshead"></div>

		Engine No : <b><?= $data->car_engine ?></b> | Frame No : <b><?= $data->car_frameno ?></b> | Tranc / Alxe : <b><?= $data->car_axle ?></b>

		<div class="thankshead"></div>


		<div class="transaction">

			<div class="card-body table-responsive p-0 mb-4">
				<table class=" table table-sm table-head-fixed text-nowrap">
					<tr>
						<th scope=" col ">No</th>
						<th class=" text-left" style="width: 60%" scope="col">Job Description / Keluhan Pelangan</th>
						<th scope="col">Flate Rate</th>
						<th scope="col">Total</th>

					</tr>
					<tbody class=" table-sm" id="cart_tabel">
						<?php $no = 1;
						if ($getrusak->num_rows() > 0) {
							foreach ($getrusak->result() as $c => $data) { ?>
								<tr style="font-size: 15px">
									<td style="width: 50px" scope="row"><?= $no++ ?>.</td>
									<td class=" text-left " scope="col"> <?= $data->nama_rusak ?></td>
									<td scope="col"><?= indo_currency($data->harga_rusak) ?></td>
									<td scope="col" id="totala"><?= indo_currency($data->total_rusak) ?></td>

								</tr>
						<?php
							}
						} else {
							echo '<tr>
										<td colspan="8" class="text-center"> Tidak Data Kerusakan yang di catat </td>
									</tr>';
						} ?>
					</tbody>
				</table>

			</div>

			<div class="card-body table-responsive p-0">
				<table class="table table-sm table-head-fixed text-nowrap">
					<tr>
						<th scope=" col ">No</th>
						<th class=" text-left" style="width: 15%" scope="col">Part number</th>
						<th class=" text-left" style="width: 50%" scope="col">Part Name</th>
						<th style="width: 40px  text-right" scope="col">Qty</th>
						<th scope="col">total</th>
					</tr>
					<tbody class=" table-sm">
						<?php $no = 1;
						if ($getsparepart->num_rows() > 0) {
							foreach ($getsparepart->result() as $c => $data) { ?>
								<tr>
									<td style="width: 50px" scope="row"><?= $no++ ?>.</td>
									<td class=" text-left " scope="col"> <?= $data->barcode_brg ?></td>
									<td class=" text-left " style="width: 50px;" scope="col"><?= $data->name_brg ?></td>
									<td style="width: 50px;" scope="col"><?= $data->stok_brg ?></td>
									<td scope="col"><?= indo_currency($data->stok_brg  *  $data->hargau_brg) ?></td>
								</tr>
						<?php
							}
						} else {
							echo '<tr>
										<td colspan="8" class="text-center"> Tidak Data Sparepart yang di catat </td>
									</tr>';
						} ?>
					</tbody>
				</table>
			</div>
			<div class="thankshead"></div>


			<div class="head">
				<?php foreach ($get_id->result() as $am => $data) : ?>
					<table style="width: 100%">
						<tr>
							<td style="width: 50%"> Total Jasa &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Rp. &nbsp;<b><?= indo_currency($data->totjasa) ?> ,-</b></td>
							<td style="width: 50%"> Down Payment &nbsp; &nbsp;&nbsp; : Rp. &nbsp;<b><?= indo_currency($data->dpbyr) ?> ,-</b> </td>
						</tr>
						<tr>
							<td> Total Sparepart &nbsp; &nbsp; &nbsp; : Rp. &nbsp;<b><?= indo_currency($data->totpart) ?> ,-</b> </td>
							<td> Total Bayar &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; : Rp. &nbsp;<b><?= indo_currency($data->totbyr) ?> ,-</b></td>
						</tr>
						<tr>
							<td> Grand Total &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; : Rp. &nbsp;<b><?= indo_currency($data->grandtotal) ?> ,-</b></td>
							<td> Pembayaran &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;: Rp. &nbsp;<b><?= indo_currency($data->cash) ?> ,- </b></td>
						</tr>
						<tr>
							<td></td>
							<td> Cash &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : Rp. &nbsp;<b><?= indo_currency($data->kembalian) ?> ,-</b></td>
						</tr>
					</table>
				<?php endforeach ?>
			</div>

			<div class="thanks">
				Info Pelanggan on Call 0813 6551 8709<br />
				*** Terima Kasih ***
			</div>
		</div>


</body>

</html>
<!--

<section class="content-header">
	<div class="container-fluid">
		<div class="row mb-2">
			<div class="col-sm-12">
				<h1>CETAK STRUK</h1>
			</div>

		</div>
	</div>
</section>