anderes System! show_message("Durch Admin gesperrt!",'red','msg_attention.png'); } else { //process - insert user list($people_id,$system_name) = convert_user_registration_to_people($user_id); //successful added? - new 20140906 if ($people_id) { //successful //store obst people_id for later pdf if ($system_name=='obst') { $obst_people_ids .= $people_id."|"; } //save people_id's for PDF generation $people_ids .= $people_id."|"; $successful++; } //successful added } } //foreach //delete last delimiter $obst_people_ids = trim($obst_people_ids,'\|'); $people_ids = trim($people_ids,'\|'); //anything successful? if ($successful>0) { echo "

Benutzer Registrierung - Brief

"; //print icons headline(array( array("Zurück","left.gif","exec_ajax('$GLOBALS[token]',146, '&values[query_search]=true', 'boxRgt');") )); //create background job for creating pdf's and send mail in case of obst //start background job $uid = bg_job_create('generate_reg', "registration_create_pdf_and_email_start('$people_ids','$obst_people_ids');"); bg_job_keep_track($uid); } //successful else { //not successful //show query again //set action item $_REQUEST[actionItem]=$return_to_ai; //call action - query frame perform_actions($_REQUEST[actionItem], ''); } //not successful } /*----------------------------------------------*/ function registration_create_pdf_and_email_start($people_ids, $obst_people_ids) { //send reg pdf's as e-mail (only for OBST) in bg-job //20120312: created for obst //empty html $html = ''; //20180904: changed split to explode for php 7 //$people_array = split('\|', $people_ids); //$obst_people_array = split('\|', $obst_people_ids); $people_array = explode('|', $people_ids); $obst_people_array = explode('|', $obst_people_ids); //delete empty records $people_array=array_del_empty($people_array); $obst_people_array=array_del_empty($obst_people_array); //generate pdfs foreach ($people_array as $people_id) { //generate reg pdf now list($html,$pdf_header_background,$pdf_file_name) = generate_registration_pdf($people_id); //$html.=$html_part; //create array of pdf files to merge later on $pdf_file_array[] = $pdf_file_name; } //summary //generate summary pdf $filename="summary.pdf"; //generate pdf - and include header/background //html2pdf("/registration/".$filename,$pdf_header_background.$html); //merge all given pdfs merge_pdf(bsb_get_path('registration').$filename, $pdf_file_array); //display link to document (20110912: add uniqid for not caching document) echo "
"; //old //echo "Druck-Dokument"; //new: via return_document $onclick = "javascript:exec_ajax('$GLOBALS[token]',23, 'document_type=others&document_subtype=registration&attachment_id=$filename', '_BLANK');"; echo "
Druck-Dokument
"; echo "

"; if (sizeof($obst_people_array)==0) echo "Info: keine Obst-Anmeldung(en)."; //send obst email foreach ($obst_people_array as $people_id) { //send reg pdf (if exists) to mail-address (if exists) echo "E-MAIL VERSENDEN BEI OBST-AKTION

"; //get parent_id for kid $parent_id=get_parent_for_kid($people_id); //get data $people_data = load_data('VIEW_customer', 'customer_people_id', $people_id, '', true); //return only one dataset $mail_address = get_mail_for_people($people_data[MPpm_people_id]); //parent_id! //get variables for mail $mail_text = nl2br(replace_php_vars_with_values(get_misterp_variable("email_registrierung_obst_text"),$people_data)); $mail_subject = replace_php_vars_with_values(get_misterp_variable("email_registrierung_obst_subject"),$people_data); $attachment = bsb_get_path('registration').$people_id.".pdf"; //send email - if body text available if ($mail_text && $mail_subject) { if ( send_mail_attachment($mail_subject, $mail_address, $mail_text, array('people_id',$people_id), //linked to in output buffer base_path.doc_path, $attachment, "registrierung_".$people_data[klastname]."_".$people_data[kfirstname].".pdf")) { //mail sent! echo "Mail (OBST-Aktion) versenden an: $mail_address
"; //insert system logging write_system_logging('people', $people_id, "Registrierungs-PDF per Mail an $mail_address versendet."); } else { //mail not sent echo "FEHLER - Kein Mail (OBST-Aktion) versenden an: $mail_address
"; } } //text & subject available } } /*----------------------------------------------*/ function get_weekday_interval_values($weekday_interval_id) { //every second week? switch ($weekday_interval_id) { case '1': default: //weekly $days14=false; $days14_comment='jede'; break; case '2': //even week $days14=true; $days14_comment='gerade'; break; case '3': //odd week $days14=true; $days14_comment='ungerade'; break; } //every second week? return array($days14,$days14_comment); } /*----------------------------------------------*/ function convert_user_registration_to_people($user_id) { //get user registration and convert to people //for current schoolyear $user_data = load_data("MP_user_registration", "MPur_id", $user_id); //do not add twice !!! - new 20140906 if ($user_data[MPur_processed]!='0') { //return error return false; } //userdata available? if (!is_array($user_data)) { //data not found print_error(100051,'User ID: '.$user_id); } //start mysql transaction //20140906 changed to lock table //do_sqli("begin;"); do_sqli("SET autocommit=0;"); do_sqli("LOCK TABLES MP_people_main WRITE, MP_people_detail WRITE, MP_people_class_link WRITE, MP_people_bank_account WRITE, MP_meal_sub WRITE, MP_user_registration WRITE, SYS_logging WRITE, SYS_numbering_plan WRITE, MP_schoolyear READ, MP_class READ, MP_invoice_main READ, SYS_holiday READ, MP_holiday_valid_for READ, SYS_user READ, SYS_message WRITE, SYS_error_msg READ, SYS_dump_info WRITE;"); //parent / teacher $kind_id = ($user_data[MPur_teacher]=='1'?2:1); //2: teacher, 1: parent //set right branch - new 20120202 for obst switch ($user_data[MPur_system_name]) { case 'obst': $branch = '4'; //obst; break; case 'mittag': default: $branch = '1'; break; } //switch $sql = "insert into MP_people_main (MPpm_parent, MPpm_kind_id, MPpm_active, MPpm_branch, MPpm_online_registration) values (null, '$kind_id', /* parent (Eltern) vs teacher */ '1', /* active */ '$branch', /* normal customer (not web customer) */ '1')"; //is online registration $result = do_sqli($sql); $parent_id = $result->insert_id; //parent_details $sql = "insert into MP_people_detail (MPpd_people_id, MPpd_title, MPpd_firstname, MPpd_lastname, MPpd_street, MPpd_zip, MPpd_city, MPpd_birthday, MPpd_telephone) values ('$parent_id', '$user_data[MPur_title]', '$user_data[MPur_pfirstname]', '$user_data[MPur_plastname]', '$user_data[MPur_street]', '$user_data[MPur_zip]', '$user_data[MPur_city]', '0000-00-00', '$user_data[MPur_telephone]')"; do_sqli($sql); //parent bank account //20141003: date_of_signature added! $sql = "insert into MP_people_bank_account (MPba_people_id, MPba_payment_kind, MPba_mail_invoice, MPba_account_owner, MPba_blz, MPba_account, MPba_date_of_signature, MPba_mail_address_invoice, MPba_newsletter, MPba_mail_address_newsletter, MPba_from, MPba_till) values ('$parent_id', '$user_data[MPur_payment_kind_id]', /* 1=Überweisung, 2 = Bankeinzug */ '$user_data[MPur_mail_invoice]', '$user_data[MPur_account_owner]', '$user_data[MPur_blz]', '$user_data[MPur_account]', '".substr($user_data[MPur_datetime],0,10)."', '$user_data[MPur_email]', '".($user_data[MPur_newsletter]=='1'?'1':'0')."', '$user_data[MPur_newsletter_email]', now(), '9999-12-31')"; do_sqli($sql); //get next value from numbering_plan $new_id = numbering_plan_get_next_number(1); //customer/employee //get schoolyear data list($schoolyear_begin,$schoolyear_end)=get_active_schoolyear(); //write child unless teacher dataset if ($user_data[MPur_teacher]!='1') { //kid $sql = "insert into MP_people_main (MPpm_parent, MPpm_kind_id, MPpm_active, MPpm_branch, MPpm_online_registration) values ($parent_id, '3', /* kid (Schüler) */ '1', /* active */ '$branch', /* normal customer - not web customer or obst */ '1')"; //is online registration $result = do_sqli($sql); $kid_id = $result->insert_id; //kid details $sql = "insert into MP_people_detail (MPpd_people_id, MPpd_title, MPpd_firstname, MPpd_lastname, MPpd_street, MPpd_zip, MPpd_city, MPpd_birthday, MPpd_vegetarian, MPpd_password) values ('$kid_id', '$user_data[MPur_ktitle]', '$user_data[MPur_kfirstname]', '$user_data[MPur_klastname]', '$user_data[MPur_street]', '$user_data[MPur_zip]', '$user_data[MPur_city]', '$user_data[MPur_kbirthday]', '$user_data[MPur_vegetarian]', '".create_random_password(6)."')"; do_sqli($sql); //kid class link $sql = "insert into MP_people_class_link (MPpc_people_id, MPpc_class_id, MPpc_customer_number, MPpc_customer_barcode, MPpc_default_numbering_plan, MPpc_begin_date) values ('$kid_id', '$user_data[MPur_class_id]', '$new_id', '$new_id', '1', '$schoolyear_begin')"; //20121004: now() -> $schoolyear_begin do_sqli($sql); } //no teacher else { //teacher //assign teacher to class $sql = "insert into MP_people_class_link (MPpc_people_id, MPpc_class_id, MPpc_customer_number, MPpc_customer_barcode, MPpc_default_numbering_plan, MPpc_begin_date) values ('$parent_id', '$user_data[MPur_class_id]', '$new_id', '$new_id', '1', '$schoolyear_begin')"; //20121004: now() -> $schoolyear_begin do_sqli($sql); //update people details - vegetarian $sql = "update MP_people_detail set MPpd_vegetarian='$user_data[MPur_vegetarian]', MPpd_password='".create_random_password(6)."' where MPpd_people_id='$parent_id' limit 1"; do_sqli($sql); //assign parent (teacher) id as kid id $kid_id = $parent_id; } //get weekdays //20180904: changed split to explode for php 7 //$weekday_array = split('\|',$user_data[MPur_weekdays]); $weekday_array = explode('|',$user_data[MPur_weekdays]); //delete empty records $weekday_array=array_del_empty($weekday_array); //get back weekday_interval array //1..every week, 2..even week, 3..odd week $weekday_interval = unserialize($user_data[MPur_weekdays_interval]); //there are weekdays selected (could be that no day is selected -> teacher! if (sizeof($weekday_array)>0) { //there are weekdays selected! //insert subscriptions now //get registration time $reg_datetime = $user_data[MPur_datetime]; //20110314: dont start subs at schoolyear begin --> start with user reg time //20121009: add one day $reg_date = date_create($reg_datetime); //does not work for even-odd -> next monday (20130925 //date_modify($reg_date, '+2 days'); //20130827: +1 day --> +2 days //$reg_datetime_plus_1_day=date_format($reg_date, 'Y-m-d'); $reg_datetime=strtotime($reg_datetime); //20131001: for monday (loop will not be called at all) $next_day=date('Y-m-d', mktime(0,0,0,date('m',$reg_datetime),date('d',$reg_datetime)+1,date('Y',$reg_datetime))); //get next monday from first sub date //!!!! Fehler: hier wird nicht das next_day verwendet, sondern das reg_datetime while ( date('w', mktime(0,0,0,date('m',$reg_datetime),date('d',$reg_datetime),date('Y',$reg_datetime))) != 1) { $next_day=date('Y-m-d', mktime(0,0,0,date('m',$reg_datetime),date('d',$reg_datetime)+1,date('Y',$reg_datetime))); $reg_datetime=strtotime($next_day); $reg_date = $next_day; } $reg_datetime_plus_1_day= $next_day; //next monday $schoolyear_begin = $reg_datetime_plus_1_day; //$reg_datetime; $end_date_php = strtotime($schoolyear_end); //20130925: moved after schoolyear_begin-correction!!! //is first monday-week even or odd? $even_odd = ((date("W", strtotime($schoolyear_begin))%2)); //0..even, 1..odd $remove=0; $type='active'; //take one meal, marked as "use for menu" //$meals = get_only_one_meal_marked_for_menu($user_data[MPur_school_id]); //20130830: take meal_info_id and meal_type_id from registration data $meals = array($user_data[MPur_meal_info_id].'_'.$user_data[MPur_meal_type_id]); //20130830 - old - no veg anymore //extend meal by "_veg" in case that people is vegetarian! //if ($user_data[MPur_vegetarian]=='1') //{ // $meals[0].="_veg"; //} //perform subscription now for every single weekday, because of the weekly, even and odd option! foreach ($weekday_array as $single_weekday) { //get single weekday in array for function peform_subscription $single_weekday_array=array(); $single_weekday_array[]=$single_weekday; //get days14 mark and comment list($days14,$days14_comment) = get_weekday_interval_values($weekday_interval[$single_weekday]); if ($days14) { //in case that first week is odd and even is selected // OR that first week is even and odd is selected // --> add 7 days if (($even_odd=='0' && $weekday_interval[$single_weekday]=='3') || ($even_odd=='1' && $weekday_interval[$single_weekday]=='2')) { //add 7 days $b_date = date_create($schoolyear_begin); date_modify($b_date, '+7 days'); $sub_begin=date_format($b_date, 'Y-m-d'); } else $sub_begin = $schoolyear_begin; } else { //take schoolyear begin as begin date $sub_begin = $schoolyear_begin; } //print_r($single_weekday_array); //echo "weekday-int: ".$weekday_interval[$single_weekday]."
"; //echo "begin: $sub_begin
"; //echo "sy-begin: $schoolyear_begin
"; //exit; //echo "14days: $days14
"; //echo "
"; //subscribe for period of time perform_subscription($kid_id, '', //no sub for whole class $sub_begin, $schoolyear_end, $single_weekday_array, //former: weekday_array $meals, 0, //insert - not remove false, //dont show messages $days14, //14days false, //storno "Online Reg. [".($days14?'14T,':'').$days14_comment."]"); } //show summary message! show_message('Schultage angemeldet! ('.$user_data[MPur_weekdays].')','green','msg_ok.png'); } //weekdays selected //set processed flag in user_registration data $sql = "update MP_user_registration set MPur_processed='1', MPur_processed_timestamp=now(), MPur_converted_to_people_id='$kid_id' where MPur_id='$user_id' limit 1"; do_sqli($sql); //commit mysql transaction //do_sqli("commit"); //20140906 added //commit and unlock tables do_sqli("COMMIT;"); do_sqli("UNLOCK TABLES;"); //IMPORTANT!!!! set autocommit again to true!! do_sqli("SET autocommit=1;"); //insert system logging (20130904) write_system_logging('people', $kid_id, 'Web Registrierung übernommen.'); //reset payment_kind to Zahlschein until Ermächtigung erhalten! (manuell) //20120203 - NICHT MEHR NOTWENDIG --> lt. MARKUS /* $sql = "update MP_people_bank_account set MPba_payment_kind='1' where MPba_people_id='$parent_id' AND MPba_till='9999-12-31' limit 1"; do_sqli($sql); */ //20120312 - including system (obst/mittag) -> send obst pdf via e-mail return array($kid_id, $user_data[MPur_system_name]); } /*----------------------------------------------*/ function get_only_one_meal_marked_for_menu($school_id) { //get the one meal, marked as "use for menu" for given //school or exit with error (no ore more than one) $meal_data = load_data("MP_meal_info_h", "MPmi_school_id", $school_id, "MPmi_take_menue_for_invoice='1'", false); //all datasets if (sizeof($meal_data)!=1) { //less or more than one -> error print_error(100052,"school_id: $school_id"); } return array($meal_data[0][MPmi_id]); } /*----------------------------------------------*/ function generate_card_file($people_id) { //generate card file only //get current card include $card_include = load_global_setting('card_include'); //create image including barcode include_once(phpinc_path."/card/".$card_include); //get people data $people_data=get_people_data($people_id); //get branch $branch = $people_data[MPpm_branch]; //get class and school data $class_school_data = get_class_and_school_array($people_id); $school_text = get_misterp_variable("institution_bezeichnung")." $class_school_data[MPsc_name], $class_school_data[MPsc_street], $class_school_data[MPsc_zip] $class_school_data[MPsc_city]"; $school_name = $class_school_data[MPsc_name]; $class = $class_school_data[MPcl_class_name]; //get schoolyear $schoolyear=substr($class_school_data[MPsy_from_date],0,4)."/".substr($class_school_data[MPsy_to_date],0,4); //20120326: changed to customer_barcode (from customer_number), since wrong number // was used as barcode!!! -- Tel Markus $barcode=sprintf("%012d",$class_school_data[MPpc_customer_barcode]); $tmp_filename=create_card(strtoupper($people_data[MPpd_firstname])." ".strtoupper($people_data[MPpd_lastname]), $schoolyear, $class, $school_name, $school_text, $barcode, false, //do not rotate true, //with background $branch); return $tmp_filename; } /*----------------------------------------------*/ function try_to_get_weekdays_from_subs($people_id, &$meal_type_id) { //get name of weekdays $meal_type_id=0; //get online reg data $reg_data = load_data("MP_user_registration", "MPur_converted_to_people_id", $people_id); //online or manual registration? if ($reg_data[MPur_converted_to_people_id]==$people_id) { //was online registration -> take days from there //including all, even or odd $meal_type_id = $reg_data[MPur_meal_type_id]; //get weekdays //20180904: changed split to explode for php 7 //$weekday_array = split('\|',$reg_data[MPur_weekdays]); $weekday_array = explode('|',$reg_data[MPur_weekdays]); //delete empty records $weekday_array=array_del_empty($weekday_array); //get back weekday_interval array //1..every week, 2..even week, 3..odd week $weekday_interval = unserialize($reg_data[MPur_weekdays_interval]); $out_string=''; for ($i=1; $i < 8; $i++) { $day = ($i<7?$i:0); //sunday = 0 if (in_array($i,$weekday_array)) { //get days14 mark and comment list($days14,$days14_comment) = get_weekday_interval_values($weekday_interval[$day]); //generate output string $out_string.=$day."_".$days14_comment."|"; } } //foreach return $out_string; } //online reg else { //no online registration - was manual input! $sql = "SELECT sum(if(weekday(MPsb_date)='0',1,0)) as mon, sum(if(weekday(MPsb_date)='1',1,0)) as tue, sum(if(weekday(MPsb_date)='2',1,0)) as wed, sum(if(weekday(MPsb_date)='3',1,0)) as thu, sum(if(weekday(MPsb_date)='4',1,0)) as fri, sum(if(weekday(MPsb_date)='5',1,0)) as sat, sum(if(weekday(MPsb_date)='6',1,0)) as sun, sum(MPsb_date) as all_together FROM `MP_meal_sub` left join MP_schoolyear on MPsy_is_current='1' where MPsb_people_id='$people_id' AND MPsb_type='active' AND MPsb_date >= MPsy_from_date AND MPsb_date <= MPsy_to_date"; $result = do_sqli($sql); $row = $result->fetch_array(); if ($row[all_together] == 0) { return false; } else { return ($row[mon]>0?1:'')."|". ($row[tue]>0?2:'')."|". ($row[wed]>0?3:'')."|". ($row[thu]>0?4:'')."|". ($row[fri]>0?5:'')."|". ($row[sat]>0?6:'')."|". ($row[sun]>0?0:'')."|"; } } //no online reg } /*----------------------------------------------*/ function get_user_defined_password($people_id) { //read user defined password (if exists) $pw_data = load_data("MPC_user_defined_password", "MPCup_people_id", $people_id); return $pw_data[MPCup_password]; } /*----------------------------------------------*/ function generate_registration_pdf($people_id, $use_letter_paper=false) { //create registration pdf $html=""; //create registration pdf in html //get parent $parent_id = get_parent_for_kid($people_id); //get account data including mail behaivour! $bank_account_data = get_account_data($parent_id); //get class and school data (FROM people ID !) $class_school_data = get_class_and_school_array($people_id); //get current date for reminder date $today=date('d.m.Y',mktime(0,0,0,date('m'),date('d'),date('Y'))); //$GLOBALS[bank]="Kontonummer: ".$bank_account_data[0][MPba_account].", BLZ: ".$bank_account_data[0][MPba_blz]; $GLOBALS[bank]=text_iban_bic($bank_account_data[0][MPba_account],$bank_account_data[0][MPba_blz]); $global_company_name = load_global_setting('company_name'); $company_details = $global_company_name." * $class_school_data[MPsc_name] * $class_school_data[MPsc_street] * $class_school_data[MPsc_zip] $class_school_data[MPsc_city]
".text_iban_bic($class_school_data[MPsc_bank_account],$class_school_data[MPsc_BLZ],' * ')." * UID-Nummer: $class_school_data[MPsc_VAT]"; $company_address = "Absender: ".get_misterp_variable("institution_bezeichnung")." $class_school_data[MPsc_name]
$global_company_name, $class_school_data[MPsc_street], $class_school_data[MPsc_zip] $class_school_data[MPsc_city]"; //load parent and child people_data $parent_data=get_people_data($parent_id); $child_data =get_people_data($people_id); //20130205: user_defined_password available? $user_defined_password = get_user_defined_password($people_id); //set password to user_defined one! if ($user_defined_password) $child_data[MPpd_password]=$user_defined_password; //get branch $branch = $child_data[MPpm_branch]; $current_page=1; $current_line=0; //catch header ob_start(); echo print_pdf_head("90"); //170 echo print_pdf_background($company_details, $use_letter_paper); $pdf_header_background=ob_get_contents(); ob_end_clean(); //catch output ob_start(); //-------------------------------- //get right logo!!! switch ($branch) { case '4': //fruit $logo = graphics_path."/obst_logo.png"; break; case '1': //mittag default: $logo = graphics_path."/misterp_logo.png"; break; } echo "
"; //no use of pre-printed paper for logo&background if (!$use_letter_paper) { check_img_availability($logo, base_path); echo ""; } else { //space echo "
 
"; //690px +1,5cm } echo "
\n"; echo "
"; //Anschrift echo ""; echo "
$company_address
"; echo get_address($parent_id); echo "
"; echo "
  "; echo " 
"; echo ""; echo ""; echo " "; echo "
Datum: ".$today."
"; echo "
"; echo " 
 
"; //get days /* $user_data = load_data("MP_user_registration", "MPur_converted_to_people_id", $child_data[MPpd_people_id]); $days_string = $user_reg_data[MPur_weekdays]; */ //get weekdays from subs or reg-data and meal_type_id for online reg only! $weekdays = try_to_get_weekdays_from_subs($child_data[MPpd_people_id],$reg_meal_type_id); //get weekdays //20180904: changed split to explode for php 7 //$weekday_array = split('\|',$weekdays); $weekday_array = explode('|',$weekdays); $weekday_array=array_del_empty($weekday_array); //mittag vs fruit switch ($branch) { case '4': //fruit echo "Bestätigung zur Teilnahme am Europäischen Schulobstprogramm
Schulobstpass für $child_data[MPpd_firstname] $child_data[MPpd_lastname]
"; echo "

"; echo "
"; echo "

"; echo "Sehr geehrte".($parent_data[MPpd_title]=='Herr'?"r":"")." ".$parent_data[MPpd_title]." ".$parent_data[MPpd_lastname]."!"; echo "

"; echo "Vielen Dank für die Anmeldung ".($people_id==$parent_id?'':"von $child_data[MPpd_firstname] $child_data[MPpd_lastname]"). " zur Teilnahme am Schulobstprogramm!"; echo "

"; echo "Wir haben die Anmeldung wie folgt gespeichert:"; echo "

"; //echo ""; echo "
"; break; case '1': //mittag default: //others echo "Bestätigung der Anmeldung zum Mittagessen
Ihre Kundenkarte für $child_data[MPpd_firstname] $child_data[MPpd_lastname]
"; echo "

"; echo "
"; //echo ""; echo "

"; echo "Sehr geehrte".($parent_data[MPpd_title]=='Herr'?"r":"")." ".$parent_data[MPpd_title]." ".$parent_data[MPpd_lastname]."!"; echo "

"; echo "Vielen Dank für die Anmeldung ".($people_id==$parent_id?'':"von $child_data[MPpd_firstname] $child_data[MPpd_lastname]")." zum Mittagessen.
Wir haben die Anmeldung wie folgt gespeichert:

"; //sho meal type - only available if online reg if ($reg_meal_type_id!=0) { //show meal type $meal_type_data = load_data("MP_meal_types", "MPmt_id", $reg_meal_type_id); echo "Ihre gewählte Menüart: $meal_type_data[MPmt_name]
"; } echo "

"; //echo "
"; echo "
"; break; } //switch branch echo "
"; echo ""; echo ""; $out_days=''; $line1=$line2=''; $meal_table = ''; if (is_array($weekday_array) && sizeof($weekday_array)>0) //20180808 - because of pdf generation error { foreach ($weekday_array as $weekday_id_and_comment) { //20180904: changed split to explode for php 7 //list($weekday_id, $weekday_comment) = split('\_',$weekday_id_and_comment); list($weekday_id, $weekday_comment) = explode('_',$weekday_id_and_comment); switch ($weekday_comment) { default: case 'jede': $comment='wöchentlich'; break; case 'gerade': $comment='gerade Wochen'; break; case 'ungerade': $comment='ungerade Wochen'; break; } //$out_days .= $GLOBALS[weekdays][$weekday_id].($comment?' ('.$comment.')':'').", "; $line1 .= ""; $line2 .= ""; } $line1.=''; $line2.=''; $meal_table = "
".$GLOBALS[weekdays][$weekday_id]."$comment
$line1$line2
"; } //is_array //get text blocks //invoice if ($bank_account_data[0][MPba_mail_invoice]=='1') { //mail invoice $invoice_text = 'per Mail an '.$bank_account_data[0][MPba_mail_address_invoice]; } else { //invoice via post $invoice_text = 'per Post'; } //newsletter //newsletter flag not used! - unly supplied for web registrations //$newsletter_text = ($bank_account_data[0][MPba_newsletter]=='0'?'Nein':'Ja'); $newsletter_text = ($bank_account_data[0][MPba_mail_address_newsletter]==''?'Nein':'Ja'); //payment kind if ($bank_account_data[0][MPba_payment_kind]=='1') { //überweisung $account_text = 'Überweisung'; } else { switch ($branch) { case '4': //fruit //bankeinzug $account_text = 'Bankeinzug'; //20120301 deleted: (nach Erhalt der Einzugsermächtigung)'; break; case '1': //mittag default: //others //bankeinzug if (user_is_web_registered($people_id)) { //registered via web $account_text = 'Bankeinzug'; //20120822 deleted: nach Erhalt der Einzugsermächtigung! } else { //registered via paper-form $account_text = 'Bankeinzug'; } break; } //switch } //20130831 - not anymore valid //vegetarian //$vegetarian_text = ($child_data[MPpd_vegetarian]=='0'?'Nein':'Ja'); echo "".($branch=='4'?'Teilnahmetage':'Ihre bestellten Essenstage').": ". //trim($out_days,', '). $meal_table.""; echo "

"; echo "Die Rechnungslegung erfolgt: $invoice_text
"; // Newsletter:$newsletter_text"; echo "Die Bezahlung erfolgt mittels $account_text
"; //switch ($branch) //{ // case '4': //fruit // echo " "; // break; // case '1': //mittag // default: //others // //echo "Vegetarier:$vegetarian_text"; // echo " "; //} //switch //echo ""; //echo ""; echo "
"; echo "
"; //echo "
"; //content div //echo ""; echo "
"; //text switch ($branch) { case '4': //fruit //20160910: changed from mein-mittagessen.at -> essen.norbertinum.at echo "

"; echo "Bitte beachten sie, dass sie An-, Ab-, bzw. Ummeldungen jederzeit selbst online unter http://essen.norbertinum.at durchführen können!

"; //login data with border echo "
"; echo "Ihre persönlichen Zugangsdaten lauten:
Schulkennzahl: $class_school_data[MPsc_public_school_id], Benutzername: $class_school_data[MPpc_customer_number] , Passwort: $child_data[MPpd_password]
Ihr Passwort können sie nach dem ersten Login selbst ändern!
"; echo "

Anbei erhalten sie den Schulobstpass, welcher ".($people_id==$parent_id?'sie':$child_data[MPpd_firstname])." zum Bezug des Schulobstes berechtigt. Um einen reibungslosen Ablauf zu gewährleisten, ist es unbedingt erforderlich, dass jeder Teilnehmer des Schulobstprogramms den Ausweis mit hat!
"; echo "Ohne Ausweis kann eine Abgabe nur in absoluten Ausnahmefällen erfolgen!
"; echo "Bitte drucken sie diese Seite aus, schneiden sie den unten beigefügten Ausweis aus und geben sie diesen Ausweis ihrem Kind mit. Sie können den Ausweis auch gerne laminieren.

"; echo "Auf Wunsch erstellen wir den Schulobstpass gegen einen Unkostenbeitrag von € 3,00 inkl. Versand auch als praktische Plastikkarte. Bestellungen senden sie bitte per Mail an kundenbuchhaltung@misterp.at.
"; echo "Für weitere Fragen erreichen sie uns an Schultagen von 07:30 bis 11:00 Uhr unter der Telefonnummer ".get_misterp_variable('kundenhotline').". Außerhalb dieser Zeiten können sie uns gerne ein Mail an office@misterp.at senden."; echo "

"; //justify //echo "Ihr Team vom Schulbuffet Mister P."; echo "

Ihr Team vom Schulbuffet Mister P.

"; break; case '1': //mittag default: //others //20160910: changed from mein-mittagessen.at -> essen.norbertinum.at echo "

"; echo "Bitte beachten sie, dass sie An-, Ab-, bzw. Ummeldungen sowie Menüänderungen
jederzeit selbst online unter http://essen.norbertinum.at durchführen können!

"; //login data with border echo "
"; echo "Ihre persönlichen Zugangsdaten lauten:
Schulkennzahl: $class_school_data[MPsc_public_school_id], Benutzername: $class_school_data[MPpc_customer_number] , Passwort: $child_data[MPpd_password]
Ihr Passwort können sie nach dem ersten Login selbst ändern!
"; echo "

Anbei erhalten sie die Kundenkarte, welche ".($people_id==$parent_id?'sie':$child_data[MPpd_firstname])." zum Bezug des Mittagessens berechtigt.
Um einen reibungslosen Ablauf während der Essenszeiten zu gewährleisten, ist es unbedingt erforderlich, dass jeder der am Mittagessen teilnehmen möchte, den Ausweis mit hat!


"; echo "

Ohne Ausweis kann eine Abgabe des Mittagessens nur in absoluten Ausnahmefällen erfolgen!


"; echo "

Die Karte darf nicht geknickt, zerschnitten, beschmiert bzw. unleserlich gemacht werden!"; //echo " Die Kosten in Höhe von €  5,00"; //20130831 - not working, since in pferdeschule is EUR 15,- inkl. reg amount //sprintf("%1\$.2f",get_misterp_variable("gebuehr_kartenausstellung")) //echo " inklusive Versand werden mit der ersten Rechnung verrechnet."; echo "
Die aktuellen Speisepläne finden sie unter ". get_misterp_variable("speiseplan_link").".


"; //old - changed 20120724 //echo "Sie erreichen uns an Schultagen von 08:00 bis 16:00 Uhr unter der Telefonnummer 0664 / 92 99 999.
Außerhalb dieser Zeiten können sie uns gerne ein Mail an // office@misterp.at senden.

"; //????????????????? echo "

Bei Fragen, Wünschen und Anregungen steht Ihnen unsere Kunden-Hotline an Schultagen von 07:30 - 11:00 Uhr
unter der Telefonnummer ".get_misterp_variable('kundenhotline')." zur Verfügung! Außerhalb dieser Zeiten können sie uns gerne ein Mail an ".get_misterp_variable('kundenemail')." senden. Wir werden dieses schnellstmöglich bearbeiten."; echo "

"; //justify //echo "Ihr Team vom Schulbuffet Mister P."; //20130901 deleted //echo "

Ihr Team vom Schulbuffet Mister P.

"; break; } //switch; check_img_availability(graphics_path."/reg_sisslor.jpg", base_path); echo "
"; //echo "
"; //echo "
"; //content div echo "
"; switch ($branch) { case '4': //fruit echo "SCHULOBSTPASS

"; echo "Hier ist Dein persönlicher Schulobstpass!

"; echo "
"; //barcode copy(generate_card_file($people_id),data_common_path.bsb_get_path('registration').$people_id.".png"); break; case '1': //mittag default: //others echo "ERSATZAUSWEIS
"; echo "

Sollte der Essensausweis einmal verloren gehen, kurzfristig unauffindbar oder kaputt sein, dient dieser Abschnitt bis zur Ausstellung einer neuen Karte als Ersatzausweis!

"; //old 20120724 //echo "Ein neuer Ausweis kann unter
office@misterp.at beantragt werden."; //20160910: changed from mein-mittagessen.at -> essen.norbertinum.at echo "Ein neuer Ausweis kann unter
essen@norbertinum.at beantragt werden.

Wir empfehlen, diesen Ersatzausweis in das Mitteilungsheft zu kleben, um ihn im Bedarfsfall griffbereit zu haben.

Es gelten unsere allgemeinen Geschäftsbedingungen."; echo "

"; echo "
"; //barcode copy(generate_card_file($people_id),data_common_path.bsb_get_path('registration').$people_id.".png"); break; } //switch check_img_availability(bsb_get_path('registration').$people_id.".png"); echo ""; echo "
"; switch ($branch) { case '4': //fruit break; case '1': //mittag default: //others break; } echo ""; //-------------------------------- //get output and generate pdf $html=ob_get_contents(); ob_end_clean(); //save single pdf in registration folder //20120822: extend with pre-printed paper option $filename=bsb_get_path('registration').$child_data[MPpd_people_id].($use_letter_paper?'_plain':'').".pdf"; //generate pdf - and include header/background html2pdf($filename,$pdf_header_background.$html); //insert system logging write_system_logging('people', $people_id, 'Registrierungs-PDF erstellt.'.($use_letter_paper?'(auf Briefpapier)':'')); //update people_data and set registration_printed! $sql = "update MP_people_main set MPpm_registration_printed=1 where MPpm_people_id='$people_id' limit 1"; do_sqli($sql); return array($html, $pdf_header_background, $filename); } /*----------------------------------------------*/ function registration_fee_charged_this_schoolyear($people_id) { //check whether registraion_fee was already //be charged this schoolyear and return date if so //note: type=2 : Anmeldegebühr $sql = "select MPic_date from MP_items_to_charge left join MP_schoolyear on MPsy_is_current=1 where MPic_date >= MPsy_from_date AND MPic_date <= MPsy_to_date AND MPic_people_id = '$people_id' AND MPic_type = 2 order by MPic_date desc"; $result = do_sqli($sql); $row = $result->fetch_array(); //return at least first date return $row[MPic_date]; } /*----------------------------------------------*/ function user_is_web_registered($people_id) { //return whether user is registered via web (true) or via paper form (false) //try to get weg registration data $user_data = load_data("MP_user_registration", "MPur_converted_to_people_id", $people_id); //found -> was converted from web return ($user_data[MPur_converted_to_people_id]==$people_id); } /*----------------------------------------------*/ function get_txt_data_2014() { $fp = popen("ls ".data_common_path.bsb_get_path('registration')."/*.txt",'r'); while (!feof($fp)) { $files[] = trim(fgets($fp, 4096)); } foreach ($files as $file) { if (file_exists($file)) { $content = file_get_contents($file); preg_match('/Mail an ([\.0-9A-Za-z\_\-\@]*)/',$content,$matches); $mail_address = $matches[1]; //Schulkennzahl: 324371, Benutzername: 552981, Passwort: h6q6ir preg_match('/Schulkennzahl\: ([0-9]*)\, Benutzername\: ([0-9]*)\, Passwort\: ([0-9a-z]*)/',$content,$matches); $user_id=$matches[1]; $user=$matches[2]; $pw = $matches[3]; //Kundenkarte fur Frau/Herrxxxx preg_match('/Kundenkarte f... ([a-zA-Z]*) ([^\s]*)/',$content,$matches); $vorname = $matches[1]; $nachname = $matches[2]; $out.= "$user_id,$nachname,$vorname,$mail_address,$user,$pw\n"; } //file exists } echo $out; file_put_contents(data_common_path.bsb_get_path('registration')."/reg_20140906_extracted_pdf.txt",$out); } /*----------------------------------------------*/ function delete_wrong_2014() { //DO NOT RUN!!!!! exit; $sql = "select * from SYS_logging left join MP_people_main on Slo_link_id=MPpm_people_id left join MP_user_registration on Slo_link_id=MPur_converted_to_people_id where Slo_datetime>='2014-09-05 00:00:00' AND Slo_user='admin' AND Slo_kind='people' AND Slo_text='Registrierungs-PDF erstellt.' AND MPpm_online_registration=1 AND isnull(MPur_id)"; $result = do_sqli($sql); while ($row = $result->fetch_array()) { $people_id = $row[Slo_link_id]; echo $people_id."
"; delete_complete_people($people_id); } } /*----------------------------------------------*/ function delete_complete_people($people_id) { //20140905: used to correct (DELETE) double registered people //including parents! //DO NOT USE!!!! //get people data (main+detail) $people_data=get_people_data($people_id); $parent_id = $people_data[MPpm_parent]; //delete parent recursive now if ($parent_id>0) delete_complete_people($parent_id); //delete the following data tables: // MP_people_main // MP_people_detail // MP_people_bank_account // MP_people_class_link //start mysql transaction do_sqli("begin;"); $sql = "delete from MP_people_main where MPpm_people_id='$people_id' limit 1"; do_sqli($sql); $sql = "delete from MP_people_detail where MPpd_people_id='$people_id' limit 1"; do_sqli($sql); $sql = "delete from MP_people_bank_account where MPba_people_id='$people_id'"; do_sqli($sql); $sql = "delete from MP_people_class_link where MPpc_people_id='$people_id'"; do_sqli($sql); $sql = "delete from MP_meal_sub where MPsb_people_id='$people_id'"; do_sqli($sql); //commit mysql transaction do_sqli("commit"); } ?>name = $name; $this->type = $type; $this->x_name = $x_name; $this->y_name = $y_name; } function set_size($pixel_x,$scale_x,$pixel_y,$scale_y) { $this->pixel_x = $pixel_x; $this->pixel_y = $pixel_y; $this->scale_x = $scale_x; $this->scale_y = $scale_y; } function add_step($x_y, $text) { //add steps on each axis switch ($x_y) { case 'x': array_push($this->step_x_array, $text); break; case 'y': array_push($this->step_y_array, $text); break; } } function add_curve($name, $style, $color, $point_array) { //add points to display $this->curve_array[] = array(utf8_encode($name), $style, $color, $point_array); } function chart_generate_xml() { //generate xml structure and write to database $main = new SimpleXMLElement("name."\">"); $rulers = $main->addChild('rulers'); /*******/ /* X */ /*******/ $ruler_x = $rulers->addChild('x'); $ruler_x->addChild('name',$this->x_name); $scale_x = $ruler_x->addChild('scale'); $pixel_x = $scale_x->addChild('pixel',$this->pixel_x); $value_x = $scale_x->addChild('value',$this->scale_x); $steps_x = $ruler_x->addChild('steps'); //steps x foreach ($this->step_x_array as $step) { $steps_x->addChild('step',$step); } /*******/ /* Y */ /*******/ $ruler_y = $rulers->addChild('y'); $ruler_y->addChild('name',$this->y_name); $scale_y = $ruler_y->addChild('scale'); $pixel_y = $scale_y->addChild('pixel',$this->pixel_y); $value_y = $scale_y->addChild('value',$this->scale_y); $steps_y = $ruler_y->addChild('steps'); //steps y foreach ($this->step_y_array as $step) { $steps_y->addChild('step',$step); } /*******************/ /* C U R V E S */ /*******************/ if (is_array($this->curve_array)) { foreach ($this->curve_array as $curve) { $chart = $main->addChild('chart'); $c_name = $chart->addChild('name',$curve[0]); $style = $curve[1]; $c_style = $chart->addChild('style',$style); //bars,lines $c_color = $chart->addChild('color',$curve[2]); $points = $chart->addChild('points'); if (is_array($curve[3])) { foreach ($curve[3] as $point) { //points $points->addChild('point',$point); } //foreach } //is_array } //foreach } //is array //echo $main->asXML(); //write to sql $sql = "insert into SYS_chart_temp (Sct_system_uid, Sct_user, Sct_data) values ('$GLOBALS[system_uid]', '$GLOBALS[username]', '".addslashes($main->asXML())."')"; $result = do_sqli($sql); //return id from dataset return $result->insert_id; } } //ChartClass /*-----------------------*/ /* C O N S T A N T S */ /*-----------------------*/ /*-----------------------*/ /* F U N C T I O N S */ /*-----------------------*/ /*----------------------------------------------*/ function chart_show_flash($id) { //show flash code with right url for xml file //get xml data $xml_data = load_data("SYS_chart_temp", "Sct_id", $id, "Sct_system_uid='$GLOBALS[system_uid]'"); //html for flash echo $xml_data[Sct_data]; //delete data now do_sqli("delete from SYS_chart_temp where Sct_system_uid='$GLOBALS[system_uid]' AND Sct_id='$id'"); exit; } ?> Bezirksliste - BFK Mödling

Bezirksliste - BFK Mödling

Login

Benutzername:
Kennwort: