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

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

<div id="flash" data-flash="<?= $this->session->flashdata('success'); ?>"></div>


<!-- Main content -->
<section class="content">

	<div class="row">

		<?php foreach ($bmproses->result() as $am => $data) : ?>
			<div class="col-12 col-md-6 col-sm-12 mt-1 ">
				<a href="<?= site_url('ssProses/editBM/' . $data->id_sell) ?>" class="btn btn-block btn-lg <?= $data->sell_tgl == date('d / m / Y') ? 'btn-outline-primary' : 'btn-primary' ?> text-uppercase"> <?= $data->car_plat ?> : <?= $data->car_merek ?> <?= $data->car_model ?> <?= $data->car_th ?>
				</a>
			</div>
		<?php endforeach ?>

	</div>

	<div class="row">
		<div class="col-12 mt-2 ">
			<div class="card card-outline card-primary p-2">
				<div class='row'>
					<div class="col-12 col-lg-12 col-sm-12 text-bold fa-2x text-center text-primary ">
						KLINIK MOBIL App V.1.0
					</div>
					<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
						<div class="input-group align-center">
							<div class="input-group-prepend">
								<span class="input-group-text"><i class="fas fa-calendar-alt"></i></span>
							</div>
							<input readonly="on" type="text" class="form-control " value="<?php echo date('d / m / Y') ?>">

						</div>
					</div>
					<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
						<div class="input-group align-center">
							<div class="input-group-prepend">
								<span class="input-group-text"><i class="fas fa-file-invoice"></i></span>
							</div>
							<input readonly="on" type='text' class='form-control' value='<?= $invoice ?>'>
						</div>
					</div>

					<div class="col-12 col-lg-12 col-sm-12 mt-2 ">
						<hr class=" badge-primary mb-1 mt-2">
					</div>

					<div class="col-12 col-lg-12 col-sm-12 mt-2 ">
						<form action="" method="get">

							<div class="input-group align-center">
								<div class="input-group-prepend">
									<span class="input-group-text btn bg-primary" data-toggle="modal" data-target="#newpelangan">&nbsp; &nbsp;<i class="fas fa-plus"></i>&nbsp; &nbsp;</span>
								</div>
								<?php if (isset($_GET['bm'])) {
									$in = $_GET['bm'];
								} else {
									$in = null;
								} ?>
								<input value="<?= $in ?>" autocomplete="off" class="form-control form-control-lg text-uppercase w-100" name="bm" type="text" placeholder="BM 12345 KM ">
								<div style="width: 150px" class="input-group-prepend">
									<button type="submit" class="btn btn-outline-secondary w-100">Cek Kendaraan</button>
								</div>
							</div>
						</form>

					</div>

					<div class="col-12 col-lg-12 col-sm-12 mt-2 ">
						<hr class=" badge-primary mb-1 mt-2">
					</div>

					<form action="ssProses/addsell" method="post">

						<input readonly="on" name="sell_tgl" type="hidden" class="form-control " value="<?php echo date('d / m / Y') ?>">
						<input readonly="on" name="sell_bln" type="hidden" class="form-control " value="<?php echo date('m / Y') ?>">
						<input readonly="on" name="sell_th" type="hidden" class="form-control " value="<?php echo date('Y') ?>">
						<input readonly="on" type='hidden' class='form-control' name="invoice_no" value='<?= $invoice ?>'>

						<?php foreach ($get_pel->result() as $am => $data) : ?>
							<input readonly="on" type='hidden' class='form-control' name="id_pel" value='<?= $data->id_pel ?>'>


							<div class="col-12 col-lg-12 col-sm-12">

								<div class="row">
									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-file-invoice"></i> &nbsp;</span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="pel_nama" value="<?= $this->input->post('pel_nama') ?? $data->pel_nama ?>" type="text">
										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-phone"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="pel_hp" value="<?= $this->input->post('pel_hp') ?? $data->pel_hp ?>" type="text">
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-map-marked-alt"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="pel_alamat" value="<?= $this->input->post('pel_alamat') ?? $data->pel_alamat ?>" type="text" placeholder="Alamat">
										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-tools"></i></i></span>
											</div>
											<input readonly required autocomplete="off" class="form-control text-uppercase" name="kunjung" value="<?= $this->input->post('kunjung') ?? $data->kunjung ?>" type="text">
										</div>
									</div>

								</div>

								<hr class=" badge-primary mb-1 mt-2">


								<div class="row">

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-car"></i> &nbsp;</span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_plat" value="<?= $this->input->post('car_plat') ?? $data->car_plat ?>" type="text" placeholder="BM 1234 SS">

										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-car"></i> </span>
											</div>
											<select required class='form-control' name='car_merek'>
												<?php $merek = $this->input->post('car_merek') ?? $data->car_merek ?>

												<option value=''>- Pilih Merek Mobil -</option>
												<option value='Toyota' <?= $merek == 'Toyota' ? "selected" : null ?>>Toyota</option>
												<option value='Mitsubishi' <?= $merek == 'Mitsubishi' ? "selected" : null ?>>Mitsubishi</option>
												<option value='Daihatsu' <?= $merek == 'Daihatsu' ? "selected" : null ?>>Daihatsu</option>
												<option value='Honda' <?= $merek == 'Honda' ? "selected" : null ?>>Honda</option>
												<option value='Suzuki' <?= $merek == 'Suzuki' ? "selected" : null ?>>Suzuki</option>
												<option value='Nissan' <?= $merek == 'Nissan' ? "selected" : null ?>>Nissan</option>
												<option value='Isuzu' <?= $merek == 'Isuzu' ? "selected" : null ?>> Isuzu</option>
												<option value='Ford' <?= $merek == 'Ford' ? "selected" : null ?>>Ford</option>
												<option value='Opel' <?= $merek == 'Opel' ? "selected" : null ?>>Opel</option>
												<option value='Hyundai' <?= $merek == 'Hyundai' ? "selected" : null ?>>Hyundai</option>
												<option value='Kia' <?= $merek == 'Kia' ? "selected" : null ?>>Kia</option>
												<option value='Timor' <?= $merek == 'Timor' ? "selected" : null ?>>Timor</option>
												<option value='Maszda' <?= $merek == 'Maszda' ? "selected" : null ?>>Maszda</option>
												<option value='mercedes' <?= $merek == 'Datsun' ? "selected" : null ?>>Datsun</option>
												<option value='BMW' <?= $merek == 'Chery' ? "selected" : null ?>>Chery</option>
												<option value='mercedes' <?= $merek == 'mercedes' ? "selected" : null ?>>Mercedes</option>
												<option value='BMW' <?= $merek == 'BMW' ? "selected" : null ?>>BMW</option>
												<option value='Tesla' <?= $merek == 'Tesla' ? "selected" : null ?>>Tesla</option>


											</select>
										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-car"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_model" value="<?= $this->input->post('car_model') ?? $data->car_model ?>" type="text" placeholder="Tipe Mobil">

										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-car-side"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_modelcode" value="<?= $this->input->post('car_modelcode') ?? $data->car_modelcode ?>" type="text" placeholder="Seri Mobil">

										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-calendar-alt"></i> &nbsp;</span>
											</div>
											<select required class='form-control  ' name='car_th'>
												<?php $th = $this->input->post('car_th') ?? $data->car_th ?>
												<?php for ($y = date('Y'); $y >= 1990; $y--) { ?>
													<option value='<?= $y ?>' <?= $th == $y ? "selected" : null ?>> <?= $y  ?></option>
												<?php } ?>
											</select>
										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-tint"></i> &nbsp; </span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_color" value="<?= $this->input->post('car_color') ?? $data->car_color ?>" type="text" placeholder="Colour">

										</div>
									</div>


									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-car-alt"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_volume" value="<?= $this->input->post('car_volume') ?? $data->car_volume ?>" type="text" placeholder="CC Mobil">

										</div>
									</div>

									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-crop-alt"></i> &nbsp;</span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_frameno" value="<?= $this->input->post('car_frameno') ?? $data->car_frameno ?>" type="text" placeholder="No Rangka">

										</div>
									</div>



									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-vote-yea"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_engine" value="<?= $this->input->post('car_engine') ?? $data->car_engine ?>" type="text" placeholder="Engine Number">

										</div>
									</div>
									<!-- 
								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-cog"></i> &nbsp; </span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_axle" type="text" placeholder="Trans / Axle">

									</div>
								</div>-->
									<input required autocomplete="off" class="form-control text-uppercase" name="car_axle" type="hidden" placeholder="Trans / Axle">


									<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
										<div class="input-group align-center">
											<div class="input-group-prepend">
												<span class="input-group-text"><i class="fas fa-tachometer-alt"></i></span>
											</div>
											<input required autocomplete="off" class="form-control text-uppercase" name="car_odometer" value="<?= $this->input->post('car_odometer') ?? $data->car_odometer ?>" type="text">

										</div>
									</div>

								</div>
							</div>

				</div>
				<button type="submit" class="btn btn-primary btn-lg w-100 mt-2">Proses Perbaikan</button>
			<?php endforeach ?>

			</form>
			</div>
		</div>
	</div>

	<!-- start add pelanggan Baru -->
	<form action="ssProses/addpelangan" method="post">

		<div class="modal fade" id="newpelangan" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
			<div class="modal-dialog modal-dialog-centered modal-xl " role="document">
				<div class="modal-content">
					<div class="modal-body">

						<input readonly="on" name="sell_tgl" type="hidden" class="form-control " value="<?php echo date('d / m / Y') ?>">
						<input readonly="on" name="sell_bln" type="hidden" class="form-control " value="<?php echo date('m / Y') ?>">
						<input readonly="on" name="sell_th" type="hidden" class="form-control " value="<?php echo date('Y') ?>">
						<input readonly="on" type='hidden' class='form-control' name="invoice_no" value='<?= $invoice ?>'>

						<div class="col-12 col-lg-12 col-sm-12">

							<div class="row">
								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-file-invoice"></i> &nbsp;</span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="pel_nama" type="text" placeholder="Nama Pelangan">
									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-phone"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="pel_hp" type="text" placeholder="No. handpone">
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-12 col-lg-12 col-sm-12 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-map-marked-alt"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="pel_alamat" type="text" placeholder="Alamat">
									</div>
								</div>
							</div>

							<hr class=" badge-primary mb-1 mt-2">


							<div class="row">

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-car"></i> &nbsp;</span>
										</div>
										<input required value="" autocomplete="off" class="form-control text-uppercase" name="car_plat" type="text" placeholder="BM 1234 SS">

									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-car"></i> </span>
										</div>
										<select required class='form-control  ' name='car_merek'>
											<option value=''>- Pilih Merek Mobil -</option>
											<option value='Toyota'>Toyota</option>
											<option value='Mitsubishi'>Mitsubishi</option>
											<option value='Daihatsu'>Daihatsu</option>
											<option value='Honda'>Honda</option>
											<option value='Nissan'>Nissan</option>
											<option value='Suzuki'>Suzuki</option>
											<option value='Isuzu'> Isuzu</option>
											<option value='Ford'>Ford</option>
											<option value='Opel'>Opel</option>
											<option value='Hyundai'>Hyundai</option>
											<option value='Kia'>Kia</option>
											<option value='Timor'>Timor</option>
											<option value='Maszda'>Maszda</option>
											<option value='mercedes'>Mercedes</option>
											<option value='BMW'>BMW</option>
											<option value='Datsun'>Datsun</option>
											<option value='Chery'>Chery</option>
											<option value='Tesla'>Tesla</option>


										</select>
									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-car"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_model" type="text" placeholder="Tipe Mobil">

									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-car-side"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_modelcode" type="text" placeholder="Seri Mobil">

									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-calendar-alt"></i> &nbsp;</span>
										</div>
										<select required class='form-control  ' name='car_th'>
											<option value=''>- Pilih Tahun Mobil -</option>
											<?php for ($y = date('Y'); $y >= 1990; $y--) { ?>
												<option value='<?= $y ?>'> <?= $y  ?></option>
											<?php } ?>
										</select>
									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-tint"></i> &nbsp; </span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_color" type="text" placeholder="Colour">

									</div>
								</div>


								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-car-alt"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_volume" type="text" placeholder="CC Mobil">

									</div>
								</div>

								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-crop-alt"></i> &nbsp;</span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_frameno" type="text" placeholder="No Rangka">

									</div>
								</div>



								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-vote-yea"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_engine" type="text" placeholder="Engine Number">

									</div>
								</div>

								<input required autocomplete="off" class="form-control text-uppercase" name="car_axle" type="hidden" placeholder="Trans / Axle">


								<div class="col-12 col-lg-6 col-sm-6 mt-2 ">
									<div class="input-group align-center">
										<div class="input-group-prepend">
											<span class="input-group-text"><i class="fas fa-tachometer-alt"></i></span>
										</div>
										<input required autocomplete="off" class="form-control text-uppercase" name="car_odometer" type="text" placeholder="Odometer">

									</div>
								</div>

							</div>
						</div>
					</div>
					<button type="submit" class="btn btn-primary btn-lg w-100 mt-2">Proses Perbaikan</button>

				</div>
			</div>
		</div>
		</div>
	</form>
	<!-- ending add pelanggan perbaikan motor -->

</section>