示例#1
0
    $sortorder = "DESC";
}
if (!$sortfield) {
    $sortfield = "a.datep";
}
// Security check
$socid = GETPOST('socid', 'int');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'agenda', $socid, '', 'myactions');
/*
 * Actions
 */
if ($action == 'builddoc') {
    $cat = new CommActionRapport($db, $month, $year);
    $result = $cat->write_file(GETPOST('id', 'int'));
    if ($result < 0) {
        setEventMessages($cat->error, $cat->errors, 'errors');
    }
}
/*
 * View
 */
llxHeader();
$sql = "SELECT count(*) as cc,";
$sql .= " date_format(a.datep, '%m/%Y') as df,";
$sql .= " date_format(a.datep, '%m') as month,";
$sql .= " date_format(a.datep, '%Y') as year";
$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm as a,";
$sql .= " " . MAIN_DB_PREFIX . "user as u";
示例#2
0
if (! $sortfield) $sortfield="a.datep";

// Security check
$socid = GETPOST("socid");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'agenda', $socid, '', 'myactions');

$langs->load("commercial");


/*
 * Actions
 */
if ($_GET["action"] == 'builddoc')
{
	$cat = new CommActionRapport($db, $_GET["month"], $_GET["year"]);
	$result=$cat->write_file(GETPOST("id"));
	if ($result < 0)
	{
		$mesg=$cat->error;
	}
}


/*
 * View
 */

llxHeader();

$sql = "SELECT count(*) as cc,";