| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/meridional/application/controllers/ |
Upload File : |
<?php
// *************************************************************************
// * *
// * iBilling - Accounting, Billing Software *
// * Copyright (c) Sadia Sharmin. All Rights Reserved *
// * *
// *************************************************************************
// * *
// * Email: sadiasharmin3139@gmail.com *
// * Website: http://www.sadiasharmin.com *
// * *
// *************************************************************************
// * *
// * This software is furnished under a license and may be used and copied *
// * only in accordance with the terms of such license and with the *
// * inclusion of the above copyright notice. *
// * If you Purchased from Codecanyon, Please read the full License from *
// * here- http://codecanyon.net/licenses/standard *
// * *
// *************************************************************************
_auth();
$ui->assign('_application_menu', 'contacts');
$ui->assign('_st', $_L['Search']);
$ui->assign('_title', $_L['Accounts'].'- '. $config['CompanyName']);
$action = $routes['1'];
$user = User::_info();
$ui->assign('user', $user);
switch ($action) {
case 'ps':
$filters = array();
$type = _post('stype');
$type_of_product = _post('type');
$name = _post('txtsearch');
$data = ORM::for_table('sys_items')
->table_alias('i')
->select('i.*')
->where('type',$type)
->where_like('description',"%$name%")
->select_expr("(select initials from sys_items_unit u where u.id=i.unit_id )", 'u_unit')
->select_expr("(select current_stock from sys_items_stock st where st.sys_items_id=i.id )", 'stock')
->order_by_asc('name');
if($type_of_product && $type_of_product != 'all')
{
$filters['type'] = $type_of_product;
$data->where('type_of_product', $type_of_product);
}
$ret="";
//valida se o módulo fiscal está instalado para exibir o botão de tributações.
//existem dependências desse módulo nessa funcionalidade
$pluginModuleFiscal = ORM::for_table('sys_pl')->where('c', "modulo_fiscal")->find_one();
$moduleFiscal=false;
if($pluginModuleFiscal){
if($pluginModuleFiscal['status']==1){
$moduleFiscal=true;
}
}
$d = $data->find_many();
// var_dump($d[0]);exit;
// if($d){
// echo '<table class="table table-hover">
// <tbody>';
// //valida se o módulo fiscal está instalado para exibir o botão de tributações.
// //existem dependências desse módulo nessa funcionalidade
// $pluginModuleFiscal = ORM::for_table('sys_pl')->where('c', "modulo_fiscal")->find_one();
// $moduleFiscal=false;
// if($pluginModuleFiscal){
// if($pluginModuleFiscal['status']==1){
// $moduleFiscal=true;
// }
// }
//
// foreach ($d as $ds){
// $price = number_format($ds['sales_price'],2,$config['dec_point'],$config['thousands_sep']);
// echo ' <tr>
//
// <td class="project-title">
// '.($ds['type']=='Service'?' <a href="#" class="cedit" id="t'.$ds['id'].'">'.$ds['name'].'</a>':' <a href="'.U.'ps/edit-product/'.$ds['id'].'" class="" id="t'.$ds['id'].'">'.$ds['description'].'</a>').'
//
//
//
//
// <br>
// <small>'.$ds['item_number'].'</small>
// </td>
// <td>
//
// '.$price.'
//
// </td>
//
// <td class="project-actions col-xs-3">
//
// '.($ds['type']=='Service'?'<a href="#" class="btn btn-primary btn-sm cedit" id="e'.$ds['id'].'"><i class="fa fa-pencil"></i> '.$_L['Edit'].' </a>':'<a href="'.U.'ps/edit-product/'.$ds['id'].'" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i> '.$_L['Edit'].' </a>').
// ' <a href="'.U.'module_stock/stock/item/'.$ds['id'].'" class="btn btn-success btn-sm" id=""><i class="fa fa-cog"></i> '.$_L['Stock'].' </a>
// '.(($moduleFiscal==true)?'<a href="'.U.'ps/taxation/'.$ds['id'].'" class="btn btn-info btn-sm "><i class="fa fa-dollar"></i> '.$_L['Taxation'].' </a>':'').
// ' <a href="#" class="btn btn-danger btn-sm cdelete" id="pid'.$ds['id'].'"><i class="fa fa-trash"></i> '.$_L['Delete'].' </a> '.
// '</td>
// </tr>';
// }
//
//
// echo '
// </tbody>
// </table>';
// }
// else
// {
// echo '<h4>Nothing Found</h4>';
// }
$valorFinal = 0;
if(sizeof($d) > 0)
{
foreach ($d as $ds)
{
// verifico o tipo de produto para saber se vai ter link para Etapas de Produção
$etapa_producao = '';
if($ds['type_of_product'] == 'Finished product' || $ds['type_of_product'] == 'Component')
{
$etapa_producao = "<li><a href='?ng=module_pcp/p-steps/product-edit/".$ds['id']."'><i class='fa fa-cog'></i> Etapas de Produção</a></li>";
}
$price = number_format($ds['sales_price'],2,$config['dec_point'],$config['thousands_sep']);
$total_estoque = number_format(($ds['sales_price']*$ds['stock']),2,$config['dec_point'],$config['thousands_sep']);
$ret .="<tr class='list_stock_1'>
<td>
<div class='btn-group dropdown dropdown-main-actions'>
<button data-toggle='dropdown' class='btn btn-primary btn-xs dropdown-toggle' type='button'>
<span class='caret'></span></button>
<ul class='dropdown-menu'>
<li style='display:none;' onclick='etiqueta()'><a href='#'><i class='fa fa-th'></i> Imprimir etiquetas</a></li>
<li>".($ds['type']=='Service'?'<a href=href="'.U.'ps/edit-service/'.$ds['id'].'"><i class="fa fa-pencil"></i> '.$_L['Edit'].' </a>':'<a href="'.U.'ps/edit-product/'.$ds['id'].'"><i class="fa fa-pencil"></i> '.$_L['Edit'].' </a>')."</li>
<li><a href='?ng=module_stock/stock/item/".$ds['id']."'><i class='fa fa-cog'></i> Gerenciar Estoque</a></li>
".$etapa_producao."
<li>".(($moduleFiscal==true)?'<a href="'.U.'ps/taxation/'.$ds['id'].'"><i class="fa fa-dollar"></i> '.$_L['Taxation'].' </a>':'')."</li>
<li><a href='#' class='cdelete' id='pid".$ds['id']."'><i class='fa fa-trash'></i> ".$_L['Delete']."</a></li>
</ul>
</div>
</td>
<td onclick='goItem(".$ds['id'].")'>".$ds['description']."</td>
<td onclick='goItem(".$ds['id'].")'>".$ds['id']."</td>
<td onclick='goItem(".$ds['id'].")' style='width: 20px;'>".$config['currency_code']."</td>
<td onclick='goItem(".$ds['id'].")'>".$price."</td>
<td onclick='goItem(".$ds['id'].")'>".$ds['stock']." ".$ds['u_unit']."</td>
<td onclick='goItem(".$ds['id'].")'>".$config['currency_code']." ".$total_estoque."</td>
<td onclick='goItem(".$ds['id'].")'> </td></tr>
";
// TODO: LR - corrigir o valor total em estoque
$valorFinal += $total_estoque;
}
}
else
{
$ret = "<tr><td colspan='8' style='text-align: center'>Nenhum produto encontrado!</td></tr>";
}
$ret .= "<tr><td colspan='8' style='text-align: right'><strong>Valor Total ".$config['currency_code']." ".number_format($valorFinal,2,$config['dec_point'],$config['thousands_sep'])."</strong></td></tr>";
echo $ret;
// $ui->assign('filter', $filters);
break;
case 'users':
echo '<table class="table table-bordered table-hover trclickable">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Access Level</th>
<th>Active</th>
</tr>
</thead>
<tbody>
<tr id="_tr120">
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td><div class="switch">
<div class="onoffswitch">
<input type="checkbox" class="onoffswitch-checkbox" data-on-text="Yes">
<label class="onoffswitch-label" for="fixednavbar">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div></td>
</tr>
</tbody>
</table>';
break;
default:
echo 'action not defined';
}