<commit_before><?php
/**
 * Created by PhpStorm.
 * User: ryan_w_frank
 * Date: 8/13/17
 * Time: 9:02 PM
 */
?>

<script type="application/javascript">
    $(document).ready(function() {
        //$("mySubmit").click(function(event) {
        $("#goodSamaritanForm").submit(function(event) {
            event.preventDefault();
            if( $("#emailList").is(':checked') ) { var mail = "1"; }
            else { var mail = "0"; }
            if( $("#donationReceived").is(':checked') ) { var rdonation = "1"; }
            else { var rdonation = "0"; }
            jQuery.ajax({
                type: "POST",
                url: "<?php echo base_url(); ?>" + "Intake/addSamaritan",
                dataType: 'json',
                data: {
                    "first": $("input#firstName").val(),
                    "last": $("input#lastName").val(),
                    "street": $("input#streetAddress").val(),
                    "city": $("input#cityName").val(),
                    "state": $("input#stateName").val(),
                    "zip": $("input#zipCode").val(),
                    "email": $("input#emailAddress").val(),
                    "phone": $("input#phoneNumber").val(),
                    "donation": rdonation,
                    "amount": $("input#donationAmount").val(),
                    "referral": $("input#referral").val(),
                    "emailList": mail
                },
                success: function(res) {
                    alert("Elements: " + res);
                if (res === "success") {
                    jQuery("div#content").html('<div class="alert alert-success mt-lg-4 col-3" role="alert">Successfully added ' + $("input#firstName").val() + ' ' + $("input#lastName").val() + '</div>');
                }
                else{
                    jQuery("div#content").html('<div class="alert alert-danger mt-lg-4 col-3" role="alert">Failed to add ' + $("input#firstName").val() + ' ' + $("input#lastName").val() + '</div>');
                }
            },
                error: function(res) {
                alert('ERROR: ' + res.first);
            }
            });
        });
    });
</script>
<form class="mt-3" id="goodSamaritanForm" name="goodSamaritanForm">
    <div class="row">
        <div class="form-group col-6">
            <label for="firstName" class="align-content-center">Good Samaritan First Name</label>
            <input type="text" class="form-control" id="firstName" placeholder="First Name" required>
            <div class="invalid-feedback">Please provide a first name</div>
        </div>
        <div class="form-group col-6">
            <label for="lastName" class="align-content-center">Good Samaritan Last Name</label>
            <input type="text" class="form-control" id="lastName" placeholder="Last Name" required>
            <div class="invalid-feedback">Please provide a last name</div>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-6">
            <label for="streetAddress" class="align-content-center">Good Samaritan Street Address</label>
            <input type="text" class="form-control" id="streetAddress" placeholder="Street Address" required>
        </div>
        <div class="form-group col-6">
            <label for="cityName" class="align-content-center">Good Samaritan City</label>
            <input type="text" class="form-control" id="cityName" placeholder="City" required>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-3">
            <label for="stateName" class="align-content-center">Good Samaritan State</label>
            <select class="form-control" id="stateName" required>
                <?php
                foreach ($states->result() as $row)
                {
                    print "<option value=" . $row->state_id .">" . $row->state_name . "</option>";
                }
                ?>
            </select>
        </div>
        <div class="form-group col-3">
            <label for="zipCode" class="align-content-center">Good Samaritan Zip</label>
            <input type="text" class="form-control" id="zipCode" placeholder="Zip Code" required>
        </div>
        <div class="form-group col-3">
            <label for="emailAddress" class="align-content-center">Good Samaritan Email</label>
            <input type="email" class="form-control" id="emailAddress" placeholder="<EMAIL>" required>
        </div>
        <div class="form-group col-3">
            <label for="phoneNumber" class="align-content-center">Good Samaritan Phone</label>
            <input type="text" class="form-control" id="phoneNumber" placeholder="XXX-XXX-XXXX" required>
        </div>
        </div>
    <div class="row">
        <div class="form-check col-3">
            <label class="form-check-label">
                <input class="form-check-input" id="donationReceived" type="checkbox" value="Yes">
                    Donation received?
            </label>
        </div>
        <div class="input-group col-3">
            <span class="input-group-addon">$</span>
            <input type="text" class="form-control" id="donationAmount" placeholder="Amount Received">
            <span class="input-group-addon">.00</span>
        </div>
        <div class="form-group col-3">
            <label for="referral" class="align-content-center">Who referred you to us?</label>
            <input type="text" class="form-control" id="referral" placeholder="Google, FaceBook, etc..." required>
        </div>
        <div class="form-check col-3">
            <label class="form-check-label">
                <input class="form-check-input" id="emailList" type="checkbox" value="1" />
                Would you like to be on our mailing list?<commit_msg>Added jQuery<commit_after><?php
/**
 * Created by PhpStorm.
 * User: ryan_w_frank
 * Date: 8/13/17
 * Time: 9:02 PM
 */
?>

<script type="application/javascript">
    $(document).ready(function() {
        //$("mySubmit").click(function(event) {
        $("#goodSamaritanForm").submit(function(event) {
            event.preventDefault();
            if( $("#emailList").is(':checked') ) { var mail = "1"; }
            else { var mail = "0"; }
            if( $("#donationReceived").is(':checked') ) { var rdonation = "1"; }
            else { var rdonation = "0"; }
            jQuery.ajax({
                type: "POST",
                url: "<?php echo base_url(); ?>" + "Intake/addSamaritan",
                dataType: 'json',
                data: {
                    "first": $("input#firstName").val(),
                    "last": $("input#lastName").val(),
                    "street": $("input#streetAddress").val(),
                    "city": $("input#cityName").val(),
                    "state": $("input#stateName").val(),
                    "zip": $("input#zipCode").val(),
                    "email": $("input#emailAddress").val(),
                    "phone": $("input#phoneNumber").val(),
                    "donation": rdonation,
                    "amount": $("input#donationAmount").val(),
                    "referral": $("input#referral").val(),
                    "emailList": mail
                },
                success: function(res) {
                    alert("Elements: " + res);
                if (res === "success") {
                    jQuery("div#content").html('<div class="alert alert-success mt-lg-4 col-3" role="alert">Successfully added ' + $("input#firstName").val() + ' ' + $("input#lastName").val() + '</div>');
                }
                else{
                    jQuery("div#content").html('<div class="alert alert-danger mt-lg-4 col-3" role="alert">Failed to add ' + $("input#firstName").val() + ' ' + $("input#lastName").val() + '</div>');
                }
            },
                error: function(res) {
                alert('ERROR: ' + res.first);
            }
            });
        });
    });
</script>
<form class="mt-3" id="goodSamaritanForm" name="goodSamaritanForm">
    <div class="row">
        <div class="form-group col-6">
            <label for="firstName" class="align-content-center">Good Samaritan First Name</label>
            <input type="text" class="form-control" id="firstName" placeholder="<NAME>" required>
            <div class="invalid-feedback">Please provide a first name</div>
        </div>
        <div class="form-group col-6">
            <label for="lastName" class="align-content-center">Good Samaritan Last Name</label>
            <input type="text" class="form-control" id="lastName" placeholder="<NAME>" required>
            <div class="invalid-feedback">Please provide a last name</div>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-6">
            <label for="streetAddress" class="align-content-center">Good Samaritan Street Address</label>
            <input type="text" class="form-control" id="streetAddress" placeholder="Street Address" required>
        </div>
        <div class="form-group col-6">
            <label for="cityName" class="align-content-center">Good Samaritan City</label>
            <input type="text" class="form-control" id="cityName" placeholder="City" required>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-3">
            <label for="stateName" class="align-content-center">Good Samaritan State</label>
            <select class="form-control" id="stateName" required>
                <?php
                foreach ($states->result() as $row)
                {
                    print "<option value=" . $row->state_id .">" . $row->state_name . "</option>";
                }
                ?>
            </select>
        </div>
        <div class="form-group col-3">
            <label for="zipCode" class="align-content-center">Good Samaritan Zip</label>
            <input type="text" class="form-control" id="zipCode" placeholder="Zip Code" required>
        </div>
        <div class="form-group col-3">
            <label for="emailAddress" class="align-content-center">Good Samaritan Email</label>
            <input type="email" class="form-control" id="emailAddress" placeholder="<EMAIL>" required>
        </div>
        <div class="form-group col-3">
            <label for="phoneNumber" class="align-content-center">Good Samaritan Phone</label>
            <input type="text" class="form-control" id="phoneNumber" placeholder="XXX-XXX-XXXX" required>
        </div>
        </div>
    <div class="row">
        <div class="form-check col-3">
            <label class="form-check-label">
                <input class="form-check-input" id="donationReceived" type="checkbox" value="Yes">
                    Donation received?
                <span class="input-group-addon">$</span>
                <input type="text" class="form-control" id="donationAmount" placeholder="Amount Received">
                <span class="input-group-addon">.00</span>
            </label>
        </div>
        <!-- <div class="input-group col-3">
            <span class="input-group-addon">$</span>
            <input type="text" class="form-control" id="donationAmount" placeholder="Amount Received">
            <span class="input-group-addon">.00</span>
        </div> -->
        <div class="form-group col-3">
            <label for="referral" class="align-content-center">Who referred you to us?</label>
            <input type="text" class="form-control" id="referral" placeholder="Google, FaceBook, etc..." required>
        </div>
        <div class="form-check col-3">
            <label class="form-check-label">
                <input class="form-check-input" id="emailList" type="checkbox" value="1" />
                Would you like to be on our mailing list?
{'fraction_non_alphanumeric': 0.1733152266168732, 'fraction_numerical': 0.005601765404854863, 'mean_word_length': 2.044702842377261, 'pattern_counts': {'":': 24, '<': 181, '<?xml version=': 0, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1362145', 'n_tokens_mistral': 3367, 'n_tokens_neox': 3254, 'n_words': 676}