Skip to content

Commit

Permalink
SubmitDate saved when submitted
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@1855 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shawn Wales committed Aug 1, 2006
1 parent b2d60f6 commit 605933a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
10 changes: 10 additions & 0 deletions index.php
Expand Up @@ -940,6 +940,10 @@ function createinsertquery()
{
$query .= "ipaddr = '".$_SERVER['REMOTE_ADDR']."',";
}
if ((isset($_POST['move']) && $_POST['move'] == " "._("submit")." "))
{
$query .= "submitdate = '".date("Y-m-d H:i:s")."',";
}
$fields=explode("|", $_POST['modfields']);
foreach ($fields as $field)
{
Expand All @@ -951,6 +955,12 @@ function createinsertquery()
else
{
$query = "";
if ((isset($_POST['move']) && $_POST['move'] == " "._("submit")." "))
{
$query = "UPDATE {$thissurvey['tablename']} SET ";
$query .= "submitdate = '".date("Y-m-d H:i:s")."' ";
$query .= "WHERE id=" . $_SESSION['srid'];
}
}
}
// <-- END NEW FEATURE - SAVE
Expand Down
19 changes: 9 additions & 10 deletions save.php
Expand Up @@ -92,18 +92,17 @@
if (isset($_POST[$pf])) {$_SESSION[$pf] = $_POST[$pf];}
if (!isset($_POST[$pf])) {$_SESSION[$pf] = "";}
}

if ($thissurvey['active'] == "Y") // Only save if active
}
if ($thissurvey['active'] == "Y") // Only save if active
{
// SAVE DATA TO SURVEY_X RECORD
$subquery = createinsertquery();
if ($result=$connect->Execute($subquery))
{
// SAVE DATA TO SURVEY_X RECORD
$subquery = createinsertquery();
if ($result=$connect->Execute($subquery))
$srid = $connect->Insert_ID();
if ($srid > 0) //Was an Insert, not an Update
{
$srid = $connect->Insert_ID();
if ($srid > 0) //Was an Insert, not an Update
{
$_SESSION['srid'] = $srid;
}
$_SESSION['srid'] = $srid;
}
}
}
Expand Down

0 comments on commit 605933a

Please sign in to comment.