EVOLUTION-NINJA
Edit File: view_client_ec_documents.php
<?php echo view('includes/header');?> <section class="content-header"> <h1> Client details </h1> </section> <!--- section 1 ----> <section class="content"> <?php $det = json_decode($details->ec); ?> <?php $uri=service('uri') ?> <input type="hidden" class="id" value="<?php echo $uri->getSegment(2);?>" > <div class="row land_owner_a"> <div class="col-sm-10"> <?php foreach($det as $ec) { ?> <div class="col-sm-4"> <label><input type="checkbox" id="select_ec" name="select_ec" value="<?php echo $ec->id;?>" style="width:7% !important;"> <p>EC<?php echo $ec->id;?></p> <h4>From :<?php echo $ec->ec_from.' To :'.$ec->ec_to;?></h4> <?php $ext = pathinfo($ec->ec_upload, PATHINFO_EXTENSION); ?> <?php if($ext == 'jpg' || $ext == 'JPG' || $ext == 'png' || $ext == 'PNG') { ?> <a href="<?php echo base_url('public/doc_client_ec_uploads');?>/<?php echo $ec->ec_upload;?>" target="_blank"><img src="<?php echo base_url('public/doc_client_ec_uploads');?>/<?php echo $ec->ec_upload;?>" class="appr_plan" style="height:300px;width:270px;"/></a> <br> <a class="remove" id="<?php echo $ec->id;?>" href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span>Remove</a> <?php } else if($ext == 'pdf' || $ext == 'PDF') { ?> <a href="<?php echo base_url('public/doc_client_ec_uploads');?>/<?php echo $ec->ec_upload;?>" target="_blank"> <embed src="https://drive.google.com/viewerng/viewer?embedded=true&url=<?php echo base_url('public/doc_client_ec_uploads');?>/<?php echo $ec->ec_upload;?>" style="height:300px;width:270px;"/>Read more</a> <br> <a class="remove" id="<?php echo $ec->id;?>" href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span>Remove</a> <?php }?> </label> </div> <?php } ?> </div> <?php if($det != "") {?> <div class="col-sm-2" > <div class="form-group"> <button type="button" class="btn btn-primary btn-md center-block send_mail">Send Mail</button> </div> </div> <?php } ?> </div> <!-- <?php $det = json_decode($details->ec); ?> <div class="col-sm-12"> <form id="land_owner" class="form-inline booking_form"> <div class="row land_owner_a"> <div class="col-sm-6"> <?php foreach($det as $ec) { ?> <div class="form-group"> <p>EC</?php echo $ec->id;?></p> <h4>From :</?php echo $ec->ec_from.' To :'.$ec->ec_to;?></h4> <?php $ext = pathinfo($ec->ec_upload, PATHINFO_EXTENSION); ?> <?php if($ext == 'jpg' || $ext == 'JPG' || $ext == 'png' || $ext == 'PNG'){?> <img src="</?php echo base_url('doc_ec_uploads');?>/</?php echo $ec->ec_upload;?>" class="appr_plan" style="height:300px;width:300px;"/> <?php } else if($ext == 'pdf' || $ext == 'PDF') { ?> <embed src="</?php echo base_url('doc_ec_uploads');?>/</?php echo $ec->ec_upload;?>" style="height:300px;width:300px;"/> </div> <hr> <?php } } ?> </div> </div> </form> </div> col-sm-8 ----> </section> <!--- section 2 ----> <style type="text/css"> .content-wrapper, .right-side { min-height: 2000px !important; } .bok-details{ background: gainsboro; text-align: center; padding-top: 7px; padding-bottom: 7px; margin-bottom: 30px; margin-top: 33px; } a { color: inherit; } </style> <script type="text/javascript"> var id = $('.id').val(); $(".send_mail").click(function(){ var ec_id = []; $.each($("input[name='select_ec']:checked"), function(){ ec_id.push($(this).val()); }); if(ec_id == "") { toastr["error"]('Please select EC(s)'); } else { $.ajax({ type : 'post', url : '<?php echo site_url("get_client_ec_selected")?>', data : {'ec_id':ec_id,'id':id}, success:function(response){ //response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { window.location.href="<?php echo site_url('send-mail-client-tax');?>/"+id+'/'+'ce'; } else { toastr["error"](response.message); $(".send_mail").text("Send Mail"); } } }); } }); $('.remove').click(function() { var ec_id = $(this).attr('id'); $.ajax({ url:"<?php echo site_url("delete-client-ec")?>", type:"POST", data : {'ec_id':ec_id,'id':id}, success:function(response) { //response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"](response.message); window.location.href = "<?php echo site_url('client-document-list');?>"; } } }); }); </script> <?php echo view('includes/footer');?>