<?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>
<script type="text/javascript" src="<?php echo $C->SITE_URL; ?>themes/<?php echo $C->THEME ?>/js/js_ajaxupload.js"></script>
<script type="text/javascript" src="<?php echo $C->SITE_URL; ?>themes/<?php echo $C->THEME ?>/js/js_uploadimage.js"></script>
<script type="text/javascript" src="<?php echo $C->SITE_URL; ?>themes/<?php echo $C->THEME ?>/js/js_uploadcover.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 id="listpages">
                
                	<div class="boxdash">
                
                        <div class="title"><?php echo $this->lang('dashboard_pages_title')?></div>
                        
                        <div class="spaceinfo">
                        
                        	<?php $this->load_template('__dashboard-smenu-pages.php');?>
                            
                            <div class="mrg20T mrg30B">
                            
                            	<div class="txtsize08"><?php echo $this->lang('dashboard_pages_update_txt_title'); ?></div>
                            
                                <div id="formedit" class="mrg20T">                                
                                
									<div class="editarea">
                                    
                                    	<div class="subtitle"><?php echo $this->lang('dashboard_pages_update_txt_infobasic'); ?></div>
                    
			                            <div id="form01" class="mrg30B">
            			            		<form id="form1" name="form1" method="post" action="">
                                            <div class="mrg20T grey1"><?php echo $this->lang('dashboard_pages_txt_category')?></div>
                                            <div><select name="pagecategory" id="pagecategory" class="boxinput withbox" onchange="loadsubcategorypages(this.value, -1, '<?php echo $this->lang('dashboard_pages_txt_choosesubcategory')?>','#pagesubcategory');"></select></div>
                    
                                            <div class="mrg10T grey1"><?php echo $this->lang('dashboard_pages_txt_subcategory')?></div>
                                            <div><select name="pagesubcategory" id="pagesubcategory" class="boxinput withbox"></select></div>

                        					<div class="mrg10T grey1"><?php echo $this->lang('dashboard_pages_txt_titlepage')?>:</div>
                        					<div><input name="titlepage" type="text" id="titlepage" class="boxinput withbox" value="<?php echo $D->titlepage?>"/></div>

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

                                            <div id="msgerror" class="redbox"></div>
                                            <div id="msgok" class="yellowbox"></div>
                                            <div class="mrg10T mrg5B">
                                                <span><input type="submit" name="bsave" id="bsave" value="<?php echo $this->lang('dashboard_pages_update_txt_submitinfobasic')?>" class="bblue hand"/></span>
                                            </div>
                      
					                      </form>
                                        </div>
                                
                                    </div>
                                
                                
                                </div>                           
                            
								<script>
								var cpage = '<?php echo $D->codpage?>';                               
                                idcategory = <?php echo $D->idcategory?>;
                                idsubcategory = <?php echo $D->idsubcategory?>;
                                var msgccategories='<?php echo $this->lang('dashboard_pages_txt_choosecategory')?>';
                                var msgcsubcategories='<?php echo $this->lang('dashboard_pages_txt_choosesubcategory')?>';
                                loadcategorypages(idcategory, msgccategories, msgcsubcategories, '#pagecategory', '#pagesubcategory');
                                loadsubcategorypages(idcategory, idsubcategory, msgcsubcategories, '#pagesubcategory');
                                var txt_choose_category='<?php echo $this->lang('dashboard_pages_error_choosecategory')?>';
                                var txt_choose_subcategory='<?php echo $this->lang('dashboard_pages_error_choosesubcategory')?>';
                                var txt_enter_title='<?php echo $this->lang('dashboard_pages_error_entertitle')?>';
                                $('#bsave').click(function(){
                                    updatePage('#msgerror','#msgok','#bsave');
                                    return false;
                                });
    
                                </script>
                                
                                
                                <div id="formeditavatar" class="mrg40T">                                
                                
									<div class="editarea">
                                    
                                    	<div class="subtitle"><?php echo $this->lang('dashboard_pages_update_txt_avatarpage'); ?></div>
                    
                                        <div id="form02" class="mrg10B">
                                             <form id="form2" name="form2" method="post" action="">
                                             
                                             <div class="grey1 mrg10T"><?php echo $this->lang('dashboard_pages_update_txt_msgcaption')?></div>
                                             <div class="mrg10T"><img src="<?php echo $C->SITE_URL.$C->FOLDER_AVATAR_PAGES.'min4/'.(empty($D->avatar_page)?$C->AVATAR_DEFAULT_PAGE:$D->avatar_page)?>" id="prwimg" class="previewavatardash"></div>
                                             <div class="mrg10T mrg10B"><span id="linkUpImage" class="onlyblue bold hand"><?php echo $this->lang('dashboard_pages_update_txt_msg0')?></span></div>
                                             <div>
                                                <div id="areapreload" class="hide"><img src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/imgs/preload.gif"/></div>
                                                <input name="loadedimage" type="hidden" id="loadedimage" value="<?php echo $D->avatar_page?>" />
                                                <input name="didchanges" type="hidden" id="didchanges" value="0" />
                                             </div>
                    
                                            <div id="msgerror2" class="redbox"></div>
                                            <div id="msgok2" class="yellowbox"></div>
                                            <div class="mrg10T mrg5B">
                                                <input type="submit" name="bsave2" id="bsave2" value="<?php echo $this->lang('dashboard_pages_update_txt_submitavatar')?>" class="bblue hand"/>
                                            </div>
                    
                                             </form>
                                             
                                        </div>
                                
                                    </div>
                                
                                
                                </div>
                            
								<script>                                
								var page_avat_msg1 = '<?php echo $this->lang('dashboard_pages_update_txt_msg2')?>';
								var page_avat_msg2 = '<?php echo $this->lang('dashboard_pages_update_txt_msg1')?>';
								var page_avat_msg3 = '<?php echo $this->lang('dashboard_pages_update_txt_msg3')?>';
								var folderavatarspages = '<?php echo $C->FOLDER_AVATAR_PAGES?>';
								$('#linkUpImage').uploadImage(1,'<?php echo $C->FOLDER_TMP?>','_avpage_',page_avat_msg1,page_avat_msg2);
								$('#bsave2').click(function(){
									updateAvatarPage('#msgerror2', '#msgok2', '#bsave2');
									return false;
								});
                                </script>
                                
                                <div id="formeditcover" class="mrg40T">                                
                                
									<div class="editarea">
                                    
										<div class="subtitle"><?php echo $this->lang('dashboard_pages_update_txt_coverpage')?></div>
                                             
                                        <div id="form03" class="mrg10B">
                                             <form id="form3" name="form3" method="post" action="">
                                             
                                             <div class="grey1 mrg10T"><?php echo $this->lang('dashboard_pages_update_txt_msgcaption_cover')?></div>
                                             <div class="mrg10T"><img src="<?php echo !empty($D->cover_page)?$C->SITE_URL.$C->FOLDER_COVERS_PAGES.'min3/'.$D->cover_page:''?>" id="prwimgCov" class="previewCoverdash"></div>
                                             <div class="mrg10T mrg10B"><span id="linkUpCover" class="onlyblue bold hand"><?php echo !empty($D->cover_page)?$this->lang('dashboard_pages_update_txt_cover_msg1'):$this->lang('dashboard_pages_update_txt_cover_msg0')?></span></div>
                                             <div>
                                                <div id="areapreloadCv" class="hide"><img src="<?php echo $C->SITE_URL?>themes/<?php echo $C->THEME ?>/imgs/preload.gif"/></div>
                                                <input name="loadedcover" type="hidden" id="loadedcover" value="<?php echo $D->cover_page?>" />
                                                <input name="didchangescov" type="hidden" id="didchangescov" value="0" />
                                             </div>
                    
                                            <div id="msgerror3" class="redbox"></div>
                                            <div id="msgok3" class="yellowbox"></div>
                                            <div class="mrg10T mrg5B">
                                                <input type="submit" name="bsave3" id="bsave3" value="<?php echo $this->lang('dashboard_pages_update_txt_submitcover')?>" class="bblue hand"/>
                                            </div>
                    
                                             </form>
                                             
                                        </div>
                                         
                                    </div>                                
                                
                                </div>

								<script>                         
                                var page_cov_msg1 = '<?php echo $this->lang('dashboard_pages_update_txt_cover_msg3')?>';
                                var page_cov_msg2 = '<?php echo $this->lang('dashboard_pages_update_txt_cover_msg2')?>';
                                var page_cov_msg3 = '<?php echo $this->lang('dashboard_pages_update_txt_cover_msg4')?>';
                                var foldercoverspages = '<?php echo $C->FOLDER_COVERS_PAGES?>';
                                $('#linkUpCover').uploadCover(1,'<?php echo $C->FOLDER_TMP?>','_covpage_',page_cov_msg1,page_cov_msg2);
                                $('#bsave3').click(function(){
                                    updateCoverPage('#msgerror3','#msgok3','#bsave3');
                                    return false;
                                });
                                </script>
                                
                            </div>
                        
                    	</div>
                
                	</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');
?>