PageRenderTime 58ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/2.0/php/util.php

https://github.com/stenrap/bridgetjohansen.com
PHP | 2676 lines | 2183 code | 423 blank | 70 comment | 294 complexity | 95573d080c18181dabe0be1aae494ce4 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. require_once('db.php');
  3. require_once('auth.php');
  4. require_once('LessonSchedule.php');
  5. require_once('EventSchedule.php');
  6. /* Commands */
  7. $SET_MUSIC_STATE = 1;
  8. $ATTEMPT_LOGIN = 2;
  9. $CHANGE_EFFECTIVE_DATE = 3;
  10. $ADD_STUDENT = 4;
  11. $EDIT_STUDENT_LOOKUP = 5;
  12. $EDIT_STUDENT_CONFIRM = 6;
  13. $DELETE_STUDENT = 7;
  14. $ADD_GROUP_CLASS = 8;
  15. $EDIT_GROUP_CLASS = 9;
  16. $DELETE_GROUP_CLASS = 10;
  17. $ADD_EVENT = 11;
  18. $EDIT_EVENT_LOOKUP = 12;
  19. $EDIT_EVENT_CONFIRM = 13;
  20. $DELETE_EVENT = 14;
  21. $UPLOAD_PHOTO = 15;
  22. $ADD_COMMENT = 16;
  23. $GET_COMMENT = 17;
  24. $DELETE_PHOTO = 18;
  25. $CHANGE_STATE = 19;
  26. if (isset($_REQUEST['command']))
  27. {
  28. if ($_REQUEST['command'] == $SET_MUSIC_STATE)
  29. {
  30. setMusicCookie($_REQUEST['state']);
  31. exit;
  32. }
  33. session_start();
  34. if ($_REQUEST['command'] != $ATTEMPT_LOGIN && $_REQUEST['command'] != $GET_COMMENT && $_REQUEST['command'] != $CHANGE_STATE && !loggedInAsAdmin())
  35. {
  36. header('Location: http://www.bridgetjohansen.com/');
  37. exit;
  38. }
  39. $response = new stdClass();
  40. if ($_REQUEST['command'] == $ATTEMPT_LOGIN)
  41. {
  42. if (isset($_REQUEST['password']) && (userPasswordCorrect($_REQUEST['password']) || adminPasswordCorrect($_REQUEST['password'])))
  43. {
  44. $_SESSION['login_name'] = userPasswordCorrect($_REQUEST['password']) ? 'user' : 'admin';
  45. changeSessionID();
  46. $response->authSuccess = true;
  47. }
  48. if (isMobile())
  49. {
  50. header('Location: http://www.bridgetjohansen.com/schedule');
  51. exit;
  52. }
  53. $lessonSchedule = new LessonSchedule();
  54. $lessonSchedule->populate();
  55. $showDynamicCSS = true;
  56. $response->content = getScheduleContent($lessonSchedule, $showDynamicCSS);
  57. $response->page = "schedule";
  58. if ($showDynamicCSS)
  59. {
  60. $response->dynamicCSS = getDynamicCSSforAjax($lessonSchedule);
  61. if (loggedInAsAdmin())
  62. {
  63. $response->admin = true;
  64. }
  65. }
  66. echo json_encode($response);
  67. }
  68. elseif ($_REQUEST['command'] == $CHANGE_EFFECTIVE_DATE)
  69. {
  70. $result = setEffectiveDate($_REQUEST['date']);
  71. if (is_null($result))
  72. {
  73. $response->error = true;
  74. }
  75. else
  76. {
  77. $response->newDate = $result;
  78. }
  79. echo json_encode($response);
  80. }
  81. elseif ($_REQUEST['command'] == $ADD_STUDENT)
  82. {
  83. $name = $_REQUEST['studentName'];
  84. $parents = $_REQUEST['parents'];
  85. $phone = $_REQUEST['phone'];
  86. $lessonDay = $_REQUEST['lessonDay'];
  87. $lessonTime = $_REQUEST['lessonHour'] . ':' . $_REQUEST['lessonMinutes'];
  88. $lessonDuration = $_REQUEST['lessonDuration'];
  89. $groupClassTime = strlen($_REQUEST['groupClassHour']) > 0 && strlen ($_REQUEST['groupClassMinutes']) > 0 ? $_REQUEST['groupClassHour'] . ':' . $_REQUEST['groupClassMinutes'] : null;
  90. if (get_magic_quotes_gpc())
  91. {
  92. $name = stripslashes($name);
  93. $parents = stripslashes($parents);
  94. }
  95. $result = addNewStudent($name, $parents, $phone, $lessonDay, $lessonTime, $lessonDuration, $groupClassTime);
  96. if (is_null($result))
  97. {
  98. $response->content = getError();
  99. $response->page = "schedule";
  100. }
  101. else
  102. {
  103. // TODO: Should you create a helper function for getting the schedule content and dynamic CSS? (The following 18 lines of code are identical in the responses to $ATTEMPT_LOGIN, $EDIT_STUDENT_CONFIRM, and $DELETE_STUDENT.)
  104. $lessonSchedule = new LessonSchedule();
  105. $lessonSchedule->populate();
  106. $showDynamicCSS = true;
  107. $response->content = getScheduleContent($lessonSchedule, $showDynamicCSS);
  108. $response->page = "schedule";
  109. if ($showDynamicCSS)
  110. {
  111. $response->dynamicCSS = getDynamicCSSforAjax($lessonSchedule);
  112. if (loggedInAsAdmin())
  113. {
  114. $response->admin = true;
  115. }
  116. }
  117. }
  118. echo json_encode($response);
  119. }
  120. elseif ($_REQUEST['command'] == $EDIT_STUDENT_LOOKUP)
  121. {
  122. $result = getStudent($_REQUEST['id']);
  123. if (is_null($result))
  124. {
  125. $response->error = true;
  126. }
  127. else
  128. {
  129. $response->student = $result;
  130. }
  131. echo json_encode($response);
  132. }
  133. elseif ($_REQUEST['command'] == $EDIT_STUDENT_CONFIRM)
  134. {
  135. $id = $_REQUEST['id'];
  136. $name = $_REQUEST['studentName'];
  137. $parents = $_REQUEST['parents'];
  138. $phone = $_REQUEST['phone'];
  139. $lessonDay = $_REQUEST['lessonDay'];
  140. $lessonTime = $_REQUEST['lessonHour'] . ':' . $_REQUEST['lessonMinutes'];
  141. $lessonDuration = $_REQUEST['lessonDuration'];
  142. $groupClassTime = strlen($_REQUEST['groupClassHour']) > 0 && strlen ($_REQUEST['groupClassMinutes']) > 0 ? $_REQUEST['groupClassHour'] . ':' . $_REQUEST['groupClassMinutes'] : null;
  143. if (get_magic_quotes_gpc())
  144. {
  145. $name = stripslashes($name);
  146. $parents = stripslashes($parents);
  147. }
  148. $result = editStudent($id, $name, $parents, $phone, $lessonDay, $lessonTime, $lessonDuration, $groupClassTime);
  149. if (is_null($result))
  150. {
  151. $response->content = getError();
  152. $response->page = "schedule";
  153. }
  154. else
  155. {
  156. $lessonSchedule = new LessonSchedule();
  157. $lessonSchedule->populate();
  158. $showDynamicCSS = true;
  159. $response->content = getScheduleContent($lessonSchedule, $showDynamicCSS);
  160. $response->page = "schedule";
  161. if ($showDynamicCSS)
  162. {
  163. $response->dynamicCSS = getDynamicCSSforAjax($lessonSchedule);
  164. if (loggedInAsAdmin())
  165. {
  166. $response->admin = true;
  167. }
  168. }
  169. }
  170. echo json_encode($response);
  171. }
  172. elseif ($_REQUEST['command'] == $DELETE_STUDENT)
  173. {
  174. $result = deleteStudent($_REQUEST['id']);
  175. if (is_null($result))
  176. {
  177. $response->content = getError();
  178. $response->page = "schedule";
  179. }
  180. else
  181. {
  182. $lessonSchedule = new LessonSchedule();
  183. $lessonSchedule->populate();
  184. $showDynamicCSS = true;
  185. $response->content = getScheduleContent($lessonSchedule, $showDynamicCSS);
  186. $response->page = "schedule";
  187. if ($showDynamicCSS)
  188. {
  189. $response->dynamicCSS = getDynamicCSSforAjax($lessonSchedule);
  190. if (loggedInAsAdmin())
  191. {
  192. $response->admin = true;
  193. }
  194. }
  195. }
  196. echo json_encode($response);
  197. }
  198. elseif ($_REQUEST['command'] == $ADD_GROUP_CLASS)
  199. {
  200. $result = addGroupClass($_REQUEST['date']);
  201. if (is_null($result))
  202. {
  203. $response->error = true;
  204. }
  205. else
  206. {
  207. $response->newHTML = $result;
  208. }
  209. echo json_encode($response);
  210. }
  211. elseif ($_REQUEST['command'] == $EDIT_GROUP_CLASS)
  212. {
  213. $result = editGroupClass($_REQUEST['id'], $_REQUEST['date']);
  214. if (is_null($result))
  215. {
  216. $response->error = true;
  217. }
  218. else
  219. {
  220. $response->newHTML = $result;
  221. }
  222. echo json_encode($response);
  223. }
  224. elseif ($_REQUEST['command'] == $DELETE_GROUP_CLASS)
  225. {
  226. $result = deleteGroupClass($_REQUEST['id']);
  227. if (is_null($result))
  228. {
  229. $response->error = true;
  230. }
  231. else
  232. {
  233. $response->newHTML = $result;
  234. }
  235. echo json_encode($response);
  236. }
  237. elseif ($_REQUEST['command'] == $ADD_EVENT)
  238. {
  239. $response->page = "events";
  240. $name = $_REQUEST['eventName'];
  241. $date = $_REQUEST['datesTimes'];
  242. $location = $_REQUEST['location'];
  243. $expiration = $_REQUEST['expiration'];
  244. if (get_magic_quotes_gpc())
  245. {
  246. $name = stripslashes($name);
  247. $date = stripslashes($date);
  248. $location = stripslashes($location);
  249. }
  250. $result = addEvent($name, $date, $location, $expiration);
  251. if (is_null($result))
  252. {
  253. $response->content = getError();
  254. }
  255. else
  256. {
  257. $eventSchedule = new EventSchedule();
  258. $eventSchedule->populate();
  259. $response->content = getEventsContent($eventSchedule);
  260. if (loggedInAsAdmin())
  261. {
  262. $response->admin = true;
  263. }
  264. }
  265. echo json_encode($response);
  266. }
  267. elseif ($_REQUEST['command'] == $EDIT_EVENT_LOOKUP)
  268. {
  269. $result = getEvent($_REQUEST['id']);
  270. if (is_null($result))
  271. {
  272. $response->error = true;
  273. }
  274. else
  275. {
  276. $response->requestedEvent = $result;
  277. }
  278. echo json_encode($response);
  279. }
  280. elseif ($_REQUEST['command'] == $EDIT_EVENT_CONFIRM)
  281. {
  282. $response->page = "events";
  283. $id = $_REQUEST['id'];
  284. $name = $_REQUEST['eventName'];
  285. $date = $_REQUEST['datesTimes'];
  286. $location = $_REQUEST['location'];
  287. $expiration = $_REQUEST['expiration'];
  288. if (get_magic_quotes_gpc())
  289. {
  290. $name = stripslashes($name);
  291. $date = stripslashes($date);
  292. $location = stripslashes($location);
  293. }
  294. $result = editEvent($id, $name, $date, $location, $expiration);
  295. if (is_null($result))
  296. {
  297. $response->content = getError();
  298. }
  299. else
  300. {
  301. $eventSchedule = new EventSchedule();
  302. $eventSchedule->populate();
  303. $response->content = getEventsContent($eventSchedule);
  304. if (loggedInAsAdmin())
  305. {
  306. $response->admin = true;
  307. }
  308. }
  309. echo json_encode($response);
  310. }
  311. elseif ($_REQUEST['command'] == $DELETE_EVENT)
  312. {
  313. $response->page = "events";
  314. $result = deleteEvent($_REQUEST['id']);
  315. if (is_null($result))
  316. {
  317. $response->content = getError();
  318. }
  319. else
  320. {
  321. $eventSchedule = new EventSchedule();
  322. $eventSchedule->populate();
  323. $response->content = getEventsContent($eventSchedule);
  324. if (loggedInAsAdmin())
  325. {
  326. $response->admin = true;
  327. }
  328. }
  329. echo json_encode($response);
  330. }
  331. elseif ($_REQUEST['command'] == $UPLOAD_PHOTO)
  332. {
  333. foreach ($_FILES["pics"]["error"] as $key => $error)
  334. {
  335. if ($error == UPLOAD_ERR_OK)
  336. {
  337. $tmp_name = $_FILES["pics"]["tmp_name"][$key];
  338. $new_name = uniqid();
  339. if (move_uploaded_file($tmp_name, './pics/' . $new_name . '.jpg'))
  340. {
  341. $dbh = getDBH(false);
  342. if (is_null($dbh))
  343. {
  344. echo "Error caused by Bluehost (" . __LINE__ . ")";
  345. exit;
  346. }
  347. $insertPic = $dbh->prepare("INSERT INTO pics VALUES(:id, :file_name, :comment)");
  348. $insertPic->bindValue(':id', NULL, PDO::PARAM_NULL);
  349. $insertPic->bindParam(':file_name', $new_name, PDO::PARAM_STR);
  350. $insertPic->bindValue(':comment', NULL, PDO::PARAM_NULL);
  351. if (!$insertPic->execute())
  352. {
  353. echo "Error caused by Bluehost (" . __LINE__ . ")";
  354. exit;
  355. }
  356. // Create a thumbnail (crop then scale):
  357. $file_name = './pics/' . $new_name . '.jpg';
  358. $src_image = imagecreatefromjpeg($file_name);
  359. $src_size = getimagesize($file_name);
  360. $src_w = $src_size[0];
  361. $src_h = $src_size[1];
  362. $src_x = 0;
  363. $src_y = 0;
  364. if ($src_w > $src_h)
  365. {
  366. $src_x = ($src_w - $src_h) / 2;
  367. $src_w = $src_h;
  368. }
  369. elseif ($src_h > $src_w)
  370. {
  371. $src_y = ($src_h - $src_w) / 2;
  372. $src_h = $src_w;
  373. }
  374. $dst_image = imagecreatetruecolor(231, 231);
  375. imagecopyresampled($dst_image, $src_image, 0, 0, $src_x, $src_y, 231, 231, $src_w, $src_h);
  376. imagejpeg($dst_image, './pics/' . $new_name . '-thumb.jpg', 80);
  377. imagedestroy($dst_image);
  378. }
  379. else
  380. {
  381. echo "Error caused by Bluehost (" . __LINE__ . ")";
  382. exit;
  383. }
  384. }
  385. }
  386. header('Location: http://www.bridgetjohansen.com/photos');
  387. exit;
  388. }
  389. elseif ($_REQUEST['command'] == $ADD_COMMENT)
  390. {
  391. // NOTE: This command is actually used for both adding and editing a comment (as evidenced by the ensuing code).
  392. $dbh = getDBH(false);
  393. if (is_null($dbh))
  394. {
  395. $response->error = true;
  396. echo json_encode($response);
  397. exit;
  398. }
  399. $comment = $_REQUEST['comment'];
  400. if (get_magic_quotes_gpc())
  401. $comment = stripslashes($comment);
  402. $commentQuery = $dbh->prepare("UPDATE pics SET comment = :comment WHERE id = :id");
  403. $commentQuery->bindParam(':comment', $comment, PDO::PARAM_STR);
  404. $commentQuery->bindParam(':id', $_REQUEST['id'], PDO::PARAM_INT);
  405. if (!$commentQuery->execute())
  406. {
  407. $response->error = true;
  408. echo json_encode($response);
  409. exit;
  410. }
  411. $response->success = true;
  412. echo json_encode($response);
  413. }
  414. elseif ($_REQUEST['command'] == $GET_COMMENT)
  415. {
  416. $result = getComment($_REQUEST['id']);
  417. if (is_null($result))
  418. {
  419. $response->error = true;
  420. }
  421. else
  422. {
  423. $response->comment = $result;
  424. }
  425. echo json_encode($response);
  426. }
  427. elseif ($_REQUEST['command'] == $DELETE_PHOTO)
  428. {
  429. $response->page = "photos";
  430. $result = deletePhoto($_REQUEST['id']);
  431. if (is_null($result))
  432. {
  433. $response->content = getError();
  434. }
  435. else
  436. {
  437. $response->content = getPhotosContent();
  438. if (loggedInAsAdmin())
  439. {
  440. $response->admin = true;
  441. }
  442. }
  443. echo json_encode($response);
  444. }
  445. elseif ($_REQUEST['command'] == $CHANGE_STATE)
  446. {
  447. $page = $_REQUEST['page'];
  448. if ($page == 'home')
  449. {
  450. $response->content = getHomeContent();
  451. $response->page = 'home';
  452. }
  453. elseif ($page == 'about')
  454. {
  455. $response->content = getAboutContent();
  456. $response->page = 'about';
  457. }
  458. elseif ($page == 'policies')
  459. {
  460. $response->content = getPoliciesContent();
  461. $response->page = 'policies';
  462. }
  463. elseif ($page == 'schedule')
  464. {
  465. $lessonSchedule = new LessonSchedule();
  466. $lessonSchedule->populate();
  467. $showDynamicCSS = true;
  468. $response->content = getScheduleContent($lessonSchedule, $showDynamicCSS);
  469. $response->page = 'schedule';
  470. if ($showDynamicCSS)
  471. {
  472. $response->dynamicCSS = getDynamicCSSforAjax($lessonSchedule);
  473. }
  474. }
  475. elseif ($page == 'events')
  476. {
  477. $eventSchedule = new EventSchedule();
  478. $eventSchedule->populate();
  479. $response->content = getEventsContent($eventSchedule);
  480. $response->page = 'events';
  481. }
  482. elseif ($page == 'photos')
  483. {
  484. $response->content = getPhotosContent();
  485. $response->page = "photos";
  486. }
  487. if (loggedInAsAdmin())
  488. {
  489. $response->admin = true;
  490. }
  491. echo json_encode($response);
  492. }
  493. }
  494. /* ===============================
  495. * Common Code
  496. * =============================== */
  497. function isMobile()
  498. {
  499. return preg_match('/android|iphone|ipod/i', $_SERVER['HTTP_USER_AGENT']);
  500. }
  501. /**
  502. * Get the head element common to all mobile pages.
  503. *
  504. * @param string $title The title of the page.
  505. * @return string The HTML for the mobile head element.
  506. */
  507. function getMobileHead($title)
  508. {
  509. $head = '
  510. <title>' . $title . '</title>
  511. <meta name="viewport" content="width=device-width, initial-scale=1">
  512. <link rel="shortcut icon" href="images/favicon.ico">
  513. <link rel="stylesheet" href="mobile/bridgetmobile.min.css" />
  514. <link rel="stylesheet" href="mobile/jquery.mobile.structure-1.3.1.min.css" />';
  515. if ($title == "Bridget Johansen Piano Studio")
  516. {
  517. $head .= '
  518. <link href="http://fonts.googleapis.com/css?family=Vidaloka" rel="stylesheet" type="text/css">
  519. <link href="http://fonts.googleapis.com/css?family=Pinyon+Script" rel="stylesheet" type="text/css">';
  520. }
  521. $head .= '
  522. <link rel="stylesheet" href="mobile/bridgetmobileoverride.css" />
  523. <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
  524. <script src="mobile/jquery.mobile-1.3.1.min.js"></script>';
  525. if ($title == "Photos")
  526. {
  527. $head .= '
  528. <script src="js/bridget-m.js"></script>';
  529. }
  530. return $head;
  531. }
  532. function getMobileHeader($title)
  533. {
  534. return '
  535. <div data-role="header" data-position="fixed">
  536. <h1 style="text-align:left; margin-left: 0.5em">' . $title . '</h1>
  537. <a href="menu.html" data-icon="bars" class="ui-btn-right" data-rel="dialog" data-transition="slidedown">Menu</a>
  538. </div>';
  539. }
  540. function getMobileFooter($page = '')
  541. {
  542. if ($page == 'schedule' && !loggedIn())
  543. return '';
  544. $date = getdate();
  545. return '
  546. <div data-role="footer">
  547. <h4>&copy; ' . $date['year'] . '</h4>
  548. </div>';
  549. }
  550. /**
  551. * Get the head element common to all pages.
  552. *
  553. * @param string $actualPage The actual page requested (but redirect if there's a hash).
  554. * @param string $title The title of the page.
  555. * @param string $initFunction The JavaScript function to call on document ready.
  556. * @return string The HTML for the head element.
  557. */
  558. function getHead($actualPage, $title, $initFunction)
  559. {
  560. return '
  561. <script>
  562. function checkRedirect(actualPage)
  563. {
  564. var pattern = /\.(\/\w*)/;
  565. var result = pattern.exec(window.location.hash.toLocaleLowerCase());
  566. var hashPage = "";
  567. if (result && result.length > 1)
  568. {
  569. hashPage = result[1];
  570. if (actualPage != hashPage)
  571. {
  572. window.location.replace("http://www.bridgetjohansen.com" + hashPage);
  573. }
  574. }
  575. }
  576. checkRedirect("' . $actualPage . '");
  577. </script>
  578. <meta charset="utf-8"/>
  579. <meta name="description" content="Web site of the Bridget Johansen Piano Studio, which provides information about her piano instruction.">
  580. <meta name="keywords" content="piano, lessons, salt lake, utah, studio, bridget, mcbride, johansen">
  581. <title>' . $title . '</title>
  582. <link rel="shortcut icon" href="images/favicon.ico">
  583. <link href="http://fonts.googleapis.com/css?family=Vidaloka" rel="stylesheet" type="text/css">
  584. <link href="http://fonts.googleapis.com/css?family=Pinyon+Script" rel="stylesheet" type="text/css">
  585. <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
  586. <script type="text/javascript" src="js/jquery.history.js"></script>
  587. <script type="text/javascript" src="js/jquery.cookie.js"></script>
  588. <script type="text/javascript" src="js/bridget.js"></script>
  589. <!--[if lt IE 9]>
  590. <script src="js/html5shiv-printshiv.js"></script>
  591. <![endif]-->
  592. <script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
  593. <link href="css/custom-theme/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css"/>
  594. <link href="css/bridget.css" rel="stylesheet" type="text/css"/>
  595. <script type="text/javascript">
  596. $(document).ready(function() {
  597. ' . $initFunction . '
  598. });
  599. </script>';
  600. }
  601. /**
  602. * Get the header element (with nav and audio) common to all pages.
  603. *
  604. * @param string $selected
  605. * @return string The HTML for the header element.
  606. */
  607. function getHeader($selected = '')
  608. {
  609. $aboutClass = $selected == 'about' ? 'selected' : 'trans';
  610. $policiesClass = $selected == 'policies' ? 'selected' : 'trans';
  611. $scheduleClass = $selected == 'schedule' ? 'selected' : 'trans';
  612. $eventsClass = $selected == 'events' ? 'selected' : 'trans';
  613. $photosClass = $selected == 'photos' ? 'selected' : 'trans';
  614. $header = '
  615. <div class="main">
  616. <div id="logo-container">
  617. <div id="logo" title="Home">Bridget Johansen Piano Studio</div>
  618. </div>
  619. <img id="equalizer" src="images/equalizer.gif" alt="equalizer" />
  620. <!-- <img id="equalizer-off" src="images/equalizer-off.png" /> -->
  621. <div id="audio-controls"></div>
  622. <audio id="music" loop>
  623. <source src="audio/background.ogg" type="audio/ogg">
  624. <source src="audio/background.mp3" type="audio/mpeg">
  625. </audio>
  626. <nav>
  627. <ul>
  628. <li><div id="about" class="' . $aboutClass . '">About</div></li>
  629. <li><div id="policies" class="' . $policiesClass . '">Policies</div></li>
  630. <li><div id="schedule" class="' . $scheduleClass . '">Schedule</div></li>
  631. <li><div id="events" class="' . $eventsClass . '">Events</div></li>
  632. <li id="last-nav-link"><div id="photos" class="' . $photosClass . '">Photos</div></li>
  633. </ul>
  634. </nav>
  635. </div>';
  636. return $header;
  637. }
  638. /**
  639. * Get generic error HTML that can be used for all pages.
  640. *
  641. * @return string
  642. */
  643. function getError()
  644. {
  645. return '
  646. <div id="schedule-error">
  647. <img src="images/error.png" id="schedule-error-icon" alt="Error" />
  648. Oops!
  649. <p>There was a problem displaying this page. Please try again later.</p>
  650. </div>';
  651. }
  652. /**
  653. * Get the footer HTML common to all pages.
  654. *
  655. * @return string
  656. */
  657. function getFooter()
  658. {
  659. return '
  660. <div class="main">
  661. <ul>
  662. <li id="footer-phone">801.566.9622</li>
  663. <li id="footer-email"><a href="mailto:email@bridgetjohansen.com">email@bridgetjohansen.com</a></li>
  664. <li id="footer-copyright">Bridget Johansen 2013</li>
  665. </ul>
  666. </div>';
  667. }
  668. /**
  669. * Set the music cookie.
  670. *
  671. * @param string $state The state of the music ("play" or "pause")
  672. */
  673. function setMusicCookie($state = "play")
  674. {
  675. setcookie("musicState", $state, time() + (60 * 60 * 24 * 365 * 5), '/', 'bridgetjohansen.com');
  676. }
  677. function getAdminDialogs($page)
  678. {
  679. if (!loggedInAsAdmin())
  680. return '';
  681. $dialogs = '';
  682. if ($page == "schedule")
  683. {
  684. $dialogs .= '
  685. <div id="lessonScheduleDateDialog" title="Lesson Schedule Effective Date">
  686. <div id="lessonScheduleDatePicker"></div>
  687. </div>
  688. <div id="studentDialog" title="Edit Student">
  689. <input type="hidden" id="studentID" name="studentID" />
  690. <label for="studentName" >Name:</label> <input id="studentName" name="studentName" />
  691. <label for="parents" >Parent(s):</label><input id="parents" name="parents" />
  692. <label for="phone" >Phone:</label> <input id="phone" name="phone" />
  693. <label for="lessonDay" >Lesson Day:</label>
  694. <select id="lessonDay" name="lessonDay">
  695. <option>Monday</option>
  696. <option>Tuesday</option>
  697. <option>Wednesday</option>
  698. <option>Thursday</option>
  699. <option>Friday</option>
  700. <option>Saturday</option>
  701. </select>
  702. <label for="lessonHour">Lesson Time:</label>
  703. <select id="lessonHour" name="lessonHour">
  704. <option>1</option>
  705. <option>2</option>
  706. <option>3</option>
  707. <option>4</option>
  708. <option>5</option>
  709. <option>6</option>
  710. <option>7</option>
  711. <option>8</option>
  712. <option>9</option>
  713. <option>10</option>
  714. <option>11</option>
  715. <option>12</option>
  716. </select>
  717. <select id="lessonMinutes" name="lessonMinutes">
  718. <option>00</option>
  719. <option>15</option>
  720. <option>30</option>
  721. <option>45</option>
  722. </select>
  723. <label for="lessonDuration">Lesson Duration:</label>
  724. <select id="lessonDuration" name="lessonDuration">
  725. <option>30 min</option>
  726. <option>45 min</option>
  727. <option>60 min</option>
  728. </select>
  729. <label for="groupClassHour">Group Class Time:</label>
  730. <select id="groupClassHour" name="groupClassHour">
  731. <option selected></option>
  732. <option>1</option>
  733. <option>2</option>
  734. <option>3</option>
  735. <option>4</option>
  736. <option>5</option>
  737. <option>6</option>
  738. <option>7</option>
  739. <option>8</option>
  740. <option>9</option>
  741. <option>10</option>
  742. <option>11</option>
  743. <option>12</option>
  744. </select>
  745. <select id="groupClassMinutes" name="groupClassMinutes">
  746. <option selected></option>
  747. <option>00</option>
  748. <option>15</option>
  749. <option>30</option>
  750. <option>45</option>
  751. </select>
  752. </div>
  753. <div id="emptyFieldDialog" title="Oops!">
  754. <p>You left the <span id="emptyField"></span> blank...</p>
  755. </div>
  756. <div id="addGroupClassDialog" title="Add Group Class">
  757. <div id="groupClassDatePicker"></div>
  758. </div>
  759. <div id="editGroupClassDialog" title="Change Group Class">
  760. <div id="editGroupClassDatePicker"></div>
  761. </div>';
  762. }
  763. elseif ($page == "events")
  764. {
  765. $dialogs .= '
  766. <div id="addEventDialog" title="Add Event">
  767. <input type="hidden" id="eventID" name="eventID" />
  768. <label for="eventName" >Event Name:</label> <input id="eventName" name="eventName" />
  769. <label for="datesTimes">Date(s) &amp; Time(s):</label><input id="datesTimes" name="datesTimes" />
  770. <label for="location">Location:</label> <input id="location" name="location" />
  771. <label for="expiration">Expiration:</label> <input id="expiration" name="expiration" />
  772. </div>
  773. <div id="emptyFieldDialog" title="Oops!">
  774. <p>You left the <span id="emptyField"></span> blank...</p>
  775. </div>';
  776. }
  777. elseif ($page == "photos")
  778. {
  779. $dialogs .= '
  780. <div id="uploadPicDialog" title="Upload Photo(s)">
  781. <form id="uploadPicForm" name="uploadPicForm" enctype="multipart/form-data" action="http://www.bridgetjohansen.com/util.php" method="post">
  782. <input type="hidden" name="command" value="15" />
  783. <input type="file" name="pics[]" multiple />
  784. </form>
  785. </div>
  786. <div id="addCommentDialog" title="Add/Edit Comment">
  787. <input type="text" id="commentInput" placeholder="Comment" />
  788. </div>';
  789. }
  790. $dialogs .= '
  791. <div id="confirmDeleteDialog" title="Please Confirm">
  792. <p>Are you sure you want to remove <span id="thingToDelete" autofocus></span>?</p>
  793. </div>
  794. <div id="waitDialog" title="Please Wait">
  795. <p id="waitMessage"></p>
  796. <img src="images/loading.gif" id="loadingImage" alt="Loading..." />
  797. </div>';
  798. return $dialogs;
  799. }
  800. /* =============================
  801. * Home Page
  802. * ============================= */
  803. /**
  804. * Get the landing HTML (used only by the home page).
  805. *
  806. * @return string The HTML for the landing using on the home page.
  807. */
  808. function getLanding()
  809. {
  810. return '
  811. <section class="landing-block" id="landing-block">
  812. <div class="main">
  813. <div class="landing-text">
  814. <p class="landing-aim">The final aim and reason</p>
  815. <p class="landing-quote">of all music is nothing other than the glorification of God and the refreshment of the human spirit.</p>
  816. <p class="landing-bach">&mdash; Johann Sebastian Bach</p>
  817. </div>
  818. </div>
  819. </section>';
  820. }
  821. function getHomeContentMobile()
  822. {
  823. return '
  824. <img src="images/steinway.png" id="steinway" alt="Steinway Grand Piano" />
  825. <div class="landing-text">
  826. <p class="landing-aim">The final aim and reason</p>
  827. <p class="landing-quote">of all music is nothing other than the glorification of God and the refreshment of the human spirit.</p>
  828. <p class="landing-bach">&mdash; Johann Sebastian Bach</p>
  829. </div>
  830. <div class="gb">
  831. <p class="pp">
  832. Bridget McBride Johansen offers weekly, private piano lessons in the Salt Lake City area. Her instruction spans a variety of topics including sight reading,
  833. memorization, theory, technique, and music history.<br/><br/>
  834. Bridget was named Youth Conservatory Teacher of the Year at Utah State University, where she graduated with a Bachelor of Music in Piano Pedagogy. Bridget
  835. has served as Chairman of the Salt Lake Area Federation of Music Clubs.
  836. </p>
  837. <div class="center-wrapper">
  838. <a href="about" data-role="button" data-icon="arrow-r" data-iconpos="right" data-inline="true">More About Bridget</a>
  839. </div>
  840. </div>';
  841. }
  842. function getHomeContent()
  843. {
  844. $homeContent = '
  845. <div id="about-content">
  846. <h1 class="section-title">
  847. About Bridget
  848. </h1>
  849. <p class="about-blurb">
  850. Bridget McBride Johansen, <abbr title="Nationally Certified Teacher of Music">NCTM</abbr>, offers weekly, private piano lessons in the Salt Lake City area.
  851. Her instruction spans a variety of topics including sight reading, memorization, theory, technique, and music history.<br/><br/>
  852. Bridget was named Youth Conservatory Teacher of the Year at Utah State University, where she graduated with a Bachelor of Music in Piano Pedagogy. Bridget
  853. has served as Chairman of the Salt Lake Area Federation of Music Clubs.
  854. </p>
  855. <a href="" id="moreAboutBridget" class="button">
  856. <span>More About Bridget</span>
  857. </a>
  858. </div>
  859. <div id="landing-events">
  860. <h1 class="section-title">
  861. Upcoming Events
  862. </h1>';
  863. $dbh = getDBH(true);
  864. if (is_null($dbh))
  865. {
  866. $homeContent .= '
  867. <p>There are no upcoming events.</p>
  868. </div>';
  869. }
  870. else
  871. {
  872. $lookUpEvents = $dbh->prepare("SELECT name, date, location, DATE_FORMAT(expiration, '%m/%e/%Y') AS formatted_expiration FROM events WHERE expiration >= DATE(NOW()) ORDER BY expiration LIMIT 2");
  873. if (!$lookUpEvents->execute())
  874. {
  875. $homeContent .= '
  876. <p>There are no upcoming events.</p>
  877. </div>';
  878. }
  879. else
  880. {
  881. $results = $lookUpEvents->fetchAll(PDO::FETCH_ASSOC);
  882. if (count($results) > 0)
  883. {
  884. $homeContent .= '
  885. <ul id="landing-events-list">';
  886. for ($i = 0; $i < count($results); $i++)
  887. {
  888. $name = $results[$i]['name'];
  889. $date = $results[$i]['date'];
  890. $location = $results[$i]['location'];
  891. $homeContent .= '
  892. <li>
  893. <p class="landing-event-title">' . $name . '</p>
  894. <p class="landing-event-date">' . $date . '</p>
  895. <p>' . $location . '</p>
  896. </li>';
  897. }
  898. $homeContent .= '
  899. </ul>
  900. </div>';
  901. }
  902. else
  903. {
  904. $homeContent .= '
  905. <p>There are no upcoming events.</p>
  906. </div>';
  907. }
  908. }
  909. }
  910. return $homeContent;
  911. }
  912. /* ==============================
  913. * About Page
  914. * ============================== */
  915. function getAboutContentMobile()
  916. {
  917. return '
  918. <img src="images/bridget.jpg" id="about-bridget-photo" alt="Photo of Bridget" />
  919. <div class="gb">
  920. <div data-role="header">
  921. <h1 style="text-align:left; margin-left: 0.5em">Experience</h1>
  922. </div>
  923. <p class="pp">
  924. Bridget has been offering private piano instruction since 1989. In conjunction with her undergradute work, Bridget taught group theory and music education courses to children
  925. ages 6 - 14 at the Utah State University Youth Conservatory. She later taught individual piano lessons for the Utah State University Department of Music.<br/><br/>
  926. Bridget has served as judge and adjudicator for numerous competitions including the USU Piano Festival, the WSU Piano Festival, the Joy Robin Piano Competition,
  927. and the UMTA Performance Evaluations. She also enjoys playing the organ, having studied with Joyce Peabody of the Day Murray Music Organ School.<br/><br/>
  928. Bridget has provided private piano instruction for the Gifted Music School, Prepatory Division. She continues to serve on their Spring Gala Committee.<br/><br/>
  929. Bridget is an active member of several professional music organizations:<br/><br/>
  930. <a href="http://www.mtna.org" target="_blank" class="normal-link">MTNA</a><br/>
  931. <a href="http://www.utahmta.org" target="_blank" class="normal-link">UMTA</a><br/>
  932. <a href="http://www.ufmc-music.org" target="_blank" class="normal-link">UFMC</a><br/><br/>
  933. Bridget frequently participates in workshops, festivals, lectures, recitals, and concerts. She has attended a variety of master classes from world-renowned artists, including:<br/><br/>
  934. <a href="http://www.americancomposers.org/bios20010318.htm" target="_blank" class="normal-link">Leon Fleisher</a><br/>
  935. <a href="http://www.danielpollack.com" target="_blank" class="normal-link">Daniel Pollack</a><br/>
  936. <a href="http://www.tunepiano.com/claude.htm" target="_blank" class="normal-link">Claude Frank</a><br/>
  937. <a href="http://music.msu.edu/faculty/profile/panayis" target="_blank" class="normal-link">Panayis Lyras</a><br/>
  938. <a href="http://www.marinalomazov.com" target="_blank" class="normal-link">Marina Lomazov</a><br/>
  939. <a href="http://www.yefimbronfman.com" target="_blank" class="normal-link">Yefin Bronfman</a><br/>
  940. <a href="http://www.pompa-baldi.com" target="_blank" class="normal-link">Antonio Pompa-Baldi</a><br/>
  941. <a href="http://www.normankrieger.com/bio.htm" target="_blank" class="normal-link">Norman Krieger</a><br/>
  942. <a href="http://www.robertoplano.com/i_index.asp" target="_blank" class="normal-link">Roberto Plano</a><br/>
  943. <a href="http://www.olgakern.com/home.html" target="_blank" class="normal-link">Olga Kern</a><br/>
  944. <a href="http://www.stephenbeus.com/" target="_blank" class="normal-link">Stephen Beus</a>
  945. </p>
  946. <div data-role="header">
  947. <h1 style="text-align:left; margin-left: 0.5em">Education</h1>
  948. </div>
  949. <p class="pp">
  950. Bridget graduated from Utah State University with a Bachelor of Music in Piano Pedagogy. She then completed post-graduate courses in Piano Performance at California State University.
  951. <br/><br/>
  952. In 2003, Bridget earned the designation <em>Nationally Certified Teacher of Music</em> from the Music Teacher\'s National Association.
  953. </p>
  954. <div data-role="header">
  955. <h1 style="text-align:left; margin-left: 0.5em">Awards</h1>
  956. </div>
  957. <p class="pp">
  958. Bridget was awarded a scholarship in Piano Pedagogy by the Utah State University Piano Department. Thereafter she was deemed Teaching Assistant of the Year and Teacher of the Year
  959. by the Utah State Youth Conservatory. Bridget was also awarded a graduate fellowship by California State University, Sacramento.
  960. </p>
  961. </div>';
  962. }
  963. function getAboutContent()
  964. {
  965. return '
  966. <div id="about-content">
  967. <h1 class="section-title">
  968. Experience
  969. </h1>
  970. <img src="images/bridget.jpg" id="about-bridget-photo" alt="Photo of Bridget" />
  971. <p class="about-blurb">
  972. Bridget has been offering private piano instruction since 1989. In conjunction with her undergradute work, Bridget taught group theory and music education courses to children
  973. ages 6 - 14 at the Utah State University Youth Conservatory. She later taught individual piano lessons for the Utah State University Department of Music.<br/><br/>
  974. Bridget has served as judge and adjudicator for numerous competitions including the USU Piano Festival, the WSU Piano Festival, the Joy Robin Piano Competition,
  975. and the UMTA Performance Evaluations. She also enjoys playing the organ, having studied with Joyce Peabody of the Day Murray Music Organ School.<br/><br/>
  976. Bridget has provided private piano instruction for the Gifted Music School, Prepatory Division. She continues to serve on their Spring Gala Committee.<br/><br/>
  977. Bridget is an active member of several professional music organizations:
  978. </p>
  979. <ul class="experience-list">
  980. <li><a href="http://www.mtna.org" target="_blank" class="normal-link">Music Teacher\'s National Association</a></li>
  981. <li><a href="http://www.utahmta.org" target="_blank" class="normal-link">Utah Music Teacher\'s Association</a></li>
  982. <li><a href="http://www.ufmc-music.org" target="_blank" class="normal-link">Utah Federation of Music Clubs</a></li>
  983. </ul>
  984. <p class="about-blurb" id="master-class-intro">
  985. Bridget frequently participates in workshops, festivals, lectures, recitals, and concerts. She has attended a variety of master classes from world-renowned artists, including:
  986. </p>
  987. <ul class="experience-list">
  988. <li><a href="http://www.americancomposers.org/bios20010318.htm" target="_blank" class="normal-link">Leon Fleisher</a></li>
  989. <li><a href="http://www.danielpollack.com" target="_blank" class="normal-link">Daniel Pollack</a></li>
  990. <li><a href="http://www.tunepiano.com/claude.htm" target="_blank" class="normal-link">Claude Frank</a></li>
  991. <li><a href="http://music.msu.edu/faculty/profile/panayis" target="_blank" class="normal-link">Panayis Lyras</a></li>
  992. <li><a href="http://www.marinalomazov.com" target="_blank" class="normal-link">Marina Lomazov</a></li>
  993. <li><a href="http://www.yefimbronfman.com" target="_blank" class="normal-link">Yefin Bronfman</a></li>
  994. <li><a href="http://www.pompa-baldi.com" target="_blank" class="normal-link">Antonio Pompa-Baldi</a></li>
  995. <li><a href="http://www.normankrieger.com/bio.htm" target="_blank" class="normal-link">Norman Krieger</a></li>
  996. <li><a href="http://www.robertoplano.com/i_index.asp" target="_blank" class="normal-link">Roberto Plano</a></li>
  997. <li><a href="http://www.olgakern.com/home.html" target="_blank" class="normal-link">Olga Kern</a></li>
  998. <li><a href="http://www.stephenbeus.com/" target="_blank" class="normal-link">Stephen Beus</a></li>
  999. </ul>
  1000. </div>
  1001. <div id="about-education">
  1002. <h1 class="section-title">
  1003. Education
  1004. </h1>
  1005. <p class="about-blurb">
  1006. Bridget graduated from Utah State University with a Bachelor of Music in Piano Pedagogy.<br/><br/>
  1007. She completed post-graduate courses in Piano Performance at California State University.<br/><br/>
  1008. In 2003, she earned the designation <em>Nationally Certified Teacher of Music</em> from the Music Teacher\'s National Association.
  1009. </p>
  1010. </div>
  1011. <div id="about-awards">
  1012. <h1 class="section-title">
  1013. Awards
  1014. </h1>
  1015. <ul class="award-list">
  1016. <li>Graduate Fellowship - California State University, Sacramento</li>
  1017. <li>Teacher of the Year - Utah State University Youth Conservatory</li>
  1018. <li>Teaching Assistant of the Year - Utah State University Youth Conservatory</li>
  1019. <li>Piano Pedagogy Scholarship - Utah State University Piano Department</li>
  1020. </ul>
  1021. </div>';
  1022. }
  1023. /* =================================
  1024. * Policies Page
  1025. * ================================= */
  1026. function getPoliciesContentMobile()
  1027. {
  1028. return '
  1029. <div class="gb">
  1030. <p class="pp">
  1031. Lessons are designed to provide students with a well-rounded approach to playing the piano. Students are taught to play musically, to sight read, and to be
  1032. detail-oriented. Theory and technical work are an integral part of curriculum. Students should come to lessons with all assignments completed from the
  1033. previous week. Students receive a grade at the end of each lesson based on overall preparedness:
  1034. <br/><br/>
  1035. <strong>5</strong> - Exceptional preparation; all assignments well-practiced; outstanding lesson
  1036. <br/>
  1037. <strong>4</strong> - Good preparation; most assignments practiced; some room for improvement
  1038. <br/>
  1039. <strong>3</strong> - Not prepared; most assignments not practiced; much room for improvement
  1040. <br/><br/>
  1041. Students who consistently receive a grade of four or above will remain in good standing and continue study. Those who consistently receive a lower grade
  1042. will be asked to reconsider their commitment to studying the piano with Bridget Johansen.
  1043. <br/><br/>
  1044. Four group classes will be held during the school year, focusing on music theory, ear training, performance, and history. Group classes provide an excellent
  1045. opportunity for students to interact with peer musicians.
  1046. </p>
  1047. <div data-role="header">
  1048. <h1 style="text-align:left; margin-left: 0.5em">Instructor Expectations</h1>
  1049. </div>
  1050. <p class="pp">
  1051. Piano practice is required six days per week. It is strongly recommended that students practice before and after their lessons. Students should document
  1052. their practice time and strive to practice according to the following daily guidelines:
  1053. </p>
  1054. <table border="1" class="pct">
  1055. <tr>
  1056. <th>Age</th><th>Time</th>
  1057. </tr>
  1058. <tr>
  1059. <td>5-8</td><td>30 minutes</td>
  1060. </tr>
  1061. <tr>
  1062. <td>9-11</td><td>45 minutes</td>
  1063. </tr>
  1064. <tr>
  1065. <td>12-13</td><td>60 minutes</td>
  1066. </tr>
  1067. <tr>
  1068. <td>14-15</td><td>75 minutes</td>
  1069. </tr>
  1070. <tr>
  1071. <td>16+</td><td>90-120 minutes</td>
  1072. </tr>
  1073. </table>
  1074. <div data-role="header">
  1075. <h1 style="text-align:left; margin-left: 0.5em">Parent Involvement</h1>
  1076. </div>
  1077. <p class="pp">
  1078. Parents with students younger than age eleven should attend weekly lessons, take notes, and assist their child in daily practice. If a parent is unable to attend, the student
  1079. may record the lesson with a video or audio recording device. Students between the ages of eleven and twelve are encouraged to develop independence in their music study;
  1080. therefore, parental attendance during this stage is optional. Students older than age thirteen should be primarily independent in their music study and practice. Parents
  1081. should encourage students to practice daily. The more involved parents become in their child\'s piano experience, the better the child\'s experience will be.
  1082. </p>
  1083. <div data-role="header">
  1084. <h1 style="text-align:left; margin-left: 0.5em">Performing</h1>
  1085. </div>
  1086. <p class="pp">
  1087. Students should wear their best attire in any performance. Boys should wear slacks, a collared shirt, and preferably a tie. Girls should wear a dress or skirt which covers
  1088. the knees, and should wear shoes with a flat heel. Jeans, shorts, mini-skirts, white socks, tennis shoes and flip flops are not appropriate attire for performing. Families
  1089. should arrive at recitals on time and plan to stay for the duration. Students who cannot stay for the entire recital will not be able to play. <em>To minimize noise and
  1090. distraction, children under the age of five should not attend recitals.</em>
  1091. </p>
  1092. <div data-role="header">
  1093. <h1 style="text-align:left; margin-left: 0.5em">Extracurricular Performances</h1>
  1094. </div>
  1095. <p class="pp">
  1096. Students are encouraged to perform for occasions other than events organized by Bridget Johansen Piano Studio. This includes performances at school, church, community affairs,
  1097. or family events. Students should attend classical music concerts as much as possible to increase their awareness and listening skills. There are numerous concert opportunities
  1098. available in our community, including: The Utah Symphony, Gina Bachauer, university recitals, and concerts on Temple Square.
  1099. </p>
  1100. <div data-role="header">
  1101. <h1 style="text-align:left; margin-left: 0.5em">Studio Rules</h1>
  1102. </div>
  1103. <ul id="studio-rules">
  1104. <li>Arrive on time.</li>
  1105. <li>Park in front of the studio, perpendicular to the curb. Do not park in the driveway.</li>
  1106. <li>Remove shoes upon arrival.</li>
  1107. <li>Close the door at the top of the stairs.</li>
  1108. <li>Wash hands in the basement bathroom adjacent to the piano studio.</li>
  1109. <li><em>Turn off mobile phones.</em></li>
  1110. <li>Do not wear rings, bracelets, or watches while playing the piano.</li>
  1111. <li>Do not bring food, candy, or gum to lessons.</li>
  1112. <li>Do not bring friends to lessons.</li>
  1113. <li>Depart on time.</li>
  1114. </ul>
  1115. <div data-role="header">
  1116. <h1 style="text-align:left; margin-left: 0.5em">Monthly Tuition</h1>
  1117. </div>
  1118. <p class="pp">
  1119. Invoices are emailed on the 25th of each month and include tuition for the upcoming month, festival fees, and costs for music and other materials. Payment is due by the
  1120. 10th of the following month to Bridget Johansen Piano Studio. Payments received after the 10th will incur a late fee.
  1121. <br/><br/>
  1122. Monthly tuition is derived from more than just a student\'s weekly lesson. Tuition also reflects time spent by Bridget attending music conferences and board meetings,
  1123. organizing recitals, selecting music, preparing lesson plans, entering students in festivals and competitions, and judging festivals.
  1124. <br/><br/>
  1125. There will be four group classes held during the school year. The cost of group classes is added to the tuition during the months they are held. There is no refund or
  1126. credit for missed group classes. Parents need not attend group classes.
  1127. </p>
  1128. <div data-role="header">
  1129. <h1 style="text-align:left; margin-left: 0.5em">Missed Lessons</h1>
  1130. </div>
  1131. <p class="pp">
  1132. Fees are not lowered or credited for missed lessons. A calendar of lesson days and holidays has been provided. Lessons are billed according to this calendar. Should a
  1133. conflict arise with a scheduled lesson time, students are encouraged to trade lesson times with another student. A current and password-protected lesson schedule can
  1134. be found <a href="" id="scheduleFoundHere" class="normal-link">here</a>. Trade arrangements should be made by the students and should be mutually agreeable. Bridget
  1135. will not be held responsible for any miscommunications or financial misunderstandings. Lessons cancelled by Bridget will always be credited. Students who discontinue
  1136. lessons for any reason will not be refunded tuition for that month. If a student takes a leave of absence for any reason, tuition is required to hold his/her place in
  1137. the studio.
  1138. </p>
  1139. </div>';
  1140. }
  1141. function getPoliciesContent()
  1142. {
  1143. return '
  1144. <div id="policies-content">
  1145. <h1 class="section-title">
  1146. Studio Policies - 2013
  1147. </h1>
  1148. <h2 class="policy-header">Lessons</h2>
  1149. <p class="policy">
  1150. Lessons are designed to provide students with a well-rounded approach to playing the piano. Students are taught to play musically, to sight read, and to be
  1151. detail-oriented. Theory and technical work are an integral part of curriculum. Students should come to lessons with all assignments completed from the
  1152. previous week. Students receive a grade at the end of each lesson based on overall preparedness:
  1153. <br/><br/>
  1154. <strong>5</strong> - Exceptional preparation; all assignments well-practiced; outstanding lesson
  1155. <br/>
  1156. <strong>4</strong> - Good preparation; most assignments practiced; some room for improvement
  1157. <br/>
  1158. <strong>3</strong> - Not prepared; most assignments not practiced; much room for improvement
  1159. <br/><br/>
  1160. Students who consistently receive a grade of four or above will remain in good standing and continue study. Those who consistently receive a lower grade
  1161. will be asked to reconsider their commitment to studying the piano with Bridget Johansen.
  1162. <br/><br/>
  1163. Four group classes will be held during the school year, focusing on music theory, ear training, performance, and history. Group classes provide an excellent
  1164. opportunity for students to interact with peer musicians.
  1165. </p>
  1166. <h2 class="policy-header">Instructor Expectations</h2>
  1167. <p class="policy">
  1168. Piano practice is required six days per week. It is strongly recommended that students practice before and after their lessons. Students should document
  1169. their practice time and strive to practice according to the following daily guidelines:
  1170. </p>
  1171. <table border="1">
  1172. <tr>
  1173. <th>Age</th><th>Time</th>
  1174. </tr>
  1175. <tr>
  1176. <td>5-8</td><td>30 minutes</td>
  1177. </tr>
  1178. <tr>
  1179. <td>9-11</td><td>45 minutes</td>
  1180. </tr>
  1181. <tr>
  1182. <td>12-13</td><td>60 minutes</td>
  1183. </tr>
  1184. <tr>
  1185. <td>14-15</td><td>75 minutes</td>
  1186. </tr>
  1187. <tr>
  1188. <td>16+</td><td>90-120 minutes</td>
  1189. </tr>
  1190. </table>
  1191. <h2 class="policy-header">Parent Involvement</h2>
  1192. <p class="policy">
  1193. Parents with students younger than age eleven should attend weekly lessons, take notes, and assist their child in daily practice. If a parent is unable to attend, the student
  1194. may record the lesson with a video or audio recording device. Students between the ages of eleven and twelve are encouraged to develop independence in their music study;
  1195. therefore, parental attendance during this stage is optional. Students older than age thirteen should be primarily independent in their music study and practice. Parents
  1196. should encourage students to practice daily. The more involved parents become in their child\'s piano experience, the better the child\'s experience will be.
  1197. </p>
  1198. <h2 class="policy-header">Performing</h2>
  1199. <p class="policy">
  1200. Students should wear their best attire in any performance. Boys should wear slacks, a collared shirt, and preferably a tie. Girls should wear a dress or skirt which covers
  1201. the knees, and should wear shoes with a flat heel. Jeans, shorts, mini-skirts, white socks, tennis shoes and flip flops are not appropriate attire for performing. Families
  1202. should arrive at recitals on time and plan to stay for the duration. Students who cannot stay for the entire recital will not be able to play. <em>To minimize noise and
  1203. distraction, children under the age of five should not attend recitals.</em>
  1204. </p>
  1205. <h2 class="policy-header">Extracurricular Performances and Concert Attendance</h2>
  1206. <p class="policy">
  1207. St

Large files files are truncated, but you can click here to view the full file