<commit_before><!DOCTYPE html>
<?php
$string = file_get_contents("peer.json");
$json = json_decode($string);
if ( $json === null ) {
    echo("<pre>\n");
    echo("Invalid JSON:\n\n");
    echo($string);
    echo("</pre>\n");
    die("<p>Internal error contact instructor</p>\n");
}
?>
<html>
<head>
<title>Assignment: <?= $json->title ?></title>
<style>
li {padding-top: 0.5em;}
pre {padding-left: 2em;}
</style>
</head>
<body style="margin-left:5%; margin-bottom: 60px; margin-right: 5%; font-family: sans-serif;">
<h1>Assignment: <?= $json->title ?></h1>
<p>
In this assignment we will merge our <b>add.php</b> and <b>edit.php</b>
into a single <b>form.php</b> which is capable of adding a new entry or
editing an existing entry. All of the form rendering will be done with 
the the <b>Handlebars</b> JavaScript library.
</p>
<p>
You can play with a sample implementation of the code at:
<pre>
<a href="http://www.php-intro.com/solutions/res-handlebars/" target="_blank">http://www.php-intro.com/solutions/res-handlebars/</a>
</pre>
</p>
<p>
You can download nearly complete implementation of this 
assignment at:
<pre>
<a href="res-handlebars.zip">http://www.php-intro.com/assn/res-handlebars/res-handlbars.zip</a>
</pre>
The only part that is missing its implementation of <b>profile.php</b>.  
Without a working <b>profile.php</b> the application's 
add functionality will work but the editing and view functionality
will not work.
</p><commit_msg>Adjustments<commit_after><!DOCTYPE html>
<?php
$string = file_get_contents("peer.json");
$json = json_decode($string);
if ( $json === null ) {
    echo("<pre>\n");
    echo("Invalid JSON:\n\n");
    echo($string);
    echo("</pre>\n");
    die("<p>Internal error contact instructor</p>\n");
}
?>
<html>
<head>
<title>Assignment: <?= $json->title ?></title>
<style>
li {padding-top: 0.5em;}
pre {padding-left: 2em;}
</style>
</head>
<body style="margin-left:5%; margin-bottom: 60px; margin-right: 5%; font-family: sans-serif;">
<h1>Assignment: <?= $json->title ?></h1>
<p>
In this assignment we will merge our <b>add.php</b> and <b>edit.php</b>
into a single <b>form.php</b> which is capable of adding a new entry or
editing an existing entry. All of the form rendering will be done with 
the the <b>Handlebars</b> JavaScript library.
</p>
<p>
In the sample code, some off the files have been comverted to completely use
in-browser rendering for dynamic data, other files use a in-server MVC approach
similar to previous assignments, and others are hybrid:
<ul>
<li><b>index.php</b> and <b>view.php</b> use in-browser rendering for all data
that comes from the model.  In these files, there is no need to requir <b>pdo.php</b>
as a result.</li>
<li><b>form.php</b> uses in-browser rendering to pull in old data if there is a 
field being edited but uses old-style MVC to handle the incoming POST data when
an entry is added or edited.</li>
<li><b>login.php</b> and <b>delete.php</b> are old-style MVC where model, controller,
and view all are handled in PHP.</li>
</ul>
<p>
You can play with a sample implementation of the code at:
<pre>
<a href="http://www.php-intro.com/solutions/res-handlebars/" target="_blank">http://www.php-intro.com/solutions/res-handlebars/</a>
</pre>
</p>
<p>
You can download nearly complete implementation of this 
assignment at:
<pre>
<a href="res-handlebars.zip">http://www.php-intro.com/assn/res-handlebars/res-handlbars.zip</a>
</pre>
The only part that is missing its implementation of <b>profile.php</b>.  
Without a working <b>profile.php</b> the application's 
add functionality will work but the editing and view functionality
will not work.
</p>
{'fraction_non_alphanumeric': 0.16529152915291528, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 4.510606060606061, 'pattern_counts': {'":': 0, '<': 112, '<?xml version=': 0, '>': 116, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '334774', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1221, 'n_words': 412}