"#C0C0C0","Background color" => "#808080","Body text color" => "#000000","Caption color" => "#FFFFFF","Width" => "200","Height" => "-1",); $hint_for_invis=TRUE; $noevents_msg=''; $location_label='Location'; $cal_size="small"; $def_view_param=1; if($def_view_param==2) { $def_view=3; } elseif ($def_view_param==3) { $def_view=6; } elseif ($def_view_param==4) { $def_view=12; } else { $def_view=1;} $em_enabled=FALSE; //event manager $em_show_participants= FALSE; $rss_settings=array("Title" => "Type title here...","Description" => "Type description here...","Language" => "en-us","Copyright" => "","Managing editor" => "","Webmaster" => "","Category" => "","Category domain" => "","Cloud domain" => "","Cloud port" => "","Cloud path" => "","Cloud reg proc" => "","Cloud protocol" => "","TTL" => "","Rating" => "","Skip hours" => "","Skip days" => "","Text input title" => "","Text input description" => "","Text input name" => "","Text input link" => "","Image" => ""); // RSS settings $max_items_in_rss=0; $max_lines_in_rss_desc=0; $hide_expired_in_rss=true; $include_date_in_rss_desc=false; $page_charset='iso-8859-1'; $utf_fl=(strpos(strtolower($page_charset),'utf')!==false? true: false); $month_name=$f_month_names; $day_name=$f_day_names; $db_fields='"Id","Short_description","Category","Details","Start_date","End_date","Location"'.$f_lf; //%%HIDDEN,%%DLINE,%%USER-Loc; %%TEMPLATE1%%-Decs $db_fields_recur= '"Id","Short_description","Category","Details","Start_date","End_date","Location","recurType","repeatEvery","repeatPeriod","stopAfter"'.$f_lf; $db_fields_reg='"Event_id","User","Timestamp","Notes"'.$f_lf; $css_event=array('customstyle'=>'event','border-style'=>'BS_EVENT','border-color'=>'BC_EVENT','height'=>'EVENTS_HEIGHT'); $css_calendar=array('customstyle'=>'calendar','border-style'=>'BS_CAL','border-color'=>'BC_CAL'); $css_day1=array('customstyle'=>'day1 '.$cal_size,'color'=>'FC_DAY1','background-color'=>'BC_DAY1','font-size'=>'FS_'.strtoupper($cal_size)); $css_day2=array('customstyle'=>'day2 '.$cal_size,'color'=>'FC_DAY2','font-size'=>'FS_'.strtoupper($cal_size)); $css_day3=array('customstyle'=>'day3 '.$cal_size,'color'=>'FC_DAY3','background-color'=>'BC_DAY3','font-size'=>'FS_'.strtoupper($cal_size)); $css_currday=array('customstyle'=>'currday '.$cal_size,'color'=>'FC_CURRDAY'); $css_currdayempty=array('customstyle'=>'currdayempty '.$cal_size, 'color'=>'FC_CURRDAY','background-color'=>'BC_CURRDAY'); $css_calh1=array('customstyle'=>'calh1 '.$cal_size,'color'=>'FC_CALH1','background-color'=>'BC_CALH1','border-style'=>'BORST_CALH1', 'border-color'=>'BORCOL_CALH1','font-size'=>'FS_'.strtoupper($cal_size)); $css_calh2=array('customstyle'=>'calh2 '.$cal_size,'color'=>'FC_CALH2','background-color'=>'BC_CALH2','border-style'=>'BORST_CALH2', 'border-color'=>'BORCOL_CALH2','font-size'=>'FS_'.strtoupper($cal_size)); $css_desc=array('customstyle'=>'desc','color'=>'FC_DESC','background-color'=>'BC_DESC','font-size'=>'FS_DESC'); $css_date=array('customstyle'=>'date','color'=>'FC_DATE','font-size'=>'FS_DATE'); $css_details=array('customstyle'=>'details','color'=>'FC_DETAILS','background-color'=>'BC_DETAILS','font-size'=>'FS_DETAILS'); $css_calurl=array('customstyle'=>'calurl '.$cal_size.'url','color'=>'FC_CURRDAYURL'); $css_currdayurl=array('customstyle'=>'currdayurl','color'=>'FC_CURRDAY'); $cal_css=''Year','1'=>'Month','2'=>'Week'); $lang_l=array('add event'=>'add event','edit event'=>'edit event','short description'=>'short description','category'=>'category', 'details'=>'details','location'=>'location','start date'=>'start date','end date'=>'end date', 'start time'=>'start time','end time'=>'end time', 'once'=>'once','repeat every'=>'repeat every','week'=>'week','month'=>'month', 'year'=>'year','submit'=>'save','cancel'=>'cancel','delete'=>'delete', 'delete MSG'=>'Are you sure you want to delete this event?','go'=>'go','no events'=>'no events','logout'=>'logout','login'=>'login','back to ca'=>'CENTRAL ADMIN','login admin'=>'calendar administrator login','change username'=>'change username&password','username'=>'username','password'=>'password', 'repeat password'=>'repeat password','short description field is required'=>'"Short Description" field is required','start date should not exceed end date'=>'"Start date" should not exceed "End date"','start year should match end year'=>'"Start year" should match "End year"','start year&month should match end year&month'=>'"Start year&month" should match "End year&month"','start date should match end date'=>'"Start date" should match "End date"','fill in both fields'=>'please, fill in both fields','incorrect username/password'=>'incorrect username/password','can contain only'=>'username can contain only A-Z, a-z, _ and 0-9','password and repeated password'=>'password and repeated password don\'t match','your password should be'=>'your password should be at least five symbols','it is recommended'=>'it is recommended to change your username&password','hidden info'=>'hidden info','save as template'=>'save as template','settings saved'=>'settings saved','language'=>'language','hide past'=>'hide past events','show past'=>'show past events', 'deadline err msg'=>'"Deadline" is after "Start Date", please check dates and try again!','status'=>'status','expired'=>'expired','open'=>'open', 'closed'=>'closed for registration','register'=>'register','unregister'=>'unregister', 'events list'=>'events list','em'=>'event manager','my account'=>'my account','settings'=>'settings','change password'=>'change password','edit profile'=>'edit profile','edit'=>'edit', 'deadline'=>'deadline','mailing'=>'mailing','author'=>'author','total attendee'=>'total participants','my registration'=>'my registration', 'notes'=>'notes','type notes'=>'Type your notes here','click here'=>'click here to see all participants','unregister MSG'=>'Are you sure you want to unregister user','cancel MSG'=>'Are you sure you want to cancel your registration for','mail type'=>'mail type','mail subject'=>'mail subject', 'message'=>'message','users'=>'users','send to'=>'send to','subscribed for'=>'Users subscribed for','registered for'=>'Users REGISTERED for this event','all users'=>'all users','admin only'=>'administrator only','users list'=>'users list','selected'=>'selected','file attachment'=>'file attachment','send'=>'send','notification'=>'notification','success registered MSG'=>'You have successfully registered.','success edit MSG'=>'Your registration info was edited successfully.','success cancel MSG'=>'Your registration was cancelled successfully.','dear'=>'dear','cancel my registration'=>'cancel my registration','registration date'=>'registration date','logged as admin MSG'=>'You are logged as Administrator. Log as different user for registration, edit or cancelation.','already registered'=>'You have ALREADY REGISTERED for this event.','details follow'=>'Your registration details follow','register event MSG'=>'If you want to register to the following event, please use the SUBMIT button at the bottom to confirm.','edit registration MSG'=>'If you want to edit or cancel your registration, press=If you want to edit or cancel your registration, press','cant register MSG1'=>"You can't register for this event.",'cant register MSG2'=>"You can't register for event with status CLOSED for registration.",'cant edit MSG'=>'Registration edit is not allowed for EXPIRED events.','cant cancel MSG'=>'Registration cancelation is not allowed for EXPIRED events.','cant edit/cancel MSG'=>'Registration edit/cancelation is not allowed for EXPIRED events.','to edit MSG'=>'If you want to change your notes, edit content of Notes box and then press EDIT button to apply.','to cancel MSG'=>'If you want to cancel your registration, use CANCEL MY REGISTRATION button.','not recommended MSG'=>'It is not recommended to edit/cancel registration after its deadline.','to register MSG'=>'To register for this event, press','none users'=>'NONE users were selected for registration.','users regsitered MSG'=>'User(s) successfully registered.','users unregsitered MSG'=>'User unregistered successfully.','mail sent MSG'=>'Mail was sent successfully.','explanations'=>'Use %short_description%, %category%, %details, %location%,'.$f_br.'%date%, %time% and %deadline% for event info.'.$f_br.'Use %username%, %name%, %sirname%, %email% for user info.','public rss'=>'public RSS in protected Calendar','manage categories'=>'manage categories','name'=>'name','invisible'=>'invisible in events table','mark'=>'mark','mark msg'=>'mark days in calendar with','add category'=>'add new category','cat err msg'=>'You have to set both Name and Color for the category.','del category msg'=>'Are you sure you want to delete this category?'); $available_lang_sets=array('CS'=>'Czech','NL'=>'Dutch','EN'=>'English','FR'=>'French','DE'=>'German','HE'=>'Hebrew','NO'=>'Norwegian','PT'=>'Portuguese','RU'=>'Russian','SL'=>'Slovenian', 'ES'=>'Spanish'); $page_lang=f_read_tagged_data($cal_settings_fname, 'language'); if($page_lang!='' && $page_lang!='EZG') $lang_set=strtoupper($page_lang); elseif(isset($_REQUEST['lang'])) $lang_set=strtoupper($_REQUEST['lang']); else $lang_set='EN'; $lg_=($lang_set=='EN'?'':'lang='.$lang_set); $lang_set_results=f_read_lang_set($lang_set_fname, $page_lang, 'calendar', $period_list); if(isset($lang_set_results['day_name'])) $day_name=$lang_set_results['day_name']; if(isset($lang_set_results['month_name'])) $month_name=$lang_set_results['month_name']; if(isset($lang_set_results['period_list'])) $period_list=$lang_set_results['period_list']; if(isset($lang_set_results['repeatPeriod_list'])) $repeatPeriod_list=$lang_set_results['repeatPeriod_list']; if(isset($lang_set_results['lang_l'])) $lang_l=$lang_set_results['lang_l']; $admin_emails='your@email.com'; $admin_emails=(get_magic_quotes_gpc()? stripslashes($admin_emails): $admin_emails); $admin_emails_array=split("[;]", $admin_emails); $admin_email=$admin_emails_array[0]; if($f_sendmail_from!='') { ini_set('sendmail_from', $f_sendmail_from); } $mails_list=array('EA'=>'Event Announcement','ECA'=>'Event Change Announcement','ER'=>'Event Reminder','AG'=>'Agenda','RConf'=>'Registration Confirmation','RCancel'=>'Registration Cancelation','RChange'=>'Registration Change','GE'=>'Generic'); $RConf_subject="Registration Confirmation for %short_description%"; $RConf_message="Dear %name% %sirname%,".$f_br.$f_br."This e-mail confirms your registration for the following event:".$f_br."Event Name: %short_description%".$f_br."Category: %category%".$f_br."Details: %details%".$f_br."Location: %location%".$f_br."Date(s): %date%".$f_br."Time: %time%".$f_br.$f_br."Your registration info:".$f_br."Date: %register_date%".$f_br."Notes: %notes%".$f_br.$f_br."For further information contact:".$f_br.$admin_email; $RCancel_subject="Registration Cancelation for %short_description%"; $RCancel_message="Dear %name% %sirname%,".$f_br.$f_br."This e-mail confirms your cancelation for the following event:".$f_br."Event Name: %short_description%".$f_br."Category: %category%".$f_br."Details: %details%".$f_br."Location: %location%".$f_br."Date(s): %date%".$f_br."Time: %time%".$f_br.$f_br."Your registration info:".$f_br."Date: %register_date%".$f_br."Notes: %notes%".$f_br.$f_br."For further information contact:".$f_br.$admin_email; $RChange_subject="Registration Change for %short_description%"; $RChange_message="Dear %name% %sirname%,".$f_br.$f_br."This e-mail confirms your registration change for the following event:".$f_br."Event Name: %short_description%".$f_br."Category: %category%".$f_br."Details: %details%".$f_br."Location: %location%".$f_br."Date(s): %date%".$f_br."Time: %time%".$f_br.$f_br."Your registration info:".$f_br."Date: %register_date%".$f_br."Notes: %notes%".$f_br.$f_br."For further information contact:".$f_br.$admin_email; $EA_subject="Announcement for %short_description%"; $EA_message="Dear %name% %sirname%,".$f_br.$f_br."You have requested to be informed for '%category%' events. ".$f_br."This e-mail is to announce the following event:".$f_br."Event Name: %short_description%".$f_br."Category: %category%".$f_br."Details: %details%".$f_br."Location: %location%".$f_br."Date(s): %date%".$f_br."Time: %time%".$f_br.$f_br."If you want to register for this event, visit our site at %calendarurl%.".$f_br."Deadline for registration: %deadline%".$f_br.$f_br."For further information contact:".$f_br.$admin_email; $ECA_subject="Event Change Announcement for %short_description%"; $ECA_message="Dear %name% %sirname%,".$f_br.$f_br."You have requested to be informed for '%category%'. ".$f_br."This e-mail is to announce change for the following event:".$f_br."Event Name: %short_description%".$f_br."Category: %category%".$f_br."Details: %details%".$f_br."Location: %location%".$f_br."Date(s): %date%".$f_br."Time: %time%".$f_br.$f_br."If you want to register for this event, visit our site at %calendarurl%.".$f_br."Deadline for registration: %deadline%".$f_br.$f_br."0) { j=l.options.length; } ' .'for(i=0; i0) { j=r.options.length; } ' .'for(i=0; i'; $js_innova= << MSG; $innova_def= << var oEdit1=new InnovaEditor("oEdit1"); oEdit1.width="100%";oEdit1.height="200px"; oEdit1.tabs=[["tabHome","",["gEdit","gFont","gPage","gPara","gLinks"]]]; oEdit1.groups=[["gEdit","",["Undo","Redo","Line","BRK","Cut","Copy","Paste"]], ["gFont","",["FontName","FontSize","BRK","Bold","Italic","Underline","Strikethrough","ForeColor","BackColor"]], ["gPage","",["Numbering","Bullets","BRK","Indent","Outdent"]], ["gPara","",["Paragraph","BRK","JustifyLeft","JustifyCenter","JustifyRight","JustifyFull"]], ["gLinks","",["Hyperlink","Image","Characters","BRK","Table","ClearAll"]]]; oEdit1.arrStyle=[["BODY",false,"","font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;background: #FFFFFF;"],["a",false,"","font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#ff8000;margin:0px;"],["p",false,"","text-indent:0px;padding:0px;margin:0px;"],["h1",false,"","font: bold 19px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h2",false,"","font: bold 16px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h3",false,"","font: bold 15px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h4",false,"","font: bold 12px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h5",false,"","font: bold 11px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h6",false,"","font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"],["h6",false,"","font: 11px Verdana, Geneva, Arial, Helvetica, sans-serif;color:#000000;margin:0px;"]]; oEdit1.cmdAssetManager="modalDialogShow('../assetmanager/assetmanager.php?lang=english&root=../documents/',640,465)"; oEdit1.customColors=["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"]; oEdit1.mode="HTMLBody"; oEdit1.REPLACE("htmlarea"); MSG; $read_access=false; $browse_with_events=true; $admin_actions=array('addevent','index','mng_settings','setmailing','editevent','delevent','saveevent','mailing','mng_categories','del_category', 'edit_category','add_category'); $tzone_offset=f_read_tagged_data($cal_settings_fname, 'tzoneoffset'); function show_calendar($action_id,$ms='') // Calendar User Mode { global $page_id,$cal_template_fname,$db_fname,$doc_dir,$s_path,$rel_path,$category_id,$category_name,$month_name,$def_view,$cal_css, $date_params,$lang_l,$lg_,$f_js_end,$f_js_st; if(in_array($action_id,array("show","showcal","showevents","showcaljs","showeventsjs"))) $flag="user"; else $flag='admin'; $current_date=my_mktime(); $nav_bar_mon=date('n',$current_date); settype($nav_bar_mon,'integer'); $nav_bar_year=date('Y',$current_date); settype($nav_bar_year,'integer'); if(!in_array($action_id,array("showcal","showevents","showcaljs","showeventsjs"))) { $data=f_read_file($cal_template_fname); $date_params=f_GFS($data,'%DATEFORMAT(',')%'); $data=str_replace('%DATEFORMAT('.$date_params.')%','',$data); } if(isset($_GET['view'])) $view_type=$_GET['view']; elseif(isset($_POST['view_type'])) $view_type=$_POST['view_type']; else $view_type=$def_view; settype($view_type, 'integer'); // set of month/week flag $month_mode=(isset($_GET['mode']) && $_GET['mode']=='month'); $week_mode=(isset($_GET['mode']) && $_GET['mode']=='week'); if(isset($_GET['mode'])) $mode=$_GET['mode']; else $mode=null; $range_or_period='period'; $range_msg=''; $selected_period=0; if(isset($_POST['period']) || isset($_GET['period'])) $period=(isset($_POST['period'])?$_POST['period']:$_GET['period']); if(isset($period) && ($period==0 || $period==4)) $week_mode=true; if(isset($period) && ($period==1 || $period==7)) $month_mode=true; if(isset($period) && $period==7) $nav_bar_mon=$nav_bar_mon+1; if(isset($period) && $period==2) { if(in_array($nav_bar_mon, array(3,6,9,12))) $nav_bar_mon-=1; elseif(in_array($nav_bar_mon, array(1,4,7,10))) $nav_bar_mon+=1; $view_type=3; } if(isset($period) && $period==8) { if(in_array($nav_bar_mon,array(3,6,9,12))) $nav_bar_mon-=1; elseif(in_array($nav_bar_mon,array(1,4,7,10))) $nav_bar_mon+=1; $nav_bar_mon=$nav_bar_mon+3; if($nav_bar_mon>12) $nav_bar_mon-=12; $view_type=3; } if(isset($period) && $period==3) $view_type=12; if(isset($period) && $period==9) {$nav_bar_year=$nav_bar_year+1;$view_type=12;} if(isset($_POST['range_or_period']) && $_POST['range_or_period']=='range') { $range_or_period='range'; $view_type=$def_view; $month_mode=false; $week_mode=false; settype($view_type, 'integer');} // check for month/year selector if(isset($_GET['mon'])) // on "<<" or ">>" press { $nav_bar_mon=$_GET['mon']; $nav_bar_year=$_GET['year']; } elseif(isset($_GET['selected_mon'])) // on 'GO' button press - month/year selection { $selected_month=$_GET['selected_mon']; $selected_mon=array_search($selected_month, $month_name); $nav_bar_mon=$selected_mon+1; $nav_bar_year=$_GET['selected_year']; } elseif(isset($_GET['event_id'])) // search events - needed in EZG search { $event_id=$_GET['event_id']; $res_record=db_get_specific_event($db_fname,$event_id); $nav_bar_mon=date('n',$res_record['Start_date']); $nav_bar_year=date('Y',$res_record['Start_date']); } if($nav_bar_year<1950) $nav_bar_year=1950; elseif($nav_bar_year>2050) $nav_bar_year=2050; // view type if($view_type==1 || $month_mode || $week_mode) //1-month view { $months=array($nav_bar_mon); $years=array($nav_bar_year); } elseif($view_type==3) //3-months view { if($nav_bar_mon==1) { $months=array(12,1,2); $years=array($nav_bar_year-1,$nav_bar_year,$nav_bar_year); } elseif($nav_bar_mon==12) { $months=array(11,12,1); $years=array($nav_bar_year,$nav_bar_year,$nav_bar_year+1); } else { $months=array($nav_bar_mon-1,$nav_bar_mon,$nav_bar_mon +1); $years=array($nav_bar_year,$nav_bar_year,$nav_bar_year); } } elseif($view_type==6) //6 months view { if($nav_bar_mon<=6) $months=range(1,6); else $months=range(7,12); $years=array($nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year); } elseif($view_type==12) //12 months view { $months=range(1,12); $years=array($nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year,$nav_bar_year, $nav_bar_year,$nav_bar_year,$nav_bar_year); } // range & period selection if(!isset($_POST['range_or_period']) && !isset($_GET['period'])) { $fdayperiod_ts=mktime(0,0,0,$months[0],1,$years[0]); $ldayperiod_ts=mktime(23,59,59,$months[count($months)-1],days_in_month($months[count($months)-1], $years[count($years)-1]),$years[count($years)-1]); } else { $t=define_range_period($range_or_period,$nav_bar_mon,$current_date); $fdayperiod_ts=$t[0]; $ldayperiod_ts=$t[1]; $selected_period=$period; if(isset($period) && ($period==0 || $period==4)) { $week_mode_st_day=date('j',$fdayperiod_ts); if($period==0 && $week_mode_st_day>date('j',my_mktime())) $nav_bar_mon -=1; } if($range_or_period=='range' && $fdayperiod_ts>$ldayperiod_ts) { $fdayperiod_ts=mktime(0,0,0,$months[0],1,$years[0]); $ldayperiod_ts=mktime(23,59,59,$months[count($months)-1],days_in_month($months[count($months)-1], $years[count($years)-1]),$years[count($years)-1]); $range_msg='Start date CAN NOT be > end date'; } } if(isset($_GET['startday'])) { $week_mode_st_day=$_GET['startday']; } // calendar build $events_records=db_get_events_raw($fdayperiod_ts,$ldayperiod_ts,$flag); if(isset($events_records[0]['Category'])) { $category_id_temp=array(); foreach($category_id as $k=>$v) $category_id_temp[]="$v"; if(in_array($events_records[0]['Category'],$category_name) || !in_array($events_records[0]['Category'],$category_id_temp) || (!isset($events_records[0]['Location']))) { category_conversion(); } $events_records=db_get_events_raw($fdayperiod_ts,$ldayperiod_ts,$flag); } $cal_html=($ms!=''?'
'.$ms.'
':'').''; for($i=0; $i)','%CALENDAR_OBJECT%',$data); $data=preg_replace('()','%CALENDAR_EVENTS%',$data); $data=f_obj_div_replacing('%CALENDAR_OBJECT%',$data); $data=f_obj_div_replacing('%CALENDAR_RANGE_SELECTION%',$data); $data=f_obj_div_replacing('%CALENDAR_SELECTION%',$data); $data=f_obj_div_replacing('%CALENDAR_EVENTS%',$data); $data=f_obj_div_replacing('%CALENDAR_EVENTS_INVISIBLE%',$data); if(strpos($data,''; $output.='
'.f_build_select("dayFrom", $days_in_month_array, $st_day, '', 'value') .f_build_select("monthFrom", $month_name, $month_name[$st_mon-1], '', 'value').f_build_select("yearFrom", $years_array, $st_year, '', 'value').'
'; $output.=f_build_select("dayTo", $days_in_month_array, $end_day, '', 'value') .f_build_select("monthTo", $month_name, $month_name[$end_mon-1], '', 'value').f_build_select("yearTo", $years_array, $end_year, '', 'value').'
' .'
'; return $output; } function viewtype_bar($action_id,$mon,$year,$selected_view=1) //calendar cal view type bar { global $s_path,$month_name,$years_array,$lg_; $output=''; return $output; } function navigation_bar($action_id_orig,$mon,$year,$type,$selected_view=1,$flag='external',$mode=null,$start_day=null) //calendar navigation { global $s_path,$month_name,$years_array,$lg_,$f_ct; $output=''; if($action_id_orig=='showcaljs' || $action_id_orig=='showeventsjs') { $action_id='show'; } else { $action_id=$action_id_orig; } //if( || $mode=='month') //$selected_view!=12 && $selected_view!=6 //{ $prev_mon=$mon-1; $prev_year=$year; $next_mon=$mon+1; $next_year=$year; if($mon==1 && $year>1950) { $prev_mon=12; $prev_year=$year-1; } elseif($mon==1 && $year<=1950) { $prev_mon=1; $prev_year=1950; } elseif($mon==12 && $year<2050) { $next_mon=1; $next_year=$year+1; } elseif($mon==12 && $year>=2050) { $next_mon=12; $next_year=2050; } if($selected_view==6 && $mon<=6) { $prev_mon=7; $prev_year=($year>1950? $year-1: 1950); $next_mon=7; $next_year=$year;} if($selected_view==6 && $mon>6) { $prev_mon=1; $prev_year=$year; $next_mon=1; $next_year=($year<2050? $year+1: 2050);} if($selected_view==12) { $prev_mon=1; $prev_year=($year>1950? $year-1: 1950); $next_mon=1; $next_year=($year<2050? $year+1: 2050);} if($mode=='week') { $prev_ts=$start_day-7*24*60*60; $next_ts=$start_day+7*24*60*60; $prev_mon=date('n', $prev_ts); $prev_year=date('Y', $prev_ts); $next_mon=date('n', $next_ts); $next_year=date('Y', $next_ts); } if($mode=='month') { $mode_param_prev='&mode=month'; $mode_param_next='&mode=month'; } elseif($mode=='week') { $mode_param_prev="&mode=week&startday=".date('j',$prev_ts); $mode_param_next="&mode=week&startday=".date('j',$next_ts); } $output='"; $cal_html.='
'; // displaying weekday names foreach (($f_day_ofweek==1?$day_name:$day_name_rev) as $k=>$v) { $cal_html.=""; } $cal_html.=($month_mode && !$excl_link_flag? '':'').""; $cal_html.=''; // displaying last days from previous month if($firstday!=0 || ($mon==2 && days_in_month($mon,$year)==28)) { if($mon==1) $days_prev_mon=days_in_month(12,$year); else $days_prev_mon=days_in_month(($mon-1),$year); if($firstday!=0) { $t=$days_prev_mon-$firstday+1; for($i=0; $i<$firstday; $i++){$cal_html.="";$t++;} } else { $t=$days_prev_mon-6; for($i=0; $i<7; $i++){$cal_html.="";$t++;} $cal_html.=''; } } for ($i=1; $i<=days_in_month($mon,$year); $i++) // displaying days from selected month { if($cal_pointer>6) { $cal_pointer = 0; if($month_mode && !($action_id_orig=='showcaljs' && isset($_GET['link']) && $_GET['link']=='0') ) $cal_html.=''; $cal_html.=''; $row_counter++; } if(array_key_exists(($i), $bg_colors)) { $day_bgcolors=$bg_colors[$i]; $events_per_day=(isset($events_per_period[$i])? implode("",$events_per_period[$i]): ""); if(cur_day_check($i,$mon,$year)) $cal_html.=""; } else { if(cur_day_check($i,$mon,$year)) { $cal_html.="'; } $cal_pointer++; } $next_month_days=1; // displaying first days from next month while($cal_pointer<=6) { $cal_html.=""; $next_month_days++; $cal_pointer++; } if($month_mode && !$excl_link_flag) $cal_html.=''; $cal_html.=""; $row_counter++; if($row_counter<6) { $cal_html.=""; $cal_pointer=0; while($cal_pointer<=6) { $cal_html.=""; $next_month_days++; $cal_pointer++; } if($month_mode && !$excl_link_flag) { $cal_html.=''; } $cal_html.=""; } $cal_html.="
'; if($excl_link_flag) { $cal_html.='
'.$month.' '.$year.'
'; } else { if($internal_nav==true) { $cal_html.='
'.$nav_prev.'
'; $cal_html.='
':'76%">'; $cal_html.=$month.' '.(strlen($month)>10?substr($year,2,2):$year).'
'; $cal_html.='
'.$nav_next.'
'; } else { $cal_html.='
':'100%">'; $cal_html.=$month.' '.$year.'
'; } if($flag=='user') { $cal_html.='
'; $cal_html.='
'; } } $cal_html.='
".($month_mode==true? $v: f_my_substr($v,0,1,$utf_fl))." 
$t$t
1) // visibility { if(season_check($day_bgcolors)==true && count(num_vis_category($day_bgcolors))==1) $clr=current(num_vis_category($day_bgcolors)); else $clr=$category_color[0]; } else $clr=current($day_bgcolors); $cal_html.=' bgcolor="'.$clr.'"'; if($flag=="user" && !$month_mode) { if($events_per_day!="") { if($action_id_orig=='showcaljs') { $buff=str_replace(array('\\"','"',$f_lf,chr(13)), array('"','"',' ',' '), $events_per_day); $buffer=htmlspecialchars(str_replace(array('\\"','"','\'','/',$f_lf,chr(13)),array('"','"','\\\'','\/',' ',' '),$buff), ENT_QUOTES); $cal_html.=" onmouseover=\"return overlib(\'".$buffer ."\',CAPTION,\'".$month_name[date('n', mktime (0, 0, 0, $mon, $i, $year))-1]. date(' j, Y', mktime (0, 0, 0, $mon, $i, $year))."\', TEXTCOLOR, \'".$hint_settings['Body text color']."\',BGCOLOR,\'".$hint_settings['Background color']."\',FGCOLOR,\'".$hint_settings['Frame color']."\', CAPCOLOR,\'" .$hint_settings['Caption color']."\',WIDTH,\'".$hint_settings['Width']."\',HEIGHT,\'".$hint_settings['Height']."\',RIGHT);\" onmouseout=\"nd();\""; } else { $buff=str_replace(array('\\"','\'','\\\\',$f_lf,chr(13)), array('"','\\\'','\\',' ',' '),$events_per_day); $buffer=htmlspecialchars($buff, ENT_QUOTES); $cal_html.=' onmouseover="return overlib(\''.$buffer ."',CAPTION,'".$month_name[date('n',mktime(0,0,0,$mon,$i,$year))-1].date(' j, Y', mktime (0, 0, 0, $mon, $i, $year))."', TEXTCOLOR, '".$hint_settings['Body text color']."',BGCOLOR,'".$hint_settings['Background color']."',FGCOLOR,'".$hint_settings['Frame color']."', CAPCOLOR,'".$hint_settings['Caption color']."',WIDTH,'".$hint_settings['Width']."',HEIGHT,'".$hint_settings['Height'].'\',RIGHT);" onmouseout="nd();"'; } } } $cal_html.='>'; if($flag!="user") { $cal_html.="'; } if($count_bgcolors>=1) { if($count_bgcolors==1) $index=array_search($day_bgcolors[0],$category_color); else $index=0; if(isset($category_mark[$index]) && $index!==false && $category_mark[$index]!='NA') { if($cal_size=='small') { $pos='top:-5px;left:1px;'; $sz='18'; } elseif($cal_size=='medium') { $pos='top:-8px;left:0px;'; $sz='22'; } else { $pos='top:-11px;left:-1px;'; $sz='26'; } $m_color=(isset($category_mark_color[$index]) && !empty($category_mark_color[$index])? $category_mark_color[$index]:'#ffffff'); $cal_html.='
'.$i.'
'.$category_mark[$index].'
'; } else $cal_html.=$i; } else $cal_html.=$i; if($flag!="user") $cal_html.="
"; $cal_html.=($month_mode==true? $f_br.''.$events_per_day.'':'')."
"; } else {$cal_html.=""; } if($flag=="admin") { $cal_html.="'.$i.''; } else $cal_html.=$i; $cal_html.='$next_month_days
$next_month_days
"; return $cal_html; } //BUILD CALENDAR WEEK TABLE function build_week($events_raw,$action_id_orig,$mon,$year,$flag,$start_day) { global $s_path,$cal_dir,$time_format,$day_name,$month_name,$category_color,$f_day_ofweek, $f_lf, $lg_, $f_br, $f_ct; global $css_event,$css_calendar,$css_day1,$css_day2,$css_day3,$css_currday,$css_currdayempty,$css_calh1,$css_calh2; global $css_desc,$css_date,$css_details,$css_calurl,$css_currdayurl,$hint_settings,$week_mode_wh_only, $utf_fl; if($action_id_orig=='showcaljs') { $action_id='show'; } else { $action_id=$action_id_orig; } $hours12_array=array('0:00am','1:00am','2:00am','3:00am','4:00am','5:00am','6:00am','7:00am','8:00am','9:00am','10:00am','11:00am','12:00pm', '1:00pm','2:00pm','3:00pm','4:00pm','5:00pm','6:00pm','7:00pm','8:00pm','9:00pm','10:00pm','11:00pm'); $hours_array=array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23'); if ($time_format==12) $h_array=$hours12_array; else $h_array=$hours_array; $mode='week'; $url_p="&".$lg_.'&mon='.$mon.'&year='.$year; settype($start_day, 'integer'); $fdaymonth_ts=mktime(0,0,0,$mon,$start_day,$year); if(($start_day+6)>days_in_month($mon,$year)) { $start_day_fixed=$start_day+6-days_in_month($mon,$year); if($mon==12) $ldaymonth_ts=mktime(23,59,59,1,$start_day_fixed,$year+1); else $ldaymonth_ts=mktime(23,59,59,$mon+1,$start_day_fixed,$year); } else { $ldaymonth_ts=mktime(23,59,59,$mon,$start_day+6,$year); } $event_records=db_get_events($events_raw, $fdaymonth_ts, $ldaymonth_ts, $flag); $bg_colors=define_events_by_hours($event_records, $fdaymonth_ts, $ldaymonth_ts, $start_day,'color'); $events_per_period=define_events_by_hours($event_records, $fdaymonth_ts, $ldaymonth_ts, $start_day); if($f_day_ofweek==2) { $temp=$day_name[0]; $day_name_rev=$day_name; array_shift($day_name_rev); array_push($day_name_rev, $temp); } $cal_html=''; $cal_html.=''; $cal_html.=""; // displaying weekday names foreach(($f_day_ofweek==1?$day_name:$day_name_rev) as $k=>$v) { $temp_ts = $fdaymonth_ts + 24*60*60*$k; $cal_html.=""; } $cal_html.=""; foreach($h_array as $hour=>$val) { if($week_mode_wh_only==false || $hour>=9 && $hour<=18) { $cal_html.='"; for($d=$start_day; $d<=($start_day+6); $d++) { if(isset($bg_colors[$d][$hour])) { $h_bgcolors = $bg_colors[$d][$hour]; $events_per_day = (isset($events_per_period[$d][$hour])?implode (" ", $events_per_period[$d][$hour]):""); $buff = $events_per_day; $cal_html.=""; } else { $cal_html.=""; } } $cal_html.=""; } } $cal_html.="
'; if($action_id_orig=='showcaljs' && isset($_GET['link']) && $_GET['link']=='0') { $cal_html.='
'.format_date($fdaymonth_ts).' - '.format_date($ldaymonth_ts).'
'; } else { $cal_html.='
'.navigation_bar($action_id,$mon,$year,'prev',1,'internal',$mode,$fdaymonth_ts) .'
'; $cal_html.='
'.format_date($fdaymonth_ts).' - ' .format_date($ldaymonth_ts).'
'; $cal_html.='
'.navigation_bar($action_id,$mon,$year,'next',1,'internal',$mode, $fdaymonth_ts).'
'; $cal_html.='
'; } $cal_html.='
 ".f_my_substr($month_name[date('n',$temp_ts)-1], 0, 3, $utf_fl).' '.date('j',$temp_ts).$f_br.$v."
$val'; } else { $cal_html.=$category_color[0].'">'; } } else { $cal_html.=current($h_bgcolors).'">'; } if(isset($events_per_period[$d][$hour])) { $cal_html.=''.$buff.''; } $cal_html.=" 
"; return $cal_html; } //BUILD EVENTS TABLE function view_events($events_raw,$fdayperiod_ts,$ldayperiod_ts,$flag,$view_type,$_mon,$_year, $event_id='',$old_reg_info='',$f_mail_type='',$all_users=array(),$send_to_list=array(),$send_to_group=array(),$short_form=false) { global $s_path,$page_id,$db_fname,$cal_dir,$doc_dir,$category_color,$day_name,$month_name,$noevents_msg,$lang_l,$lg_,$f_lf, $f_br, $f_ct; global $time_format,$location_label,$last_line,$f_max_chars,$category_vis,$hide_expired,$include_hide_button,$read_access; global $css_event,$css_calendar,$css_desc,$css_date,$css_details,$css_calurl,$em_enabled,$hint_settings,$em_show_participants; $events_html = ""; $records = array(); $registered = array(); if($flag=='admin') $recur_flag=false; else $recur_flag=true; if($event_id!='') $embed_form=true; else $embed_form=false; if($embed_form==false) $records=db_get_events($events_raw,$fdayperiod_ts,$ldayperiod_ts,$flag); else $records[]=db_get_specific_event($db_fname,$event_id); $page_list=get_sitemap_list(); $url_p="&".$lg_.'&mon='.$_mon.'&year='.$_year; $icon_st=' style="background-color:transparent; text-decoration:none"'; if(!empty($records)) { foreach ($records as $key=>$row) {$name[$key]=$row['Start_date'];} // sorting event records by start_date array_multisort($name,SORT_ASC,$records); if(!$embed_form && $include_hide_button) //event manager { $hidepast=(isset($_GET['hidepast'])? $_GET['hidepast']: 'false'); $events_html.='' .'"; } foreach($records as $k=> $v) { if(strpos(urldecode($v['Short_description']),'%%TEMPLATE1%%')===false) { if($category_vis[get_cat_index($v['Category'])]==true || $flag=="admin") // visibility { $font_color=get_category($v['Category'],'color'); //category change $events_html.=""; if ($flag=="admin") // if admin screen - Edit/Del options { $events_html.=''; $events_html.=''.$lang_l['edit'].''; } else { $events_html.='>['.ucfirst($lang_l['edit']).']';} $events_html.=' '.$lang_l['delete'].''; } else { $events_html.='>['.ucfirst($lang_l['delete']).']'; } $events_html.=''; } else { $events_html.=''; } $events_html.=''.format_date($v['Start_date']); if(date('n j, Y',$v['Start_date'])==date('n j, Y',$v['End_date'])) { $events_html.='' ; } // one-day event else {$events_html.=' - '.format_date($v['End_date']).''; } //multiple-days event if ($time_format==12) { $t_format='g:i A'; $pattern='12:00 AM'; } else {$t_format='G:i'; $pattern='0:00'; } if(date($t_format,$v['Start_date'])==date($t_format,$v['End_date']) && date($t_format,$v['Start_date'])==$pattern) //no time { $events_html.=''; } else { $events_html.=''.date($t_format, $v['Start_date']); if(date($t_format,$v['Start_date'])!=date($t_format,$v['End_date'])) $events_html.=" - ".date($t_format, $v['End_date']); $events_html.=''; } $em_use=($em_enabled && isset($v['DEADLINE']) && !empty($v['DEADLINE'])); if($em_enabled && !isset($v['recurType']) && ($flag=="admin" || $category_vis[get_cat_index($v['Category'])]==true)) { $events_html.=''; $events_html.=($em_use? ucfirst($lang_l['deadline']).': '.format_date($v['DEADLINE']): "").''; } $events_html.=''; $events_html.="['.$lang_l['mailing'].']'; $events_html.=''; } else { $events_html.='>';} $loc_value=f_sth(urldecode($v['Location'])); $desc_field_value=f_sth(urldecode($v['Short_description'])); $desc_field_value=str_replace('%%TEMPLATE1%%','',$desc_field_value); $events_html.=':: '.$desc_field_value.''; $events_html.=''.($loc_value!=""? $location_label.': '.$loc_value: "").''; if($em_enabled) //event manager { $events_html.=''; if($em_use && !isset($v['recurType']) && ($flag=="user" || $category_vis[get_cat_index($v['Category'])]==true) ) { $mktime=my_mktime(); $today_ts=mktime(0,0,0,date("n",$mktime),date("j",$mktime),date("Y",$mktime)); $events_html.=ucfirst($lang_l['status']).': '; if($v['Start_date']<=$today_ts) { $events_html.=ucfirst($lang_l['expired']); } elseif($v['DEADLINE']>=$today_ts) { $events_html.=ucfirst($lang_l['open']); if((!$embed_form || isset($_GET['event_id'])) && $flag=="user") { $events_html.=' ['.$lang_l['register'].']';} } else { $events_html.=ucfirst($lang_l['closed']); } if((!$embed_form || isset($_GET['event_id'])) && $flag=="admin") { $events_html.=' ['.$lang_l['register'].']';} } $events_html.=''; } $events_html.=''; $events_html.=''; if(isset($v['USER']) && !empty($v['USER']) && $flag=="admin") { $events_html.=ucfirst($lang_l['author']).' ['.f_sth(urldecode($v['USER'])).']'; } elseif($flag=="admin") { $events_html.=ucfirst($lang_l['author']).' [admin]'; } $events_html.=''.f_sth_2(urldecode($v['Details'])); if($flag=="admin" && isset($v['HIDDEN'])) $events_html.=$f_br.f_sth_2($v['HIDDEN']); $events_html.=''; if($em_enabled) //event manager { $events_html.=''; if($em_use && !isset($v['recurType']) && ($flag=="user" || $category_vis[get_cat_index($v['Category'])]==true)) { $users=get_user('all'); $attendee_list=array(); $registered=db_get_registered(); $events_html.=ucfirst($lang_l['total attendee']).': '; if(!empty($registered) && isset($registered[$v['Id']])) { $events_html.=count($registered[$v['Id']]).' '; if($flag=="user" && (!$embed_form || isset($_GET['event_id'])) && $v['Start_date']>$today_ts) $events_html.=$f_br.'['.$lang_l['edit'].'] ['.$lang_l['cancel'].'] '.$lang_l['my registration'].''.$f_br; $events_html.=$f_br; if(count($registered[$v['Id']])>5 && !isset($_GET['event_id'])) { $registered_cut=array_slice($registered[$v['Id']],0,5); } else { $registered_cut=$registered[$v['Id']]; } if($flag=="admin") { foreach($registered_cut as $m=>$n) { $curr_user=$m; $user_details=$users[$curr_user]['details']; $attendee_list[$curr_user]=ucfirst($user_details['name']).' '.$user_details['sirname']; $buffer=$user_details['name'].' '.$user_details['sirname'].$f_br.$user_details['email']; $notes_value=f_sth(urldecode($registered[$v['Id']][$curr_user]['notes'])); if(!empty($notes_value)) {$buffer.=$f_br.''.ucfirst($lang_l['notes']).':'.$f_br.$notes_value; } $events_html.=''; $events_html.='::'.$curr_user.' ['.$lang_l['unregister'].']'.$f_br; } } elseif($read_access || $em_show_participants) { foreach($registered_cut as $m=>$n) { $curr_user=$m; if(isset($users[$curr_user])) { $user_details=$users[$curr_user]['details']; $events_html.='::'.$user_details['name'].' '.$user_details['sirname'].' '.$f_br; } else { $events_html.=':: undefined'.$f_br; } } } if(count($registered[$v['Id']])>5 && !isset($_GET['event_id'])) { $events_html.=''; } } else { $events_html.='0'; } } $events_html.=''; } $events_html.=''; } } } if($em_enabled && $embed_form && $f_mail_type=='' && !isset($_GET['event_id'])) //event manager { $events_html.="'; if($embed_form) { $events_html.=ucfirst($lang_l['notes']).$f_br.' ' .(empty($old_reg_info)?'': '' .mailing_form($f_mail_type,$def_subject,$def_message,$send_to_group,$send_to_list,$all_users,$v['Category'],$event_id, $short_form).''; } elseif($em_enabled) { $events_html.=" '; } else { $events_html.=" '; } } else { $events_html.=''; $events_html.=":: '.$noevents_msg.''; $events_html.=" '; } $events_html="".$events_html."
"; return $events_html; } // BUILD ADD/EDIT EVENT forms function add_event_form($mon,$mday,$year,$view_type) { global $page_id,$s_path,$category_name,$category_color,$month_name,$time_format,$lang_l,$lg_,$f_lf, $f_br, $f_ct; global $days_in_month_array,$location_label, $em_enabled,$use_editor,$innova_def,$js_innova; global $ampm_array,$hours_array,$hours12_array,$min_array,$years_array,$repeatPeriod_list,$rel_path; $caption_style="font-size:10px;font-weight:bolder;line-height:16px;"; $span8=''.ucfirst('%s')."".$f_br; $input="'); $hidden_value=''; $t_data=get_event_template(); if($time_format==12) $h_array=$hours12_array; else$h_array=$hours_array; if(!empty($t_data)) { $location_value=f_sth(urldecode($t_data['Location'])); $hidden_value=(isset($t_data['HIDDEN'])? urldecode($t_data['HIDDEN']): ''); $hidden_value=str_replace($f_br,$f_lf,$hidden_value); $desc_value=f_sth(urldecode($t_data['Short_description'])); $desc_value=str_replace('%%TEMPLATE1%%','',$desc_value); $details_value= str_replace($f_br, $f_lf, f_sth_2(urldecode($t_data['Details']))); } $output="
".f_fmt_admin_title($lang_l['add event']).$f_br.$f_br; $output.='
'.sprintf($span8,ucfirst($lang_l['short description']).'*'); $output.=sprintf($input,'Short_description',(!empty($t_data)? $desc_value: '')); $output.=sprintf($span8,ucfirst($lang_l['category'])).build_select_category('Category',$category_name,$category_color,$category_name[1],' style="width:500px;" ').$f_br; $block_flag=(isset($_POST['add_category']) && (empty($_POST['cat_color']) || empty($_POST['cat_name']))); $output.=''.ucfirst($lang_l['add category']).''.$f_br; $output.='
'; $output.=build_add_category_form('', '#', $marks_array[0], '#', '') .'
'; $output.="".$f_br; $tinymice_flag=(strpos($js_innova,'tiny_mce.js')!==false && $use_editor==true); $output.=sprintf($span8,ucfirst($lang_l['details'])).""; if($use_editor==true) $output.=$innova_def; $output.=$f_br.sprintf($span8,$location_label).sprintf($input,'Location',(!empty($t_data)? $location_value: '')); $output.=sprintf($span8,ucfirst($lang_l['hidden info']))."".$f_br; $output.=$f_br.'
'.ucfirst($lang_l['start date']) .' '.f_build_select('Start_month',$month_name,$month_name[$mon-1], '', 'value') .f_build_select('Start_day',$days_in_month_array,$mday,'','value').f_build_select('Start_year',$years_array,$year,'','value').'
'; $output.='
  '.ucfirst($lang_l['end date']).' ' .f_build_select('End_month',$month_name, $month_name[$mon-1], '', 'value').f_build_select('End_day',$days_in_month_array,$mday, '', 'value') .f_build_select('End_year',$years_array,$year, '', 'value').'
'; $output.='
'.ucfirst($lang_l['start time']).' ' .f_build_select('Start_hour',$h_array,$h_array[0], '', 'value').':' .f_build_select('Start_min',$min_array,$min_array[0], '', 'value'); if($time_format==12) $output.=f_build_select('Start_ampm',$ampm_array,$ampm_array[0], '', 'value'); $output.='
  '.ucfirst($lang_l['end time']).' ' .f_build_select('End_hour',$h_array,$h_array[0], '', 'value').':' .f_build_select('End_min',$min_array,$min_array[0], '', 'value'); if($time_format==12) $output.=f_build_select('End_ampm',$ampm_array,$ampm_array[0], '', 'value'); $output.='
'; if($em_enabled) //event manager { $output.='
Use EM --> '.ucfirst($lang_l['deadline']).' '.f_build_select('Deadline_month',$month_name,$month_name[$mon-1], '', 'value') .f_build_select('Deadline_day',$days_in_month_array,$mday,'','value').f_build_select('Deadline_year',$years_array,$year,'', 'value') ."
"; } $output.='
'.ucfirst($lang_l['once']).''; $output.=' '.ucfirst($lang_l['repeat every']).' ' .f_build_select("repeatPeriod",$repeatPeriod_list,$repeatPeriod_list[0]).'
'; //$output .= 'Repeat every '.f_build_select("repeatPeriod", $repeatPeriod_list, $repeatPeriod_list[0]).' Stop after events. (0- unlimited)'; $output.=$f_br.'"; return $output; } function edit_event_form($event_record,$view_type,$mon='',$year='') { global $page_id,$s_path,$category_name,$category_color,$category_id,$month_name,$days_in_month_array, $f_br,$f_ct; global $years_array,$time_format,$location_label,$lang_l,$f_lf,$lg_, $em_enabled, $use_editor, $innova_def,$js_innova; global $ampm_array,$hours_array,$hours12_array,$min_array,$repeatPeriod_list,$cal_settings_fname,$rel_path; $caption_style="font-size:10px;font-weight:bolder;line-height:16px;"; $span8=''.ucfirst('%s')."".$f_br; $input="'); if($time_format==12) $h_array=$hours12_array; else $h_array=$hours_array; $occur_type=(isset($event_record['event_frequency'])?$event_record['event_frequency']:'once'); $location_value=f_sth(urldecode($event_record['Location'])); $hidden_value=(isset($event_record['HIDDEN'])? urldecode($event_record['HIDDEN']):""); $hidden_value=str_replace($f_br,$f_lf,$hidden_value); $desc_value=f_sth(urldecode($event_record['Short_description'])); if(strpos($desc_value,'%%TEMPLATE1%%')!==false) $is_template=true; else $is_template=false; $desc_value=str_replace('%%TEMPLATE1%%','',$desc_value); if($use_editor==true) $details_value=f_sth_2(urldecode($event_record['Details'])); else $details_value=str_replace($f_br, $f_lf, f_sth_2(urldecode($event_record['Details']))); $output="
".(array_key_exists('Id',$event_record)?f_fmt_admin_title($lang_l['edit event']):f_fmt_admin_title($lang_l['add event'])).$f_br.$f_br; $output.='
'; if(array_key_exists('Id',$event_record)) { $output.="*').sprintf($input,'Short_description',$desc_value); $output.=sprintf($span8,ucfirst($lang_l['category'])).build_select_category('Category',$category_name,$category_color,(in_array($event_record['Category'],$category_id)? $event_record['Category']: '1'),' style="width:500px;" ').$f_br; $block_flag=(isset($_POST['add_category']) && (empty($_POST['cat_color']) || empty($_POST['cat_name']) || $_POST['cat_name']=='#')); $output.=''.ucfirst($lang_l['add category']).''.$f_br; $output.='
'; $output.=build_add_category_form((isset($_POST['cat_name'])?$_POST['cat_name']:''), (isset($_POST['cat_color'])?$_POST['cat_color']:'#'), (isset($_POST['cat_mark'])? $_POST['cat_mark']: $marks_array[0]), (isset($_POST['mark_color'])?$_POST['mark_color']:'#'), (isset($_POST['cat_invisible'])? 'checked="checked"': '')) .'
'; $output.="".$f_br; $tinymice_flag=(strpos($js_innova,'tiny_mce.js')!==false && $use_editor==true); $output.=sprintf($span8,ucfirst($lang_l['details'])).""; if($use_editor==true) $output.=$innova_def; $output.=$f_br.sprintf($span8,$location_label).sprintf($input,'Location',$location_value); $output.=sprintf($span8,ucfirst($lang_l['hidden info']))."".$f_br; $s_d=$event_record['Start_date']; $e_d=$event_record['End_date']; $st_mon=date('n',$s_d); $st_day=date('j',$s_d); $st_year=date('Y',$s_d); $output.=$f_br.'
'.ucfirst($lang_l['start date']) .' '.f_build_select('Start_month',$month_name,$month_name[$st_mon-1], '', 'value') .f_build_select('Start_day',$days_in_month_array,$st_day, '', 'value').f_build_select('Start_year',$years_array,$st_year, '', 'value').'
'; $end_mon=date('n',$e_d); $end_day=date('j',$e_d); $end_year=date('Y',$e_d); $output.='
  '.ucfirst($lang_l['end date']).' ' .f_build_select('End_month',$month_name,$month_name[$end_mon-1], '', 'value') .f_build_select('End_day',$days_in_month_array,$end_day, '', 'value').f_build_select('End_year',$years_array,$end_year, '', 'value').'
'; $st_min=date('i',$s_d); $end_min=date('i',$e_d); if($time_format==12) { $st_hour=date('g',$s_d); $end_hour=date('g',$e_d); $st_ampm=date('A',$s_d); $end_ampm=date('A',$e_d);} else { $st_hour=date('G',$s_d); $end_hour=date('G',$e_d); } $output.='
'.ucfirst($lang_l['start time']) .' '; if($time_format==12) { if($st_hour==$end_hour && $end_hour=='12' && $st_min==$end_min && $end_min=='00' && $st_ampm==$end_ampm && $end_ampm=='AM') {$output.=f_build_select('Start_hour',$h_array,$h_array[0], '', 'value'); } else { $output.=f_build_select('Start_hour', $h_array, $h_array[$st_hour], '', 'value'); } } else { if($st_hour==$end_hour && $end_hour=='24' && $st_min==$end_min && $end_min=='00') {$output.=f_build_select('Start_hour', $h_array, $h_array[0], '', 'value');} else { $output.=f_build_select('Start_hour',$h_array,$h_array[$st_hour],'','value'); } } $output.=f_build_select('Start_min', $min_array, $st_min, '', 'value'); if($time_format==12) $output.=f_build_select('Start_ampm',$ampm_array,$st_ampm,'','value'); $output.='
'; $output.='
  '.ucfirst($lang_l['end time']).' '; if($time_format==12) { if( ($st_hour==$end_hour && $end_hour=='12' && $st_min==$end_min && $end_min=='00' && $st_ampm==$end_ampm && $end_ampm=='AM') || ($st_hour==$end_hour && $st_min==$end_min && $st_ampm==$end_ampm) ) {$output.=f_build_select('End_hour',$h_array,$h_array[0],'','value');} else $output.=f_build_select('End_hour',$h_array,$h_array[$end_hour],'','value'); } else { if( ($st_hour==$end_hour && $end_hour=='24' && $st_min==$end_min && $end_min=='00') || ($st_hour==$end_hour && $st_min==$end_min) ) {$output.=f_build_select('End_hour',$h_array, $h_array[0],'','value');} else $output.=f_build_select('End_hour',$h_array,$h_array[$end_hour],'','value'); } $output.=f_build_select('End_min',$min_array,$end_min,'','value'); if($time_format==12) $output.=f_build_select('End_ampm',$ampm_array,$end_ampm,'','value'); $output.='
'; if($em_enabled) { $em_use=(isset($event_record['DEADLINE']) && !empty($event_record['DEADLINE'])); $dline=($em_use? $event_record['DEADLINE']: $event_record['Start_date']); $dl_mon=date('n',$dline); $dl_day=date('j',$dline); $dl_year=date('Y',$dline); $output.='
Use EM --> '.ucfirst($lang_l['deadline']).' ' .f_build_select('Deadline_month',$month_name,$month_name[$dl_mon-1], '', 'value') .f_build_select('Deadline_day',$days_in_month_array,$dl_day, '', 'value').f_build_select('Deadline_year',$years_array,$dl_year, '', 'value')."
"; } $output.='
'.ucfirst($lang_l['once']).''; $output.=' '.ucfirst($lang_l['repeat every']).' '.f_build_select("repeatPeriod", $repeatPeriod_list, (isset($event_record['repeatPeriod'])?$event_record['repeatPeriod']:$repeatPeriod_list[0])).'
'; $output.=$f_br.'"; $output.="'; $output.="
" ."".$header_text."".$f_br.$f_br."".$user_info['details']['name'].' ' .$user_info['details']['sirname'].$f_br.$f_br.$user_info['details']['email'].$f_br.'
 
'; if(isset($reg_info['Event_id'])) $output.=view_events($event_data,0,0,'user',3,0,0,$id,$reg_info); else $output.=view_events($event_data,0,0,'user',3,0,0,$id); $output.='
"; return $output; } function mailing_form($def_mail,$def_subject,$def_message,$send_to_group,$send_to_list,$all_users,$cat_id,$event_id='',$short_form=false) { global $s_path,$lg_,$lang_l,$category_id,$mails_list,$css_details,$def_view, $f_br,$f_ct; if(isset($_GET['view'])) { $view_type=$_GET['view'];} else { $view_type=$def_view;} $current_date=getdate(); $mon=(isset($_GET['mon'])? $_GET['mon']: $current_date['mon']); $year=(isset($_GET['year'])? $_GET['year']: $current_date['year']); $url_p="&".$lg_.'&mon='.$mon.'&year='.$year; $jstring="onchange=\"document.location='".$s_path."?action=mailing&Id=$event_id&view=$view_type" .$url_p."&type=' + this.options[this.selectedIndex].value;\" style='width:100%;' "; $jstring2="onchange=\"document.location='".$s_path."?action=".($short_form?'emregister':'mailing') ."&view=$view_type" .$url_p."&Id=$event_id&type=$def_mail&send_to=' + this.options[this.selectedIndex].value;\" "; $output=$f_br."
"; $output.="'; if($short_form==false) { $output.=""; $output.=""; $output.=""; } $output.=""; if($short_form==false) $output.=""; $output.="
".($short_form? ''.ucfirst($lang_l['register']).'': f_fmt_admin_title(ucfirst($lang_l['mailing']))).$f_br.$f_br.'
".ucfirst($lang_l['mail type'])."".$f_br; $output.=f_build_select("type", $mails_list, $def_mail, '', 'key',$jstring).$f_br.$f_br."
".ucfirst($lang_l['mail subject'])."".$f_br."
".ucfirst($lang_l['message'])."".$f_br."".$f_br."
"; $output.="".ucfirst($short_form? $lang_l['users']: $lang_l['send to']).""; $output.="".$f_br.$f_br; $output.=""; $output.="
".ucfirst($lang_l['users list'])."".$f_br.""; $output.="".ucfirst($lang_l['selected'])."".$f_br."
".$f_br."".ucfirst($lang_l['file attachment'])."".$f_br."
".$f_br."
"; return $output; } function get_mailing_settings($tag) { global $EA_subject,$EA_message, $ECA_subject,$ECA_message, $ER_subject,$ER_message, $AG_subject,$AG_message, $cal_settings_fname; global $RConf_subject,$RConf_message, $RCancel_subject,$RCancel_message, $RChange_subject,$RChange_message, $GE_subject,$GE_message; $settings=array('EA_subject'=>$EA_subject, 'EA_message'=>$EA_message, 'ECA_subject'=>$ECA_subject, 'ECA_message'=>$ECA_message, 'ER_subject'=>$ER_subject, 'ER_message'=>$ER_message, 'AG_subject'=>$AG_subject, 'AG_message'=>$AG_message, 'RConf_subject'=>$RConf_subject, 'RConf_message'=>$RConf_message, 'RCancel_subject'=>$RCancel_subject, 'RCancel_message'=>$RCancel_message, 'RChange_subject'=>$RChange_subject, 'RChange_message'=>$RChange_message, 'GE_subject'=>$GE_subject, 'GE_message'=>$GE_message); $set_raw=f_read_tagged_data($cal_settings_fname, $tag); if(strpos($set_raw,'')!==false) $settings[$tag.'_subject']=f_sth(f_GFS($set_raw,'','')); if(strpos($set_raw,'')!==false) $settings[$tag.'_message']=f_sth_2(f_GFS($set_raw,'','')); return $settings; } //EVENT MANAGER functions function parse_event_info($username,$message,$ev_info,$user_info,$reg_info='') //event manager { global $time_format; $content=str_replace("%short_description%",f_sth(urldecode($ev_info['Short_description'])),$message); $content=str_replace("%details%",f_sth_2(urldecode($ev_info['Details'])),$content); $content=str_replace("%category%",get_category($ev_info['Category']),$content); $content=str_replace("%location%",f_sth(urldecode($ev_info['Location'])),$content); $st_d=$ev_info['Start_date']; $end_d=$ev_info['End_date']; if(date('n j, Y',$st_d)==date('n j, Y',$end_d)) { $content=str_replace("%date%",format_date($st_d),$content);} else { $content=str_replace("%date%",format_date($st_d).' - '.format_date($end_d),$content); } if($time_format==12) { $t_f='g:i A'; $pattern='12:00 AM'; } else { $t_f='G:i'; $pattern='0:00'; } if(date($t_f,$st_d)==date($t_f,$end_d) && date($t_f,$st_d)==$pattern) {$content=str_replace("%time%",'',$content);} elseif(date($t_f,$st_d)==date($t_f,$end_d) && date($t_f,$st_d)!=$pattern) {$content=str_replace("%time%",date($t_f,$st_d),$content);} else { $content=str_replace("%time%",date($t_f,$st_d)." - ".date($t_f,$end_d),$content);} if(isset($ev_info['DEADLINE']) && !empty($ev_info['DEADLINE'])) $content=str_replace("%deadline%",format_date($ev_info['DEADLINE']),$content); $content=str_replace("%username%",$username,$content); $content=str_replace("%name%",$user_info['name'],$content); $content=str_replace("%sirname%",$user_info['sirname'],$content); $content=str_replace("%email%",$user_info['email'],$content); if(!empty($reg_info)) { $content=str_replace("%notes%",f_sth(urldecode($reg_info['Notes'])),$content); $content=str_replace("%register_date%",format_date($reg_info['Timestamp']),$content); } return $content; } function build_reg_url($event_id) { global $script_name, $full_path_to_script; return $full_path_to_script.'/'.$script_name.'?event_id='.$event_id; } function build_reg_subject($event_desc,$mail_subject) { return str_replace("%short_description%", f_sth(urldecode($event_desc)), f_sth($mail_subject)); } function register($action_id, $logged_user) //event manager { global $db_fname, $db_fname_reg,$db_fields_reg, $db_fname_recur,$category_vis, $cal_template_fname, $cal_css; global $s_path,$lang_l,$lg_,$css_event,$time_format,$f_lf,$script_name,$admin_email, $f_br, $css_calurl; $body_section=''; if(isset($_POST['Id'])) $event_id=$_POST['Id']; elseif(isset($_GET['Id'])) $event_id=$_GET['Id']; else $event_id=''; $user_info=get_user($logged_user); // user info $event_info=db_get_specific_event($db_fname,$event_id); // event info $reg_info=db_get_registered($logged_user,$event_id); // registration info $mktime=my_mktime(); $today_ts = mktime(0,0,0,date("n",$mktime),date("j",$mktime),date("Y",$mktime)); if(f_is_logged('SID_ADMIN')) {$body_section=$f_br.''.ucfirst($lang_l['logged as admin MSG']).''; } elseif($action_id=='register' && isset($_POST['submit'])) // user confirms registration { $mail_settings=get_mailing_settings('RConf'); $reg_record['Event_id']=$_POST['Id']; $reg_record['User']=$_POST['user']; $reg_record['Timestamp']=mktime(); $reg_record['Notes']=$_POST['notes']; $register_line=prepare_for_write($reg_record); db_add_event($db_fname_reg,$db_fields_reg,$register_line); $subject=build_reg_subject($event_info['Short_description'],$mail_settings['RConf_subject']); $url=build_reg_url($event_id); $content=parse_event_info($user_info['username'],f_sth_2($mail_settings['RConf_message']),$event_info,$user_info['details'],$reg_record); $content_text=str_replace("%calendarurl%",$url,$content); $content=str_replace("%calendarurl%",''.$url.'',$content); $res=send_mail($content,$content_text,$subject,$user_info['details']['email']); send_mail($content,$content_text,ucfirst($lang_l['notification']).' - '.$subject,$admin_email); show_calendar('show',''.$lang_l['success registered MSG'].''.$f_br.$f_br); exit; } elseif($action_id=='register' && isset($_GET['Id'])) // show registration form { if(isset($reg_info['Event_id'])) { $body_section=$f_br."".ucfirst($lang_l['dear'])." $logged_user, ".$f_br.$f_br."".ucfirst($lang_l['already registered'])."".$f_br.$f_br."".ucfirst($lang_l['details follow']) .":".$f_br."".ucfirst($lang_l['registration date']).": ".format_date($reg_info['Timestamp']).$f_br.ucfirst($lang_l['notes']).": " .f_sth(urldecode($reg_info['Notes']))."".$f_br.$f_br.ucfirst($lang_l['edit registration MSG'])." "; $body_section.='['.ucfirst($lang_l['edit']).'] ['.ucfirst($lang_l['cancel']).'] '.$lang_l['my registration'].'.'; } else { $recurring=db_get_specific_event($db_fname_recur,$event_id); if(isset($event_info['DEADLINE']) && !empty($event_info['DEADLINE'])&& $event_info['DEADLINE']>=$today_ts) { $action=$s_path.'?action=register&'.$lg_; $id=$event_id; $bt_name='submit'; $header_text=ucfirst($lang_l['register event MSG']); $body_section=register_form(array($event_info),$header_text,$action,$id,$user_info,$reg_info,$event_info,$bt_name); } else { $msg_text=""; if(!empty($recurring) || $category_vis[get_cat_index($event_info['Category'])]==false) {$msg_text.=ucfirst($lang_l['register event MSG']); } else { $msg_text.=ucfirst($lang_l['cant register MSG2']); } $msg_text.=''.$f_br.$f_br; show_calendar('show',$msg_text); exit; } } } elseif($action_id=='chregister' && isset($_POST['submit'])) // change registration { if($event_info['Start_date']>$today_ts) { $mail_settings=get_mailing_settings('RChange'); $reg_record['Event_id']=$_POST['Id']; $reg_record['User']=$_POST['user']; $reg_record['Timestamp']=$_POST['timestamp']; $reg_record['Notes']=$_POST['notes']; $register_line=prepare_for_write($reg_record); db_edit_event($db_fname_reg,$_POST['Id'],$register_line,$_POST['user']); $subject=build_reg_subject($event_info['Short_description'],$mail_settings['RChange_subject']); $url=build_reg_url($_POST['Id']); $content=parse_event_info($user_info['username'],f_sth_2($mail_settings['RChange_message']),$event_info,$user_info['details'],$reg_record); $content_text=str_replace("%calendarurl%", $url, $content); $content=str_replace("%calendarurl%", ''.$url.'', $content); $res=send_mail($content,$content_text,$subject,$user_info['details']['email']); send_mail($content,$content_text,ucfirst($lang_l['notification']).' - '.$subject,$admin_email); $msg_text=$lang_l['success edit MSG']; } else { $msg_text=$lang_l['cant edit MSG']; } show_calendar('show',''.$msg_text.''.$f_br.$f_br); exit; } elseif($action_id=='clregister' && isset($_POST['submit'])) // cancel registration { if($event_info['Start_date']>$today_ts) { $mail_settings=get_mailing_settings('RCancel'); db_delete_event($db_fname_reg,$_POST['Id'],$_POST['user']); $subject=build_reg_subject($event_info['Short_description'],$mail_settings['RCancel_subject']); $url=build_reg_url($_POST['Id']); $content=parse_event_info($user_info['username'],f_sth_2($mail_settings['RCancel_message']),$event_info,$user_info['details'],$reg_info); $content_text=str_replace("%calendarurl%", $url, $content); $content=str_replace("%calendarurl%", ''.$url.'', $content); $res=send_mail($content,$content_text,$subject,$user_info['details']['email']); send_mail($content,$content_text,ucfirst($lang_l['notification']).' - '.$subject,$admin_email); $msg_text=$lang_l['success cancel MSG']; } else { $msg_text=$lang_l['cant cancel MSG']; } show_calendar('show',''.$msg_text.''.$f_br.$f_br); exit; } elseif(($action_id=='chregister' || $action_id=='clregister') && isset($_GET['Id'])) //show change/cancel form { $em_use=(isset($event_info['DEADLINE']) && !empty($event_info['DEADLINE'])); if($event_info['Start_date']>$today_ts) { if(isset($reg_info['Event_id'])) { if($action_id=='chregister') { $action=$s_path.'?action=chregister&'.$lg_; $bt_name='edit'; } else { $action=$s_path.'?action=clregister&'.$lg_; $bt_name='cancel my registration'; } $id=$reg_info['Event_id']; $header_text=ucfirst($lang_l['dear'])." $logged_user,".$f_br.$f_br; if($action_id=='chregister') $header_text.=$lang_l['to edit MSG']; else $header_text.=$lang_l['to cancel MSG']; if($em_use && $event_info['DEADLINE']<$today_ts) {$header_text.=$f_br.''.$lang_l['not recommended MSG'].'';} $body_section=register_form(array($event_info),$header_text,$action,$id,$user_info,$reg_info,$event_info,$bt_name); } elseif($em_use && $event_info['DEADLINE']>=$today_ts) { $body_section.=$lang_l['to register MSG'].' ['.ucfirst($lang_l['register']).']'; } } else {show_calendar('show',''.$lang_l['cant edit/cancel MSG'].''.$f_br.$f_br); exit;} } $output=f_fmt_in_template($cal_template_fname,$body_section,$cal_css); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) {print $output;} else {f_eval_php_code($output);} } function em_register($action_id) { global $db_fname,$db_fname_reg,$db_fields_reg,$category_id,$js_move,$admin_email, $f_br; global $s_path,$page_id,$script_name,$lang_l,$css_details,$f_lf, $cal_template_fname, $cal_css; $body_section = ''; if(isset($_POST['Id'])) $event_id=$_POST['Id']; elseif(isset($_GET['Id'])) $event_id=$_GET['Id']; else $event_id=''; $event_info=db_get_specific_event($db_fname,$event_id); // event info $users=get_user('all'); if(isset($_POST['Submit'])) { $res_msg=''; $send_to = array(); $mail_settings = get_mailing_settings('RConf'); $message = $mail_settings['RConf_message']; $subject = $mail_settings['RConf_subject']; if(isset($_POST["selected_list"]) && $_POST["selected_list"]!=null) { $selected_list = (array) $_POST["selected_list"]; foreach($users as $k=>$v) { if(in_array($v['username'],$selected_list)) {$send_to[]=$v;} } } else { $res_msg = $lang_l['none users']; } $subject = build_reg_subject($event_info['Short_description'],$subject); $url = build_reg_url($event_id); $content_text = str_replace("%calendarurl%", $url, f_sth_2($message)); $content = str_replace("%calendarurl%", ''.$url.'', f_sth_2($message)); $content = str_replace($f_lf,$f_br,$content); foreach($send_to as $k=>$v) { $reg_info = db_get_registered($v['username'],$event_id); if(!isset($reg_info['Event_id'])) { $reg_record['Event_id'] = $event_id; $reg_record['User'] = $v['username']; $reg_record['Timestamp'] = mktime(); $reg_record['Notes'] = ''; $register_line = prepare_for_write($reg_record); db_add_event($db_fname_reg,$db_fields_reg,$register_line); $content_u = parse_event_info($v['username'],$content,$event_info,$v['details'],$reg_record); $content_text_u = parse_event_info($v['username'],$content_text,$event_info,$v['details'],$reg_record); $res = send_mail($content_u,$content_text_u,$subject,$v['details']['email']); send_mail($content_u,$content_text_u,ucfirst($lang_l['notification']).' - '.$subject,$admin_email); if(!$res) $res_msg .= $lang_l['send to'].$v['details']['email'].' FAILED; '; } else { $res_msg.=' '.ucfirst($lang_l['user']).' "'.$v['username'].'" ALREADY REGISTERED.'; } } show_calendar('index',''.($res_msg!=''? $res_msg:' '.$lang_l['users regsitered MSG']).''.$f_br.$f_br); exit; } elseif(isset($_GET['remove'])) { $remove_user = $_GET['remove']; $event_id = $_GET['Id']; $reg_info = db_get_registered($remove_user,$event_id); // registered info $user_info = get_user($remove_user); // user info $mail_settings = get_mailing_settings('RCancel'); $message = $mail_settings['RCancel_message']; $subject = $mail_settings['RCancel_subject']; db_delete_event($db_fname_reg,$event_id,$remove_user); $subject = build_reg_subject($event_info['Short_description'],$mail_settings['RCancel_subject']); $url = build_reg_url($event_id); $content = parse_event_info($user_info['username'],f_sth_2($mail_settings['RCancel_message']),$event_info,$user_info['details'],$reg_info); $content_text = str_replace("%calendarurl%", $url, $content); $content = str_replace("%calendarurl%", ''.$url.'',$content); $res = send_mail($content,$content_text,$subject,$user_info['details']['email']); send_mail($content,$content_text,ucfirst($lang_l['notification']).' - '.$subject,$admin_email); $msg_text = $lang_l['users unregsitered MSG']; show_calendar('index',''.$msg_text.''.$f_br.$f_br); exit; } else { $all_users = array(); $send_to_list = array(); $def_mail = (isset($_GET['type'])? $_GET['type']:'EA'); if(isset($_GET['send_to'])) $send_to_group = $_GET['send_to']; elseif($def_mail=='EA'|| $def_mail=='ECA') $send_to_group = $event_info['Category']; else $send_to_group = 'registered'; if(!empty($users)) { foreach ($users as $key => $row) { $u_name[$key]=$row['details']['name']; $u_name_lower=array_map('strtolower', $u_name); } array_multisort($u_name_lower,SORT_ASC, $users); } foreach($users as $k=>$v) { if(!empty($v['details']['email'])) $all_users [$v['username']] = $v['details']['name'].' '.$v['details']['sirname']; } if($send_to_group=='admin') { $send_to_list [$admin_email] = 'Admin'; } elseif($send_to_group=='all') { $send_to_list = $all_users; } elseif($send_to_group=='registered') { $registered = db_get_registered(); if(!empty($registered) && isset($registered[$event_id])) { foreach($registered[$event_id] as $curr_user=>$n) { $send_to_list[$curr_user] = $all_users[$curr_user]; } } } else { foreach($users as $k=>$v) { if(isset($v['news']) && !empty($v['news'])) { foreach($v['news'] as $key=>$val) { if($val['page']==$page_id && $val['cat']==$send_to_group) { $send_to_list [$v['username']] = $v['details']['name'].' '.$v['details']['sirname'];} } } } } $output=''; $output.=''; $output.='
'.build_admin_menu($action_id).$f_br.$f_br.'
'; $output.=view_events(array($event_info),0,0,'admin',3,0,0, $event_id,'',$def_mail,$all_users,$send_to_list,$send_to_group,true); $output.='
'; } $output=f_fmt_in_template($cal_template_fname,$output,$cal_css); $output = str_replace(array('',''),array(' '.$js_move.' ',' '.$js_move.' '),$output); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) {print $output;} else {f_eval_php_code($output);} } function send_mail($content,$content_text,$subject,$send_to_email='',$attachment='',$file='',$file_type='') //event manager { global $f_use_linefeed, $admin_email, $f_return_path, $f_sendmail_from, $f_lf, $f_br; global $f_mail_type, $f_SMTP_HOST, $f_SMTP_PORT, $f_SMTP_HELLO, $f_SMTP_AUTH, $f_SMTP_AUTH_USR, $f_SMTP_AUTH_PWD; $res = false; if(strpos($admin_email,'your@email.here')===false && $admin_email!='') { $content_text = str_replace($f_br, $f_lf, $content_text); $mail = new htmlMimeMail(); if ($f_use_linefeed) $mail->setCrlf("\r\n"); $mail->setHtml($content, $content_text); $mail->setSubject($subject); if($f_sendmail_from=='') $mail->setFrom($admin_email); else $mail->setFrom($f_sendmail_from); if ($f_return_path!='') {$mail->setReturnPath($f_return_path);} if($attachment!='') $mail->addAttachment($attachment, $file, $file_type); //attachment if(($f_mail_type=='smtp')&&($f_SMTP_HOST!=='')) $mail->setSMTPParams($f_SMTP_HOST,$f_SMTP_PORT,$f_SMTP_HELLO,$f_SMTP_AUTH,$f_SMTP_AUTH_USR,$f_SMTP_AUTH_PWD); if($send_to_email!='') $res = $mail->send(array($send_to_email),$f_mail_type); else $res = $mail->send(array($admin_email),$f_mail_type); } return $res; } function mailing($action_id) //event manager { global $db_fname,$db_fname_reg,$db_fields_reg,$js_move,$admin_email, $f_br; global $page_id,$script_name,$s_path,$lang_l,$css_event,$f_lf, $cal_template_fname, $cal_css; $event_id=(isset($_POST['Id'])? $_POST['Id']: $_GET['Id']); $event_info=db_get_specific_event($db_fname,$event_id); $users=get_user('all'); if(isset($_POST['Submit'])) //send mail { if(isset($_POST["selected_list"]) && $_POST["selected_list"]!=null) { $selected_list=(array) $_POST["selected_list"]; foreach($users as $k=>$v) { if(in_array($v['username'],$selected_list)) {$send_to[]=$v;} } } else { $send_to=$admin_email; } $attachment=''; if($_FILES['Attachment']['name']!="") { $file_attach=$_FILES['Attachment']['name']; $file_type=$_FILES['Attachment']['type']; $file_path=$_FILES['Attachment']['tmp_name']; if (!strlen($file_type)) { $file_type="applicaton/octet-stream"; } if ($file_type=='application/x-msdownload') { $file_type="applicaton/octet-stream"; } if(file_exists($file_path)) { $f=@fopen($file_path, "rb"); if($f) { while($f && !feof($f)) { $attachment.=fread($f,4096); } fclose($f); } } } $subject=build_reg_subject($event_info['Short_description'],$_POST['Subject']); $url=build_reg_url($event_id); $content_text=str_replace("%calendarurl%",$url,f_sth_2($_POST['Message'])); $content=str_replace("%calendarurl%",''.$url.'',f_sth_2($_POST['Message'])); $content=str_replace($f_lf,$f_br,$content); $res_msg=''; if($send_to==$admin_email) { $content=parse_event_info('Administrator',$content,$event_info,array('name'=>'Administrator','sirname'=>'','email'=>$send_to)); $content_text=parse_event_info('Administrator',$content_text, $event_info,array('name'=>'Administrator','sirname'=>'','email'=>$send_to)); if(!empty($attachment)) send_mail($content,$content_text,$subject,$send_to,$attachment,$file_attach,$file_type); else send_mail($content,$content_text,$subject,$send_to); } else { $res_msg=''; foreach($send_to as $k=>$v) { $reg_info=db_get_registered($v['username'],$event_id); // registration info - if any $content_u=parse_event_info($v['username'],$content,$event_info,$v['details'],$reg_info); $content_text_u=parse_event_info($v['username'],$content_text,$event_info,$v['details'],$reg_info); if(!empty($attachment)) $res=send_mail($content_u,$content_text_u,$subject,$v['details']['email'],$attachment,$file_attach,$file_type); else $res= send_mail($content_u,$content_text_u,$subject,$v['details']['email']); if(!$res) $res_msg.=ucfirst($lang_l['send to']).' '.$v['details']['email'].' FAILED; '; } } show_calendar('index',''.($res_msg!=''? $res_msg: $lang_l['mail sent MSG']).''.$f_br.$f_br); } else // send mail form { $all_users=array(); $send_to_list=array(); $def_mail=(isset($_GET['type'])? $_GET['type']:'EA'); if(isset($_GET['send_to'])) $send_to_group=$_GET['send_to']; elseif($def_mail=='EA'|| $def_mail=='ECA') $send_to_group=$event_info['Category']; else $send_to_group='registered'; if(!empty($users)) { foreach ($users as $key => $row) { $u_name[$key]=$row['details']['name']; $u_name_lower=array_map('strtolower', $u_name); } array_multisort($u_name_lower,SORT_ASC, $users); } foreach($users as $k=>$v) { if(!empty($v['details']['email'])) $all_users [$v['username']] = $v['details']['name'].' '.$v['details']['sirname']; } if($send_to_group=='admin') { $send_to_list [$admin_email]='Admin'; } elseif($send_to_group=='all') { $send_to_list=$all_users; } elseif($send_to_group=='registered') { $registered=db_get_registered(); if(!empty($registered) && isset($registered[$event_id])) { foreach($registered[$event_id] as $curr_user=>$n) { $send_to_list[$curr_user]=$all_users[$curr_user]; } } } else { foreach($users as $k=>$v) { if(isset($v['news']) && !empty($v['news'])) { foreach($v['news'] as $key=>$val) { if($val['page']==$page_id && $val['cat']==$send_to_group) { $send_to_list [$v['username']]=$v['details']['name'].' '.$v['details']['sirname'];} } } } } $output=''; $output.=''; $output.='
'.build_admin_menu($action_id).$f_br.$f_br.'
'; $output.=view_events(array($event_info),0,0,'admin',3,0,0, $event_id,'',$def_mail,$all_users,$send_to_list,$send_to_group); $output.='
'; $output=f_fmt_in_template($cal_template_fname,$output,$cal_css); $output=str_replace(array('',''),array(' '.$js_move.' ',' '.$js_move.' '),$output); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) {print $output;} else {f_eval_php_code($output);} } } function set_mailing($action_id) // EA, ECA, AG, RC, GE //event manager { global $s_path,$lg_,$lang_l,$mails_list,$f_lf, $cal_template_fname, $cal_css, $f_br, $f_ct; $jstring="onchange=\"document.location='". $s_path."?action=setmailing&$lg_&type=' + this.options[this.selectedIndex].value;\" style='width:100%;'"; if(isset($_POST['Submit'])) { $tag=$_POST['type']; $new_setting=''.$_POST['Subject'].''.''.str_replace($f_lf,$f_br,$_POST['Message']).''; if(db_write_data($tag,$new_setting)) $output=''.ucfirst($lang_l['settings saved']).''; else $output='Settings save failed'; } else { $def_mail=(isset($_GET['type'])? $_GET['type']:'EA'); $settings=get_mailing_settings($def_mail); $def_subject=$settings[$def_mail.'_subject']; $def_message=str_replace($f_br,$f_lf,$settings[$def_mail.'_message']); $output="
"; $output.=f_fmt_admin_title($lang_l['settings']).$f_br.$f_br; $output.=''; $output.=""; $output.=""; $output.=""; $output.=""; $output.=""; $output.=""; $output.="
".ucfirst($lang_l['mail type'])."".$f_br; $output.=f_build_select("type", $mails_list, $def_mail, '', 'key', $jstring).$f_br.$f_br."
".ucfirst($lang_l['mail subject'])."".$f_br ."
".ucfirst($lang_l['message'])."".$f_br ."
".$f_br."".ucfirst($lang_l['explanations'])."
Use %register_date% and %notes% for user registration info.
Use %calendarurl% for calendar page url.
".$f_br."
"; } $output=f_fmt_admin_screen($output, build_admin_menu($action_id)); $output=f_fmt_in_template($cal_template_fname,$output,$cal_css); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) print $output; else f_eval_php_code($output); } function get_sitemap_list() //event manager { global $sitemap_fname,$f_max_chars; $pages=array(); $sp_pages_ids=array('136','137','138','143'); if(file_exists($sitemap_fname)) { $fsize=filesize($sitemap_fname); if($fsize > 0) { $fp=fopen($sitemap_fname,'r'); while($data=fgetcsv($fp,$f_max_chars,'|')) { $data_str=implode('|',$data); $buffer=array(); if(strpos($data_str,'*/ ?>')===false && strpos($data_str,'')!==false && in_array($data[4],$sp_pages_ids)) { $p_name=(strpos($data[0],'#')!==false && strpos($data[0],'#')==0? str_replace('#','',$data[0]): $data[0]); $id=str_replace('','',$data[10]); $pages["'".$id."'"]=array('name'=>trim($p_name),'url'=>$data[1]); } } } fclose($fp); } } return $pages; } function format_users($users) { $users_array = array(); $details_arr = array(); $i = 1; while(strpos($users, ''); $basic = f_GFS($all, '').' '; $details = f_GFS($all, '
').' '; $access = f_GFS($all, '', '').' '; $news = f_GFS($all,'','').' '; // event manager list($username, $password) = explode (' ', $basic); $details_arr['email']=f_GFS($details,'email="','"'); $details_arr['name']=f_GFS($details,'name="','"'); $details_arr['sirname']=f_GFS($details,'sirname="','"'); $access_arr = array(); $j = 1; while (strpos($access, ''); $page_access_arr=array(); $m=1; while(strpos($access_full,'

'); $page_access_arr []=array('page'=>f_GFS($page_access_str,'page="','"'), 'type'=>f_GFS($page_access_str,'type="','"')); $m++; } $access_str = f_GFS($access_full, ''); list($section, $type) = explode (' ', $access_str); $access_arr [] = array(substr($section, 0, strpos($section, '=')) => f_GFS($section, '="', '"'), substr($type, 0, strpos($type, '=')) => f_GFS($type, '="', '"'),'page_access'=>$page_access_arr); $j++; } $news_arr=array();$j=1; // event manager while(strpos($news,''); list($page,$cat)=explode(' ',$news_str); $news_arr []=array(substr($page,0,strpos($page,'='))=>f_GFS($page,'="','"'), substr($cat,0,strpos($cat,'='))=>f_GFS($cat,'="','"')); $j++; } $user = f_GFS($username,'="','"'); $users_array [$user] = array('id'=>$i, 'username'=>$user, 'password'=>f_GFS($password,'="','"'), 'access'=>$access_arr, 'details'=>$details_arr, 'news'=>$news_arr); $i++; } return $users_array; } function get_user($username) { global $ca_fname; $users_arr=array(); $result=array(); $file_contents=f_read_file($ca_fname); $users=f_GFS($file_contents,'',''); if($users!='') $users_arr=format_users($users); if(!empty($users_arr)) { foreach($users_arr as $k=>$v) { if($username=='all') { $result[$k]=$v; } elseif(array_search($username,$v)!==false) { $result=$v; break; } } } return $result; } function has_access($pv_user,$page_info, $type) { global $page_id, $rel_path; $auth = false; $section_flag = false; $write_flag = false; $user_account = array(); $user_account = get_user($pv_user); if (isset($page_info [7]) && $page_info [7]!='' && $page_info [7]!='-1' && !empty($user_account)) { if($user_account['access'][0]['section']!='ALL' && $user_account['username']==$pv_user) { foreach($user_account['access'] as $k=>$v) { if( $page_info[7]==$v['section']) { if($type=='write' && $v['type']=='1') { $auth = true; } elseif($type=='write' && $v['type']=='2' && isset($v['page_access'])) { foreach($v['page_access'] as $key=>$val) { if($page_id==$val['page'] && $val['type']=='1') {$auth=true; break;} } } elseif($type=='read') { $auth = true; } break; } } } elseif($user_account['username']==$pv_user) { if($user_account['access'][0]['type']=='1'&& $type=='write') { $auth=true; } elseif($type=='read') { $auth=true; } } } return $auth; } function update_rssfeed() { global $db_fname, $f_use_linefeed, $f_lf, $cal_dir, $script_name, $lang_l, $page_charset, $location_label, $time_format, $full_path_to_script; global $rss_settings, $max_items_in_rss, $max_lines_in_rss_desc, $include_date_in_rss_desc, $category_vis; $entries_records=db_get_events_raw(0,0); $entries_records=db_get_events($entries_records,0,0); if(!empty($entries_records)) { foreach($entries_records as $key=>$row) {$row['Start_date']=intval($row['Start_date']); $sort_name[$key]=$row['Start_date'];} //sort $flag=array_multisort($sort_name,SORT_ASC,SORT_NUMERIC,$entries_records); if($max_items_in_rss!=0) $entries_records=array_slice($entries_records,0,$max_items_in_rss); if(isset($_GET['cat'])) { $temp=array(); foreach($entries_records as $k=>$v) { if(get_category($v['Category'])==$_GET['cat'] || $v['Category']==$_GET['cat']) {$temp[]=$v;} } $entries_records=$temp; } } $output=f_build_rss_header($rss_settings, $page_charset, $full_path_to_script."/".$script_name, filemtime($db_fname)); foreach ($entries_records as $k=>$v) { if(strpos(urldecode($v['Short_description']),'%%TEMPLATE1%%')===false && $category_vis[get_cat_index($v['Category'])]==true) { if(count($entries_records)==1 || $max_lines_in_rss_desc==0) { $details=f_sth_2(urldecode($v['Details'])); } else { $temp=f_sth_2(urldecode($v['Details'])); $max_chrl=$max_lines_in_rss_desc*60; if(strlen($temp)>$max_chrl) $details=f_split_html_content($temp, $max_chrl).' ...'; else $details=$temp; } $details=preg_replace("'<[/!]*?[^<>]*?>'si"," ",$details); $details=str_replace (array('<','&','"',' '),array('<','&','"',' '),$details); $more=''; if($include_date_in_rss_desc) { if(date('n j, Y',$v['Start_date'])==date('n j, Y',$v['End_date'])) {$more.=format_date($v['Start_date']).', ';} else {$more.=format_date($v['Start_date']).' - '.format_date($v['End_date']).', ';} if($time_format==12) {$t_format='g:i A';$pattern='12:00 AM';} else {$t_format='G:i';$pattern='0:00';} if((date($t_format,$v['Start_date'])==date($t_format,$v['End_date'])) && (date($t_format,$v['Start_date'])!=$pattern)) { $more.=date($t_format,$v['Start_date']).', '; } elseif(date($t_format,$v['Start_date'])!=$pattern) {$more.=date($t_format,$v['Start_date'])." - ".date($t_format,$v['End_date']).', ';} } $location_field_value=f_sth(urldecode($v['Location'])); if(!empty($location_field_value)) { $more.=$location_label.': '.$location_field_value.', '; } $output.=''.$f_lf.''.(empty($v['Short_description'])?'empty':f_sth(urldecode($v['Short_description']))).''.$f_lf; $output.=''.$full_path_to_script."/".$script_name."?entry_id=".$v['Id'].''.$f_lf; $output.=''.$more.(empty($v['Details'])?' ': $details).'<br clear="all">'.$f_lf; $output.=''.date('r', $v['Start_date']).''.$f_lf; $output.=''.$full_path_to_script."/".$script_name."?entry_id=".$v['Id'].''.$f_lf; $output.=''.f_sth(get_category($v['Category'],'color')).''.$f_lf; $output.=''.$f_lf; } } $output.=''.$f_lf.''; header('Content-Type: text/xml; charset='.$page_charset); echo $output; } function process_calendar() { global $prefix,$thispage_id,$page_id,$preview_on, $version,$doc_dir,$lg_, $cal_template_fname, $cal_css, $em_enabled, $admin_email, $s_path; global $def_view,$em_enabled,$s_path,$read_access,$available_lang_sets,$lang_l, $rel_path, $f_br, $f_ct, $cal_template_fname, $cal_settings_fname; global $category_id, $category_vis, $category_mark, $category_mark_color; $page_info=f_get_page_params($page_id, $rel_path); $action_id='show'; if(isset($_GET['action'])) $action_id=$_GET['action']; elseif (isset($_POST['action'])) $action_id=$_POST['action']; if($em_enabled && (strpos($admin_email,'your@email.here')!==false || empty($admin_email)) ) {print f_fmt_in_template($cal_template_fname,f_fmt_error_msg('EMAIL_NOTSET', '', 'calendar')); exit;} if(in_array($action_id, array("show","showcal","showevents","showcaljs","showeventsjs"))) { if($em_enabled) { if(!isset($_SESSION)) f_int_start_session(); if(isset($_SESSION['cur_user']) && has_access(f_get_session_var('cur_user'), $page_info, 'read')==true) { $read_access=true; } } show_calendar($action_id); } elseif($action_id=="logout") { if(!isset($_SESSION)) f_int_start_session('private'); f_unset_session(); show_calendar('show');} elseif($action_id=="preview") { $preview_on=true; show_calendar("show"); } elseif($action_id=="version") { echo $version; } elseif(in_array($action_id, array("register","chregister","clregister")) && $em_enabled) //event manager { if(!isset($_SESSION)) f_int_start_session(); if(isset($_SESSION['cur_user']) && has_access(f_get_session_var('cur_user'),$page_info,'read')==true) { register($action_id, f_get_session_var('cur_user')); } elseif(f_is_logged('SID_ADMIN')) { register($action_id, f_get_session_var('SID_ADMIN')); } else { $ref_url=$s_path.'?action='.$action_id.'&Id='.$_GET['Id']."&".$lg_.(isset($_GET['user'])? '&user='.$_GET['user']:''); f_url_redirect($doc_dir."centraladmin.php?pageid=$page_id&ref_url=".urlencode($ref_url),false); exit; } } elseif($action_id=="register" && !$em_enabled) { echo "Registering for Calendar Events is not supported."; exit;} elseif($action_id=="rss") {update_rssfeed();} else { if(!isset($_SESSION)) { f_int_start_session('private'); f_regenerate_session_id(); } if(!f_is_logged('SID_ADMIN') || (f_is_logged('HTTP_USER_AGENT') && f_get_session_var('HTTP_USER_AGENT')!= md5($_SERVER['HTTP_USER_AGENT']))) { if(!isset($_SESSION['cur_user']) || has_access(f_get_session_var('cur_user'),$page_info,'write')==false) { f_url_redirect($doc_dir."centraladmin.php?pageid=$page_id&indexflag=index&".$lg_,false); exit; } } if($action_id=="index") { show_calendar($action_id); } elseif($action_id=="addevent") { add_event($action_id);} elseif($action_id=="editevent") { edit_event($action_id);} elseif($action_id=="delevent") { save_event('index');} elseif($action_id=="saveevent") { save_event('index');} elseif($action_id=="mailing") { mailing($action_id);} elseif($action_id=="setmailing"){ set_mailing($action_id);} elseif($action_id=="emregister" && $em_enabled) { em_register($action_id);} elseif($action_id=="mng_settings") { if(isset($_GET['view'])) $view_type=$_GET['view']; else $view_type=$def_view; $current_date=my_getdate(); $mday=(isset($_GET['mday'])? $_GET['mday']: $current_date['mday']); $mon=(isset($_GET['mon'])? $_GET['mon']: $current_date['mon']); $year=(isset($_GET['year'])? $_GET['year']: $current_date['year']); if(isset($_POST['submit'])) { $tags=array('language', 'public_rss'); $newset=array($_POST['lang'], $_POST['public_rss']); f_write_tagged_data($tags, $newset, $cal_settings_fname, $cal_template_fname); $output=''.ucfirst($lang_l['settings saved']).""; } else { $rss_public_options=array('0'=>'false','1'=>'true'); $all_settings=f_read_file($cal_settings_fname); $def_lang=f_GFS($all_settings,'',''); if($def_lang=='' || $def_lang=='EZG') $def_lang='EN'; $def_public_rss=f_GFS($all_settings,'',''); if($def_public_rss=='') $def_public_rss='0'; $output="

" .f_fmt_admin_title($lang_l['settings']).$f_br.$f_br.''; $output.=''; $output.="
'.ucfirst($lang_l['language']).''; $output.=f_build_select('lang',$available_lang_sets,strtoupper($def_lang)).'
'.ucfirst($lang_l['public rss']).''.f_build_select('public_rss',$rss_public_options,$def_public_rss).'
".$f_br."
"; } $admin_menu=build_admin_menu($action_id); $output=f_fmt_admin_screen($output,$admin_menu); $output=f_fmt_in_template($cal_template_fname,$output,$cal_css); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) {print $output;} else {f_eval_php_code($output);} } elseif($action_id=='mng_categories' || $action_id=='del_category' || $action_id=='edit_category' || $action_id=='add_category') { $caption_style="font-size:10px;font-weight:bolder;line-height:16px;"; $span8=''.ucfirst('%s')."".$f_br; $marks_array=array('NA','X','@','#','$','%','&','*','!','?','~','+','-','^','<','>'); $err_on_submit=(isset($_POST['submit']) && (empty($_POST['cat_color']) || empty($_POST['cat_name']) || $_POST['cat_name']=='#')); $show_list_flag=true; $output=f_fmt_admin_title($lang_l['manage categories']).$f_br.$f_br; if($err_on_submit) $output.=f_format_err_msg('You have to set both Name and Color for the category').$f_br; if($action_id=='del_category' && isset($_GET['cat_id']) && $_GET['cat_id']!='0') { add_edit_category('del',$_GET['cat_id']); update_categories_list(); } elseif($action_id=='edit_category' && isset($_POST['submit']) && !$err_on_submit) {add_edit_category('edit',$_POST['cat_id']); update_categories_list();} elseif($action_id=='add_category' && isset($_POST['submit']) && !$err_on_submit) {add_edit_category('add'); update_categories_list();} elseif($action_id=='edit_category' || $action_id=='add_category') { $show_list_flag=false; $cat_name=''; $cat_color='#'; $cat_mark='NA'; $cat_mark_color='#'; $invis_checked=''; if($action_id=='edit_category') { $cat_id=$_REQUEST['cat_id']; settype($cat_id,'integer'); $cat_color=get_category($cat_id,'color'); $cat_name=get_category($cat_id,'name'); $index=get_cat_index($cat_id); if($category_vis[$index]==false) $invis_checked=' checked="checked"'; if(isset($category_mark[$index])) $cat_mark=$category_mark[$index]; if(isset($category_mark_color[$index])) $cat_mark_color=$category_mark_color[$index]; if($cat_mark!='NA' && empty($cat_mark_color)) $cat_mark_color='#ffffff'; } $cat_name=(isset($_POST['cat_name'])? $_POST['cat_name']: $cat_name); $cat_color=(isset($_POST['cat_color'])? $_POST['cat_color']: $cat_color); $cat_mark=(isset($_POST['cat_mark'])? $_POST['cat_mark']: $cat_mark); $cat_mark_color=(isset($_POST['mark_color'])? $_POST['mark_color']: $cat_mark_color); if(empty($cat_mark_color)) $cat_mark_color='#'; $invis_checked=(isset($_POST['cat_invisible'])? ' checked="checked"': $invis_checked); $output.='
'; if($action_id=='edit_category') $output.='
'.$f_br; } if($show_list_flag) { $output.=''; foreach($category_id as $k=>$v) { $cat_name=get_category($v,'name'); $output.=''; } $output.=''; $output.="
 
 '.$cat_name.'
'.ucfirst($lang_l['edit']).' '; if($k!=0) $output.=''.ucfirst($lang_l['delete']).'
"; } $output=f_fmt_admin_screen($output, build_admin_menu($action_id)); $output=f_fmt_in_template($cal_template_fname,$output,$cal_css); if(strpos($output,'<'.'?php')===false && strpos($output,'<'.'?')===false) {print $output;} else {f_eval_php_code($output);} } } } function build_add_category_form($cat_name, $cat_color, $cat_mark, $cat_mark_color, $invis_checked) { global $lang_l, $f_br, $f_ct, $s_path, $rel_path; $caption_style="font-size:10px;font-weight:bolder;line-height:16px;"; $span8=''.ucfirst('%s').""; $marks_array=array('NA','X','@','#','$','%','&','*','!','?','~','+','-','^','<','>'); $output='
'.sprintf($span8,ucfirst($lang_l['name'])) .$f_br.'' .'
' .sprintf($span8,ucfirst($lang_l['mark'])).$f_br .'
' .f_build_select('cat_mark', $marks_array, $cat_mark, ' title="'.ucfirst($lang_l['mark msg']).'" ', 'value').'
' .'
'.sprintf($span8,ucfirst($lang_l['category'])).$f_br .f_color_picker('cat_color',$rel_path).'
' .'' ."" ."" .'
'.ucfirst($lang_l['invisible']).'
'; return $output; } process_calendar(); ?>