whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
public_html
/
application
/
views
/
webapp
/
office_user
/
Upload File:
files >> //proc/self/root/home/papecmvm/public_html/application/views/webapp/office_user/view_customer.php
<?php require_once(APPPATH.'views/webapp/header.php');?> <?php require_once(APPPATH.'views/webapp/menu.php'); $cur_year = date('Y'); $cur_month = strtolower(date('F')); echo "<style>.file-tree .topyear_".$cur_year.":before{ color:#d81b60!important;}</style>"; echo "<style>.year_".$cur_year." .".$cur_month.":before{ color:#d81b60!important;}</style>"; $CI = & get_instance(); $CI->load->model('app'); $cid = $CI->app->encryptdata($data[0]['rid']); $user_id =$data[0]['rid']; ?> <style type="text/css"> .upload{ display:none!important; } .label{ padding: 0.2em 0.3em 0.2em 0.3em; } .label-ac{ color: red; font-size: 12px;} .label-purchase{background-color: #d81b60; color: #fff; font-size:75%;} .label-sales{background-color: #605ca8; color: #fff; font-size:75%;} .label-payment{background-color: #001F3F; color: #fff; font-size:75%;} .label-receipt{background-color: #ff851b; color: #fff; font-size:75%;} .label-contra{background-color: #3d9970; color: #fff; font-size:75%;} .label-journal{background-color: #3c8dbc; color: #fff; font-size:75%;} .label-credit{background-color: #DD4B39; color: #fff; font-size:75%;} .label-debit{background-color: #596D82; color: #fff; font-size:75%;} .label-bank{background-color: #f74ef5; color: #fff; font-size:75%;} .label-cheque_reg{background-color: #56afe2; color: #fff; font-size:75%;} .label-all{color: #000; font-size:75%;} .btn-sm{padding: 0px 4px;} .file-body ul li a{ width:auto!important; } .box-header{padding-bottom: 0px;} .file-body ul li a{width: auto!important; margin-right: 10px;} .file-list .folder-root a{width: auto!important; margin-right: 10px;} </style> <script type="text/javascript"> $(function(){ $(".upload_link").on('click', function(e){ e.preventDefault(); $(this).prev().trigger('click'); }); }); </script> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> View Customer </h1> <ol class="breadcrumb"> <li><a href="<?php echo site_url('webapp/welcome')?>"><i class="fa fa-dashboard"></i> Dashboard</a></li> <li class="active">View Customer</li> </ol> <?php if($this->session->flashdata('msg')){ echo "<br>"; echo $this->session->flashdata('msg'); } ?> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-6"> <div class="box box-primary"> <div class="box-header ui-sortable-handle"> <i class="fa fa-user"></i> <h3 class="box-title">Customer Detail</h3> <div class="box-tools pull-right"> </div> </div> <table class="table"> <tr> <th>Name</th> <td><?php echo $data[0]['name']; ?></td> </tr> <tr> <th>Email</th> <td><?php echo $data[0]['email']; ?></td> </tr> <tr> <th>Mobile</th> <td><?php echo $data[0]['mobile']; ?></td> </tr> <tr> <th>constitution</th> <td><?php echo $data[0]['constitution']; ?></td> </tr> <tr> <th>Date of Incorporation</th> <td><?php echo date("d-m-Y", strtotime($data[0]['date_incorporation'])); ?></td> </tr> <tr> <th>Nature of Business</th> <td><?php echo $data[0]['nob']; ?></td> </tr> <tr> <th>Unique Requiremant</th> <td><?php echo $data[0]['ur']; ?></td> </tr> <tr> <th>Report Interval</th> <td><?php echo $data[0]['ri']; ?></td> </tr> <tr> <th>GST</th> <td><?php echo $data[0]['gst']; ?></td> </tr> <tr> <th>PAN</th> <td><?php echo $data[0]['pan']; ?></td> </tr> </table> </div><!-- /.box --> </div> <?php if($data[0]['type'] == 'customer'){ ?> <div class="col-xs-12 col-sm-12 col-md-6"> <div class="box box-primary"> <div class="box-header ui-sortable-handle"> <ul class="list-unstyled text-capitalize"> <li class='text-danger'> <h5>Available Access : <?php $access = explode('|', rtrim($data[0]['folder'], '|')); for ($k=0; $k < count($access); $k++) { ?> <span class="label label-<?php echo $access[$k]; ?>"><?php echo $access[$k]; ?></span> <?php } ?> </h5> </li> </ul> </div> <div class="box-body"> <ul class="file-tree"> <?php $access = explode('|', trim($data[0]['folder'], '|')); $somePath = $data[0]['folder_code']; $dirs = array_filter(glob('documents/'.$somePath.'/*'), 'is_dir'); foreach ($dirs as $key => $value) { ?> <?php $exp = explode('/', $value); $year = ($exp[2]); ?> <li class="topyear_<?php echo $year; if($cur_year == $year){ echo " open"; } ?>"><a href="#"><?php echo $year; ?></a> <ul class="year_<?php echo $year; ?>"> <?php $dirs2 = array_filter(glob('documents/'.$somePath.'/'.$year.'/*'), 'is_dir'); foreach ($dirs2 as $key2 => $value2) { ?> <?php $exp2 = explode('/', $value2); $month = ($exp2[3]); ?> <?php $m = explode('_', $month); ?> <li class="<?php echo $m[1]; if($cur_month == $m[1]){ echo " open"; } ?>"> <a href="#"><?php echo $m[1]; ?></a> <ul> <?php //echo "<pre>"; print_r($access); die; $dirs3 = array_filter(glob('documents/'.$somePath.'/'.$year.'/'.$month.'/*'), 'is_dir'); //foreach ($dirs3 as $value3) { foreach ($access as $value3) { ?> <li class="folder-root"> <a href="#"> <?php //$exp3 = explode('/', $value3); //$stage = ($exp3[4]); if($value3 != ''){ echo $value3; } $dirs4 = array_filter(glob('documents/'.$somePath.'/'.$year.'/'.$month.'/'.$value3.'/*'), 'is_file'); $cnt4 = count($dirs4); ?> <span class="text-danger"><strong>(<?php echo $cnt4; ?>)</strong></span> </a> <?php /* <button title="View Files" type="button" class="btn btn-success btn-sm" data-toggle="modal" data-target="#file_<?php echo $year.'_'.$month.'_'.$value3; ?>"> <i class="fa fa-eye" aria-hidden="true"></i> </button> */ $cid = $CI->model->encryptdata($data[0]['rid']); $cu_folder = $value3; $avail_folder = 'documents/'.$somePath.'/'.$year.'/'.$month.'/'.$value3; $avail_folder = base64_encode($avail_folder); ?> <?php /* <a href="<?php echo base_url().'webapp/office/custData/'.$cid.'/'.$cu_folder; ?>" title="View Files" class="btn btn-success btn-sm" style="color:#fff;"><i class="fa fa-eye" aria-hidden="true"></i></a> */ ?> <a href="<?php echo base_url().'webapp/office/custDataTwo/'.$cid.'/'.$cu_folder.'/'.$avail_folder; ?>" title="View Files" class="btn btn-success btn-sm" style="color:#fff;"><i class="fa fa-eye" aria-hidden="true"></i></a> <!-- Modal --> <div class="modal fade" id="file_<?php echo $year.'_'.$month.'_'.$value3; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Files</h4> </div> <div class="modal-body file-body"> <?php if($cnt4 == 0){ echo "<h4 class='text-danger'>No files available.</span>"; } ?> <ul> <?php /* $files = array_filter(glob('documents/'.$somePath.'/'.$year.'/'.$month.'/'.$stage.'/*'), 'is_file'); foreach ($files as $f){ $tmp[basename($f)] = filemtime($f); echo "hi"; } asort($tmp); $files = array_keys($tmp); //echo "<pre>"; print_r($files); foreach ( array_reverse($files) as $f) { ?> <li><a href="#"><?php echo $f; ?></a></li> <?php } */ $path = $value2.'/'.$value3.'/'; // php get files from directory order by date second way $dir = opendir($path); $list = array(); while($file = readdir($dir)){ if ($file != '.' and $file != '..'){ // add the filename, to be sure not to // overwrite a array key $ctime = filectime($path . $file) . ',' . $file; $list[$ctime] = $file; } } closedir($dir); krsort($list); foreach ( $list as $f) { $ext = pathinfo($f, PATHINFO_EXTENSION); $t = $path.$f; ?> <?php if($ext == 'png' || $ext == 'PNG' || $ext == 'jpg' || $ext == 'JPG' || $ext == 'jpeg' || $ext == 'JPEG') { ?> <li class="li-img"> <a class="example-image-link text-primary" href="<?php echo base_url().$t; ?>" data-lightbox="example-set" data-title="<?php echo $f; ?>"><?php echo $f; ?></a> <small class="text-lowercase label label-sales"><i class="fa fa-clock-o"></i> <?php echo date ("d-m-Y, h:i:a.", filectime($t)); ?> </small> <?php $enc_url = base64_encode($t);?> <?php $where = array('cid' => $user_id, 'path' => $t); $form_data = $CI->app->DetailData('tbl_form', $where); $f_cnt = count($form_data); if($f_cnt == '0'){ ?> <?php if($cur_month == $m[1]){ ?> <a href="<?php echo base_url().'webapp/office/form/'.$enc_url.'/'.$cid; ?>"><strong>Generate</strong></a> <?php } ?> <?php }else{ echo "<strong class='text-success'>Generated</strong>"; } ?> <?php /* <a onclick="return confirm('Are you sure you want to delete this item?');" href="<?php echo base_url().'webapp/users/remove/'.$enc_url.'/'.$encrypted_id; ?>"><i class="fa fa-trash text-danger" aria-hidden="true"></i></a> */ ?> </li> <?php }elseif($ext == ''){ } else { ?> <li class="li-doc"> <a target="_blank" href="<?php echo base_url().$t; ?>"><?php echo $f; ?></a> <small class="text-lowercase label label-primary"><i class="fa fa-clock-o"></i> <?php echo date ("d-m-Y, h:i:a.", filectime($t)); ?> </small> <?php $enc_url = base64_encode($t); ?> <?php $where = array('cid' => $user_id, 'path' => $t); $form_data = $CI->app->DetailData('tbl_form', $where); $f_cnt = count($form_data); if($f_cnt == '0'){ ?> <?php if($cur_month == $m[1]){ ?> <a href="<?php echo base_url().'webapp/office/form/'.$enc_url.'/'.$cid; ?>"><strong>Generate</strong></a> <?php } ?> <?php }else{ echo "<strong class='text-success'>Generated</strong>"; } ?> <?php /*<a onclick="return confirm('Are you sure you want to delete this item?');" href="<?php echo base_url().'webapp/users/remove/'.$enc_url.'/'.$encrypted_id; ?>"><i class="fa fa-trash text-danger" aria-hidden="true"></i></a> */ ?> </li> <?php } ?> <?php } /*foreach ($dirs4 as $value4) { $exp5 = explode('/', $value4); $doc = ($exp5[5]); $ext = pathinfo($doc, PATHINFO_EXTENSION); $t = $value4; ?> <?php if($ext == 'png' || $ext == 'PNG' || $ext == 'jpg' || $ext == 'JPG' || $ext == 'jpeg' || $ext == 'JPEG') { ?> <li class="li-img"> <a class="example-image-link text-primary" href="<?php echo base_url().$value4; ?>" data-lightbox="example-set" data-title="<?php echo $doc; ?>"><?php echo $doc; ?></a> <small class="text-lowercase label label-danger"><i class="fa fa-clock-o"></i> <?php echo date ("d-m-Y, h:i:a.", filectime($t)); ?> </small> </li> <?php } else { ?> <li class="li-doc"> <a target="_blank" href="<?php echo base_url().$value4; ?>"><?php echo $doc; ?></a> <small class="text-lowercase label label-primary"><i class="fa fa-clock-o"></i> <?php echo date ("d-m-Y, h:i:a.", filectime($t)); ?> </small> </li> <?php } ?> <?php } */ ?> </ul> </div> </div> </div> </div> <!--<input class="upload" type="file"/> <a href="#" class="upload_link"><i class="fa fa-plus-square" aria-hidden="true"></i></a>--> <!-- Button trigger modal --> <?php /* <button title="Upload File" type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#select_<?php echo $year.'_'.$month.'_'.$stage; ?>"> <i class="fa fa-upload" aria-hidden="true"></i> </button> <!-- Modal --> <div class="modal fade" id="select_<?php echo $year.'_'.$month.'_'.$stage; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <?php $attr = array('class' => 'browseForm'); echo form_open_multipart('webapp/users/upload', $attr); ?> <!-- <form class="form-horizontal contactForm_<?php //echo $year.'_'.$month.'_'.$stage; ?>"> --> <input type="hidden" name="path" value="<?php echo $value3; ?>" /> <input type="hidden" name="id" value="<?php echo $encrypted_id; ?>" /> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Select File</h4> </div> <div class="modal-body"> <p><span class="text-primary"><strong>Path to be Upload : </strong></span> <span class="text-danger"><?php echo $value3; ?></span></p> <input type="file" name="doc" required=""> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary">Save changes</button> </div> </div> <!--</form>--> <?php echo form_close(); ?> </div> </div> */ ?> </li> <?php } ?> </ul> </li> <?php } ?> </ul> </li> <?php } ?> </ul> </div><!--body--> </div><!--box--> </div><!--col--> <?php } ?> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php require_once(APPPATH.'views/webapp/footer.php');?> <script type="text/javascript"> $(".contactForm_").submit(function (event) { event.preventDefault(); var form_data = $(".contactForm").serialize(); $.ajax({ url: 'http://localhost/paper/webapp/users/upload', type: 'POST', data: form_data, success: function (data) { $('.contactForm')[0].reset(); $('.successLabel').show(); }, error: function () { alert("Something went wrong!"); $('.errorLabel').show(); } }); }); </script>
Copyright ©2021 || Defacer Indonesia