Files
crm.e5.pl/modules/EcmProductReports/index3.php
2024-04-27 09:23:34 +02:00

94 lines
2.8 KiB
PHP
Executable File

<table cellspacing="0" cellpadding="0" border="0"><tr><td width="19"><img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts" width="16" border="0" height="16"></td>
<td width="544"><h2>Containers on sea</h2></td></tr></table><br />
<table class="h3Row" width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td nowrap="nowrap">
<h3>Containers List</h3>
</td>
<td width="100%">
<img src="include/images/blank.gif" alt="" width="1" height="1">
</td>
</tr>
</tbody>
</table>
<?
include_once("modules/EcmProductReports/vtigerConnector.php");
include_once('modules/EcmCharts/chartHelper.php');
$vc=new vtigerConnector();
$vc->start=1;
$wc[]="1=1";
$wc[]="purchaseordercf.cf_528='0'";
$wc[]="purchaseorder.tracking_no!=''";
$vc1->where=@implode(" and ",$wc);
$vc->getData();
$cnt=$vc->getCount();
$data=$vc->data;
//echo '<pre>';
//print_r($data);
//echo '</pre>';
if(count($data)>0){
foreach($data as $d){
$dd[$d['tracking_no']]=$d;
}
}
if(!$_GET['order_by'])$_GET['order_by']="deliverydate";
if(!$_GET['sorder'])$_GET['sorder']="asc";
$dd=multisort($dd,array(array('key'=>$_GET['order_by'],'sort'=>$_GET['sorder'])));
$tds1='<td class="listViewThS1">';
$trs='<tr>';
$tre='</tr>';
$tds='<td class="oddListRowS1">';
$tde='</td>';
$tbs='<table cellpadding="0" cellspacing="0" border="0" class="ListView" id="containers_list" style="width:100%;">';
$tbe='</table>';
$t.='<script language="javascript">
function checkAll(){
var c = document.getElementsByName("check[]");
for(var i=0;i<c.length;i++){
c[i].checked=document.getElementById("check_all").checked;
}
}
</script>';
$t.='<form id="form_list" action="index.php?module=EcmProductReports&action=CreateXLScontainers&to_pdf=1" method="post">';
$t.=$tbs;
$t.=$trs;
$t.=$tds1;
$t.='<input type="checkbox" id="check_all" onclick="checkAll();" checked>';
$t.=$tde;
$t.=$vc->sortableColumn("ETA","deliverydate",$_GET['sorder'],10,"index");
$t.=$vc->sortableColumn("Tracking No","tracking_no",$_GET['sorder'],85,"index");
$t.=$tds1;
$t.="Spec.";
$t.=$tde;
$t.=$tre;
if(count($dd)>0){
foreach($dd as $a){
if(trim($a['tracking_no'])=="")continue;
$t.=$trs;
$t.=$tds;
$t.='<input type="checkbox" name="check[]" value="'.$a['tracking_no'].'" checked>';
$t.=$tde;
$t.=$tds;
$t.=$GLOBALS['timedate']->to_display_date($a['deliverydate']);
$t.=$tde;
$t.=$tds;
$t.=$a['tracking_no'];
$t.=$tde;
$t.=$tds;
$t.='<a href="index.php?module=EcmProductReports&action=CreatePDFcontainers&tracking_no='.$a['tracking_no'].'&to_pdf=1"><img src="modules/EcmInvoiceOuts/images/pdf.gif" border="0" /></a>';
$t.=$tde;
$t.=$tre;
}
}
$t.=$tbe;
$t.='<input class="button" type="submit" name="xls" value="Create XLS">';
$t.='</form>';
echo $t;
?>