EVOLUTION-NINJA
Edit File: notification_status_conversation.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> Status Conversations </h1> </section> <!--- section 1 ----> <section class="content"> <div class="preview"> <div class="container-fluid"> <div class="row"> <div class="col-md-12" style="margin-left: 390px;"> <div class="form-group col-md-8"> <h4> <strong>Project Name :</strong> <?php echo $project;?> <strong> Site Number :</strong> <?php echo $site_number;?> <strong> Client Name : </strong><?php echo $customer_name;?></h4> </div> </div> </div> </div> </div> <div class="preview"> <div class="container-fluid"> <div class="row"> <div class="col-md-12" > <div class="form-group col-md-8"> <?php if(session()->get('admin_id') == '18') {?> <?php } else { ?> <button type="button" class="btn btn-default btn-sm" onclick="fun(<?php echo service('uri')->getSegment(2); ?>);">ADD Conversation</button> <?php } ?> </div> </div> </div> </div> </div> <div class="modal fade" id="add_call_conversation" 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 Conversation</h4> </div> <div class="modal-body"> <form id="add_call_convo" class="form-inline add_conversation"> <div class="form-group col-md-offset-2 col-md-8"> <label>Conversation</label> <div> <textarea type="text" class="col-md-12 conversation" name="conversation" rows="3"></textarea> <input type="hidden" id="booking_id" name="booking_id" value="<?php echo service('uri')->getSegment(2); ?>"> </div> </div> <div class="form-group col-md-offset-2 col-md-8"> <label>Source</label> <div> <select type="text" class="col-md-12 source_type" name="source_type"> <option value="">Select</option> <option value="own">Own</option> <option value="loan">Loan</option> </select> </div> </div> <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">Submit</button> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 4----> </form> </div> </div> </div> </div> </hr> </br> <div class="container"> <?php foreach($detail as $row) { ?> <strong>Conversation :</strong> <p><?php echo $row['conversation']; ?></p> <strong><?php echo strtoupper($row['username']);?>    </strong> <span class="time_date"> <?php echo $row['created_at'];?></span> <?php } ?> </div> <div class="container"> <h3 class=" text-center"></h3> <div class="col-sm-10"> <div class="messaging"> <div class="inbox_msg"> <?php $i=1; foreach($detail as $row) { if(!empty($row['reply'])) { ?> <div class="mesgs"> <div class="msg_history"> <?php foreach($row['reply'] as $value) {?> <?php if(session()->get('admin_id') == $value->created_by){?> <div class="incoming_msg"> <div class="received_msg"> <div class="received_withd_msg"> <p><?php echo $value->reply; ?></p> <strong><?php echo strtoupper($value->username);?></strong> <span class="time_date"><?php echo $value->created_at;?> <?php if(session()->get('user_type_id') == 4 && session()->get('admin_id') == $value->created_by) { ?> <button type="button" class="btn btn-default btn-sm" onclick="fun_delete_reply(<?php echo $value->id; ?>);" style="border: none; background: transparent;"> <span class="glyphicon glyphicon-trash"></span>Delete </button> <?php } else if(session()->get('user_type_id') == 5) { ?> <?php } else { ?> <?php } ?> </span> </div> </div> <?php } else { ?> <div class="outgoing_msg"> <div class="sent_msg"> <p><?php echo $value->reply; ?></p> <strong><?php echo strtoupper($value->username);?></strong> <span class="time_date"><?php echo $value->created_at;?> <?php if(session()->get('user_type_id') == 4 && session()->get('admin_id') == $value->created_by) { ?> <button type="button" class="btn btn-default btn-sm" onclick="fun_delete_reply(<?php echo $value->id; ?>);" style="border: none; background: transparent;"> <span class="glyphicon glyphicon-trash"></span>Delete </button> <?php } else if(session()->get('user_type_id') == 5) { ?> <?php } else { ?> <?php } ?> </span> </div> </div> <?php } } } ?> </div> <?php if(session()->get('admin_id') != '18') {?> <div class="type_msg"> <div class="input_msg_write"> <form id="reply" class="form-inline reply"> <input type="hidden" id="booking_id" name="booking_id" value="<?php echo $this->uri->segment(2); ?>"> <input type="text" class="user_reply" name="reply" placeholder="Reply Here" /> <button class="msg_send_btn reply_submit" type="button" conv_id="<?php echo $row['conv_id']; ?>"><i class="fa fa-paper-plane-o" aria-hidden="true"></i></button> </form> </div> </div> <?php } ?> </div> <?php $i++; }?> </div> </div> </div> </div> </section> <script type="text/javascript"> function fun_delete_convo(str) { var val = str; $.ajax({ type : 'post', url :"<?php echo site_url('gss/delete_conversation');?>", data : {'conversation_id':val}, async : false, success:function(data) { toastr["success"]('Deleted'); location.reload(); } }); } function fun_delete_reply(str) { var val = str; $.ajax({ type : 'post', url :"<?php echo site_url('gss/delete_reply');?>", data : {'reply_id':val}, async : false, success:function(data) { toastr["success"]('Deleted'); location.reload(); } }); } function fun(str) { $('#add_call_conversation').modal('show'); } $('#add_call_convo').submit(function(e){ e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url :"<?php echo site_url('add-status-conversation');?>", data : formdata, contentType : false, processData : false, success:function(response) { toastr["success"]('Message Sent'); $('#add_call_conversation').modal('hide'); //location.reload(); } }); }); /*function add_reply(str) {*/ $('.reply_submit').click(function(){ var conv_id = $(this).attr('conv_id'); var booking_id = $('#booking_id').val(); var conversation_id = conv_id; var reply = $(this).parent().find("input[name=reply]").val() if(reply == "") { toastr["error"]('Please type a message'); } else { $.ajax({ type : 'post', url :"<?php echo site_url('add-converstaion-reply');?>", data : {'conversation_id':conversation_id,'booking_id':booking_id,'reply':reply}, async : false, success:function(data) { toastr["success"]('Message Sent'); $('#reply_modal').modal('hide'); location.reload(); } }); } //var reply = $('.user_reply').val(); }); /*}*/ $('.date_picker').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:c", //dateFormat: 'yy-mm-dd' dateFormat: 'dd-mm-yy' }); </script> <style> .label_comment { background-color: white; color: blue; font-weight: bold; padding: 4px; text-transform: uppercase; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; } .label_reply{ background-color: white; color: black; font-weight: bold; padding: 4px; text-transform: uppercase; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; } </style> <style> img{ max-width:100%;} .inbox_msg { border: 1px solid #c4c4c4; clear: both; overflow: hidden; } .top_spac{ margin: 20px 0 0;} .chat_ib h5{ font-size:15px; color:#464646; margin:0 0 8px 0;} .chat_ib h5 span{ font-size:13px; float:right;} .chat_ib p{ font-size:14px; color:#989898; margin:auto} .chat_img { float: left; width: 11%; } .chat_ib { float: left; padding: 0 0 0 15px; width: 88%; } .chat_people{ overflow:hidden; clear:both;} .chat_list { border-bottom: 1px solid #c4c4c4; margin: 0; padding: 18px 16px 10px; } .inbox_chat { height: 550px; overflow-y: scroll;} .active_chat{ background:#ebebeb;} .incoming_msg_img { display: inline-block; width: 6%; } .received_msg { display: inline-block; padding: 0 0 0 10px; vertical-align: top; width: 50%; } .received_withd_msg p { background: #ebebeb none repeat scroll 0 0; border-radius: 3px; color: #646464; font-size: 14px; margin: 0; padding: 5px 10px 5px 12px; width: 100%; } .time_date { color: #747474; display: block; font-size: 12px; margin: 8px 0 0; } .received_withd_msg { /*width: 57%;*/ } .mesgs { float: left; padding: 30px 15px 0 25px; width: 100%; } .sent_msg p { background: #05728f none repeat scroll 0 0; border-radius: 3px; font-size: 14px; margin: 0; color:#fff; padding: 5px 10px 5px 12px; width:100%; } .outgoing_msg{ overflow:hidden; margin:26px 0 26px;} .sent_msg { float: right; width: 50%; } .input_msg_write input { background: rgba(0, 0, 0, 0) none repeat scroll 0 0; border: medium none; color: #4c4c4c; font-size: 15px; min-height: 48px; width: 100%; } .type_msg {border-top: 1px solid #c4c4c4;position: relative;} .msg_send_btn { background: #05728f none repeat scroll 0 0; border: medium none; border-radius: 50%; color: #fff; cursor: pointer; font-size: 17px; height: 33px; position: absolute; right: 0; top: 11px; width: 33px; } .messaging { padding: 0 0 50px 0;} .msg_history { /*height: 516px;*/ overflow-y: auto; } </style> <?php echo view('includes/footer');?>