<tr> <td><a href="<?php echo base_url('admin_produk/detailProduk/' . $row->ID_PRODUK); ?> " title="Produk <?php echo $row->NM_PRODUK; ?> "><?php echo $row->NM_PRODUK; ?> </a></td> <td><?php echo ubahFormatTgl($row->TGL_POS, 'd-m-Y') . ' - ' . $row->WKT_POS; ?> </td> <td><?php if ($row->STS_PUBLISH == 0) { ?> <?php echo anchor('admin_produk/ubahSts/' . $row->ID_PRODUK, 'Publikasikan'); ?> <?php } else { ?>
<tr> <td><i class="fa fa-star"></i> Min. Pesan</td> <td><?php echo $row->MIN_PESAN; ?> </td> <td><i class="fa fa-money"></i> Terjual</td> <td><?php echo $row->IN_CART; ?> </td> </tr> <tr> <td><i class="fa fa-calendar"></i> Tgl Posting</td> <td><?php echo ubahFormatTgl($row->TGL_POS, 'd-m-Y'); ?> </td> <td><i class="fa fa-clock-o"></i> Wkt Posting</td> <td><?php echo $row->WKT_POS; ?> </td> </tr> </table> </div> </div> <?php if ($row->STS_GROSIR != 0) { ?> <div class="panel panel-default">
public function ubahProduksubmit() { $this->form_validation->set_rules('NM_PRODUK', 'NM_PRODUK', 'required'); $this->form_validation->set_rules('ID_KATEGORI', 'ID_KATEGORI', 'required'); $this->form_validation->set_rules('ID_SUB_KATEGORI', 'ID_SUB_KATEGORI', 'required'); $this->form_validation->set_rules('HARGA', 'HARGA', 'required'); $this->form_validation->set_rules('BERAT_PRODUK', 'BERAT_PRODUK', 'required'); $this->form_validation->set_rules('MIN_PESAN', 'MIN_PESAN', 'required'); $this->form_validation->set_rules('DES_PRODUK', 'DES_PRODUK', 'required'); // $this->form_validation->set_rules('grosir[]', 'grosir', 'required'); if ($this->input->post('HARGA') == 0) { $grosir = $this->input->post('grosir'); $banyak = count($this->input->post('grosir')); $all = ""; for ($i = 0; $i < $banyak; $i++) { $all .= $grosir[$i] . "-"; $i = $i + 1; $all .= $grosir[$i] . "-"; $i = $i + 1; $all .= $grosir[$i] . "|"; } $harga = $all; $sts = '1'; } else { $harga = $this->input->post('HARGA'); $sts = '0'; } if ($this->form_validation->run() == FALSE) { $this->session->set_flashdata('notif', validation_errors()); $this->session->set_flashdata('a', $harga); $this->session->set_flashdata('clr', 'danger'); redirect('ukm_produk/ubahProduk/' . $this->input->post('ID_PRODUK')); } $data = array('NM_PRODUK' => $this->input->post('NM_PRODUK'), 'ID_KATEGORI' => $this->input->post('ID_KATEGORI'), 'ID_SUB_KATEGORI' => $this->input->post('ID_SUB_KATEGORI'), 'HARGA' => $harga, 'BERAT_PRODUK' => $this->input->post('BERAT_PRODUK'), 'MIN_PESAN' => $this->input->post('MIN_PESAN'), 'DES_PRODUK' => $this->input->post('DES_PRODUK'), 'TGL_POS' => ubahFormatTgl(tglSekarang(), 'Y-m-d'), 'WKT_POS' => wktSekarang(), 'DES_META' => $this->input->post('DES_META'), 'KEY_META' => $this->input->post('KEY_META'), 'STS_GROSIR' => $sts); $where = array('ID_PRODUK' => $this->input->post('ID_PRODUK')); $update = $this->proukm->editData($data, 'mp_produk', $where); if ($update) { $this->session->set_flashdata('notif', 'Produk berhasil diubah'); $this->session->set_flashdata('clr', 'success'); redirect('ukm_produk/ubahProduk/' . $this->input->post('ID_PRODUK')); } else { $this->session->set_flashdata('notif', 'maaf data tidak bisa diubah ulangi lagi'); $this->session->set_flashdata('clr', 'warning'); redirect('ukm_produk/ubahProduk/' . $this->input->post('ID_PRODUK')); } }
function tambahPenanggungJwbSubmit() { $this->form_validation->set_rules('nama', 'Nama', 'required'); $this->form_validation->set_rules('alamat', 'Alamat', 'required'); $this->form_validation->set_rules('telp', 'Telepon', 'required'); $this->form_validation->set_rules('email', 'Email', 'valid_email'); $this->form_validation->set_rules('id_provinsi', 'Provinsi', 'required'); $this->form_validation->set_rules('id_kota', 'Kota', 'required'); $this->form_validation->set_rules('id_kecamatan', 'Kecamatan', 'required'); if ($this->form_validation->run() == FALSE) { $this->session->set_flashdata('notif', validation_errors()); $this->session->set_flashdata('clr', 'danger'); redirect('admin_penanggung_jwb/tambahPenanggungJwb'); } $nama = $this->input->post('nama'); $alamat = $this->input->post('alamat'); $telp = $this->input->post('telp'); $email = $this->input->post('email'); $s_bbm = $this->input->post('s_bbm'); $id_provinsi = $this->input->post('id_provinsi'); $id_kota = $this->input->post('id_kota'); $id_kecamatan = $this->input->post('id_kecamatan'); $kelurahan = $this->input->post('kelurahan'); $tgl_terdaftar = ubahFormatTgl(tglSekarang(), 'Y-m-d'); if (!empty($_FILES['foto_profil']["tmp_name"])) { // Jika upload $config['file_name'] = date("Ymdhis"); $config['upload_path'] = './assets-admin/img/penanggung_jwb/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = 1048; $config['max_width'] = 1024; $config['max_height'] = 768; $config['detect_mime'] = TRUE; $this->load->library("upload", $config); $filename = "foto_profil"; if (!$this->upload->do_upload($filename)) { $this->session->set_flashdata('notif', $this->upload->display_errors()); $this->session->set_flashdata('clr', 'danger'); redirect('admin_penanggung_jwb/tambahPenanggungJwb', 'location'); exit; } $nm_img = $this->upload->data("file_name"); } else { $nm_img = NULL; } $data = array('NAMA' => $nama, 'ALAMAT' => $alamat, 'TELP' => $telp, 'EMAIL' => $email, 'S_BBM' => $s_bbm, 'KELURAHAN' => $kelurahan, 'ID_PROVINSI' => $id_provinsi, 'ID_KOTA' => $id_kota, 'ID_KECAMATAN' => $id_kecamatan, 'TGL_TERDAFTAR' => $tgl_terdaftar, 'FT_PROFIL' => $nm_img, 'STATUS_HAPUS' => 0); $this->penanggung_jwb->tambahData($data, 'mp_penanggung_jwb'); $this->session->set_flashdata('notif', 'Tambah UKM Berhasil'); $this->session->set_flashdata('clr', 'success'); redirect('admin_penanggung_jwb/tambahPenanggungJwb', 'location'); }
public function bukti_checkout() { $akun = $this->session->userdata("id_akun_user"); $config['upload_path'] = '././assets/images/bukti'; $config['allowed_types'] = 'jpg|jpeg|png|gif|bmp'; $config['max_size'] = '1024'; $config['overwrite'] = FALSE; $this->load->library('upload'); $this->form_validation->set_rules("ATAS_NAMA", "ATAS NAMA", "required"); $this->form_validation->set_rules("TGL_TRANSFER", "TGL TRANSFER", "required"); $this->form_validation->set_rules("NO_REKENING", "NO REKENING", "required"); $this->form_validation->set_rules("BANK_TUJUAN", "BANK TUJUAN", "required"); $this->form_validation->set_rules("NAMA_BANK", "NAMA BANK", "required"); if ($this->form_validation->run() == FALSE) { $this->session->set_flashdata('notifi', validation_errors()); $this->session->set_flashdata('clri', 'danger'); redirect('user_checkout/detailcheckout/' . $this->input->post('NO_TRANS')); } if (!empty($_FILES['filebukti']['name'])) { $this->upload->initialize($config); if ($this->upload->do_upload('filebukti')) { $uploaddata = $this->upload->data(); $tambahft = array('KODE_UNIK' => $this->input->post('KODE_UNIK'), 'NO_TRANS' => $this->input->post('NO_TRANS'), 'ATAS_NAMA' => $this->input->post('ATAS_NAMA'), 'TGL_TRANSFER' => ubahFormatTgl($this->input->post('TGL_TRANSFER'), 'Y-m-d'), 'NO_REKENING' => $this->input->post('NO_REKENING'), 'BANK_TUJUAN' => $this->input->post('BANK_TUJUAN'), 'NAMA_BANK' => $this->input->post('NAMA_BANK'), 'FT_BUKTI' => $uploaddata['file_name']); $insert = $this->producthomemodel->tambahData($tambahft, 'mp_bukti'); $update = $this->producthomemodel->editData(array('STS_BAYAR' => 1, 'TOT_TRANSFER' => $this->input->post('TOT_TRANSFER')), 'mp_transaksi', array('NO_TRANS' => $this->input->post('NO_TRANS'))); $this->session->set_flashdata('notif', 'Bukti telah terkirim'); $this->session->set_flashdata('clr', 'success'); redirect('user_checkout/detailcheckout/' . $this->input->post('NO_TRANS')); } else { $this->session->set_flashdata('notif', 'maaf foto tidak bisa diupload ulangi lagi'); $this->session->set_flashdata('clr', 'warning'); redirect('user_checkout/detailcheckout/' . $this->input->post('NO_TRANS')); } } else { $tambahft = array('KODE_UNIK' => $this->input->post('KODE_UNIK'), 'NO_TRANS' => $this->input->post('NO_TRANS'), 'ATAS_NAMA' => $this->input->post('ATAS_NAMA'), 'TGL_TRANSFER' => ubahFormatTgl($this->input->post('TGL_TRANSFER'), 'Y-m-d'), 'NO_REKENING' => $this->input->post('NO_REKENING'), 'BANK_TUJUAN' => $this->input->post('BANK_TUJUAN'), 'NAMA_BANK' => $this->input->post('NAMA_BANK')); $insert = $this->producthomemodel->tambahData($tambahft, 'mp_bukti'); $update = $this->producthomemodel->editData(array('STS_BAYAR' => 1, 'TOT_TRANSFER' => $this->input->post('TOT_TRANSFER')), 'mp_transaksi', array('NO_TRANS' => $this->input->post('NO_TRANS'))); $this->session->set_flashdata('notif', 'Bukti telah terkirim'); $this->session->set_flashdata('clr', 'success'); redirect('user_checkout/detailcheckout/' . $this->input->post('NO_TRANS')); } }