<?php 
$this->load->view('site/templates/commonheader');
$this->load->view('site/templates/shop_header'); 
?>
<div style="background:none repeat scroll 0 0 #FFFFFF;border-bottom:1px solid #DDDDDD;border-top:1px solid #DDDDDD;padding: 20px 0;" class="add_shop">
    <div class="main">  
    			<div>
    				<a href="shops/<?php echo $this->uri->segment(2); ?>/contact-user">Back</a><br /><br />
                </div>   			
                <?php if ($contactUserInfo->num_rows() > 0){ ?>                               
                <form class="tab_form_list">
                	<?php foreach ($contactUserInfo->result() as $row){ ?>
                     <table class="tab_form_list_table" align="center" width="100">
                        <thead>     
                            <tr class="table-header">
                                <th><span>Sender Name :</span> <?php echo $row->username;?></th>
                                <th><span>Email :</span> <?php echo $row->useremail;?></th>                                
                                <th><span><a href="shops/<?php echo $this->uri->segment(2); ?>/replay-contact-user/<?php echo $row->id;?>" class="contact-popup">Replay</a></span></th>
                            </tr>
                        </thead>
                        <tbody align="center">
                            <tr>                            
                                <td colspan="3" align="left"><strong><?php echo $row->product_name;?></strong></td>
                            </tr>
                            <tr>
                                <td colspan="3" align="left"><?php echo $row->description;?></td>
                            </tr>
                        </tbody>
                        <tfoot>     
                            <tr class="table-header">
                                <th><span>Sender Name :</span> <?php echo $row->username;?></th>
                                <th><span>Email :</span> <?php echo $row->useremail;?></th>                                
                                <th><span><a href="shops/<?php echo $this->uri->segment(2); ?>/replay-contact-user/<?php echo $row->id;?>" class="contact-popup">Replay</a></span></th>
                            </tr>
                        </tfoot>
                     </table>  
                     <?php } ?>   
                 </form>
        		<?php }else{ ?>
                <div class=" warning-error">
                    <h3>
                        <span style="margin:0 0 0 3px; color:#000; font-weight:bold">No Message Found.</span>                        
                    </h3>
                </div>
                <?php } ?>
    </div>
</div>
<div style='display:none'>
        <div id='contact_reg' style='background:#fff;'>  
            <div style="width:96.7%" class="conversation">
                <div style="padding:20px; width:94.5%;" class="conversation_container">
                    <h2 class="conversation_headline">Replay to : <?php echo $row->username;?></h2>
                    <div class="conversation_right" style="width:680px;">
                        <form name="contactpeople" id="contactpeople" method="post" action="site/user/contactpeople" onsubmit="return contactsCheck();">
                            <input class="conversation-subject" type="text" name="subject" id="subject" placeholder="Subject" style="width:610px;" value="Re:<?php echo $row->product_name;?>" >
                            <textarea class="conversation-textarea" style="width:610px;" rows="11" name="message_text" id="message_text" placeholder="<?php if($this->lang->line('user_msgtxt') != '') { echo stripslashes($this->lang->line('user_msgtxt')); } else echo 'Message text'; ?>"></textarea>
                            <input type="hidden" name="sender_email" id="sender_email" value="<?php echo $this->session->userdata['shopsy_session_user_email']; ?>" >
                            <input type="hidden" name="sender_id" id="sender_id" value="<?php echo $this->session->userdata['shopsy_session_user_id']; ?>" >
                            <input type="hidden" name="receiver_email" id="receiver_email" value="<?php echo $row->useremail;?>" >
                            <input type="hidden" name="receiver_id" id="receiver_id" value="<?php echo $row->user_id;?>" >
                            <input type="hidden" name="current_user" value="<?php echo $this->session->userdata['shopsy_session_user_name']; ?>" >
                            <input type="hidden" name="FromURL" value="ContactUser" >
                            <input class="subscribe_btn" type="submit" value="send" style="height: auto; padding: 7px 10px; margin: 10px 0 7px 20px; font-weight: bold;">
                            <span class="error" id="ErrPUP"></span>
                        </form>		
                    </div> 
                </div>
            </div>
        </div>
	</div>
<script>
$(document).ready(function(){

		$(".cboxClose1").click(function(){
			$("#cboxOverlay,#colorbox").hide();
			});
		
			$(".contact-popup").colorbox({width:"765", height:"auto", inline:true, href:"#contact_reg"});
		
			//Example of preserving a JavaScript event for inline calls.
			$("#onLoad").click(function(){ 
				$('#onLoad').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});

});
</script>


<style>

#cboxLoadedContent{background:none;}


#cboxClose {  right: 15px;
    text-indent: -9999px;
    top: 11px;}
</style>
<?php $this->load->view('site/templates/footer'); ?>