function onprocsess($id = '') { if (!$this->session->userdata('logged_in')) { redirect('login', 'refresh'); } else { $rtrim = rtrim($id); $cekurid = cekurlid('brosur', 'id'); if (empty($rtrim)) { redirect('login', 'refresh'); } else { if (in_array($id, $cekurid)) { $siuser = datauser(); if ($siuser['jabatan'] === 'designer') { $this->db->where('id', $id); $query = $this->db->update('brosur', array('status' => 'op')); if ($query) { redirect(site_url('gudang/slug/16/4/20'), 'refresh'); } else { ?> <script type="text/javascript"> alert('maaf ,terjadi kesalahan pada system :( '); </script> <?php redirect('login', 'refresh'); } } } else { ?> <script type="text/javascript"> alert('not allowed'); </script> <?php redirect('login', 'refresh'); } } } }
<?php $infouser = datauser(); $detuser = getdetuser($infouser['id']); $likol = $this->db->list_fields('user'); ?> <script src="<?php echo base_url() . 'asset/js/default/jquery-1.9.1.js'; ?> "></script> <script type="text/javascript"> //$(window).load(function(){ var counter = 0; $(document).ready(function() { $("#btnweb").click(function(){ var map = {}; $(".web").each(function() { map[$(this).attr("name")] = $(this).val(); }); var postData = { 'namaweb' : map.namaweb, 'website' : map.website }; $.ajax({ type: "POST", url: "<?php echo site_url('gudang/addweb'); ?> ", data: postData , //assign the var here success: function(){
} } } else { echo 'pending'; } ?> </td> <?php break; case 'brosur': ?> <td> <?php $rtrimimg = rtrim($valdata['idimg']); if (empty($rtrimimg) && strlen($rtrimimg) === 0) { $siuser = datauser(); if ($siuser['jabatan'] === 'designer') { ?> <a href="<?php echo site_url('gudang/edit/' . $valdata[$fkolm] . '/20/' . $fkolm); ?> " class="btn btn-sm btn-primary">upload</a> <?php if ($valdata['status'] === 'op') { ?> <span class="glyphicon glyphicon-time"></span> <?php } else { ?> <a href="<?php echo site_url('gudang/onprocsess/' . $valdata[$fkolm]);