Untitled
unknown
plain_text
a year ago
8.1 kB
2
Indexable
Never
<div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">Tambah Purchase Requisition (PR)</h3> </div><!-- /.box-header --> <div class="box-body"> <?php $attributes = array('class'=>'form-horizontal','role'=>'form'); echo form_open_multipart('administrator/pr_user',$attributes); $latest_ticket = $this->model_app->get_latest_ticket_pr(); //PRINT($latest_ticket); $cekskrng = date('Ymd'); $cekdata_akhir = substr($latest_ticket,3,-3); // Jika tidak ada nomor tiket sebelumnya, mulai dari 1 if (empty($latest_ticket) OR $cekskrng != $cekdata_akhir) { $new_number = 1; } else { // Mengambil nomor urutan dari nomor tiket terbaru 001 $last_number = number_format(substr($latest_ticket,-3)); //$last_number = intval(substr($latest_ticket, 3)); // Menambahkan 1 ke nomor urutan $new_number = $last_number + 1; } // Mengonversi nomor urutan ke format 3 digit dengan nol di depan $new_number_str = str_pad($new_number, 3, '0', STR_PAD_LEFT); // Membuat nomor tiket baru dengan nomor urutan yang diperbarui $kd_pr = "PR-" . date('Ymd') . $new_number_str; // if ($rows['kd_pr']==''){ // $kd_pr = "PR-".date('Ymd'); // }else{ // $kd_pr = $rows['kd_pr']; // } ?> <table class='table table-condensed table-bordered'> <tbody> <tr><th width='140px' scope='row'>Kode PR</th> <td><input type='text' class='form-control' value='<?php echo "$kd_pr"; ?>' name='a'> </td></tr> <tr><th width='140px' scope='row'>Username</th> <td><input type='text' class='form-control' value='<?php echo "$nik"; ?>' name='user_create'> </td></tr> <tr> <th scope='row'>Kategori</th> <td> <select class='form-control' name='kategori_pr' placeholder="Cari Kategori"> <option selected disabled value="">Cari Kategori</option> <option value='Projek'>Projek</option> <option value='Non Projek'>Non Projek</option> </select> </td> </tr> <tr> <th scope='row'>Tipe Purchase</th> <td> <select class='form-control' name='type_pr' placeholder="Cari Tipe"> <option selected disabled value="">Cari Tipe</option> <option value='Boms'>Boms</option> <option value='Non Boms'>Non Boms</option> </select> </td> </tr> <tr> <tr><th width='140px' scope='row'>No Vip</th> <td><input type='text' class='form-control' value='<?php echo "$no_projek"; ?>' name='no_projek'> </td></tr> <tr> <th scope='row'>Lokasi</th> <td> <select class='form-control' name='lokasi_projek' placeholder="Cari Lokasi"> <option selected disabled value="">Cari Lokasi</option> <option value='Office'>Office</option> <option value='Workshop'>Workshop</option> <option value='Insitu'>Insitu</option> <option value='Workshop'>Workshop</option> </select> </td> </tr> <tr> <th scope='row'>Status</th> <td> <select class='form-control' name='status_pr' placeholder="Pilih Status"> <option selected disabled value="">Pilih Status</option> <option value='Boms'>Boms</option> <option value='Non Boms'>Non Boms</option> </select> </td> </tr> <tr> <tr><th width='140px' scope='row'>Tanggal Dibutuhkan</th> <td><input type='date' class='form-control' value='<?php echo "$tgl_kebutuhan"; ?>' name='tgl_kebutuhan'> </td></tr> </tbody> </table> <input class='btn btn-primary btn-sm' type="submit" name='submit1' value='Simpan Data'> <?php if ($this->session->idp !=''){ ?> <a class='btn btn-default btn-sm' href='<?php echo base_url(); ?>administrator/pembelian'>Selesai / Kembali</a> <hr> <table id="example2" class="table table-bordered table-striped"> <thead> <tr> <th style='width:40px'>No</th> <th>Description Material</th> <th>Dimension</th> <th>Jumlah</th> <th>Satuan</th> <th>Action</th> </tr> </thead> <?php echo "<tr> <td></td> <input type='hidden' value='".$this->uri->segment(3)."' name='idpd'> <td><input class='form-control' type='text' name='deskripsi_item' value='$row[deskripsi_item]' id='deskripsi_item'> </td> <td><input class='form-control' type='text' name='dimension_item' value='$row[dimension_item]' id='dimension_item'> </td> <td><input class='form-control' type='number' name='jumlah_item' value='$row[jumlah_item]'></td> <td><input class='form-control' type='text' name='satuan_item' id='satuan_item' value='$row[satuan_item]'> </td> <td><button type='submit' name='submit' class='btn btn-success btn-xs'><span class='glyphicon glyphicon-ok' aria-hidden='true'></span></button> <a class='btn btn-danger btn-xs' title='Delete Data' href='".base_url()."administrator/tambah_pembelian'><span class='glyphicon glyphicon-remove'></span></a> </td> </tr>"; ?> <tbody> <?php $no = 1; foreach ($record as $row){ echo "<tr><td>$no</td> <td>$row[nama_produk]</td> <td>Rp ".rupiah($row['harga_pesan'])."</td> <td>$row[jumlah_pesan]</td> <td>$row[satuan]</td> <td>Rp ".rupiah($row['harga_pesan']*$row['jumlah_pesan'])."</td> <td> <a class='btn btn-warning btn-xs' title='Edit Data' href='".base_url()."administrator/tambah_pembelian/$row[id_pembelian_detail]'><span class='glyphicon glyphicon-edit'></span></a> <a class='btn btn-danger btn-xs' title='Delete Data' href='".base_url()."administrator/delete_pembelian_tambah_detail/$row[id_pembelian_detail]' onclick=\"return confirm('Apa anda yakin untuk hapus Data ini?')\"><span class='glyphicon glyphicon-remove'></span></a> </td> </tr>"; $no++; } $total = $this->db->query("SELECT sum(a.harga_pesan*a.jumlah_pesan) as total FROM `rb_pembelian_detail` a where a.id_pembelian='".$this->session->idp."'")->row_array(); echo "<tr class='success'> <td colspan='5'><b>Total</b></td> <td><b>Rp ".rupiah($total['total'])."</b></td> </tr>"; ?> </tbody> </table> <?php } ?> </div> </div> </div> </div> <script type="text/javascript"> <?php echo $jsArray; ?> function changeValue(id){ document.getElementById('harga').value = prdName[id].name; document.getElementById('satuan').value = prdName[id].desc; }; </script>