<?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_ads_title');?></div>
                        
                        <div class="spaceinfo">
                    
							<?php $this->load_template('__admin-smenu-ads.php');?>
                            
                            <div id="linkback" class="mrg10T linkblue">&laquo; <a href="<?php echo $C->SITE_URL?>admin/ads"><?php echo $this->lang('admin_txt_linkback')?></a></div>
                            
							<div class="mrg10T mrg30B">
                            
                            	<div id="prevad" class="editarea">
                                	<div class="subtitle"><?php echo $this->lang('admin_ads_userads_txt_aduser'); ?></div>
                                    <div class="preview-ad mrg10T">
                                    	<a href="<?php echo $D->ad->url_destination?>" target="_blank" class="undecorated">
                                        <?php if (!empty($D->ad->image)) { ?>
                                        <div class="imagead"><img src="<?php echo($C->SITE_URL.$C->FOLDER_ADS.$D->ad->image)?>"></div>
                                        <?php } ?>
                                    	<div id="headlineP" class="headline"><?php echo $D->ad->headline?></div>
                                        <div id="urlvisibleP" class="urlvisible"><?php echo $D->ad->url_visible?></div>
                                        <div id="descriptiveline1P" class="descriptiveline"><?php echo $D->ad->descriptionline1?></div>
                                        <div id="descriptiveline2P" class="descriptiveline"><?php echo $D->ad->descriptionline2?></div>
                                        </a>
                                    </div>
                                </div>
                            
                                <div id="formactivate">                                
                                
									<div class="editarea">
                                    
                                    	<div class="subtitle"><?php echo $this->lang('admin_ads_userads_actv_txt_title'); ?></div>
                    
			                            <div id="form01" class="mrg30B">
            			            		<form id="formPay" name="formPay" method="post" action="">
                                            <div>
                                                <div class="mrg10T grey1"><?php echo $this->lang('admin_ads_userads_actv_txt_typeplan')?>:</div>
                                                <div><select name="typeplan" id="typeplan" class="boxinput withbox" style="width:150px;" onChange="showTypePlan(this.value)">
                                                    <option value="1"><?php echo $this->lang('admin_ads_userads_actv_txt_typeplanimpre')?></option>
                                                    <option value="2"><?php echo $this->lang('admin_ads_userads_actv_txt_typeplanclics')?></option>
                                                </select></div>
                                                
                                                <div id="spacePimpress" class="hide mrg10T"><?php echo $D->htmlPlans1?></div>
                                                <div id="spacePclic" class="hide mrg10T"><?php echo $D->htmlPlans2?></div>
                                            </div>
                                            <div id="msgok" class="yellowbox"></div>
                                            <div id="msgerror" class="redbox"></div>
                                            <div class="mrg10T mrg5B">
                                                <span><input type="submit" name="bpaynow" id="bpaynow" value="<?php echo $this->lang('admin_ads_userads_actv_txt_assignplan')?>" class="bblue hand"/></span>
                                                <input name="valCPlan" type="hidden" id="valCPlan" value="">

                                            </div>
                      
					                      </form>
                                        </div>
                                
                                    </div>
                                
                                
                                </div>
                                
                            
								<script>
								function showTypePlan(typeP) {
									if (typeP == 1) {
										$('#spacePimpress').show('fast');
										$('#spacePclic').hide('fast');
									}
									if (typeP == 2) {
										$('#spacePclic').show('fast');
										$('#spacePimpress').hide('fast');
									}
									$('#valCPlan').val('');
									$("input[name=myPlan]").removeAttr("checked");
								}

								$("input[name=myPlan]").click(function () {
									$('#valCPlan').val($(this).val());
								});

								showTypePlan(1);

                                var txt_err_plan='<?php echo $this->lang('admin_ads_userads_actv_error_plan')?>';
								var codad = '<?php echo $D->ad->code?>';
								var idad = '<?php echo $D->ad->idad?>';
                                $('#bpaynow').click(function(){
                                    activateNow('#msgerror', '#msgok','#bpaynow');
                                    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');
?>