core/api/modules/crm/ajax.php

61 lines
2.0 KiB
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
switch(@$_POST['act']) {
/* ----------------------------------------------------------------------
13.06.2022
Добавление коментария к задаче
---------------------------------------------------------------------- */
case 'add_comment':
unset( $_POST['act'] );
$_POST['t'] = time();
$_POST['user_id'] = $_SESSION['user_id'];
$_POST['txt'] = nl2br( $_POST['txt'] );
$db -> add ( 'crm_comments', $_POST );
break;
/* ----------------------------------------------------------------------
13.06.2022
Завершаем задачу
---------------------------------------------------------------------- */
case 'end_task':
$db -> free_sql ( 'UPDATE `crm` SET `status`=1, `end_task`= "' . time() . '" WHERE `id` = ' . $_POST['id'] );
break;
/* ----------------------------------------------------------------------
13.06.2022
Возобновить задачу
---------------------------------------------------------------------- */
case 'repeat_task':
$db -> free_sql ( 'UPDATE `crm` SET `status`=0, `end_task`= "' . time() . '" WHERE `id` = ' . $_POST['id'] );
break;
/* ----------------------------------------------------------------------
13.06.2022
Изенить срок задачи
---------------------------------------------------------------------- */
case 'change_srok':
$d = substr( $_POST['t'], 0, 2 );
$m = substr( $_POST['t'], 3, 2 );
$y = substr( $_POST['t'], 6, 4 );
$t = mktime( '21', '00', '00', $m, $d, $y );
$db -> free_sql ( 'UPDATE `crm` SET `t`= "' . $t . '" WHERE `id` = ' . $_POST['id'] );
break;
/* ----------------------------------------------------------------------
16.06.2022
Делегирование
---------------------------------------------------------------------- */
case 'deleg':
$db -> free_sql ( 'UPDATE `crm` SET `isp`= "' . $_POST['isp'] . '" WHERE `id` = ' . $_POST['id'] );
break;
default:
}
?>