<?php
if (isset($_GET['user'])) {
	if (empty($_GET['user'])) {
	$usercode = 00;
	}else{
	$usercode = $_GET['user'];
	}

	$select = $conn->query("SELECT * FROM users WHERE id = '$usercode'");
	$fetch = $select->fetchAll(PDO::FETCH_OBJ);
	$count = $select->rowCount();
	if ($count > 0) {
	  foreach ($fetch as $value) {
	    $username = $value->username;
	}

?>
<style type="text/css">
        #message-body{ 
            border: 1px solid #ead6a3;
            min-height: 650px;
            max-height: 650px;
            border-radius: 5px;
            box-shadow: 0.2px 0px 7px #ead6a3;
            margin-top: 1%;
            background: #fff;
        }
        #mhead{
            background: #c19524;
            min-height: 50px;
            margin-top: 10px;
        }
        #mbody{
            height: 400px;
            overflow: scroll;
            scroll-behavior: initial;
        }

        #mfooter{
            margin-top: 10px;
            border: 1px solid #ddd;
            border-radius: 20px;
            box-shadow: 0.2px 0px 7px #14445d;
            max-height: 20%;
        }
        .mtext{
            margin: 10px;
        }

        .box1{
            background: #f5e2b1;
            min-width: 20%;
            max-width: 25%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box11{
            background: #f5e2b1;
            min-width: 20%;
            max-width: 30%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box12{
            background: #f5e2b1;
            min-width: 20%;
            max-width: 40%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box13{
            background: #f5e2b1;
            min-width: 20%;
            max-width: 50%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box14{
            background: #f5e2b1;
            min-width: 20%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
         .box2{
            background: white;
            margin-left:75%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box21{
            background: white;
            margin-left:70%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box22{
            background: white;
            margin-left:60%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box23{
            background: white;
            margin-left:50%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .box24{
            background: white;
            margin-left:30%;
            max-width: 80%;
            min-height: 20%;
            border-radius: 10px;
            box-shadow: 0.2px 0px 5px #d9edf8;
        }
        .btext{
            margin-top: 10px;
            margin: 7px;
            text-align: justify;
            font-size: 18px;
        }
        #sendmessage{
            display: flex;
            margin: 20px;
        }
        .alert-box {
  padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;  
}

    </style>
	
<div class="x_panel">
                  <div class="x_title">
                    <h2>Chatting with <?php echo "$username"; ?></h2>
                    <div class="clearfix"></div>
                  </div>

                  <div class="x_content">
                      <div class="col-md-12" id="message-body">
           <div id="mbody">
               <div id="mtext">
               

                    <div id="getinner">
                      
                    </div>
                    <button class="btn btn-default btn-transparent" id="downbt" style="position:fixed; top: 50%; left: 50%px; z-index: 2;"><i class="fa fa-arrow-down fa-2x"></i></button>

                
              
               </div>
           </div>
           <div id="mfooter">
              <form method="post" id="sendmess">
                  <div id="sendmessage">
                      <div class="form-group">
                        <div class="row">
                          <div class="col-md-10 col-xs-10 col-sm-10 col-lg-10">
                          <textarea class="form-control" id="filetext" name="message" rows="1" cols="100%"></textarea>
                        </div>
                        <div class="col-md-2 col-xs-2 col-sm-2 col-lg-2">
                          <label for="fileadd"><i class="fa fa-file" title="add a file" id="clickme"></i></label>
                          <input type="file" name="fileadd" id="fileadd" style="display: none;">
                          <input type="text" name="2id" value="<?php echo $usercode ?>" style="display: none;">
                          <button class="btn btn-default btn-xs" type="reset" id="reseting"><i class="fa fa-times"></i></button>
                        </div>
                        </div>
                      </div>
                      <div class="form-group">
                          <button class="btn btn-default btn-xs" name="sendmes">Send</button>
                          
                      </div>
                  </div>
              </form>
           </div>
        </div>
                </div>

                </div>
<?php
}
	
}
?>	

	
			