78 lines
1.9 KiB
PHP
78 lines
1.9 KiB
PHP
|
|
<?
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_contacts")
|
||
|
|
{
|
||
|
|
$module="Contacts";
|
||
|
|
$parent_id="contact_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_accounts")
|
||
|
|
{
|
||
|
|
$module="Accounts";
|
||
|
|
$parent_id="account_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecmcorrespondenceins")
|
||
|
|
{
|
||
|
|
$module="EcmCorrespondenceIns";
|
||
|
|
$parent_id="ecmcorrespondencein_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecmcorrespondenceouts")
|
||
|
|
{
|
||
|
|
$module="EcmCorrespondenceOuts";
|
||
|
|
$parent_id="ecmcorrespondenceout_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecminvoiceins")
|
||
|
|
{
|
||
|
|
$module="EcmInvoiceIns";
|
||
|
|
$parent_id="ecminvoicein_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecminvoiceouts")
|
||
|
|
{
|
||
|
|
$module="EcmInvoiceOuts";
|
||
|
|
$parent_id="ecminvoiceout_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecmcontracts")
|
||
|
|
{
|
||
|
|
$module="EcmContracts";
|
||
|
|
$parent_id="ecmcontract_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_ecmdocs")
|
||
|
|
{
|
||
|
|
$module="EcmDocs";
|
||
|
|
$parent_id="ecmdoc_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_emails")
|
||
|
|
{
|
||
|
|
$module="Emails";
|
||
|
|
$parent_id="email_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_calls")
|
||
|
|
{
|
||
|
|
$module="Calls";
|
||
|
|
$parent_id="call_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_meetings")
|
||
|
|
{
|
||
|
|
$module="Meetings";
|
||
|
|
$parent_id="meeting_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_notes")
|
||
|
|
{
|
||
|
|
$module="Notes";
|
||
|
|
$parent_id="note_id";
|
||
|
|
}
|
||
|
|
if($_REQUEST['relation']=="ecmdocuments_tasks")
|
||
|
|
{
|
||
|
|
$module="Tasks";
|
||
|
|
$parent_id="task_id";
|
||
|
|
}
|
||
|
|
|
||
|
|
$w=mysql_query("select id,ecmdocument_id,".$parent_id." from ".$_REQUEST['relation']." where ecmdocument_id='".$_REQUEST['ecmdocument_id']."' and ".$parent_id."='".$_REQUEST['id']."' and deleted='0'");
|
||
|
|
$r=mysql_fetch_array($w);
|
||
|
|
$ids=$r['id'];
|
||
|
|
|
||
|
|
|
||
|
|
$z="update ".$_REQUEST['relation']." set deleted='1' where id='".$ids."'";
|
||
|
|
|
||
|
|
print $z;
|
||
|
|
if(mysql_query($z))print "ok";
|
||
|
|
header("Location: index.php?module=".$module."&action=DetailView&record=".$_REQUEST['id']);
|
||
|
|
?>
|