当前位置: 首页>>代码示例>>PHP>>正文


PHP dol_get_last_day函数代码示例

本文整理汇总了PHP中dol_get_last_day函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_get_last_day函数的具体用法?PHP dol_get_last_day怎么用?PHP dol_get_last_day使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dol_get_last_day函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getNbByMonth

 /**
  * Return shipment number by month for a year
  *
  * @param	int		$year		Year to scan
  * @return	array				Array with number by month
  */
 function getNbByMonth($year)
 {
     global $user;
     $sql = "SELECT date_format(d.datedon,'%m') as dm, COUNT(*) as nb";
     $sql .= " FROM " . $this->from;
     $sql .= " WHERE d.datedon BETWEEN '" . $this->db->idate(dol_get_first_day($year)) . "' AND '" . $this->db->idate(dol_get_last_day($year)) . "'";
     $sql .= " AND " . $this->where;
     $sql .= " GROUP BY dm";
     $sql .= $this->db->order('dm', 'DESC');
     $res = $this->_getNbByMonth($year, $sql);
     return $res;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:18,代码来源:donstats.class.php

示例2: loadBox

 /**
  *  Load data for box to show them later
  *
  *  @param  int     $max        Maximum number of records to load
  *  @return void
  */
 function loadBox($max = 5)
 {
     global $conf, $user, $langs, $db;
     $this->max = $max;
     $totalMnt = 0;
     $totalnb = 0;
     $totalDuree = 0;
     include_once DOL_DOCUMENT_ROOT . "/projet/class/task.class.php";
     $taskstatic = new Task($db);
     $textHead = $langs->trans("Tasks") . " " . date("Y");
     $this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
     // list the summary of the orders
     if ($user->rights->projet->lire) {
         // FIXME fk_statut on a task is not be used. We use the percent. This means this box is useless.
         $sql = "SELECT pt.fk_statut, count(DISTINCT pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
         $sql .= " FROM " . MAIN_DB_PREFIX . "projet_task as pt, " . MAIN_DB_PREFIX . "projet_task_time as ptt";
         $sql .= " WHERE pt.datec BETWEEN '" . $this->db->idate(dol_get_first_day(date("Y"), 1)) . "' AND '" . $this->db->idate(dol_get_last_day(date("Y"), 12)) . "'";
         $sql .= " AND pt.rowid = ptt.fk_task";
         $sql .= " GROUP BY pt.fk_statut ";
         $sql .= " ORDER BY pt.fk_statut DESC";
         $sql .= $db->plimit($max, 0);
         $result = $db->query($sql);
         if ($result) {
             $num = $db->num_rows($result);
             $i = 0;
             while ($i < $num) {
                 $objp = $db->fetch_object($result);
                 $this->info_box_contents[$i][] = array('td' => 'align="left"', 'text' => $langs->trans("Task") . " " . $taskstatic->LibStatut($objp->fk_statut, 0));
                 $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => $objp->nb . "&nbsp;" . $langs->trans("Tasks"), 'url' => DOL_URL_ROOT . "/projet/tasks/list.php?leftmenu=projects&viewstatut=" . $objp->fk_statut);
                 $totalnb += $objp->nb;
                 $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot, 'all', 25200, 5));
                 $totalplannedtot += $objp->plannedtot;
                 $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot, 'all', 25200, 5));
                 $totaldurationtot += $objp->durationtot;
                 $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut, 3));
                 $i++;
             }
         } else {
             dol_print_error($this->db);
         }
     }
     // Add the sum à the bottom of the boxes
     $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total") . "&nbsp;" . $textHead);
     $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ') . "&nbsp;" . $langs->trans("Tasks"));
     $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot, 'all', 25200, 5));
     $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot, 'all', 25200, 5));
     $this->info_box_contents[$i][] = array('td' => '', 'text' => "");
 }
开发者ID:Albertopf,项目名称:prueba,代码行数:54,代码来源:box_task.php

示例3: foreach

        });

    });

    </script>

_END;
    // Add number of product when there is a filter on period
    if (count($arrayofuniqueproduct) == 1 && is_numeric($year)) {
        $productidselected = 0;
        foreach ($arrayofuniqueproduct as $key => $val) {
            $productidselected = $key;
            $productlabelselected = $val;
        }
        $datebefore = dol_get_first_day($year ? $year : strftime("%Y", time()), $month ? $month : 1, true);
        $dateafter = dol_get_last_day($year ? $year : strftime("%Y", time()), $month ? $month : 12, true);
        $balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore);
        $balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter);
        //print '<tr class="total"><td class="liste_total">';
        print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore, 'day', 'gmt'));
        //print '</td>';
        //print '<td class="liste_total" colspan="6" align="right">';
        print ': ' . $balancebefore;
        print "<br>\n";
        //print '</td></tr>';
        //print '<tr class="total"><td class="liste_total">';
        print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter, 'day', 'gmt'));
        //print '</td>';
        //print '<td class="liste_total" colspan="6" align="right">';
        print ': ' . $balanceafter;
        print "<br>\n";
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:mouvement.intentohector.php

示例4: date_format

if ($search_amount) {
    $sql .= " AND bc.amount='" . $db->escape(price2num(trim($search_amount))) . "'";
}
if ($month > 0) {
    if ($year > 0 && empty($day)) {
        $sql .= " AND bc.date_bordereau BETWEEN '" . $db->idate(dol_get_first_day($year, $month, false)) . "' AND '" . $db->idate(dol_get_last_day($year, $month, false)) . "'";
    } else {
        if ($year > 0 && !empty($day)) {
            $sql .= " AND bc.date_bordereau BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month, $day, $year)) . "' AND '" . $db->idate(dol_mktime(23, 59, 59, $month, $day, $year)) . "'";
        } else {
            $sql .= " AND date_format(bc.date_bordereau, '%m') = '" . $month . "'";
        }
    }
} else {
    if ($year > 0) {
        $sql .= " AND bc.date_bordereau BETWEEN '" . $db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year, 12, false)) . "'";
    }
}
$sql .= " ORDER BY {$sortfield} {$sortorder}";
$sql .= $db->plimit($limit + 1, $offset);
//print "$sql";
$resql = $db->query($sql);
if ($resql) {
    $num = $db->num_rows($resql);
    $i = 0;
    $params = '';
    print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num);
    print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
    print '<table class="liste" width="100%">';
    print '<tr class="liste_titre">';
    print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "bc.number", "", $params, "", $sortfield, $sortorder);
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:list.php

示例5: strftime

    }
}
// Formulaire saisie salaire
if ($action == 'create') {
    $year_current = strftime("%Y", dol_now());
    $pastmonth = strftime("%m", dol_now()) - 1;
    $pastmonthyear = $year_current;
    if ($pastmonth == 0) {
        $pastmonth = 12;
        $pastmonthyear--;
    }
    $datesp = dol_mktime(0, 0, 0, $datespmonth, $datespday, $datespyear);
    $dateep = dol_mktime(23, 59, 59, $dateepmonth, $dateepday, $dateepyear);
    if (empty($datesp) || empty($dateep)) {
        $datesp = dol_get_first_day($pastmonthyear, $pastmonth, false);
        $dateep = dol_get_last_day($pastmonthyear, $pastmonth, false);
    }
    print '<form name="salary" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="action" value="add">';
    print_fiche_titre($langs->trans("NewSalaryPayment"), '', 'title_accountancy.png');
    dol_fiche_head('', '');
    print '<table class="border" width="100%">';
    print "<tr>";
    print '<td class="fieldrequired">' . $langs->trans("DatePayment") . '</td><td>';
    print $form->select_date(empty($datep) ? -1 : $datep, "datep", '', '', '', 'add', 1, 1);
    print '</td></tr>';
    print '<tr><td>' . $langs->trans("DateValue") . '</td><td>';
    print $form->select_date(empty($datev) ? -1 : $datev, "datev", '', '', '', 'add', 1, 1);
    print '</td></tr>';
    // Employee
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:card.php

示例6: AND

    } else {
        $filter .= " AND (cp.date_fin BETWEEN '" . $db->idate(dol_get_first_day($year_end, 1, 1)) . "' AND '" . $db->idate(dol_get_last_day($year_end, 12, 1)) . "')";
        //$filter.= " AND date_format(cp.date_fin, '%Y') = '$year_end'";
    }
} else {
    if ($month_end > 0) {
        $filter .= " AND date_format(cp.date_fin, '%m') = '{$month_end}'";
    }
}
// DATE CREATE
if ($year_create > 0) {
    if ($month_create > 0) {
        $filter .= " AND (cp.date_create BETWEEN '" . $db->idate(dol_get_first_day($year_create, $month_create, 1)) . "' AND '" . $db->idate(dol_get_last_day($year_create, $month_create, 1)) . "')";
        //$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$year_create-$month_create'";
    } else {
        $filter .= " AND (cp.date_create BETWEEN '" . $db->idate(dol_get_first_day($year_create, 1, 1)) . "' AND '" . $db->idate(dol_get_last_day($year_create, 12, 1)) . "')";
        //$filter.= " AND date_format(cp.date_create, '%Y') = '$year_create'";
    }
} else {
    if ($month_create > 0) {
        $filter .= " AND date_format(cp.date_create, '%m') = '{$month_create}'";
    }
}
// EMPLOYE
if (!empty($search_employe) && $search_employe != -1) {
    $filter .= " AND cp.fk_user = '" . $db->escape($search_employe) . "'\n";
}
// VALIDEUR
if (!empty($search_valideur) && $search_valideur != -1) {
    $filter .= " AND cp.fk_validator = '" . $db->escape($search_valideur) . "'\n";
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:index.php

示例7: while

} else {
    $j = 0;
    $numlt = 0;
}
while ($j < $numlt) {
    if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') {
        print "<br>";
        $tva = new Tva($db);
        print_fiche_titre($langs->transcountry($j == 1 ? "LT1Payments" : "LT2Payments", $mysoc->country_code) . ($year ? ' (' . $langs->trans("Year") . ' ' . $year . ')' : ''), '', '');
        $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp";
        $sql .= " FROM " . MAIN_DB_PREFIX . "localtax as pv";
        $sql .= " WHERE pv.entity = " . $conf->entity . " AND localtaxtype = " . $j;
        if ($year > 0) {
            // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
            // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
            $sql .= " AND pv.datev between '" . $db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year, 12, false)) . "'";
        }
        if (preg_match('/^pv/', $sortfield)) {
            $sql .= $db->order($sortfield, $sortorder);
        }
        $result = $db->query($sql);
        if ($result) {
            $num = $db->num_rows($result);
            $i = 0;
            $total = 0;
            print '<table class="noborder" width="100%">';
            print '<tr class="liste_titre">';
            print_liste_field_titre($langs->trans("PeriodEndDate"), $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("ExpectedToPay"), $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'align="right"', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("RefPayment"), $_SERVER["PHP_SELF"], "pv.rowid", "", $param, '', $sortfield, $sortorder);
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:index.php

示例8: getAllByProduct

 /**
  *	Return nb, amount of predefined product for year
  *
  *	@param	int		$year	Year to scan
  *	@return	array	Array of values
  */
 function getAllByProduct($year)
 {
     global $user;
     $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl." . $this->field_line . ") as total, AVG(tl." . $this->field_line . ") as avg";
     $sql .= " FROM " . $this->from . ", " . $this->from_line . ", " . MAIN_DB_PREFIX . "product as product";
     if (!$user->rights->societe->client->voir && !$user->socid) {
         $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
     }
     $sql .= " WHERE " . $this->where;
     $sql .= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
     $sql .= " AND " . $this->field_date . " BETWEEN '" . $this->db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $this->db->idate(dol_get_last_day($year, 12, false)) . "'";
     $sql .= " GROUP BY product.ref";
     $sql .= $this->db->order('nb', 'DESC');
     //$sql.= $this->db->plimit(20);
     return $this->_getAllByProduct($sql);
 }
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:22,代码来源:propalestats.class.php

示例9: dol_print_date

print '<br>';
/* Affichage de la liste des projets du mois */
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("ActivityOnProjectThisMonth") . ': ' . dol_print_date($now, "%B %Y") . '</td>';
print '<td align="right">' . $langs->trans("Time") . '</td>';
print "</tr>\n";
$sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
$sql .= ", " . MAIN_DB_PREFIX . "projet_task as t";
$sql .= ", " . MAIN_DB_PREFIX . "projet_task_time as tt";
$sql .= " WHERE t.fk_projet = p.rowid";
$sql .= " AND p.entity = " . $conf->entity;
$sql .= " AND tt.fk_task = t.rowid";
$sql .= " AND tt.fk_user = " . $user->id;
$sql .= " AND task_date BETWEEN '" . $db->idate(dol_get_first_day($year, $month)) . "' AND '" . $db->idate(dol_get_last_day($year, $month)) . "'";
$sql .= " AND p.rowid in (" . $projectsListId . ")";
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public";
$resql = $db->query($sql);
if ($resql) {
    $total = 0;
    $var = false;
    while ($row = $db->fetch_object($resql)) {
        print "<tr " . $bc[$var] . ">";
        print '<td>';
        $projectstatic->id = $row->rowid;
        $projectstatic->ref = $row->ref;
        $projectstatic->title = $row->title;
        $projectstatic->public = $row->public;
        print $projectstatic->getNomUrl(1, '', 1);
        print '</td>';
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:index.php

示例10: build_exportfile

 /**
  *		Export events from database into a cal file.
  *		@param		format			'vcal', 'ical/ics', 'rss'
  *		@param		type			'event' or 'journal'
  *		@param		cachedelay		Do not rebuild file if date older than cachedelay seconds
  *		@param		filename		Force filename
  *		@param		filters			Array of filters
  *		@return     int     		<0 if error, nb of events in new file if ok
  */
 function build_exportfile($format, $type, $cachedelay, $filename, $filters)
 {
     global $conf, $langs, $dolibarr_main_url_root, $mysoc;
     require_once DOL_DOCUMENT_ROOT . "/lib/xcal.lib.php";
     require_once DOL_DOCUMENT_ROOT . "/lib/date.lib.php";
     dol_syslog("ActionComm::build_exportfile Build export file format=" . $format . ", type=" . $type . ", cachedelay=" . $cachedelay . ", filename=" . $filename . ", filters size=" . sizeof($filters), LOG_DEBUG);
     // Check parameters
     if (empty($format)) {
         return -1;
     }
     // Clean parameters
     if (!$filename) {
         $extension = 'vcs';
         if ($format == 'ical') {
             $extension = 'ics';
         }
         $filename = $format . '.' . $extension;
     }
     // Create dir and define output file (definitive and temporary)
     $result = create_exdir($conf->agenda->dir_temp);
     $outputfile = $conf->agenda->dir_temp . '/' . $filename;
     $result = 0;
     $buildfile = true;
     $login = '';
     $logina = '';
     $logind = '';
     $logint = '';
     $now = dol_now();
     if ($cachedelay) {
         $nowgmt = dol_now();
         include_once DOL_DOCUMENT_ROOT . '/lib/files.lib.php';
         if (dol_filemtime($outputfile) > $nowgmt - $cachedelay) {
             dol_syslog("ActionComm::build_exportfile file " . $outputfile . " is not older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . "). Build is canceled");
             $buildfile = false;
         }
     }
     if ($buildfile) {
         // Build event array
         $eventarray = array();
         $sql = "SELECT a.id,";
         $sql .= " a.datep,";
         // Start
         $sql .= " a.datep2,";
         // End
         $sql .= " a.durationp,";
         $sql .= " a.datec, a.tms as datem,";
         $sql .= " a.note, a.label, a.fk_action as type_id,";
         $sql .= " a.fk_soc,";
         $sql .= " a.fk_user_author, a.fk_user_mod,";
         $sql .= " a.fk_user_action, a.fk_user_done,";
         $sql .= " a.fk_contact, a.percent as percentage,";
         $sql .= " a.fk_element, a.elementtype,";
         $sql .= " a.priority, a.fulldayevent, a.location,";
         $sql .= " u.firstname, u.name,";
         $sql .= " s.nom as socname,";
         $sql .= " c.id as type_id, c.code as type_code, c.libelle";
         $sql .= " FROM (" . MAIN_DB_PREFIX . "c_actioncomm as c, " . MAIN_DB_PREFIX . "actioncomm as a)";
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on u.rowid = a.fk_user_author";
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s on s.rowid = a.fk_soc AND s.entity IN (0, " . $conf->entity . ")";
         $sql .= " WHERE a.fk_action=c.id";
         $sql .= " AND a.entity = " . $conf->entity;
         foreach ($filters as $key => $value) {
             if ($key == 'notolderthan') {
                 $sql .= " AND a.datep >= '" . $this->db->idate($now - $value * 24 * 60 * 60) . "'";
             }
             if ($key == 'year') {
                 $sql .= " AND a.datep BETWEEN '" . $this->db->idate(dol_get_first_day($value, 1)) . "' AND '" . $this->db->idate(dol_get_last_day($value, 12)) . "'";
             }
             if ($key == 'id') {
                 $sql .= " AND a.id=" . (is_numeric($value) ? $value : 0);
             }
             if ($key == 'idfrom') {
                 $sql .= " AND a.id >= " . (is_numeric($value) ? $value : 0);
             }
             if ($key == 'idto') {
                 $sql .= " AND a.id <= " . (is_numeric($value) ? $value : 0);
             }
             if ($key == 'login') {
                 $login = $value;
                 $userforfilter = new User($this->db);
                 $result = $userforfilter->fetch('', $value);
                 $sql .= " AND (";
                 $sql .= " a.fk_user_author = " . $userforfilter->id;
                 $sql .= " OR a.fk_user_action = " . $userforfilter->id;
                 $sql .= " OR a.fk_user_done = " . $userforfilter->id;
                 $sql .= ")";
             }
             if ($key == 'logina') {
                 $logina = $value;
                 $userforfilter = new User($this->db);
                 $result = $userforfilter->fetch('', $value);
//.........这里部分代码省略.........
开发者ID:netors,项目名称:dolibarr,代码行数:101,代码来源:actioncomm.class.php

示例11: print_projecttasks_array

/**
 * Return HTML table with list of projects and number of opened tasks
 *
 * @param	DoliDB	$db					Database handler
 * @param	Form	$form				Object form
 * @param   int		$socid				Id thirdparty
 * @param   int		$projectsListId     Id of project I have permission on
 * @param   int		$mytasks            Limited to task I am contact to
 * @param	int		$statut				-1=No filter on statut, 0 or 1 = Filter on status
 * @param	array	$listofoppstatus	List of opportunity status
 * @param   array   $hiddenfields       List of info to not show ('projectlabel', 'declaredprogress', '...', )
 * @return	void
 */
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $statut = -1, $listofoppstatus = array(), $hiddenfields = array())
{
    global $langs, $conf, $user, $bc;
    require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
    $projectstatic = new Project($db);
    $thirdpartystatic = new Societe($db);
    $sortfield = '';
    $sortorder = '';
    $project_year_filter = 0;
    $title = $langs->trans("Projects");
    if (strcmp($statut, '') && $statut >= 0) {
        $title = $langs->trans("Projects") . ' ' . $langs->trans($projectstatic->statuts_long[$statut]);
    }
    $arrayidtypeofcontact = array();
    print '<table class="noborder" width="100%">';
    $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
    if ($mytasks) {
        $sql .= ", " . MAIN_DB_PREFIX . "projet_task as t";
        $sql .= ", " . MAIN_DB_PREFIX . "element_contact as ec";
        $sql .= ", " . MAIN_DB_PREFIX . "c_type_contact as ctc";
    } else {
        $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task as t ON p.rowid = t.fk_projet";
    }
    $sql .= " WHERE p.entity = " . $conf->entity;
    $sql .= " AND p.rowid IN (" . $projectsListId . ")";
    if ($socid) {
        $sql .= "  AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = " . $socid . ")";
    }
    if ($mytasks) {
        $sql .= " AND p.rowid = t.fk_projet";
        $sql .= " AND ec.element_id = t.rowid";
        $sql .= " AND ec.fk_socpeople = " . $user->id;
        $sql .= " AND ec.fk_c_type_contact = ctc.rowid";
        // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact
        $sql .= " AND ctc.element = 'project_task'";
    }
    if ($statut >= 0) {
        $sql .= " AND p.fk_statut = " . $statut;
    }
    if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) {
        $project_year_filter = GETPOST("project_year_filter");
        //Check if empty or invalid year. Wildcard ignores the sql check
        if ($project_year_filter != "*") {
            if (empty($project_year_filter) || !ctype_digit($project_year_filter)) {
                $project_year_filter = date("Y");
            }
            $sql .= " AND (p.dateo IS NULL OR p.dateo <= " . $db->idate(dol_get_last_day($project_year_filter, 12, false)) . ")";
            $sql .= " AND (p.datee IS NULL OR p.datee >= " . $db->idate(dol_get_first_day($project_year_filter, 1, false)) . ")";
        }
    }
    // Get id of project we must show tasks
    $arrayidofprojects = array();
    $sql1 = "SELECT p.rowid as projectid";
    $sql1 .= $sql;
    $resql = $db->query($sql1);
    if ($resql) {
        $i = 0;
        $num = $db->num_rows($resql);
        while ($i < $num) {
            $objp = $db->fetch_object($resql);
            $arrayidofprojects[$objp->projectid] = $objp->projectid;
            $i++;
        }
    } else {
        dol_print_error($db);
    }
    if (empty($arrayidofprojects)) {
        $arrayidofprojects[0] = -1;
    }
    // Get list of project with calculation on tasks
    $sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_soc, s.nom as socname, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,";
    $sql2 .= " COUNT(t.rowid) as nb, SUM(t.planned_workload) as planned_workload, SUM(t.planned_workload * t.progress / 100) as declared_progess_workload";
    $sql2 .= " FROM " . MAIN_DB_PREFIX . "projet as p";
    $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = p.fk_soc";
    $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task as t ON p.rowid = t.fk_projet";
    $sql2 .= " WHERE p.rowid IN (" . join(',', $arrayidofprojects) . ")";
    $sql2 .= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
    $sql2 .= " ORDER BY p.title, p.ref";
    $var = true;
    $resql = $db->query($sql2);
    if ($resql) {
        $total_task = 0;
        $total_opp_amount = 0;
        $ponderated_opp_amount = 0;
        $num = $db->num_rows($resql);
        $i = 0;
        print '<tr class="liste_titre">';
//.........这里部分代码省略.........
开发者ID:Albertopf,项目名称:prueba,代码行数:101,代码来源:project.lib.php

示例12: PaymentSalary

    }
    $j++;
}
// Payment Salary
if ($conf->salaries->enabled) {
    if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') {
        $sal = new PaymentSalary($db);
        print '<br>';
        print load_fiche_titre($langs->trans("SalariesPayments") . ($year ? ' (' . $langs->trans("Year") . ' ' . $year . ')' : ''), '', '');
        $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
        $sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s, " . MAIN_DB_PREFIX . "user as u";
        $sql .= " WHERE s.entity IN (" . getEntity('user', 1) . ")";
        $sql .= " AND u.rowid = s.fk_user";
        if ($year > 0) {
            $sql .= " AND (s.datesp between '" . $db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year, 12, false)) . "'";
            $sql .= " OR s.dateep between '" . $db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year, 12, false)) . "')";
        }
        if (preg_match('/^s\\./', $sortfield)) {
            $sql .= $db->order($sortfield, $sortorder);
        }
        $result = $db->query($sql);
        if ($result) {
            $num = $db->num_rows($result);
            $i = 0;
            $total = 0;
            print '<table class="noborder" width="100%">';
            print '<tr class="liste_titre">';
            print_liste_field_titre($langs->trans("PeriodEndDate"), $_SERVER["PHP_SELF"], "s.dateep", "", $param, 'width="140px"', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "s.label", "", $param, '', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("ExpectedToPay"), $_SERVER["PHP_SELF"], "s.amount", "", $param, 'align="right"', $sortfield, $sortorder);
            print_liste_field_titre($langs->trans("RefPayment"), $_SERVER["PHP_SELF"], "s.rowid", "", $param, '', $sortfield, $sortorder);
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:index.php

示例13: date_format

        $sql .= " AND f.datef BETWEEN '" . $db->idate(dol_get_first_day($year, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year, 12, false)) . "'";
    }
}
if ($month_lim > 0) {
    if ($year_lim > 0 && empty($day_lim)) {
        $sql .= " AND f.date_lim_reglement BETWEEN '" . $db->idate(dol_get_first_day($year_lim, $month_lim, false)) . "' AND '" . $db->idate(dol_get_last_day($year_lim, $month_lim, false)) . "'";
    } else {
        if ($year_lim > 0 && !empty($day_lim)) {
            $sql .= " AND f.date_lim_reglement BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim)) . "' AND '" . $db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim)) . "'";
        } else {
            $sql .= " AND date_format(f.date_lim_reglement, '%m') = '" . $month_lim . "'";
        }
    }
} else {
    if ($year_lim > 0) {
        $sql .= " AND f.date_lim_reglement BETWEEN '" . $db->idate(dol_get_first_day($year_lim, 1, false)) . "' AND '" . $db->idate(dol_get_last_day($year_lim, 12, false)) . "'";
    }
}
if ($option == 'late') {
    $sql .= " AND f.date_lim_reglement < '" . $db->idate(dol_now() - $conf->facture->client->warning_delay) . "'";
}
if ($filter == 'paye:0') {
    $sql .= " AND f.fk_statut = 1";
}
if ($search_sale > 0) {
    $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $search_sale;
}
if ($search_user > 0) {
    $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = " . $search_user;
}
if (!$sall) {
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:list.php

示例14: ROUND

$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=1,bk.montant,0)),2) AS 'Janvier',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=2,bk.montant,0)),2) AS 'Fevrier',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=3,bk.montant,0)),2) AS 'Mars',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=4,bk.montant,0)),2) AS 'Avril',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=5,bk.montant,0)),2) AS 'Mai',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=6,bk.montant,0)),2) AS 'Juin',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=7,bk.montant,0)),2) AS 'Juillet',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=8,bk.montant,0)),2) AS 'Aout',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=9,bk.montant,0)),2) AS 'Septembre',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=10,bk.montant,0)),2) AS 'Octobre',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=11,bk.montant,0)),2) AS 'Novembre',";
$sql .= "  ROUND(SUM(IF(MONTH(bk.doc_date)=12,bk.montant,0)),2) AS 'Decembre',";
$sql .= "  ROUND(SUM(bk.montant),2) as 'Total'";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE bk.doc_date >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= "  AND bk.doc_date <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " GROUP BY bk.numero_compte";
$resql = $db->query($sql);
if ($resql) {
    $i = 0;
    $num = $db->num_rows($resql);
    while ($i < $num) {
        $row = $db->fetch_row($resql);
        print '<tr><td width="14%">' . length_accountg($row[0]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[1]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[2]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[3]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[4]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[5]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[6]) . '</td>';
        print '<td align="right" width="6.5%">' . price($row[7]) . '</td>';
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:balancebymonth.php

示例15: ROUND

$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=2,lo.loy,0)),2) AS 'Fevrier',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=3,lo.loy,0)),2) AS 'Mars',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=4,lo.loy,0)),2) AS 'Avril',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=5,lo.loy,0)),2) AS 'Mai',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=6,lo.loy,0)),2) AS 'Juin',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=7,lo.loy,0)),2) AS 'Juillet',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=8,lo.loy,0)),2) AS 'Aout',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=9,lo.loy,0)),2) AS 'Septembre',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=10,lo.loy,0)),2) AS 'Octobre',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=11,lo.loy,0)),2) AS 'Novembre',";
$sql .= "  ROUND(SUM(IF(MONTH(lo.echeance)=12,lo.loy,0)),2) AS 'Decembre',";
$sql .= "  ROUND(SUM(lo.loy),2) as 'Total'";
$sql .= " FROM " . MAIN_DB_PREFIX . "immo_loyer as lo";
$sql .= " , " . MAIN_DB_PREFIX . "immo_local as ll";
$sql .= " WHERE lo.echeance >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= "  AND lo.echeance <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= "  AND lo.local_id = ll.rowid ";
if ($user->id != 1) {
    $sql .= " AND ll.proprietaire_id=" . $user->id;
}
$resql = $db->query($sql);
if ($resql) {
    $i = 0;
    $num = $db->num_rows($resql);
    while ($i < $num) {
        $row = $db->fetch_row($resql);
        print '<tr><td>' . $row[0] . '</td>';
        print '<td align="right">' . $row[1] . '</td>';
        print '<td align="right">' . $row[2] . '</td>';
        print '<td align="right">' . $row[3] . '</td>';
        print '<td align="right">' . $row[4] . '</td>';
开发者ID:abbenbouchta,项目名称:immobilier,代码行数:31,代码来源:loyermois.php


注:本文中的dol_get_last_day函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。