EVOLUTION-NINJA
Edit File: reply_details.php
<?php echo view('includes/header');?> <link href="<?php echo base_url('public/assets/admin_dashboard/css/jquery-ui.css');?>" rel="stylesheet"><script src="<?php echo base_url('public/assets/js/jquery-ui.js');?>"></script> <section class="content-header"> <h1> User Comments </h1> </section> <!--- section 1 --> <section class="content"> <div class="col-md-1"></div> <table class="table table-striped table-hover reminder_table" style=""> <thead> <tr class="default" > <th class="col-xs-2">User Reply</th> <th class="col-xs-1">Reply Date</th> <th class="col-xs-2">Project</th> <th class="col-xs-1">Site Number</th> <th class="col-xs-2">Handled By</th> <th class="col-xs-1">Customer Name</th> <?php if($this->session->userdata('user_type_id')== 1){?> <th class="col-xs-1">Comment</th> <?php }?> <?php if($this->session->userdata('user_type_id')>1){?> <th class="col-xs-1">Reply</th> <?php }?> </tr> </thead> <tbody id="table_body"> <?php foreach($details as $row) { if($row->notification_status == 1) {?> <tr style="background-color: #ffcce6"> <th><?php echo $row->user_reply;?></th> <th><?php echo $row->reply_date;?></th> <th><?php if($row->nick_name == "") {echo $row->project_name;} else {echo$row->nick_name;}?></th> <th><?php echo $row->site_number;?></th> <th><?php echo $row->username;?></th> <th><?php echo $row->customer_name;?></th> <?php if($this->session->userdata('user_type_id')== 1){?> <th><button type="button" onclick="add_comment(<?php echo $row->id;?>);">ADD Comment</button></th> <?php }?> </tr> <?php } else { ?> <tr> <th><?php echo $row->user_reply;?></th> <th><?php echo $row->reply_date;?></th> <th><?php if($row->nick_name == "") {echo $row->project_name;} else {echo$row->nick_name;}?></th> <th><?php echo $row->site_number;?></th> <th><?php echo $row->username;?></th> <th><?php echo $row->customer_name;?></th> <?php if($this->session->userdata('user_type_id')== 1){?> <th><button type="button" onclick="add_comment(<?php echo $row->id;?>);">ADD Comment</button></th> <?php }?> </tr> <?php } }?> </tbody> </table> <div class="modal fade" id="comment_modal" role="dialog"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Add Comment</h4> </div> <div class="modal-body"> <form id="add_comment" class="form-inline add_admin_comment"> <div class="form-group col-md-offset-2 col-md-8"> <label>Add Comment</label> <div> <textarea type="text" class="col-md-12 admin_comment" id="add_admin_comments" name="comment"></textarea> <input type="hidden" class="form-control col-sm-8 reminder_id" id="reminder_id" name="reminder_id" required="required"> </div> </div> <input type="hidden" id="detail_id" name="detail_id" value="<?php echo $row->detail_id ?>"> <input type="hidden" id="project_id" name="project_id" value="<?php echo $row->project_id ?>"> <input type="hidden" id="site_number" name="site_number" value="<?php echo $row->site_number ?>"> <input type="hidden" id="handled_by" name="handled_by" value="<?php echo $row->user_id ?>"> <!-- row 1----> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button type="submit" class="btn btn-primary center-block submit" id="comment_submit">Submit</button> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 4----> </form> </div> <!-- <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary" data-dismiss="modal">Submit</button> </div> --> </div> </div> </div> <div class="modal fade" id="reply_modal" role="dialog"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Reply</h4> </div> <div class="modal-body"> <form id="reply" class="form-inline reply"> <div class="form-group col-md-offset-2 col-md-8"> <label>Reply</label> <div> <textarea type="text" class="col-md-12 user_reply" id="users_reply" name="reply"></textarea> <input type="hidden" class="form-control col-sm-8 reminder_id" id="reminder_id" name="reminder_id" required="required"> </div> </div> <input type="hidden" id="detail_id" name="detail_id" value="<?php echo $row->detail_id ?>"> <input type="hidden" id="project_id" name="project_id" value="<?php echo $row->project_id ?>"> <input type="hidden" id="site_number" name="site_number" value="<?php echo $row->site_number ?>"> <input type="hidden" id="handled_by" name="handled_by" value="<?php echo $row->user_id ?>"> <!-- row 1----> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button type="submit" class="btn btn-primary center-block submit" id="reply_submit">Submit</button> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 4----> </form> </div> <!-- <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary" data-dismiss="modal">Submit</button> </div> --> </div> </div> </div> <?php $this->load->view('includes/footer');?> <script> function add_comment(str) { //alert(str); var val = str; // alert(val); $('#comment_modal').modal('show'); $('#comment_submit').click(function(e){ e.preventDefault(); //alert(); var admin_comment = $('.admin_comment').val(); var detail_id = $('#detail_id').val(); var project_id = $('#project_id').val(); var handled_by = $('#handled_by').val(); var site_number = $('#site_number').val(); var val = str; $.ajax({ type : 'post', url :"<?php echo site_url('add-comment');?>", data : {'conv_id':val,'detail_id':detail_id,'project_id':project_id,'handled_by':handled_by,'site_number':site_number,'admin_comment':admin_comment}, async : false, success:function(data) { $('#comment_modal').modal('hide'); window.location.reload(); } }); }); } </script> <script> function reply(str,str1) { var val = str; var val1 = str1; // alert(val); // alert(str1); $('#reply_modal').modal('show'); $('#reply_submit').click(function(e){ e.preventDefault(); //alert(); var reply = $('.user_reply').val(); var detail_id = $('#detail_id').val(); var project_id = $('#project_id').val(); var handled_by = $('#handled_by').val(); var site_number = $('#site_number').val(); var val = str; var val1 = str1; $.ajax({ type : 'post', url :"<?php echo site_url('reply');?>", data : {'conversation_id':val1,'comment_id':val,'detail_id':detail_id,'project_id':project_id,'handled_by':handled_by,'site_number':site_number,'reply':reply}, async : false, success:function(data) { $('#reply_modal').modal('hide'); window.location.reload(); } }); }); } </script>