init
This commit is contained in:
43
modules/EcmProducts/generateProductCardsFromProduct.php
Normal file
43
modules/EcmProducts/generateProductCardsFromProduct.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include_once("modules/EcmProducts/productCardNew.php");
|
||||
include_once("include/html2fpdf/html2fpdf.php");
|
||||
$p=new HTML2FPDF("L");
|
||||
$p->SetAutoPageBreak(10);
|
||||
$rcat=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select product_category_id,th from ecmproducts where id='".$_REQUEST['record']."'"));
|
||||
if($_REQUEST['header']==1){
|
||||
$p=catalogueHeader($p,$rcat['th']);
|
||||
}
|
||||
if($_REQUEST['content']==1){
|
||||
$p=catalogueContent($p);
|
||||
}
|
||||
if($_REQUEST['title']==1){
|
||||
$p->AddPage();$p=categoryTitle($p,$rcat['product_category_id'],$rcat['th']);
|
||||
}
|
||||
|
||||
|
||||
$p=productCardNew($p,$_REQUEST['record'],$_GET['language'],true,true,"","",$_REQUEST['show_price'], $_REQUEST['ean']);
|
||||
if($_REQUEST['extra']==1){
|
||||
if(categoryExtra($p,$rcat['product_category_id'],$rcat['th'])){
|
||||
$p->AddPage();
|
||||
$p->Image("modules/EcmProducts/".categoryExtra($p,$rcat['product_category_id'],$rcat['th']),5,0,283);
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['create_img']==1){
|
||||
$guid=create_guid();
|
||||
$type="F";
|
||||
$file="cache/upload/Catalogue".$guid.".pdf";
|
||||
}
|
||||
else{
|
||||
$type="D";
|
||||
$file="Catalogue".date("YmdHi").".pdf";
|
||||
}
|
||||
$p->Output($file,$type);
|
||||
|
||||
if($_REQUEST['create_img']==1){
|
||||
echo "convert -density 120 -quality 100 /var/www/html/crm/".$file." /var/www/html/crm/".str_replace(".pdf",".jpg",$file);
|
||||
exec("convert -density 120 -quality 100 /var/www/html/crm/".$file." /var/www/html/crm/".str_replace(".pdf",".jpg",$file));
|
||||
chmod(str_replace(".pdf",".jpg",$file),0777);
|
||||
//header("Location: index.php?module=EcmProducts&action=showProductsCardImages&to_pdf=1&guid=".$guid);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user