 <?php foreach($msg as $msg){
	  if($msg->msg_from=="user"){?>
 <li class="friend">
                                                <div class="friend-msg-wrap">
           <!--<img class="user-img img-circle block pull-left" src="<?php echo base_url();?>newadminassets/img/avatars/avatar.png" alt="user">-->
                                                    <div class="msg pull-left"><?php echo $msg->msg;?>
                                                        <div class="msg-per-detail mt-5">
                                                           <!-- <span class="msg-per-name txt-success">Jane</span>-->
                                                            <span class="msg-time txt-grey"><?php echo date("d M Y",strtotime($msg->chdate));?></span>
                                                        </div>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </li>
                                            <?php }else{?>
                                            <li class="self">
                                                <div class="self-msg-wrap">
                                                    <div class="msg block pull-right"><?php echo $msg->msg;?>
                                                        <div class="msg-per-detail mt-5">
                                                            <span class="msg-time txt-grey"><?php echo date("d M Y",strtotime($msg->chdate));?></span>
                                                        </div>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </li><?php }}?>