<?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_admin.js"></script>
<div id="generalspace">
        
    <div id="container">
    
    	<div id="column1-admin"><?php $this->load_template('_verticalmenu-admin.php'); ?></div>
        
        <div id="column2-admin">
		
            <div id="dashboard-admin2">                
                
                <div class="editarea">
                
                	<div class="boxdash">
                
                    	<div class="title"><?php echo $this->lang('admin_groups_title');?></div>
                        
                        <div class="spaceinfo">
                    
							<div>
                            	<div class="linkblue2 mrg10T">&laquo; <a href="<?php echo $C->SITE_URL?>admin/groups"><?php echo $this->lang('admin_txt_linkback');?></a></div>
                                <div class="mrg10T txtsize00 grey1"><?php echo $this->lang('admin_groups_update_txt_title')?></div>
                                <div class="mrg20B txtsize07 bold"><?php echo $D->namegroup?></div>
                                
                                <div id="formedit" class="mrg20T">                                
                                
									<div class="editarea">
                                    
                                    	<div class="subtitle"><?php echo $this->lang('dashboard_groups_update_txt_infobasic'); ?></div>
                    
			                            <div id="form01" class="mrg30B">
            			            		<form id="form1" name="form1" method="post" action="">
                        					<div class="mrg10T grey1"><?php echo $this->lang('admin_groups_txt_namegroup')?>:</div>
                        					<div><input name="namegroup" type="text" id="namegroup" class="boxinput withbox" value="<?php echo $D->namegroup?>"/></div>

                        					<div class="mrg10T grey1"><?php echo $this->lang('admin_groups_txt_descriptiongroup')?>:</div>
                        					<div><textarea name="descriptiongroup" rows="4" class="boxinput withbox" id="descriptiongroup"><?php echo $D->aboutgroup?></textarea></div>

											<div class="mrg10T grey1"><?php echo $this->lang('admin_groups_txt_privacy')?></div>
                                            <div><select name="privacygroup" id="privacygroup" class="boxinput withbox" onchange="loadDetails(this.value, '#msgprivacy');">
                                            	<option value="0" <?php echo($D->privacy==0?'Selected':'')?>><?php echo $this->lang('admin_groups_txt_public')?></option>
                                            	<option value="1" <?php echo($D->privacy==1?'Selected':'')?>><?php echo $this->lang('admin_groups_txt_closed')?></option>
                                            	<option value="2" <?php echo($D->privacy==2?'Selected':'')?>><?php echo $this->lang('admin_groups_txt_secret')?></option>
                                            </select></div>
                                            <div id="msgprivacy" class="mrg5T"></div>
                                            
                                            <div class="mrg10T grey1"><?php echo $this->lang('admin_groups_txt_status')?></div>
                                            <div>
                                            <select name="statusgroup" id="statusgroup" class="boxinput withbox">
                                            	<option value="0" <?php echo($D->status==0?'Selected':'')?>><?php echo $this->lang('admin_groups_txt_status_inactive')?></option>
                                          		<option value="1" <?php echo($D->status==1?'Selected':'')?>><?php echo $this->lang('admin_groups_txt_status_active')?></option>
                                            </select>
                                            </div>
                                            
											<div id="msgok" class="yellowbox"></div>
                                            <div id="msgerror" class="redbox"></div>
                                            <div class="mrg20T mrg5B">
                                                <span><input type="submit" name="bsave" id="bsave" value="<?php echo $this->lang('admin_groups_update_txt_submitinfobasic')?>" class="bblue hand"/></span>
                                            </div>
                      
					                      </form>
                                        </div>
                                
                                    </div>
                                
                                
                                </div>                           
                            
								<script>
								function loadDetails(idmsg, divmsg) {
									idmsg = parseInt(idmsg);
									switch (idmsg) {
										case 0:
											$(divmsg).html('<?php echo $this->lang('admin_groups_txt_msgpublic');?>');
											break;	
										case 1:
											$(divmsg).html('<?php echo $this->lang('admin_groups_txt_msgclosed');?>');
											break;	
										case 2:
											$(divmsg).html('<?php echo $this->lang('admin_groups_txt_msgsecret');?>');
											break;
									}
								}
                                
								var cgroup = '<?php echo $D->codegroup?>';
                                loadDetails(<?php echo $D->privacy?>, '#msgprivacy');
                                var txt_enter_name='<?php echo $this->lang('admin_groups_error_entername')?>';
                                $('#bsave').click(function(){
                                    updateGroup('#msgerror', '#msgok', '#bsave');
                                    return false;
                                });
    
                                </script>
                                
                    		</div>
                    	</div>
                        
                    </div>
                    
				</div>

            </div>
        
        
        </div>
        
        <div class="sh"></div>
    
    </div>
            
</div>

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