$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } $sql.= "GROUP BY t_workshops.WORKSHOP_ID "; if ($order_element) { $sql.= "ORDER BY ".$order_element." ".$order_order." "; } else { $sql.= "ORDER BY t_workshops.WORKSHOP_ID DESC "; } $sql.= "LIMIT ".$index_element.", ".$show_elements." "; // echo "
".$sql."
"; $datos_results = LIB_db_generic_query($sql, $connection); //print_r($datos_results); // generamos los datos validos $results = MOD_WORKSHOPS_get_workshops_results($datos_results, $destiny); return $results; } // contabiliza el total de resultados de una busqueda function MOD_WORKSHOPS_search_total_workshops ($search_criteria=false, $destiny=false, $forceDB=false) { global $GLOBAL_config, $MOD_WORKSHOPS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT COUNT(DISTINCT(t_workshops.WORKSHOP_ID)) ". "FROM t_workshops ". "LEFT JOIN t_school_centers ON t_workshops.CENTER_ID = t_school_centers.CENTER_ID ". "WHERE t_workshops.WORKSHOP_options_erased=0 "; if (is_array($search_criteria)) { foreach ($search_criteria as $key=>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } // echo $sql; $datos_results = LIB_db_generic_query($sql, $connection); return $datos_results[0][0]; } // muestrea los resultados de una busqueda function MOD_WORKSHOPS_get_workshops_results ($complete_results, $destino='') { global $GLOBAL_config, $MOD_WORKSHOPS_config, $search_criteria; if (is_array($complete_results)) { foreach($complete_results as $key=>$result) { switch ($destino) { case "load": default: $final_results[$key]["WORKSHOP_ID"] = $result["WORKSHOP_ID"]; $final_results[$key]["WORKSHOP_name"] = $result["WORKSHOP_name"]; $final_results[$key]["WORKSHOP_intervention_days"] = $result["WORKSHOP_intervention_days"]; $final_results[$key]["WORKSHOP_hours"] = $result["WORKSHOP_hours"]; $final_results[$key]["WORKSHOP_remark"] = $result["WORKSHOP_remark"]; $final_results[$key]["WORKSHOP_order"] = $result["WORKSHOP_order"]; $final_results[$key]["CENTER_ID"] = $result["CENTER_ID"]; break; } } } else { $final_results[0]["WORKSHOP_name"] = ""; $final_results[0]["WORKSHOP_intervention_days"] = ""; $final_results[0]["WORKSHOP_hours"] = ""; $final_results[0]["CENTER_name"] = ""; $final_results[0]["OP"] = ""; } return $final_results; } // Función para generar un SELECT con las categorieas function MOD_WORKSHOPS_generate_workshops_select ($selected=false, $selected_action="add_selecteds") { global $GLOBAL_config, $MOD_WORKSHOPS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $elements = LIB_db_select_query("WORKSHOP_ID, WORKSHOP_name", "t_workshops", $connection, "WORKSHOP_options_erased=0 ORDER BY WORKSHOP_name "); $html = ""; if (!is_array($selected)) { $selected = explode(";", $selected); } if (is_array($elements)) { foreach ($elements as $value) { // Si ESTE elemento NO ESTÁ en los elementos pasados como parámetro, lo incluimos en el listado switch ($selected_action) { case "add_selecteds": $html.= ""; } return $html; } ?>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } $sql.= "GROUP BY t_school_centers.CENTER_ID "; if ($order_element) { $sql.= "ORDER BY ".$order_element." ".$order_order." "; } else { $sql.= "ORDER BY t_school_centers.CENTER_ID DESC "; } $sql.= "LIMIT ".$index_element.", ".$show_elements." "; // echo "
".$sql."
"; $datos_results = LIB_db_generic_query($sql, $connection); //print_r($datos_results); // generamos los datos validos $results = MOD_SCHOOLCENTERS_get_centers_results($datos_results, $destiny); return $results; } // contabiliza el total de resultados de una busqueda function MOD_SCHOOLCENTERS_search_total_centers ($search_criteria=false, $destiny=false, $forceDB=false) { global $GLOBAL_config, $MOD_SCHOOLCENTERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT COUNT(DISTINCT(t_school_centers.CENTER_ID)) ". "FROM t_school_centers ". "WHERE t_school_centers.CENTER_options_erased=0 "; if (is_array($search_criteria)) { foreach ($search_criteria as $key=>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } // echo $sql; $datos_results = LIB_db_generic_query($sql, $connection); return $datos_results[0][0]; } // muestrea los resultados de una busqueda function MOD_SCHOOLCENTERS_get_centers_results ($complete_results, $destino='') { global $GLOBAL_config, $MOD_SCHOOLCENTERS_config, $search_criteria; if (is_array($complete_results)) { foreach($complete_results as $key=>$result) { switch ($destino) { case "load": default: $final_results[$key]["CENTER_ID"] = $result["CENTER_ID"]; $final_results[$key]["CENTER_name"] = htmlentities($result["CENTER_name"]); $final_results[$key]["CENTER_info"] = nl2br($result["CENTER_info"]); $final_results[$key]["CENTER_confirmed"] = $result["CENTER_confirmed"]; $final_results[$key]["CENTER_confirmed_text"] = $result["CENTER_confirmed_text"]; $search_criteria_workshops["t_workshops.CENTER_ID"] = $result["CENTER_ID"]; $total_workshops = MOD_WORKSHOPS_search_total_workshops($search_criteria_workshops); $results_workshops = MOD_WORKSHOPS_search_workshops(0, $total_workshops, "WORKSHOP_order", "ASC", $search_criteria_workshops, "load"); $final_results[$key]["WORKSHOPS"] = $results_workshops; break; } } } else { $final_results[0]["CENTER_ID"] = ""; $final_results[0]["CENTER_name"] = ""; $final_results[0]["OP"] = ""; } return $final_results; } // Función para generar un SELECT con las categorieas function MOD_SCHOOLCENTERS_generate_centers_select ($selected=false, $selected_action="add_selecteds", $search_criteria=false) { global $GLOBAL_config, $MOD_SCHOOLCENTERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT CENTER_ID, CENTER_name FROM t_school_centers ". "WHERE CENTER_options_erased=0 AND ( ". "(". "SELECT COUNT(WORKSHOP_ID) ". "FROM t_workshops ". "WHERE t_workshops.CENTER_ID = t_school_centers.CENTER_ID ". "AND WORKSHOP_options_erased =0 ". ") >0 ". ") "; if ($search_criteria != false && is_array($search_criteria)) { foreach ($search_criteria as $key_criteria=>$value_criteria) { $sql.= "AND ".$key_criteria." = ".$value_criteria." "; } } $sql.=" ORDER BY CENTER_ID ASC "; echo("[".$sql."]"); $elements = LIB_db_generic_query($sql, $connection); $html = ""; if (!is_array($selected)) { $selected = explode(";", $selected); } if (is_array($elements)) { foreach ($elements as $value) { // Si ESTE elemento NO ESTÁ en los elementos pasados como parámetro, lo incluimos en el listado switch ($selected_action) { case "delete_selecteds": if (!in_array($value[0], $selected)) { $html.= ""; } return $html; } ?>"); // var_dump($datos); // echo(""); if (is_array($datos)) { if (empty($id)) { $datos["USER_inscription_date"] = "NOW()"; // insertamos el nuevo elemento $return = LIB_db_insert_query($datos, "t_users", $connection); $id = LIB_db_id($connection); } else { // modificamos el elemento $return = LIB_db_update_query($datos, "t_users", $connection, "USER_ID='".$id."' "); } // else if (!empty($id)) { // ************************************************************************************************************ // ********** STAR workshops ********************************************************************************** if (isset($data["workshops"]) && !empty($data["workshops"]) && is_array($data["workshops"]) && isset($data["workshops"][0]) && !empty($data["workshops"][0])) { // Delete the user workshops to re-insert ALL LIB_db_delete_query("t_users_workshops", $connection, "USER_ID=".$id); foreach ($data["workshops"] as $key_workshop=>$value_workshop) { $temp_user_workshop["USER_ID"] = $id; $temp_user_workshop["WORKSHOP_ID"] = $value_workshop; LIB_db_insert_query($temp_user_workshop, "t_users_workshops", $connection); } } // ********** END workshops *********************************************************************************** // ************************************************************************************************************ // images // echo("
");
			// var_dump($_FILES);
			// echo("
"); // ************************************************************************************************************ // ********** MANEJO DE IMAGENES ****************************************************************************** // ************************************************************************************************************ if (isset($_FILES["images"]) && is_array($_FILES["images"])) { for ($contImages=0;$contImages$value_imageType) { // Obtengo los tipos de medidas para esta imagen $actualIimage_sizeTypes = array_keys($value_imageType); if (preg_match("/^MAX_/", $actualIimage_sizeTypes[0]) && preg_match("/^MAX_/", $actualIimage_sizeTypes[2])) { // Redimensión por TAMAÑOS MAXIMOS $transform_percent = -0+LIB_imagenes_get_image_transformation_percent($dimensions[0], $dimensions[1], $value_imageType["WIDTH"], $value_imageType["HEIGHT"]); // echo("

Redimensioando imagen POR TAMAÑO MAXIMO " .$_FILES["images"]["name"][$contImages]. " Medidas INICIALES : [" .$dimensions[0]. "] x [" .$dimensions[1]. "] Medidas DESTINO: [" .$value_imageType["WIDTH"]. "] x [" .$value_imageType["HEIGHT"]. "] -->" .$MOD_PRESSROOM_config["NOTES"]["IMAGES_DIR"].$id."_".$contImages."_".$key_imageType."." .$actualImage_extension. ""); // resizing the image $error = LIB_imagenes_generate_image($_FILES["images"]["tmp_name"][$contImages], $MOD_USERS_config["IMAGES_DIR"].$id."_".$contImages."_".$key_imageType. "." .$actualImage_extension, 0, 0, "", "", $value_imageType["WIDTH"], $value_imageType["HEIGHT"], $transform_percent, 100, "", array(255, 255, 255), "backend", false); // Verificamos si se ha producido error al redimensionar la imagen if (!$error) { GLOBAL_set_message("ERROR", "Transformacion MATRIX. Error al transformar la imagen " .$_FILES["images"]["name"][$contImages]. ".
Vuelva a insertarla."); } } else { // echo("

Redimensioando imagen POR TAMAÑO FIJO " .$_FILES["images"]["name"][$contImages]. " Medidas INICIALES : [" .$dimensions[0]. "] x [" .$dimensions[1]. "] Medidas DESTINO: [" .$value_imageType["WIDTH"]. "] x [" .$value_imageType["HEIGHT"]. "] -->" .$MOD_PRESSROOM_config["NOTES"]["IMAGES_DIR"].$id."_".$contImages."_".$key_imageType."." .$actualImage_extension. ""); $transform_percent = -0+LIB_imagenes_get_image_transformation_percent($dimensions[0], $dimensions[1], $value_imageType["WIDTH"], $value_imageType["HEIGHT"]); // Redimension por TAMAÑOS FIJOS $error = LIB_imagenes_generate_image($_FILES["images"]["tmp_name"][$contImages], $MOD_USERS_config["IMAGES_DIR"].$id."_".$contImages."_".$key_imageType."." .$actualImage_extension, 0, 0, $value_imageType["WIDTH"], $value_imageType["HEIGHT"], $value_imageType["WIDTH"], $value_imageType["HEIGHT"], 100, 100, "", array(255, 255, 255)); // Verificamos si se ha producido error al redimensionar la imagen if (!$error) { GLOBAL_set_message("ERROR", "Transformación TAMAÑO FIJO. Error al transformar la imagen " .$_FILES["images"]["name"][$contImages]. ".
Vuelva a insertarla."); } } } } else { GLOBAL_set_message("ERROR", "El fichero para la imagen " .$_FILES["images"]["name"][$contImages]. " no coincide con el formato especificado.
Convierta la imagen antes de insertarla."); } } } } } // fin del manejo de IMÁGENES if (isset($_FILES["files"]) && is_array($_FILES["files"])) { // ************************************************************************************************************ // ********** MANEJO DE ARCHIVOS ****************************************************************************** // ************************************************************************************************************ // echo("
");
				// var_dump ($_FILES["files"]);
				// echo("
"); if (!$_FILES["files"]["error"][0]) { $file_extension = explode(".", $_FILES["files"]["name"][0]); $file_extension = array_pop($file_extension); //echo("Copiamos [".$_FILES["files"]["tmp_name"][0]."] en el siguiente destino [".$MOD_USERS_config["FILES_DIR"].$id.".".$file_extension."]"); copy($_FILES["files"]["tmp_name"][0], $MOD_USERS_config["FILES_DIR"].$id.".".$file_extension); } } } // if id } // if LIB_db_close($connection); return $id; } // carga los datos function MOD_USERS_load_users ($id) { global $GLOBAL_config, $MOD_USERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; // cargamos los datos basicos $datos = LIB_db_select_query("*", "t_users", $connection, "USER_ID='".$id."' "); // $datos = $datos[0]; $datos = MOD_USERS_get_users_results ($datos, "load"); return $datos; } // search the last modified entry function MOD_USERS_search_last_users_modified ($search_criteria=false) { global $GLOBAL_config, $MOD_USERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT t_users.USER_ID ". "FROM t_users ". "WHERE USER_options_erased=0 AND USER_options_modified > '".date("Y-m-d H:i:s", mktime(date("H")-1, date("i"), date("s"), date("m"), date("d"), date("Y")))."' "; if (is_array($search_criteria)) { foreach ($search_criteria as $key=>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } $sql.= "ORDER BY USER_options_modified DESC LIMIT 1"; //echo $sql; $datos_results = LIB_db_generic_query($sql, $connection); return $datos_results[0][0]; } // realiza una busqueda function MOD_USERS_search_workshops ($index_element=0, $show_elements=10, $order_element=false, $order_order="ASC", $search_criteria=false, $destiny=false, $forceDB=false) { global $GLOBAL_config, $MOD_USERS_config, $LIB_db_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT t_users.*, t_school_centers.* ". "FROM t_users ". "LEFT JOIN t_school_centers ON t_users.CENTER_ID = t_school_centers.CENTER_ID ". "WHERE t_users.USER_options_erased=0 "; if (is_array($search_criteria)) { foreach ($search_criteria as $key=>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } $sql.= "GROUP BY t_users.USER_ID "; if ($order_element) { $sql.= "ORDER BY ".$order_element." ".$order_order." "; } else { $sql.= "ORDER BY t_users.USER_ID DESC "; } $sql.= "LIMIT ".$index_element.", ".$show_elements." "; // echo "
".$sql."
"; $datos_results = LIB_db_generic_query($sql, $connection); //print_r($datos_results); // generamos los datos validos $results = MOD_USERS_get_users_results($datos_results, $destiny); return $results; } // contabiliza el total de resultados de una busqueda function MOD_USERS_search_total_workshops ($search_criteria=false, $destiny=false, $forceDB=false) { global $GLOBAL_config, $MOD_USERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $sql = "SELECT COUNT(DISTINCT(t_users.USER_ID)) ". "FROM t_users ". "LEFT JOIN t_school_centers ON t_users.CENTER_ID = t_school_centers.CENTER_ID ". "WHERE t_users.USER_options_erased=0 "; if (is_array($search_criteria)) { foreach ($search_criteria as $key=>$value) { if (!empty($value)) { if (preg_match("/_ID$/", $key)) { if (preg_match("/NOT_/", $key)) { $key = explode("NOT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." != '".addslashes($value)."' "; } else { $sql.= "AND ".$key." = '".addslashes($value)."' "; } } else { if (preg_match("/EXACT_/", $key)) { $key = explode("EXACT_", $key); $key = $key[0].$key[1]; $sql.= "AND ".$key." = '".addslashes($value)."' "; } else { $sql.= "AND ".$key." LIKE '%".addslashes($value)."%' "; } } } } } // echo $sql; $datos_results = LIB_db_generic_query($sql, $connection); return $datos_results[0][0]; } // muestrea los resultados de una busqueda function MOD_USERS_get_users_results ($complete_results, $destino='') { global $GLOBAL_config, $MOD_USERS_config, $search_criteria; if (is_array($complete_results)) { foreach($complete_results as $key=>$result) { switch ($destino) { case "load": $final_results[$key]["USER_ID"] = $result["USER_ID"]; $final_results[$key]["USER_name"] = htmlentities($result["USER_name"]); $final_results[$key]["USER_year"] = $result["USER_year"]; $final_results[$key]["USER_address_address"] = $result["USER_address_address"]; $final_results[$key]["USER_address_cp"] = $result["USER_address_cp"]; $final_results[$key]["USER_address_city"] = $result["USER_address_city"]; $final_results[$key]["USER_special_educational_needs"] = $result["USER_special_educational_needs"]; $final_results[$key]["USER_tutor"] = $result["USER_tutor"]; $final_results[$key]["USER_tutor_nif"] = $result["USER_tutor_nif"]; $final_results[$key]["USER_tutor_email"] = $result["USER_tutor_email"]; $final_results[$key]["USER_tutor_phone"] = $result["USER_tutor_phone"]; $final_results[$key]["USER_tutor_movil"] = $result["USER_tutor_movil"]; $final_results[$key]["USER_tutor_bank_entity"] = $result["USER_tutor_bank_entity"]; $final_results[$key]["USER_tutor_bank_office"] = $result["USER_tutor_bank_office"]; $final_results[$key]["USER_tutor_bank_dc"] = $result["USER_tutor_bank_dc"]; $final_results[$key]["USER_tutor_bank_number"] = $result["USER_tutor_bank_number"]; $final_results[$key]["CENTER_ID"] = $result["CENTER_ID"]; break; default: $prefix = ""; if (MOD_USERS_search_last_users_modified() == $result["USER_ID"]) { $prefix = "*"; } $final_results[$key]["t_users.USER_name"] = $prefix."".htmlentities($result["USER_name"]).""; $final_results[$key]["t_users.USER_year"] = $result["USER_year"]; $final_results[$key]["t_users.USER_tutor"] = $result["USER_tutor"]; $final_results[$key]["t_users.USER_tutor_email"] = $result["USER_tutor_email"]; $final_results[$key]["OP"] = "". "". "". ""; if ($GLOBAL_config["PROTOS_ACTUAL_USER"]["USER_account_type"] == "admin" || $GLOBAL_config["PROTOS_ACTUAL_USER"]["USER_account_type"] == "root") { $final_results[$key]["OP"] .= ""; } $final_results[$key]["OP"].= "". "
 
 
 
"; } } } else { $final_results[0]["USER_name"] = ""; $final_results[0]["USER_intervention_days"] = ""; $final_results[0]["USER_hours"] = ""; $final_results[0]["CENTER_name"] = ""; $final_results[0]["OP"] = ""; } return $final_results; } // Función para generar un SELECT con las categorieas function MOD_USERS_generate_workshops_select ($selected=false, $selected_action="add_selecteds") { global $GLOBAL_config, $MOD_USERS_config, $LIB_db_config; $connection = $LIB_db_config["LIGAEDUCACIONEXTRAESCOLARESALCALA_connection"]; $elements = LIB_db_select_query("USER_ID, USER_name", "t_users", $connection, "USER_options_erased=0 ORDER BY USER_name "); $html = ""; if (!is_array($selected)) { $selected = explode(";", $selected); } if (is_array($elements)) { foreach ($elements as $value) { // Si ESTE elemento NO ESTÁ en los elementos pasados como parámetro, lo incluimos en el listado switch ($selected_action) { case "add_selecteds": $html.= ""; } return $html; } function MOD_USERS_send_inscription_email ($inscription_data) { global $MAIL_config, $GLOBAL_config; $result_send = false; if (!empty($inscription_data)) { $result_user = $inscription_data; $level = ""; if (preg_match("/PROTOS/", $_SERVER["REQUEST_URI"])) { $level = "../"; } $messagefile_user = $_SERVER['DOCUMENT_ROOT'].$GLOBAL_config["VIRTUAL_SERVER"].$level."email_templates/user_inscription.html"; $file = fopen($messagefile_user, "r"); $html_message = fread($file, filesize($messagefile_user)); $subject = $GLOBAL_config["PROJECT_NAME"]. " - Confirmación de Alta"; $text = str_replace("[EMAIL_SUBJECT]", $subject, $html_message); $text = str_replace("[PROJECT_NAME]", $GLOBAL_config["PROJECT_NAME"], $text); $text = str_replace("[THIS_DOMAIN]", $GLOBAL_config["THIS_DOMAIN"], $text); $text = str_replace("[CENTER_name]", $inscription_data["center"]["CENTER_name"], $text); $string_workshops = ""; foreach ($inscription_data["workshops"] as $key_workshop=>$value_workshop) { $string_workshops.= $value_workshop["WORKSHOP_name"]." - ".$value_workshop["WORKSHOP_intervention_days"]." - ".$value_workshop["WORKSHOP_hours"]."
"; } $text = str_replace("[WORKSHOPS]", $string_workshops, $text); $html = $text; $images = false; $attachments = false; $embeddedImages = array( 0 => array("EMBEDDED_PATH"=>$level."email_templates/img/logotype_email_template.gif", "EMBEDDED_ID"=>"logotype_email_template", "EMBEDDED_NAME"=>"logotype_email_template.gif"), ); // Envío AL USUARIO $data_from = array("NAME"=>"no-reply@ligaeducacion.org", "EMAIL"=>"no-reply@ligaeducacion.org"); $data_to = array("NAME"=>$result_user["datos"]["USER_tutor"], "EMAIL"=>$result_user["datos"]["USER_tutor_email"]); // $data_to = array("NAME"=>"javier", "EMAIL"=>"javier@ad-do.com"); $data_replyTo = array("NAME"=>"no-reply@ligaeducacion.org", "EMAIL"=>"no-reply@ligaeducacion.org"); $CC = false; $BCC = false; // echo("Enviando a
");
//		var_dump($data_to);
//		echo("



"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); /* $data_to = array("NAME"=>"javier", "EMAIL"=>"javier@ad-do.com"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); $data_to = array("NAME"=>"javier", "EMAIL"=>"el_javichu@yahoo.es"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); $data_to = array("NAME"=>"javier", "EMAIL"=>"addo.web@gmail.com"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); */ } return ($result_send); } function MOD_USERS_send_inscription_copy_email ($inscription_data) { global $MAIL_config, $GLOBAL_config; $result_send = false; if (!empty($inscription_data)) { $result_user = $inscription_data; $level = ""; if (preg_match("/PROTOS/", $_SERVER["REQUEST_URI"])) { $level = "../"; } $messagefile_user = $_SERVER['DOCUMENT_ROOT'].$GLOBAL_config["VIRTUAL_SERVER"].$level."email_templates/user_inscription_copy.html"; $file = fopen($messagefile_user, "r"); $html_message = fread($file, filesize($messagefile_user)); $subject = $GLOBAL_config["PROJECT_NAME"]. " - Nuevo alta de Usuario"; $text = str_replace("[EMAIL_SUBJECT]", $subject, $html_message); $text = str_replace("[PROJECT_NAME]", $GLOBAL_config["PROJECT_NAME"], $text); $text = str_replace("[THIS_DOMAIN]", $GLOBAL_config["THIS_DOMAIN"], $text); $text = str_replace("[USER_name]", $inscription_data["datos"]["USER_name"], $text); $text = str_replace("[USER_address_address]", $inscription_data["datos"]["USER_address_address"], $text); $text = str_replace("[USER_address_cp]", $inscription_data["datos"]["USER_address_cp"], $text); $text = str_replace("[USER_address_city]", $inscription_data["datos"]["USER_address_city"], $text); $text = str_replace("[USER_tutor]", $inscription_data["datos"]["USER_tutor"], $text); $text = str_replace("[USER_tutor_nif]", $inscription_data["datos"]["USER_tutor_nif"], $text); $text = str_replace("[USER_tutor_email]", $inscription_data["datos"]["USER_tutor_email"], $text); $text = str_replace("[USER_tutor_phone]", $inscription_data["datos"]["USER_tutor_phone"], $text); $text = str_replace("[USER_tutor_movil]", $inscription_data["datos"]["USER_tutor_movil"], $text); $text = str_replace("[USER_tutor_bank_entity]", $inscription_data["datos"]["USER_tutor_bank_entity"], $text); $text = str_replace("[USER_tutor_bank_office]", $inscription_data["datos"]["USER_tutor_bank_office"], $text); $text = str_replace("[USER_tutor_bank_dc]", $inscription_data["datos"]["USER_tutor_bank_dc"], $text); $text = str_replace("[USER_tutor_bank_number]", $inscription_data["datos"]["USER_tutor_bank_number"], $text); $text = str_replace("[CENTER_name]", $inscription_data["center"]["CENTER_name"], $text); $string_workshops = ""; foreach ($inscription_data["workshops"] as $key_workshop=>$value_workshop) { $string_workshops.= $value_workshop["WORKSHOP_name"]." - ".$value_workshop["WORKSHOP_intervention_days"]." - ".$value_workshop["WORKSHOP_hours"]."
"; } $text = str_replace("[WORKSHOPS]", $string_workshops, $text); $html = $text; $images = false; $attachments = false; $embeddedImages = array( 0 => array("EMBEDDED_PATH"=>$level."email_templates/img/logotype_email_template.gif", "EMBEDDED_ID"=>"logotype_email_template", "EMBEDDED_NAME"=>"logotype_email_template.gif"), ); // Envío AL USUARIO $data_from = array("NAME"=>"no-reply@ligaeducacion.org", "EMAIL"=>"no-reply@ligaeducacion.org"); $data_to = array("NAME"=>"Inscripciones Alcala", "EMAIL"=>"inscripcionesalcala@ligaeducacion.org"); // $data_to = array("NAME"=>"javier", "EMAIL"=>"javier@ad-do.com"); $data_replyTo = array("NAME"=>"no-reply@ligaeducacion.org", "EMAIL"=>"no-reply@ligaeducacion.org"); $CC = false; $BCC = false; // echo("Enviando a
");
//		var_dump($data_to);
//		echo("



"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); /* $data_to = array("NAME"=>"javier", "EMAIL"=>"javier@ad-do.com"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); $data_to = array("NAME"=>"javier", "EMAIL"=>"el_javichu@yahoo.es"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); $data_to = array("NAME"=>"javier", "EMAIL"=>"addo.web@gmail.com"); $result_send = LIB_mail_send_phpMailer ($data_from, $data_to, $data_replyTo, $CC, $BCC, $subject, $text, $html, $images, $attachments, $embeddedImages); */ } return ($result_send); } ?> Actividades Extraescolares Alcalá de Henares
  • Liga española de la educación
  • rayuela.org

FORMULARIO DE INSCRIPCIÓN