23 lines
1.4 KiB
PHP
23 lines
1.4 KiB
PHP
<?php
|
|
|
|
require_once 'include/utils/utils.php';
|
|
|
|
|
|
|
|
if($_SERVER['REQUEST_METHOD'] == "POST" and isset($_POST['Enregistrer']))
|
|
|
|
{
|
|
|
|
$secteur = $_POST['ISecteur'];
|
|
|
|
$dateString = $_POST['date'];
|
|
|
|
$idUser = $_POST['idUser'];
|
|
|
|
|
|
|
|
|
|
|
|
$query = "INSERT INTO `vtiger_crmentity`(`crmid`, `smcreatorid`, `smownerid`, `modifiedby`, `setype`, `description`, `smgroupid`, `source`, `label`) VALUES ((SELECT * FROM vtiger_crmentity_seq)+1, ".$idUser.", ".$idUser.", ".$idUser.", 'Calendar', '', 0, 'CRM', '".$secteur."');";
|
|
|
|
$adb->query($query);
|
|
|
|
$query = "UPDATE vtiger_crmentity_seq SET ID = ID + 1;";
|
|
|
|
$adb->query($query);
|
|
|
|
$query = "INSERT INTO vtiger_activity (activityid, subject, activitytype, location, date_start, time_start, due_date, duration_hours, status, eventstatus, visibility) VALUES ((SELECT * FROM vtiger_crmentity_seq), '".$secteur."','Visite','', SUBDATE('".$dateString."',1), '22:00:00','".$dateString."','24','In Progress','Planned','Private');";
|
|
|
|
$adb->query($query);
|
|
|
|
$query = "INSERT INTO vtiger_activitycf (activityid, cf_964) VALUES ((SELECT * FROM vtiger_crmentity_seq), '".$secteur."');";
|
|
|
|
$adb->query($query);
|
|
|
|
header("Location: index.php?module=Calendar&view=Calendar");
|
|
|
|
|
|
|
|
}else{ header("Location: index.php");}
|
|
|
|
?>
|
|
|