Created deleteEvent function and use that now.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@123 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
3a3faa5a70
commit
b35f0c95ac
|
@ -50,17 +50,7 @@ if ( $action )
|
|||
{
|
||||
foreach( $mark_eids as $mark_eid )
|
||||
{
|
||||
$result = mysql_query( "delete from Stats where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Frames where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Events where Id = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
if ( $mark_eid )
|
||||
system( escapeshellcmd( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $mark_eid ) ) );
|
||||
deleteEvent( $mark_eid );
|
||||
}
|
||||
}
|
||||
elseif ( $mark_zids )
|
||||
|
@ -104,17 +94,7 @@ if ( $action )
|
|||
}
|
||||
foreach( $mark_eids as $mark_eid )
|
||||
{
|
||||
$result = mysql_query( "delete from Stats where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Frames where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Events where Id = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
if ( $mark_eid )
|
||||
system( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $mark_eid ) );
|
||||
deleteEvent( $mark_eid );
|
||||
}
|
||||
system( "rm -rf ".EVENT_PATH."/".$monitor[Name] );
|
||||
|
||||
|
|
|
@ -19,6 +19,21 @@
|
|||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
function deleteEvent( $eid )
|
||||
{
|
||||
$result = mysql_query( "delete from Stats where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Frames where EventId = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$result = mysql_query( "delete from Events where Id = '$mark_eid'" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
if ( $mark_eid )
|
||||
system( escapeshellcmd( "rm -rf ".EVENT_PATH."/*/".sprintf( "%04d", $mark_eid ) ) );
|
||||
}
|
||||
|
||||
function getBrowser( &$browser, &$version )
|
||||
{
|
||||
global $HTTP_SERVER_VARS;
|
||||
|
|
Loading…
Reference in New Issue