when code_document in ('art_soumis') then 'soumission'
when code_document in ('art_brochure') then 'securite'
else null end as tblcolumn,
- case when commentaire is not null
+ case when commentaire like 'http%'
then commentaire else
concat(case when code_document in ('art_bro_pdf') then 'brochure'
when code_document in ('art_fiche') then 'fiche'
code_document,commentaire,nom_fichier from wiges_ole_article where code_document!='art_image' and article LIKE '&%';";
my $filedata = $db->queryarray($sqlfiles);
foreach my $f (@{$filedata}){
- if (($f->{tblcolumn} ne "") && ($f->{tblvalue} !~ /^http/) && (-e $cfg->{mediapath}.'/'.$f->{nom_fichier})){
- if (! -d dirname($cfg->{path}.'/'.$f->{tblvalue})){
- mkdir dirname($cfg->{mediapath}.'/'.$f->{tblvalue});
- }
- #print 'cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"'."\n";
- system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"');
- #print "UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
- $db->exec("UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
- } elsif (($f->{tblcolumn} ne "") && ($f->{tblvalue} =~ /^http/)){
- #print "UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
+ # if (-e $cfg->{mediapath}.'/'.$f->{nom_fichier}) && (){
+ # $stat = stat($cfg->{mediapath}.'/'.$f->{nom_fichier});
+ # if ($stat[7] ne "0"){
+ # $db->exec("UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
+ # }
+ # }
+ if ($f->{tblvalue} =~ /^http/){
$db->exec("UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
+ } elsif (-e $cfg->{mediapath}.'/'.$f->{nom_fichier}){
+ my @stat = stat($cfg->{mediapath}.'/'.$f->{nom_fichier});
+ if ($stat[7] ne "0"){
+ $db->exec("UPDATE article_groups SET ".$f->{tblcolumn}."='".$f->{nom_fichier}."' where article='".$f->{article}."';");
+ if (-e $cfg->{mediapath}.'/'.$f->{tblvalue}){
+ my @stat2 = stat($cfg->{mediapath}.'/'.$f->{tblvalue});
+ if ($stat2[7] ne $stat[7]){
+ system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.'/'.$f->{tblvalue}.'"');
+ }
+ } else {
+ system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.'/'.$f->{tblvalue}.'"');
+ }
+
+ }
}
}
code_document,commentaire,nom_fichier from wiges_ole_article where code_document!='art_image' and article NOT LIKE '&%';";
my $filedata = $db->queryarray($sqlfiles);
foreach my $f (@{$filedata}){
- if (($f->{tblcolumn} ne "") && ($f->{tblvalue} !~ /^http/)){
- if (! -d dirname($cfg->{mediapath}.''.$f->{tblvalue})){
- mkdir dirname($cfg->{mediapath}.''.$f->{tblvalue});
- }
- #print 'cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"'."\n";
- system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"');
- #print "UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
- $db->exec("UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
- } elsif (($f->{tblcolumn} ne "") && ($f->{tblvalue} =~ /^http/)){
- #print "UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
+ if ($f->{tblvalue} =~ /^http/){
$db->exec("UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
+ } elsif (-e $cfg->{mediapath}.'/'.$f->{nom_fichier}){
+ my @stat = stat($cfg->{mediapath}.'/'.$f->{nom_fichier});
+ if ($stat[7] ne "0"){
+ $db->exec("UPDATE articles SET ".$f->{tblcolumn}."='".$f->{nom_fichier}."' where article='".$f->{article}."';");
+ if (-e $cfg->{mediapath}.'/'.$f->{tblvalue}){
+ my @stat2 = stat($cfg->{mediapath}.'/'.$f->{tblvalue});
+ if ($stat2[7] ne $stat[7]){
+ system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.'/'.$f->{tblvalue}.'"');
+ }
+ } else {
+ system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.'/'.$f->{tblvalue}.'"');
+ }
+
+ }
}
+ # if (($f->{tblcolumn} ne "") && ($f->{tblvalue} !~ /^http/)){
+ # if (! -d dirname($cfg->{mediapath}.''.$f->{tblvalue})){
+ # mkdir dirname($cfg->{mediapath}.''.$f->{tblvalue});
+ # }
+ # #print 'cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"'."\n";
+ # system('cp "'.$cfg->{mediapath}.'/'.$f->{nom_fichier}.'" "'.$cfg->{mediapath}.''.$f->{tblvalue}.'"');
+ # #print "UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
+ # $db->exec("UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
+ # } elsif (($f->{tblcolumn} ne "") && ($f->{tblvalue} =~ /^http/)){
+ # #print "UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';"."\n";
+ # $db->exec("UPDATE articles SET ".$f->{tblcolumn}."='".$f->{tblvalue}."' where article='".$f->{article}."';");
+ # }
}
- $api->writelog("end copy articles files...");
+ $api->writelog("end copy articles files...");
}
if (($steps =~ /prices,/) || ($steps =~ /articles,/)){
$api->writelog("copy article prices...");
<meta name="geo.placename" content="Luxembourg" />
<meta name="geo.position" content="49.651203;6.083003" />
<meta name="ICBM" content="49.651203, 6.083003" />
-<link rel="alternate" type="text/html" hreflang="fr" href="<?php echo $cfg["siteurl"]; ?>home/home/matieres-premieres/fr/" />
+<link rel="alternate" type="text/html" hreflang="fr" href="<?php echo $cfg["siteurl"]; ?>/home/1/fr/" />
<link rel="canonical" href="<?php echo $cfg["siteurl"]; ?>" />
<!--CSS-->
<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo $cfg["version"];?>" ></script>
-<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/tabulator/js/tabulator.min.js?v={{ version }}"></script>
-<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/moment/moment-with-locales.min.js?v={{ version }}"></script>
+<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/tabulator/js/tabulator.min.js?v=<?php echo $cfg["version"];?>"></script>
+<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/moment/moment-with-locales.min.js?v=<?php echo $cfg["version"];?>"></script>
<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>vendor/mustache/mustache.min.js?v=<?php echo $cfg["version"];?>" ></script>
<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>js/publicrequest.js?v=<?php echo $cfg["version"];?>"></script>
<script type="text/javascript" src="<?php echo $cfg["basepath"]; ?>js/askprice.js?v=<?php echo $cfg["version"];?>"></script>
},
loadTable: function(){
postData({"ac":"getOrderItems","id_user":mysite.iduser,"type":"askprice","lang":preferences.lang}).then(ogrps => {
+
this.setTable(ogrps.data);
});
},
setTable: function(odata){
- //console.log("odata",odata);
+ //console.log("order table to fill!",odata);
let bs = document.getElementById("lst_order_askprice");
if (!bs){
return false;
cval = cval.replace(/,/,'.');
cval = parseFloat(cval);
}
- console.log("RecalcValue",cval);
- console.log("Send",{"ac":"setUserItem","article":obj.dataset.article,"quantity":cval,"id_user":mysite.iduser,"type":'askprice'});
+ //console.log("RecalcValue",cval);
+ //console.log("Send",{"ac":"setUserItem","article":obj.dataset.article,"quantity":cval,"id_user":mysite.iduser,"type":'askprice'});
postData({"ac":"setUserItem","article":obj.dataset.article,"quantity":cval,"id_user":mysite.iduser,"type":'askprice'}).then(data => {
//console.log("AC quRecalc returned",data);
});
},
getItemCount: function(){
- console.log("mysite",mysite);
+ //console.log("mysite",mysite);
postData({"ac":"getOrderItemCount","id_user":mysite.iduser,"type":'askprice'}).then(data => {
publicaskprice.itemscount = data.data.cnt;
//console.log("Items",data.data);
},
getCounterfield: function(labels,unit){
labels.unshift('');
- let stf = null;
+ let stf = null;
for (var l=1;l<=labels.length;l++){
if (/^Carton/.test(labels[l])){ stf="c0"+l};
});
},
initEvents(){
+ //console.log("init events now!");
if (document.getElementById("searchtopnav")){
//console.log("Shop SET search event!");
document.getElementById("searchtopnav").addEventListener("keypress", function(event) {
- console.log("Enter Search",event.keyCode)
+ //console.log("Enter Search",event.keyCode)
//console.log("Keypress ",event.keyCode);
if (event.keyCode === 13) {
//console.log("Keypress ",event.keyCode);
$ng[$grps[$g]["article_group"]] = $grps[$g];
$ng[$grps[$g]["article_group"]]["articles"] = array();
}
- $arsql ="select ar.id, UPPER(ar.article_group) as article_group, UPPER(ar.article) as article,oa.quantity, ar.gp_art, ar.famille_art, ar.c01, ar.c02, ar.c03, ar.c04, ar.c05, ap.prix_net, ar.unite_quantite, qte_stock, qte_commandee, ar.doc_ft, ar.doc_mo, ar.doc_fs, case when ar.creationdate + INTERVAL 1 month > CURRENT_DATE then 1 else null end as isnew, ar.videolink , oa.comment
- from articles ar left join article_prices ap on (ar.article = ap.article)
+ $arsql ="select ar.id, UPPER(ar.article_group) as article_group, UPPER(ar.article) as article,oa.quantity, ar.gp_art, ar.famille_art, ar.c01, ar.c02, ar.c03, ar.c04, ar.c05, ar.unite_quantite, qte_stock, qte_commandee, ar.doc_ft, ar.doc_mo, ar.doc_fs, case when ar.creationdate + INTERVAL 1 month > CURRENT_DATE then 1 else null end as isnew, ar.videolink , oa.comment
+ from articles ar
join order_articles oa on (ar.article = oa.article and id_user='".$id_user."' and id_order is null and code_document='".$type."')
- where ar.isactive=1 group by ar.article,ar.id,oa.quantity,oa.comment,ap.prix_net order by ar.article_group,ar.article;";
+ where ar.isactive=1 group by ar.article,ar.id,oa.quantity,oa.comment order by ar.article_group,ar.article;";
$arts = $this->dbh->queryarray($arsql);
for ($a=0;$a < count($arts);$a++){
if (isset($ng[$arts[$a]["article_group"]])){
</div>
</div>
<div class="col d-md-none" style="margin-left: 10px;">
- <div class="row bg-qube" style="width: 180px;">
+ <div class="row bg-qube" style="width: 176px;">
<div class="col-12" style="margin: 0 auto; background-color: #fff;text-align: center;">
- <img src="<?php echo $imgfile ?>" style="width: 170px;height: 170px;" alt="<?php echo $agr['article'];?>">
+ <img src="<?php echo $imgfile ?>" style="width: 166px;height: 166px;" alt="<?php echo $agr['article'];?>">
</div>
<div class="col-12" style="min-height: 50px; padding:5px; text-align: center; font-size: 10pt;">
<span class="text-white"><?php echo $agr["titre"]; ?></span>
<?php
- $cfg["version"] = "1.6.12";
+ $cfg["version"] = "1.6.19";
if ($cfg["debug"] == 1){
$cfg["version"] = date('Ymdhis');
}
}\r
\r
?>\r
- <nav class="navbar navbar-expand-lg bg-qube">\r
+<nav class="navbar navbar-expand-lg bg-qube">\r
<div class="container-fluid">\r
<a class="navbar-brand text-white" ><?php echo $lbl["products"]; ?></a> \r
<div class="d-flex d-none d-sm-block text-white" id="articleresulthead"><?php if ($selfamille != null) {echo $selfamille." | ".$famname; }?> <?php if ($pgrp != null) {echo " - ".$pgrp." | ".$grpname; }?></div>\r
$cla = "odd";\r
$agrp = $ag->getPublishedGroups($lang);\r
foreach ($agrp as $ax){\r
+ //file_put_contents("log/products.log",print_r($ax,true)."\n",FILE_APPEND);\r
if ($cla == "odd"){ $cla = "even";} else { $cla="odd"; }\r
if ($fam != $ax['famille_art']){\r
?>\r
<?php\r
$fam = $ax['famille_art'];\r
}\r
+ //file_put_contents("log/products.log",$ax['famille_art'].'=='.$selfamille."\n",FILE_APPEND);\r
if (($ax['famille_art'] == $selfamille) && ($selfamille != null)) {\r
// onclick="mysite.reload('<?php echo $cfg["basepath"]."product/".$ax["famille_art"].'/'.$ax["gp_art"].'/'.$cfg["lang"]; ? >/');"\r
?>\r
if ($pgrp == null){\r
$agroups = $ag->getArticleGroupsByFamille($selfamille,$lang);\r
$count=1;\r
+ ?>\r
+ <script>\r
+ let loadp = true;\r
+ function initpage(){\r
+ console.log("init events!");\r
+ shop.initEvents();\r
+ publicaskprice.init();\r
+ publicaskprice.getItemCount();\r
+ \r
+ }\r
+ </script>\r
+ <?php\r
foreach($agroups as $agr) {\r
$imgfile = $cfg["basepath"].'shop/img/qubenoimg.jpg';\r
if (file_exists('shop/img/'.$agr['image'])) {\r
$count++;\r
}\r
?>\r
- <script>\r
- let loadp = true;\r
- function initpage(){\r
- publicaskprice.init();\r
- publicaskprice.getItemCount();\r
- shop.initEvents();\r
- }\r
- </script> <?php\r
+ <?php\r
} else {\r
\r
$agroups = $ag->getArticleGroupsByFamilleAndGroup($selfamille,$pgrp,$lang);\r
$dtype = 'askprice';\r
if (isset($sess["id_user"])){\r
$dtype = 'shop';\r
- }\r
+ } \r
\r
?>\r
\r
<script>\r
let loadp = true;\r
+ \r
function initpage(){\r
+ \r
+ shop.initEvents();\r
let lst = document.getElementById("productdata");\r
let col=1;\r
postData({"ac":"getArticleGroups","groupcode":"<?php echo $pgrp; ?>","famillycode":"<?php echo $selfamille; ?>","lang":"<?php echo $lang; ?>"}).then(agrps => {\r