<?php
$this->load_template('_header.php');
$this->load_template('_top.php');
?>
<script type="text/javascript" src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/js/js_dashboard.js"></script>
<div id="generalspace">
        
    <div id="container">
    
    	<div id="column1"><?php $this->load_template('_verticalmenu-dashboard.php'); ?></div>
        
        <div id="column2">
		
            <div id="dashboard2">

				<div class="boxdash">
    
                    <div class="title"><?php echo $this->lang('dashboard_requestssent_title'); ?></div>
                    
                    <div class="spaceinfo">
                    
                    	<div class="mrg20B centered">
                        <select name="morefriendship" id="morefriendship" onChange="reloadfs(this.value)">
                          <option value="1" <?php echo $D->optioncombo==1?'selected':''; ?>><?php echo $this->lang('dashboard_friendship_combo_friends')?></option>
                          <option value="2" <?php echo $D->optioncombo==2?'selected':''; ?>><?php echo $this->lang('dashboard_friendship_combo_followers')?></option>
                          <option value="3" <?php echo $D->optioncombo==3?'selected':''; ?>><?php echo $this->lang('dashboard_friendship_combo_following')?></option>
                          <option value="4" <?php echo $D->optioncombo==4?'selected':''; ?>><?php echo $this->lang('dashboard_friendship_combo_fsend')?></option>
                          <option value="5" <?php echo $D->optioncombo==5?'selected':''; ?>><?php echo $this->lang('dashboard_friendship_combo_freceived')?></option>
                        </select>

                        </div>

                        <script>
						function reloadfs(opc) {
							switch(parseInt(opc)) {
								case 1:
									self.location = siteurl + 'dashboard/friends';
									break;
								case 2:
									self.location = siteurl + 'dashboard/followers';
									break;
								case 3:
									self.location = siteurl + 'dashboard/following';
									break;
								case 4:
									self.location = siteurl + 'dashboard/requests-sent';
									break;
								case 5:
									self.location = siteurl + 'dashboard/requests-received';
									break;									
							}
						}
						</script>
                    
						<?php if ($D->numrequests == 0) { ?>
                        
                        <div class="mrg30T mrg30B txtsize00 centered"><?php echo $this->lang('dashboard_requestssent_norequestsent'); ?></div>
                        
                        <?php } else { ?>
                        
                        <div class="mrg20B"><?php echo $this->lang('dashboard_requestssent_msg')?></div>
                        
                        <div><?php echo $D->htmlRequest?></div>
                        
                        
                        
                        <?php if ($D->totalrequests>$C->NUM_FRIENDS_PAGE) { ?>
                        
                        <div id="moreitems"></div>
                        
                        <div><input name="numitems" type="hidden" id="numitems" value="<?php echo $D->numrequests?>" /></div>
                        
                        <div id="moreitemsbar" class="mrg20T mrg10B">
                            <div class="centered">
                                <span id="bmore" class="bgrey2 rounded"><?php echo $this->lang('global_txt_moreitems')?></span>
                                <span id="morepreload" class="hide"><img src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/imgs/preload.gif" /></span>
                            </div>
                        </div>
                        <script>
                            var idu = <?php echo $this->user->id ?>;
                            var itemperpage = <?php echo $C->NUM_FRIENDS_PAGE ?>;
                            var txt_norequest = '<?php echo $this->lang('global_txt_no_request') ?>';
                            $('#bmore').click(function(){
                                reloadinfo('requestssent')
                                return false;
                            });
                        </script>
                
                        <?php } ?>
                    
                        <?php } ?>
					
                    </div>

				</div>


            </div>
        
        
        </div>
        
        <div id="divseparator" class="sh"></div>
        
        <div id="column3"><?php $this->load_template('_accessories-dashboard.php'); ?></div>
        
        <div class="sh"></div>
    
    </div>
            
</div>    

<?php
$this->load_template('_foot.php');
$this->load_template('_footer.php');
?>