<?
////////////////////////////////////////////////////
// Conciliación: gestión de conciliación de activos
// Version: 1.0
//
// Copyright (C) 2014  Eustotem Multimedia, S.L.
//
// License: MIT, see LICENSE
////////////////////////////////////////////////////


include("../conf/preferences.php");
session_name(SYS_APP_SESSNAME);
session_start();
include("../conf/langs/".$langs[$_SESSION['userlang']][0]."/MAIN.php");
include("../conf/connections.php");
include("../phplib/auth.php");
require_once("../phplib/utils.php");
require_once("../core/plugins.php");

require_once("../phplib/phpmailer/class.phpmailer.php");
$mail = new phpmailer();
$mail->SetLanguage("es","../phplib/phpmailer/language/");
$mail->PluginDir="../phplib/phpmailer/";

$returnUrl=$_SERVER['HTTP_REFERER'];
$id=(int)$_GET['id'];
$sql="SELECT * FROM smk_frm_submission WHERE id=$id";
$q=mysql_query($sql);
$f=mysql_fetch_assoc($q);
if($f['status']==1){
	$w=mysql_query("UPDATE smk_frm_submission SET status=2, attended=NOW(), attended_by=" . $_SESSION[session_id()]['id'] . " WHERE id=$id");
}else if($f['status']==2){
	$w=mysql_query("UPDATE smk_frm_submission SET status=1 WHERE id=$id");
}
header("Location: $returnUrl");
// ====================================================================================
?>
