diff --git a/js/reports.js b/js/reports.js index bb64bc9..b3d5d88 100644 --- a/js/reports.js +++ b/js/reports.js @@ -36,18 +36,31 @@ $(function(){ $(".stats-left").attr("href","/individual_history_log.php?contact_id=" + prev); $(".stats-right").attr("href","/individual_history_log.php?contact_id=" + next); + var record_count; + $.post("json/reports.php", { record_count: 1 }, function (data) { + record_count = data; + record_count = $.parseJSON(data); + }); + // name $.post("json/reports.php", { name: 1, contact_id: contact_id }, function (data) { if (data) { + var d = new Date(); + var date = d.toISOString().split('T')[0]; var obj = $.parseJSON(data); - $("#name").text(obj.full_name); + var full_name_with_link = '' + obj.full_name + ""; + $("#name").html(full_name_with_link); var pad_name; if (obj.configurations.prefix) { pad_name = obj.configurations.prefix + "_pad_contact_id_" + contact_id; } else { pad_name = "pad_contact_id_" + contact_id; } - console.log(pad_name); + //console.log(pad_name); if ( obj.configurations.host && obj.full_name ) { $("#individual_history_pad").pad({ "padId": pad_name, diff --git a/json/reports.php b/json/reports.php index e4c054f..9fd4e34 100644 --- a/json/reports.php +++ b/json/reports.php @@ -129,5 +129,15 @@ $handler->start(); echo json_encode($result); } // return everyone + + // Latest transaction_id + if (isset($_POST['record_count'])) { + + $query = 'SELECT MAX(transaction_id) AS record_count FROM transaction_log;'; + $sql = mysql_query($query, $YBDB) or die(mysql_error()); + $result = mysql_fetch_assoc($sql); + echo json_encode($result); + + } ?> diff --git a/transaction_log.php b/transaction_log.php index 8fd7681..2e63b87 100644 --- a/transaction_log.php +++ b/transaction_log.php @@ -691,11 +691,15 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) { $result = mysql_fetch_assoc($sql); if($result['anonymous']) { - echo "Anonymous"; + echo "Anonymous"; + $whoami = "Anonymous"; } else { echo '' . $row_Recordset1['full_name'] . ""; + $whoami = '' . + $row_Recordset1['full_name'] . ""; } ?>  @@ -791,7 +795,23 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) { - TOTAL + TOTAL + ' . + $result['full_name'] . ""; + } + } + ?> + $