$_SESSION['back_request_uri']=$_SERVER['REQUEST_URI'];
if($_GET['tab']=="EcmContracts")
{
foreach($_POST as $key=>$val)$_SESSION['ecmcontracts_'.$key]=$val;
}
if($_GET['tab']=="EcmCorrespondenceIns")
{
foreach($_POST as $key=>$val)$_SESSION['ecmcorrespondenceins_'.$key]=$val;
}
if($_GET['tab']=="EcmCorrespondenceOuts")
{
foreach($_POST as $key=>$val)$_SESSION['ecmcorrespondenceouts_'.$key]=$val;
}
if($_GET['tab']=="EcmInvoiceIns")
{
foreach($_POST as $key=>$val)$_SESSION['ecminvoiceins_'.$key]=$val;
}
if($_GET['tab']=="EcmInvoiceOuts")
{
foreach($_POST as $key=>$val)$_SESSION['ecminvoiceouts_'.$key]=$val;
}
if($_GET['tab']=="EcmDocs")
{
foreach($_POST as $key=>$val)$_SESSION['ecmdocs_'.$key]=$val;
}
if($_GET['tab']=="All")
{
foreach($_POST as $key=>$val)$_SESSION['all_'.$key]=$val;
}
print '';
function get_assigned_user_name_in_search($id)
{
$r=mysql_fetch_array(mysql_query("select user_name from users where id='".$id."'"));
return $r['user_name'];
}
function cut_name_in_search($t,$ile)
{
if(strlen($t)>$ile)
{
for($i=0;$i<=$ile-1;$i++)
{
$text.=$t[$i];
}
return $text.="...";
}
else
{
return $t;
}
}
function search_ids($id,$html="")
{
$z="select id from ecmdocuments where iddir='".$id."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
$html.=$r['id']."||";
$html=search_ids($r['id'],$html);
}
return $html;
}
$record=$_REQUEST['record'];
if($record=="")$record=0;
$ids=search_ids($record,"").$record;
$idy=explode("||",$ids);
/*
////////////////////////EcmContracts/////////////////////////
if($_GET['tab']=="EcmContracts" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecmcontract_id from ecmdocuments_ecmcontracts where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmContracts")
{
if(mysql_num_rows(mysql_query("select id from ecmcontracts where id='".$r['ecmcontract_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and group_name like '%".$_POST['group_name']."%' and contractant_name like '%".$_POST['contractant_name']."%' and signedon like '%".$_POST['signedon']."%' and deleted='0'"))>0)$ecmcontracts[]=$r['ecmcontract_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecmcontracts where id='".$r['ecmcontract_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmcontracts[]=$r['ecmcontract_id'];
}
}
}
$ecmcontractsw="";
$i=0;
if(count($ecmcontracts)>0)
{
foreach($ecmcontracts as $ecmcontract)
{
if($i==0)$or="";
else $or=" or";
$ecmcontractsw.=$or." id='".$ecmcontract."'";
$i++;
}
}
}
////////////////////////EcmCorrespondenceIns/////////////////////////
if($_GET['tab']=="EcmCorrespondenceIns" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecmcorrespondencein_id from ecmdocuments_ecmcorrespondenceins where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmCorrespondenceIns")
{
if(mysql_num_rows(mysql_query("select id from ecmcorrespondenceins where id='".$r['ecmcorrespondencein_id']."' and name like '%".$_POST['name']."%' and account_name_from like '%".$_POST['account_name_from']."%' and account_name_to like '%".$_POST['account_name_to']."%' and description like '%".$_POST['description']."%' and document_date like '%".$_POST['document_date']."%' and delivery_date like '%".$_POST['delivery_date']."%' and stamp_date like '%".$_POST['stamp_date']."%' and reg_date like '%".$_POST['reg_date']."%' and deleted='0'"))>0)$ecmcorrespondenceins[]=$r['ecmcorrespondencein_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecmcorrespondenceins where id='".$r['ecmcorrespondencein_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmcorrespondenceins[]=$r['ecmcorrespondencein_id'];
}
}
}
$ecmcorrespondenceinsw="";
$i=0;
if(count($ecmcorrespondenceins)>0)
{
foreach($ecmcorrespondenceins as $ecmcorrespondencein)
{
if($i==0)$or="";
else $or=" or";
$ecmcorrespondenceinsw.=$or." id='".$ecmcorrespondencein."'";
$i++;
}
}
}
////////////////////////EcmCorrespondenceOuts/////////////////////////
if($_GET['tab']=="EcmCorrespondenceOuts" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecmcorrespondenceout_id from ecmdocuments_ecmcorrespondenceouts where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmCorrespondenceOuts")
{
if(mysql_num_rows(mysql_query("select id from ecmcorrespondenceouts where id='".$r['ecmcorrespondenceout_id']."' and name like '%".$_POST['name']."%' and account_from_name like '%".$_POST['account_from_name']."%' and account_to_name like '%".$_POST['account_to_name']."%' and document_date like '%".$_POST['document_date']."%' and deleted='0'"))>0)$ecmcorrespondenceouts[]=$r['ecmcorrespondenceout_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecmcorrespondenceouts where id='".$r['ecmcorrespondenceout_id']."' and name like '%".$_POST['name']."%' and deleted='0'"))>0)$ecmcorrespondenceouts[]=$r['ecmcorrespondenceout_id'];
}
}
}
$ecmcorrespondenceoutsw="";
$i=0;
if(count($ecmcorrespondenceouts)>0)
{
foreach($ecmcorrespondenceouts as $ecmcorrespondenceout)
{
if($i==0)$or="";
else $or=" or";
$ecmcorrespondenceoutsw.=$or." id='".$ecmcorrespondenceout."'";
$i++;
}
}
}
////////////////////////EcmInvoiceIns/////////////////////////
if($_GET['tab']=="EcmInvoiceIns" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecminvoicein_id from ecmdocuments_ecminvoiceins where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmInvoiceIns")
{
if(mysql_num_rows(mysql_query("select id from ecminvoiceins where id='".$r['ecminvoicein_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['ekmn_description']."%' and filename like '%".$_POST['ekmn_filename']."%' and from_name like '%".$_POST['from_name']."%' and to_name like '%".$_POST['to_name']."%' and deleted='0'"))>0)$ecminvoiceins[]=$r['ecminvoicein_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecminvoiceins where id='".$r['ecminvoicein_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecminvoiceins[]=$r['ecminvoicein_id'];
}
}
}
$ecminvoiceinsw="";
$i=0;
if(count($ecminvoiceins)>0)
{
foreach($ecminvoiceins as $ecminvoicein)
{
if($i==0)$or="";
else $or=" or";
$ecminvoiceinsw.=$or." id='".$ecminvoicein."'";
$i++;
}
}
}
////////////////////////EcmInvoiceOuts/////////////////////////
if($_GET['tab']=="EcmInvoiceOuts" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecminvoiceout_id from ecmdocuments_ecminvoiceouts where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmInvoiceOuts")
{
if(mysql_num_rows(mysql_query("select id from ecminvoiceouts where id='".$r['ecminvoiceout_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['ekmn_description']."%' and filename like '%".$_POST['ekmn_filename']."%' and from_name like '%".$_POST['from_name']."%' and to_name like '%".$_POST['to_name']."%' and deleted='0'"))>0)$ecminvoiceouts[]=$r['ecminvoiceout_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecminvoiceouts where id='".$r['ecminvoiceout_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecminvoiceouts[]=$r['ecminvoiceout_id'];
}
}
}
$ecminvoiceoutsw="";
$i=0;
if(count($ecminvoiceouts)>0)
{
foreach($ecminvoiceouts as $ecminvoiceout)
{
if($i==0)$or="";
else $or=" or";
$ecminvoiceoutsw.=$or." id='".$ecminvoiceout."'";
$i++;
}
}
}
*/
////////////////////////EcmDocs/////////////////////////
if($_GET['tab']=="EcmDocs" or $_GET['tab']=="All")
{
foreach($idy as $idx)
{
$z="select ecmdoc_id from ecmdocuments_ecmdocs where ecmdocument_id='".$idx."' and deleted='0'";
$w=mysql_query($z);
while($r=mysql_fetch_array($w))
{
if($_GET['tab']=="EcmDocs")
{
if(mysql_num_rows(mysql_query("select id from ecmdocs where id='".$r['ecmdoc_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmdocs[]=$r['ecmdoc_id'];
}
else
{
if(mysql_num_rows(mysql_query("select id from ecmdocs where id='".$r['ecmdoc_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmdocs[]=$r['ecmdoc_id'];
}
}
}
$ecmdocsw="";
$i=0;
if(count($ecmdocs)>0)
{
foreach($ecmdocs as $ecmdoc)
{
if($i==0)$or="";
else $or=" or";
$ecmdocsw.=$or." id='".$ecmdoc."'";
$i++;
}
}
}
?>
////////////////////////EcmContracts/////////////////////////
if($_GET['tab']=="EcmContracts" or $_GET['tab']=="All")
{
if(!$_GET['ecmcontract_start'])$_GET['ecmcontract_start']=0;
$il=10;
if($_GET['ecmcontract_start']==0 || $_GET['ecmcontract_start']=="")
{
if(!$ecmcontractsw)$_SESSION['ecmcontract_where']="id='xxx'";
else $_SESSION['ecmcontract_where']=$ecmcontractsw;
}
if(!$_GET['ecmcontracts_order_by'])$ecmcontracts_order_by="name";
else $ecmcontracts_order_by=$_GET['ecmcontracts_order_by'];
if(!$_GET['ecmcontracts_sorder'])$ecmcontracts_sorder="asc";
elseif($_GET['ecmcontracts_sorder']=="asc")$ecmcontracts_sorder="desc";
elseif($_GET['ecmcontracts_sorder']=="desc")$ecmcontracts_sorder="asc";
$z="select distinct * from ecmcontracts where ".$_SESSION['ecmcontract_where']." order by ".$ecmcontracts_order_by." ".$_GET['ecmcontracts_sorder']." limit ".$_GET['ecmcontract_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecmcontracts where ".$_SESSION['ecmcontract_where']." order by name"));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecmcontract_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecmcontract_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecmcontract_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecmcontract_start']+$il;
$next='';
}
if($_GET['ecmcontract_start']>0 && $_GET['ecmcontract_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecmcontract_start']+$il;
$next='';
$previousl=$_GET['ecmcontract_start']-$il;
$previous='';
}
if($_GET['ecmcontract_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecmcontract_start']-$il;
$previous='';
}
}
/*
print 'Contracts List |  |
';
*/
}
////////////////////////EcmCorrespondenceIns/////////////////////////
if($_GET['tab']=="EcmCorrespondenceIns" or $_GET['tab']=="All")
{
if(!$_GET['ecmcorrespondencein_start'])$_GET['ecmcorrespondencein_start']=0;
$il=10;
if($_GET['ecmcorrespondencein_start']==0 || $_GET['ecmcorrespondencein_start']=="")
{
if(!$ecmcorrespondenceinsw)$_SESSION['ecmcorrespondencein_where']="id='xxx'";
else $_SESSION['ecmcorrespondencein_where']=$ecmcorrespondenceinsw;
}
if(!$_GET['ecmcorrespondenceins_order_by'])$ecmcorrespondenceins_order_by="name";
else $ecmcorrespondenceins_order_by=$_GET['ecmcorrespondenceins_order_by'];
if(!$_GET['ecmcorrespondenceins_sorder'])$ecmcorrespondenceins_sorder="asc";
elseif($_GET['ecmcorrespondenceins_sorder']=="asc")$ecmcorrespondenceins_sorder="desc";
elseif($_GET['ecmcorrespondenceins_sorder']=="desc")$ecmcorrespondenceins_sorder="asc";
$z="select distinct * from ecmcorrespondenceins where ".$_SESSION['ecmcorrespondencein_where']." order by ".$ecmcorrespondenceins_order_by." ".$_GET['ecmcorrespondenceins_sorder']." limit ".$_GET['ecmcorrespondencein_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecmcorrespondenceins where ".$_SESSION['ecmcorrespondencein_where']." order by name"));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecmcorrespondencein_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecmcorrespondencein_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecmcorrespondencein_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecmcorrespondencein_start']+$il;
$next='';
}
if($_GET['ecmcorrespondencein_start']>0 && $_GET['ecmcorrespondencein_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecmcorrespondencein_start']+$il;
$next='';
$previousl=$_GET['ecmcorrespondencein_start']-$il;
$previous='';
}
if($_GET['ecmcorrespondencein_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecmcorrespondencein_start']-$il;
$previous='';
}
}
/*
print 'Correspondence In List |  |
';
*/
}
////////////////////////EcmCorrespondenceOuts/////////////////////////
if($_GET['tab']=="EcmCorrespondenceOuts" or $_GET['tab']=="All")
{
if(!$_GET['ecmcorrespondenceout_start'])$_GET['ecmcorrespondenceout_start']=0;
$il=10;
if($_GET['ecmcorrespondenceout_start']==0 || $_GET['ecmcorrespondenceout_start']=="")
{
if(!$ecmcorrespondenceoutsw)$_SESSION['ecmcorrespondenceout_where']="id='xxx'";
else $_SESSION['ecmcorrespondenceout_where']=$ecmcorrespondenceoutsw;
}
if(!$_GET['ecmcorrespondenceouts_order_by'])$ecmcorrespondenceouts_order_by="name";
else $ecmcorrespondenceouts_order_by=$_GET['ecmcorrespondenceouts_order_by'];
if(!$_GET['ecmcorrespondenceouts_sorder'])$ecmcorrespondenceouts_sorder="asc";
elseif($_GET['ecmcorrespondenceouts_sorder']=="asc")$ecmcorrespondenceouts_sorder="desc";
elseif($_GET['ecmcorrespondenceouts_sorder']=="desc")$ecmcorrespondenceouts_sorder="asc";
$z="select distinct * from ecmcorrespondenceouts where ".$_SESSION['ecmcorrespondenceout_where']." order by ".$ecmcorrespondenceouts_order_by." ".$_GET['ecmcorrespondenceouts_sorder']." limit ".$_GET['ecmcorrespondenceout_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecmcorrespondenceouts where ".$_SESSION['ecmcorrespondenceout_where']." order by name"));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecmcorrespondenceout_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecmcorrespondenceout_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecmcorrespondenceout_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecmcorrespondenceout_start']+$il;
$next='';
}
if($_GET['ecmcorrespondenceout_start']>0 && $_GET['ecmcorrespondenceout_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecmcorrespondenceout_start']+$il;
$next='';
$previousl=$_GET['ecmcorrespondenceout_start']-$il;
$previous='';
}
if($_GET['ecmcorrespondenceout_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecmcorrespondenceout_start']-$il;
$previous='';
}
}
/*
print 'Correspondence Out List |  |
';
*/
}
////////////////////////EcmInvoiceIns/////////////////////////
if($_GET['tab']=="EcmInvoiceIns" or $_GET['tab']=="All")
{
if(!$_GET['ecminvoicein_start'])$_GET['ecminvoicein_start']=0;
$il=10;
if($_GET['ecminvoicein_start']==0 || $_GET['ecminvoicein_start']=="")
{
if(!$ecminvoiceinsw)$_SESSION['ecminvoicein_where']="id='xxx'";
else $_SESSION['ecminvoicein_where']=$ecminvoiceinsw;
}
if(!$_GET['ecminvoiceins_order_by'])$ecminvoiceins_order_by="name";
else $ecminvoiceins_order_by=$_GET['ecminvoiceins_order_by'];
if(!$_GET['ecminvoiceins_sorder'])$ecminvoiceins_sorder="asc";
elseif($_GET['ecminvoiceins_sorder']=="asc")$ecminvoiceins_sorder="desc";
elseif($_GET['ecminvoiceins_sorder']=="desc")$ecminvoiceins_sorder="asc";
$z="select distinct * from ecminvoiceins where ".$_SESSION['ecminvoicein_where']." order by ".$ecminvoiceins_order_by." ".$_GET['ecminvoiceins_sorder']." limit ".$_GET['ecminvoicein_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecminvoiceins where ".$_SESSION['ecminvoicein_where']." order by name"));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecminvoicein_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecminvoicein_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecminvoicein_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecminvoicein_start']+$il;
$next='';
}
if($_GET['ecminvoicein_start']>0 && $_GET['ecminvoicein_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecminvoicein_start']+$il;
$next='';
$previousl=$_GET['ecminvoicein_start']-$il;
$previous='';
}
if($_GET['ecminvoicein_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecminvoicein_start']-$il;
$previous='';
}
}
/*
print 'Invoice In List |  |
';
*/
}
////////////////////////EcmInvoiceOuts/////////////////////////
if($_GET['tab']=="EcmInvoiceOuts" or $_GET['tab']=="All")
{
if(!$_GET['ecminvoiceout_start'])$_GET['ecminvoiceout_start']=0;
$il=10;
if($_GET['ecminvoiceout_start']==0 || $_GET['ecminvoiceout_start']=="")
{
if(!$ecminvoiceoutsw)$_SESSION['ecminvoiceout_where']="id='xxx'";
else $_SESSION['ecminvoiceout_where']=$ecminvoiceoutsw;
}
if(!$_GET['ecminvoiceouts_order_by'])$ecminvoiceouts_order_by="name";
else $ecminvoiceouts_order_by=$_GET['ecminvoiceouts_order_by'];
if(!$_GET['ecminvoiceouts_sorder'])$ecminvoiceouts_sorder="asc";
elseif($_GET['ecminvoiceouts_sorder']=="asc")$ecminvoiceouts_sorder="desc";
elseif($_GET['ecminvoiceouts_sorder']=="desc")$ecminvoiceouts_sorder="asc";
$z="select distinct * from ecminvoiceouts where ".$_SESSION['ecminvoiceout_where']." order by ".$ecminvoiceouts_order_by." ".$_GET['ecminvoiceouts_sorder']." limit ".$_GET['ecminvoiceout_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecminvoiceouts where ".$_SESSION['ecminvoiceout_where']." order by name"));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecminvoiceout_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecminvoiceout_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecminvoiceout_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecminvoiceout_start']+$il;
$next='';
}
if($_GET['ecminvoiceout_start']>0 && $_GET['ecminvoiceout_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecminvoiceout_start']+$il;
$next='';
$previousl=$_GET['ecminvoiceout_start']-$il;
$previous='';
}
if($_GET['ecminvoiceout_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecminvoiceout_start']-$il;
$previous='';
}
}
/*
print 'Invoice Out List |  |
';
*/
}
////////////////////////EcmDocs/////////////////////////
if($_GET['tab']=="EcmDocs" or $_GET['tab']=="All")
{
if(!$_GET['ecmdoc_start'])$_GET['ecmdoc_start']=0;
$il=10;
if($_GET['ecmdoc_start']==0 || $_GET['ecmdoc_start']=="")
{
if(!$ecmdocsw)$_SESSION['ecmdoc_where']="id='xxx'";
else $_SESSION['ecmdoc_where']=$ecmdocsw;
}
if(!$_GET['ecmdocs_order_by'])$ecmdocs_order_by="name";
else $ecmdocs_order_by=$_GET['ecmdocs_order_by'];
if(!$_GET['ecmdocs_sorder'])$ecmdocs_sorder="asc";
elseif($_GET['ecmdocs_sorder']=="asc")$ecmdocs_sorder="desc";
elseif($_GET['ecmdocs_sorder']=="desc")$ecmdocs_sorder="asc";
$z="select distinct * from ecmdocs where ".$_SESSION['ecmdoc_where']." order by ".$ecmdocs_order_by." ".$_GET['ecmdocs_sorder']." limit ".$_GET['ecmdoc_start'].",".$il;
$w=mysql_query($z);
$ile=mysql_num_rows(mysql_query("select distinct id from ecmdocs where ".$_SESSION['ecmdoc_where']." order by ".$ecmdocs_order_by." ".$ecmdocs_sorder));
if($ile<$il)$ilenastronie=$ile;
else $ilenastronie=$il;
$od=$_GET['ecmdoc_start']+1;
$do=$od+$il-1;
$endl=floor($ile/$il);
$endl=$endl*$il;
if($ile==0)$od=0;
if($_GET['ecmdoc_start']+$il>=$ile)$do=$ile;
if($ile==0 || $ile<=$il)
{
$start='
';
$end='
';
$previous='
';
$next='
';
}
else
{
if($_GET['ecmdoc_start']==0)
{
$start='
';
$previous='
';
$end='';
$nextl=$_GET['ecmdoc_start']+$il;
$next='';
}
if($_GET['ecmdoc_start']>0 && $_GET['ecmdoc_start']<$ile)
{
$start='';
$end='';
$nextl=$_GET['ecmdoc_start']+$il;
$next='';
$previousl=$_GET['ecmdoc_start']-$il;
$previous='';
}
if($_GET['ecmdoc_start']+$il>=$ile)
{
$start='';
$end='
';
$next='
';
$previousl=$_GET['ecmdoc_start']-$il;
$previous='';
}
}
print 'Files List |  |
|
|
| Name |
Registered On |
Account |
Version |
Assigned |
User |
';
while($r=mysql_fetch_array($w))
{
print '
|
'.cut_name_in_search($r['name'],20).' |
'.$r['date_entered'][0].$r['date_entered'][1].$r['date_entered'][2].$r['date_entered'][3].$r['date_entered'][4].$r['date_entered'][5].$r['date_entered'][6].$r['date_entered'][7].$r['date_entered'][8].$r['date_entered'][9].' |
|
|
|
'.get_assigned_user_name_in_search($r['assigned_user_id']).' |
|
';
}
print '
';
}
?>