<?php $this->load->view('site/templates/header');  ?>
<?php  $this->load->view('site/community/templates/css_js_files.php'); ?>
<script src="js/jquery.validate.js"></script>    

<script>$(document).ready(function(){$("#addevent_form").validate(); });</script>
<script>
$(function(){
    $('.special_normal').click(function() {
	if($('#specialEventsyle').css('display')=='none'){
        $("#specialEventsyle").css('display','block');
		}else{
			 $("#specialEventsyle").css('display','none');
		}
    });
});
</script>
<style>
.error{
color:#FF0000!important;

}
</style>
<!--selection-->

    <script type="text/javascript" src="js/tinymce/jscripts/tiny_mce/jquery.tinymce.js"></script>
    <script type="text/javascript" src="js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>


<script type="text/javascript">
 $(function() {
tinyMCE.init({
				// General options
				mode : "specific_textareas",
				editor_selector : "addPostTiny",
				theme : "advanced",
				plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
				 
				// Theme options
				theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
				theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
				theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
				theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_statusbar_location : "bottom",
				theme_advanced_resizing : true,
				file_browser_callback : "ajaxfilemanager",
				relative_urls : false,
				// Example content CSS (should be your site CSS)
				content_css : "css/example.css",
				 
				// Drop lists for link/image/media/template dialogs
				template_external_list_url : "js/template_list.js",
				external_link_list_url : "js/link_list.js",
				external_image_list_url : "js/image_list.js",
				media_external_list_url : "js/media_list.js",
				 
				// Replace values for the template plugin
				template_replace_values : {
				username : "Some User",
				staffid : "991234"
				}
				});
});

function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = '<?php echo base_url() ?>js/tinymce/jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php';
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: '<?php echo base_url() ?>js/tinymce/jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php',
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
            
            return false;			
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "440";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;
		}
</script>
<!-- <script src="js/jquery.validate.js"></script>
<script>
 $(document).ready(function(){	
 	 $("#postForm").validate();
 });
 </script>-->

<section>
	
    	<div class="main">
        <div class="wrapper">
        <ul class="bread_crumbs">
        	<li> <a href="index.html" class="a_links"><?php if($this->lang->line('user_home') != '') { echo stripslashes($this->lang->line('user_home')); } else echo "Home"; ?></a></li>
               <span>&rsaquo;</span>
            <li> <a href="settings" class="a_links"><?php if($this->lang->line('comm_account') != '') { echo stripslashes($this->lang->line('comm_account')); } else echo "Your Account"; ?></a></li>
               <span>&rsaquo;</span>
            <li> <a href="manage-events" class="a_links"><?php if($this->lang->line('comm_events') != '') { echo stripslashes($this->lang->line('comm_events')); } else echo "Events"; ?></a></li>
            <span>&rsaquo;</span>
             <li> <a href="javascript:void(0);" class="a_links"><?php if($this->lang->line('com_addevent') != '') { echo stripslashes($this->lang->line('com_addevent')); } else echo "Add Event"; ?></a></li>
        </ul>
     <div class="clear"></div>
     <div class="hole_content">
      <div class="heading"><?php if($this->lang->line('com_eventst') != '') { echo stripslashes($this->lang->line('com_eventst')); } else echo "Eventst"; ?></div>
        	<?php  $this->load->view('site/community/community/community_control/blog_leftside.php'); ?>
            <div class="right_split">
            <div class="right_split">
             <?php $attributes = array('class' => 'form_container left_label', 'id' => 'addevent_form', 'enctype' => 'multipart/form-data');
							echo form_open_multipart('site/community/insertEvent',$attributes);
					?>
                    
             <div class="new_post_content" style="width:124%;">          
                 
                    <div class="cardinfo_div">
                    	<label><p class="teamnames"><?php if($this->lang->line('com_eventtitle') != '') { echo stripslashes($this->lang->line('com_eventtitle')); } else echo "Event Title"; ?></p><span style="color:#F00; margin: 0px;">*</span></label>
                        <input type="text" class="payment_txt required" name="eventTitle" id="eventTitle" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->eventTitle; }?>">
                    </div>
                   
                    <div class="cardinfo_div">
                    	<label><p class="teamnames"><?php if($this->lang->line('shop_description') != '') { echo stripslashes($this->lang->line('shop_description')); } else echo "Description"; ?></p><span style="color:#F00; margin: 0px;">*</span></label>
                        <textarea class="payment_area required" name="eventDescription" id="eventDescription"><?php if(!empty($eventsList)){ echo $eventsList->row()->eventDescription; } ?></textarea>
                    </div>
                    <div class="cardinfo_div">
                    	<label><?php if($this->lang->line('com_eventtype') != '') { echo stripslashes($this->lang->line('com_eventtype')); } else echo "Event Type"; ?></label>
                       <!-- <input name="rado" type="radio" value="Special" />-->
                      <div class="cardinfo_div" style="width:110px; float:left;">
                      
                      <input name="eventType" type="radio" value="Special" class="special_normal" style="margin-top:8px; float:left;" <?php if(!empty($eventsList)){ if($eventsList->row()->eventType=='Special'){?> checked="checked" <?php } } ?> />
                      <label style="width:60%; margin-right:0px;"><?php if($this->lang->line('com_special') != '') { echo stripslashes($this->lang->line('com_special')); } else echo "Special"; ?></label>
                     
                      </div>
                     
                       <div class="cardinfo_div" style="width:110px; float:left;">
                        <input name="eventType" type="radio" value="Normal" style="margin-top:8px; float:left;" class="special_normal"  <?php if(!empty($eventsList)){ if($eventsList->row()->eventType=='Normal'){?> checked="checked" <?php  } }else{ ?> checked="checked" <?php } ?> />
                        <label style="width:60%; margin-right:0px;  "><?php if($this->lang->line('com_normal') != '') { echo stripslashes($this->lang->line('com_normal')); } else echo "Normal"; ?></label>
                      </div>
                   </div>
                    <div class="cardinfo_div" id="specialEventsyle" <?php if(empty($eventsList)){ ?> style="display:none" <?php } ?> <?php if(!empty($eventsList)){ if($eventsList->row()->eventType=='Special'){?>  style="display:block" <?php } else{  ?> style="display:none"  <?php } ?> <?php  } ?>>
                    	<label><p class="teamnames"><?php if($this->lang->line('com_eventimage') != '') { echo stripslashes($this->lang->line('com_eventimage')); } else echo "Special Event Image"; ?></p><span style="color:#F00; margin: 0px;">*</span></label>
                        <input type="file" class="payment_txt <?php if(!empty($eventsList)){ if($eventsList->row()->imagePath==''){?> required <?php }} ?>" name="imagePath" id="imagePath" >
                    </div>
                    
                     <?php if(!empty($eventsList)){ if($eventsList->row()->eventType=='Special'){?> 
                      <div class="cardinfo_div" style="margin-left:180px;" >
                      
                     <img src="<?php echo base_url().EVENT_PATH.$eventsList->row()->imagePath; ?>" width="60px"  />
                     
                      </div>
                       <?php } } ?>
                       
                      <div class="cardinfo_div">
                    	<label><p class="teamnames"><?php if($this->lang->line('com_eventdate') != '') { echo stripslashes($this->lang->line('com_eventdate')); } else echo "Event Date"; ?></p><span style="color:#F00; margin: 0px;">*</span></label>
                         <input type="text" class="payment_txt datepicker required" name="eventDate" id="eventDate" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->eventDate; } ?>">
                        
                       
                    </div>
                    
                    <div class="cardinfo_div">
                    	<label><p class="teamnames"><?php if($this->lang->line('com_eventtime') != '') { echo stripslashes($this->lang->line('com_eventtime')); } else echo "Event Time"; ?></p><span style="color:#F00; margin: 0px;">*</span></label>
                         <input type="text" class="payment_txt required" name="eventTime" id="eventTime" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->eventTime; } ?>">
                         <div class="clear"></div>
                         <span style="font-size:11px; color:#F00; float:right; margin-right:110px"><?php if($this->lang->line('com_notetime') != '') { echo stripslashes($this->lang->line('com_notetime')); } else echo 'Note: Please enter the correct time format, For your reference  " 12:00am - 11:59pm EST "'; ?></span>
                 </div>
                 
                  <div class="cardinfo_div">
                    	<label><?php if($this->lang->line('com_buttonname') != '') { echo stripslashes($this->lang->line('com_buttonname')); } else echo "Event Button Name"; ?></label>
                         <input type="text" name="eventButtonName" class="payment_txt" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->eventButtonName; } ?>" >
                   </div>
                   <div class="cardinfo_div">
                    	<label><?php if($this->lang->line('com_eventbutton') != '') { echo stripslashes($this->lang->line('com_eventbutton')); } else echo "Event Button Link"; ?></label>
                         <input type="text" name="eventLink" class="payment_txt" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->eventLink; } ?>">
                         <div class="clear"></div>
                         <span style="font-size:11px; color:#F00; float:right; margin-right:420px"><?php if($this->lang->line('com_note') != '') { echo stripslashes($this->lang->line('com_note')); } else echo 'Note: starts with "http://"'; ?></span>
                   </div>
                   <div class="cardinfo_div">
                    	<label><?php if($this->lang->line('com_location') != '') { echo stripslashes($this->lang->line('com_location')); } else echo "Location"; ?></label>
                         <input type="text" name="eventLocation" class="payment_txt">
                   </div>
                    <input type="hidden" name="event_id" value="<?php if(!empty($eventsList)){ echo $eventsList->row()->id; } ?>" />
                    <input type="submit" value="<?php if($this->lang->line('user_submit') != '') { echo stripslashes($this->lang->line('user_submit')); } else echo "SUBMIT"; ?>" class="create_btn_1">
               </div>  
               
             
                     
                </form>                     
            <!--rightsplit-->
            </div>
            </div>
            </div>
            </div>
        </div>
     </div>
</section>
<!--selection-->

<link rel="stylesheet" href="css/jquery.ptTimeSelect.css" type="text/css" />
<script language="javascript" src="js/jquery.ptTimeSelect.js"></script>
<link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="js/1.8.24-jquery-ui.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
	    $("#eventDate").datepicker({ dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true, minDate:0  }).val()
    });
</script>

<?php $this->load->view('site/templates/footer');  ?>