Ejemplo n.º 1
0
<?php

# Require files
require_once '../vendor/autoload.php';
require_once '../generated-conf/config.php';
require_once '../app/functions/functions.php';
# Add topic tag (if applicable)
if (isset($_GET['add_topic_tag'])) {
    addTopicTag($_GET['topic_id'], $_GET['verse_id'], $_GET['bible_code'], $_GET['relevant_words']);
}
# Add lesson tag (if applicable)
if (isset($_GET['add_lesson_tag'])) {
    addLessonTag($_GET['lesson_id'], $_GET['verse_id'], $_GET['bible_code'], $_GET['relevant_words']);
}
# Get passage data
$passage_data = getPassageDataAndVerses($_GET['reference_string']);
# Get topics select options
$topics_select_options = getTopicsSelectOptions($_GET['topic_parent_id']);
# Get lessons select options
$lessons_select_options = getLessonsSelectOptions($_GET['topic_parent_id']);
echo <<<s
<html>
<head></head>
<body>
<h1>{$passage_data['reference']['string']}</h1>

s;
foreach ($passage_data['verses'] as $passage_verse_data) {
    echo <<<s
<p>
\t<b>{$passage_verse_data['text']['string']}</b>
Ejemplo n.º 2
0
		$lesson_id = addLesson($_GET['lesson_title'], $_GET['lesson_parent_id']);

		if ($_GET['topic_id']) {
			addTopicLesson($_GET['topic_id'], $lesson_id);
		}

	}

	// Add topic tag
	if (isset($_GET['add_topic_tag'])) {
		addTopicTag($_GET['topic']['id'], $_GET['reference_string']);
	}

	// Add lesson tag
	if ($_GET['action'] == 'add_lesson_tag') {
		addLessonTag($_GET['lesson_id'], $_GET['reference_string']);
	}

	// Edit lesson title
	if ($_GET['action'] == 'edit_lesson_title') {
		$lesson_object = getLesson($_GET['lesson_id']);
		$lesson_object->setTitle($_GET['lesson_title'])
			->save();
	}

	// Edit topic name
	if (isset($_GET['edit_topic_name'])) {
		$topic_object = getTopic($_GET['topic_id']);
		$topic_object->setTitle($_GET['topic_title'])
			->save();
	}