forked from science-ation/science-ation
Updated the activity log tab. Now in working order.
This commit is contained in:
parent
e3633a3cf4
commit
1da21bea9e
@ -131,15 +131,12 @@ function save_contact(){
|
|||||||
$successMessage = i18n("Contact created successfully");
|
$successMessage = i18n("Contact created successfully");
|
||||||
$u = user_create("sponsor", $_POST['email']);
|
$u = user_create("sponsor", $_POST['email']);
|
||||||
$id = $u['id'];
|
$id = $u['id'];
|
||||||
|
|
||||||
|
|
||||||
}else if($_POST['recordtype'] == 'existing'){
|
}else if($_POST['recordtype'] == 'existing'){
|
||||||
// this is an existing record being updated. Load the user.
|
// this is an existing record being updated. Load the user.
|
||||||
$successMessage = i18n("Contact updated successfully");
|
$successMessage = i18n("Contact updated successfully");
|
||||||
|
|
||||||
$u = user_load($_POST['userid']);
|
$u = user_load($_POST['userid']);
|
||||||
$id = intval($_POST['userid']);
|
$id = intval($_POST['userid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sponsor_id = $_POST['sponsor_id'];
|
$sponsor_id = $_POST['sponsor_id'];
|
||||||
@ -331,7 +328,7 @@ function draw_activityinfo_form(){
|
|||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$query = "SELECT (users.firstname && \" \" && users.lastname) AS name, fdl.dt, fdl.log
|
$query = "SELECT CONCAT_WS(' ', users.firstname, users.lastname) AS name, fdl.dt, fdl.log
|
||||||
FROM fundraising_donor_logs AS fdl
|
FROM fundraising_donor_logs AS fdl
|
||||||
JOIN users ON fdl.users_id=users.id
|
JOIN users ON fdl.users_id=users.id
|
||||||
WHERE sponsors_id=" . $sponsorid;
|
WHERE sponsors_id=" . $sponsorid;
|
||||||
@ -340,9 +337,9 @@ function draw_activityinfo_form(){
|
|||||||
$row = mysql_fetch_array($results);
|
$row = mysql_fetch_array($results);
|
||||||
if($row){
|
if($row){
|
||||||
do{
|
do{
|
||||||
echo "<tr><td>" . $results["dt"];
|
echo "<tr><td>" . $row["dt"];
|
||||||
echo "<tr><td>" . $results["name"];
|
echo "</td><td>" . $row["name"];
|
||||||
echo "</td><td>" . $results["log"];
|
echo "</td><td>" . $row["log"];
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
}while($row = mysql_fetch_array($results));
|
}while($row = mysql_fetch_array($results));
|
||||||
}else{
|
}else{
|
||||||
@ -359,12 +356,15 @@ function draw_activityinfo_form(){
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save the activity info that was submitted
|
||||||
function save_activityinfo(){
|
function save_activityinfo(){
|
||||||
happy_("foo!");
|
|
||||||
$query = "INSERT INTO fundraising_donor_logs (sponsors_id, dt, users_id, log)";
|
$query = "INSERT INTO fundraising_donor_logs (sponsors_id, dt, users_id, log)";
|
||||||
$query .= "VALUES (" . $_GET['id'] . ", NOW())";
|
$query .= "VALUES (" . $_GET['id'] . ",NOW(), " . $_SESSION['users_id'] . ",'" . $_POST['comment'] . "')";
|
||||||
echo $query;
|
if(mysql_query($query)){
|
||||||
|
happy_(i18n("Note Added"));
|
||||||
|
}else{
|
||||||
|
error_(i18n("Error Inserting Record"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,7 +540,10 @@ function update_activityinfo()
|
|||||||
|
|
||||||
function activityinfo_save() {
|
function activityinfo_save() {
|
||||||
var id=sponsor_id;
|
var id=sponsor_id;
|
||||||
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=activityinfo_save&id="+id, $("#activityinfo").serializeArray());
|
$("#debug").load("<?$_SERVER['PHP_SELF']?>?action=activityinfo_save&id="+id, $("#activityinfo").serializeArray(),
|
||||||
|
function(){
|
||||||
|
update_activityinfo();
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user