<?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">    			
                <?php if ($contactUserList->num_rows() > 0){ ?>                
                <form class="tab_form_list">
                     <table class="tab_form_list_table" align="center" width="100">
                        <thead>     
                            <tr class="table-header">
                                <th width="15%"><span>UserName</span></th>
                                <th width="20%"><span>Email</span></th>        
                                <th width="15%"><span>Product Name</span></th> 
                                <th width="25%"><span>Message</span></th>       
                                <th width="15%"><span>Date</span></th> 
                                <th width="10%"><span>Action</span></th>
                            </tr>
                        </thead>
                        <tbody align="center">                    
                        <?php foreach ($contactUserList->result() as $row){ ?>
                            <tr id="contactuser-<?php echo $row->id;?>" >                            
                                <td><?php echo $row->username;?></td>        
                                <td><?php echo $row->useremail;?></td>        
                                <td><?php echo $row->product_name;?></td>
                                <td><a href="shops/<?php echo $this->uri->segment(2); ?>/view-contact-user/<?php echo $row->id;?>"><?php echo $row->description; ?></a></td>
                                <td><?php echo $row->dateAdded;?></td>
                                <td>
                                	<a href="javascript:void(0);" onclick="contactUser('<?php echo $row->id;?>');" class="contact-popup" title="Replay">Replay</a><br />
                                    <a href="shops/<?php echo $this->uri->segment(2); ?>/view-contact-user/<?php echo $row->id;?>" title="View">View</a><br />
                                    <a href="shops/<?php echo $this->uri->segment(2); ?>/delete-contact-user/<?php echo $row->id;?>" title="Delete">Delete</a>
                                </td>
                            </tr>
                        <?php } ?>
                        </tbody>
                     </table>     
                 </form>
        		<?php }else{ ?>
                <div class=" warning-error">
                    <h3>
                        <span style="margin:0 0 0 3px; color:#000; font-weight:bold">No Contacts in your Shop yet.</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"><?php if($this->lang->line('new_conversation') != '') { echo stripslashes($this->lang->line('new_conversation')); } else echo 'New conversation with'; ?><?php echo ucfirst($userProfileDetails[0]['full_name']); ?></h2>
                    <div class="conversation_thumb">
                        <img width="75" height="75" src="images/<?php echo $profile_pic; ?>">
                    </div>
                    <div class="conversation_right">
                        <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" >
                            <textarea class="conversation-textarea" 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 $userProfileDetails[0]['email']; ?>" >
                            <input type="hidden" name="receiver_id" id="receiver_id" value="<?php echo $userProfileDetails[0]['id']; ?>" >
                            <input type="hidden" name="current_user" value="<?php echo $userProfileDetails[0]['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'); ?>