PageRenderTime 83ms CodeModel.GetById 40ms RepoModel.GetById 1ms app.codeStats 0ms

/application/views/mapos/panel.php

https://gitlab.com/devdoblea/factutextil.local
PHP | 345 lines | 264 code | 66 blank | 15 comment | 40 complexity | 23a02637079b628b608b729ed26f338c MD5 | raw file
  1. <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="<?php echo base_url();?>js/dist/excanvas.min.js"></script><![endif]-->
  2. <script src="<?php echo base_url();?>assets/js/dist/jquery.jqplot.min.js"></script>
  3. <link href="<?php echo base_url();?>assets/js/dist/jquery.jqplot.min.css" rel="stylesheet" type="text/css"/>
  4. <script src="<?php echo base_url();?>assets/js/dist/plugins/jqplot.pieRenderer.js"></script>
  5. <script src="<?php echo base_url();?>assets/js/dist/plugins/jqplot.donutRenderer.js"></script>
  6. <!--Action boxes-->
  7. <div class="container-fluid">
  8. <div class="quick-actions_homepage">
  9. <ul class="quick-actions">
  10. <?php
  11. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vOs')){
  12. echo '<li class="bg_lv"> <a href="'.base_url().'index.php/compras"> <i class="icon icon-plus-sign"></i> Compras </a> </li>';
  13. }
  14. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vCliente')){
  15. echo '<li class="bg_lb"> <a href="'.base_url().'index.php/clientes"> <i class="icon-group"></i> Clientes</a> </li>';
  16. }
  17. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vProduto')){
  18. echo '<li class="bg_lg"> <a href="'.base_url().'index.php/productos"> <i class="icon-barcode"></i> Productos</a> </li>';
  19. }
  20. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vVenda')){
  21. echo '<li class="bg_ls"> <a href="'.base_url().'index.php/servicios"><i class="icon-shopping-cart"></i> Ventas</a></li>';
  22. }
  23. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vOs')){
  24. echo '<li class="bg_lo"> <a href="'.base_url().'"> <i class="icon-tags"></i> Orden Compra</a> </li>';
  25. }
  26. /*if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vServico')){
  27. echo '<li class="bg_ly"> <a href="<?php echo base_url()?>index.php/facturas"> <i class="icon-wrench"></i> Facturas</a> </li>';
  28. }*/
  29. ?>
  30. </ul>
  31. </div>
  32. </div>
  33. <!--End-Action boxes-->
  34. <div class="row-fluid" style="margin-top: 0">
  35. <div class="span12">
  36. <div class="widget-box">
  37. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Productos Con Existencia Mínima</h5></div>
  38. <div class="widget-content">
  39. <table class="table table-bordered">
  40. <thead>
  41. <tr>
  42. <th>#</th>
  43. <th>Producto</th>
  44. <th>Precio de Venta</th>
  45. <th>Existencia</th>
  46. <th>Existencia Mínima</th>
  47. <th></th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. <?php
  52. if($productos != null){
  53. foreach ($productos as $p) {
  54. echo '<tr>';
  55. echo '<td>'.$p->idProductos.'</td>';
  56. echo '<td>'.$p->descriProd.'</td>';
  57. echo '<td>'.$p->precioVenta.'</td>';
  58. echo '<td>'.$p->existencia.'</td>';
  59. echo '<td>'.$p->existMinimo.'</td>';
  60. echo '<td>';
  61. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'eProduto')){
  62. echo '<a href="'.base_url().'index.php/productos/editar/'.$p->idProductos.'" class="btn btn-info"> <i class="icon-pencil" ></i> </a> ';
  63. }
  64. echo '</td>';
  65. echo '</tr>';
  66. }
  67. }
  68. else{
  69. echo '<tr><td colspan="3">Ningun Producto con existencia baja.</td></tr>';
  70. }
  71. ?>
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="span12" style="margin-left: 0">
  78. <div class="widget-box">
  79. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Ordenes de Compra Abiertas</h5></div>
  80. <div class="widget-content">
  81. <table class="table table-bordered">
  82. <thead>
  83. <tr>
  84. <th>#</th>
  85. <th>Fecha Inicial</th>
  86. <th>Fecha Final</th>
  87. <th>Cliente</th>
  88. <th></th>
  89. </tr>
  90. </thead>
  91. <tbody>
  92. <?php
  93. if($ordenes != null){
  94. foreach ($ordenes as $o) {
  95. echo '<tr>';
  96. echo '<td>'.$o->idOs.'</td>';
  97. echo '<td>'.date('d-m-Y' ,strtotime($o->fechaInicial)).'</td>';
  98. echo '<td>'.date('d-m-Y' ,strtotime($o->fechaFinal)).'</td>';
  99. echo '<td>'.$o->nomCliente.'</td>';
  100. echo '<td>';
  101. if($this->permission->checkPermission($this->session->userdata('permisos_id'),'vOs')){
  102. echo '<a href="'.base_url().'index.php/os/visualizar/'.$o->idOs.'" class="btn"> <i class="icon-eye-open" ></i> </a> ';
  103. }
  104. echo '</td>';
  105. echo '</tr>';
  106. }
  107. }
  108. else{
  109. echo '<tr><td colspan="3">Ninguna Orden de Compra abierta.</td></tr>';
  110. }
  111. ?>
  112. </tbody>
  113. </table>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <?php if($estatisticas_financiero != null){
  119. if($estatisticas_financiero->total_receita != null || $estatisticas_financiero->total_despesa != null || $estatisticas_financiero->total_receita_pendente != null || $estatisticas_financiero->total_despesa_pendente != null){ ?>
  120. <div class="row-fluid" style="margin-top: 0">
  121. <div class="span4">
  122. <div class="widget-box">
  123. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Estatísticas financieras - Procesadas</h5></div>
  124. <div class="widget-content">
  125. <div class="row-fluid">
  126. <div class="span12">
  127. <div id="chart-financeiro" style=""></div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="span4">
  134. <div class="widget-box">
  135. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Estatísticas financieras - Pendentes</h5></div>
  136. <div class="widget-content">
  137. <div class="row-fluid">
  138. <div class="span12">
  139. <div id="chart-financeiro2" style=""></div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="span4">
  146. <div class="widget-box">
  147. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Total en caja / Previsto</h5></div>
  148. <div class="widget-content">
  149. <div class="row-fluid">
  150. <div class="span12">
  151. <div id="chart-financeiro-caixa" style=""></div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <?php } } ?>
  159. <?php if($os != null){ ?>
  160. <div class="row-fluid" style="margin-top: 0">
  161. <div class="span12">
  162. <div class="widget-box">
  163. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Estatísticas de OS</h5></div>
  164. <div class="widget-content">
  165. <div class="row-fluid">
  166. <div class="span12">
  167. <div id="chart-os" style=""></div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <?php } ?>
  175. <div class="row-fluid" style="margin-top: 0">
  176. <div class="span12">
  177. <div class="widget-box">
  178. <div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>Estatísticas del Sistema</h5></div>
  179. <div class="widget-content">
  180. <div class="row-fluid">
  181. <div class="span12">
  182. <ul class="site-stats">
  183. <li class="bg_lh"><i class="icon-group"></i> <strong><?php echo $this->db->count_all('clientes');?></strong> <small>Clientes</small></li>
  184. <li class="bg_lh"><i class="icon-barcode"></i> <strong><?php echo $this->db->count_all('productos');?></strong> <small>Productos </small></li>
  185. <li class="bg_lh"><i class="icon-tags"></i> <strong><?php echo $this->db->count_all('os');?></strong> <small>Ordenes de Compra</small></li>
  186. <li class="bg_lh"><i class="icon-wrench"></i> <strong><?php echo $this->db->count_all('ventas');?></strong> <small>Ventas</small></li>
  187. </ul>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <script src="<?php echo base_url();?>assets/js/bootstrap.min.js"></script>
  195. <?php if($os != null) {?>
  196. <script >
  197. $(document).ready(function(){
  198. var data = [
  199. <?php foreach ($os as $o) {
  200. echo "['".$o->status."', ".$o->total."],";
  201. } ?>
  202. ];
  203. var plot1 = jQuery.jqplot ('chart-os', [data],
  204. {
  205. seriesDefaults: {
  206. // Make this a pie chart.
  207. renderer: jQuery.jqplot.PieRenderer,
  208. rendererOptions: {
  209. // Put data labels on the pie slices.
  210. // By default, labels show the percentage of the slice.
  211. showDataLabels: true
  212. }
  213. },
  214. legend: { show:true, location: 'e' }
  215. }
  216. );
  217. });
  218. </script>
  219. <?php } ?>
  220. <?php
  221. if(isset($estatisticas_financiero) && $estatisticas_financiero != null) {
  222. if($estatisticas_financiero->total_receita != null || $estatisticas_financiero->total_despesa != null || $estatisticas_financiero->total_receita_pendente != null || $estatisticas_financiero->total_despesa_pendente != null){
  223. ?>
  224. <script type="text/javascript">
  225. $(document).ready(function(){
  226. var data2 = [['Total Receitas',<?php echo ($estatisticas_financiero->total_receita != null ) ? $estatisticas_financiero->total_receita : '0.00'; ?>],['Total Despesas', <?php echo ($estatisticas_financiero->total_despesa != null ) ? $estatisticas_financiero->total_despesa : '0.00'; ?>]];
  227. var plot2 = jQuery.jqplot ('chart-financeiro', [data2],
  228. {
  229. seriesColors: [ "#9ACD32", "#FF8C00", "#EAA228", "#579575", "#839557", "#958c12","#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc"],
  230. seriesDefaults: {
  231. // Make this a pie chart.
  232. renderer: jQuery.jqplot.PieRenderer,
  233. rendererOptions: {
  234. // Put data labels on the pie slices.
  235. // By default, labels show the percentage of the slice.
  236. dataLabels: 'value',
  237. showDataLabels: true
  238. }
  239. },
  240. legend: { show:true, location: 'e' }
  241. }
  242. );
  243. var data3 = [['Total Receitas',<?php echo ($estatisticas_financiero->total_receita_pendente != null ) ? $estatisticas_financiero->total_receita_pendente : '0.00'; ?>],['Total Despesas', <?php echo ($estatisticas_financiero->total_despesa_pendente != null ) ? $estatisticas_financiero->total_despesa_pendente : '0.00'; ?>]];
  244. var plot3 = jQuery.jqplot ('chart-financeiro2', [data3],
  245. {
  246. seriesColors: [ "#90EE90", "#FF0000", "#EAA228", "#579575", "#839557", "#958c12","#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc"],
  247. seriesDefaults: {
  248. // Make this a pie chart.
  249. renderer: jQuery.jqplot.PieRenderer,
  250. rendererOptions: {
  251. // Put data labels on the pie slices.
  252. // By default, labels show the percentage of the slice.
  253. dataLabels: 'value',
  254. showDataLabels: true
  255. }
  256. },
  257. legend: { show:true, location: 'e' }
  258. }
  259. );
  260. var data4 = [['Total em Caixa',<?php echo ($estatisticas_financiero->total_receita - $estatisticas_financiero->total_despesa); ?>],['Total a Entrar', <?php echo ($estatisticas_financiero->total_receita_pendente - $estatisticas_financiero->total_despesa_pendente); ?>]];
  261. var plot4 = jQuery.jqplot ('chart-financeiro-caixa', [data4],
  262. {
  263. seriesColors: ["#839557","#d8b83f", "#d8b83f", "#ff5800", "#0085cc"],
  264. seriesDefaults: {
  265. // Make this a pie chart.
  266. renderer: jQuery.jqplot.PieRenderer,
  267. rendererOptions: {
  268. // Put data labels on the pie slices.
  269. // By default, labels show the percentage of the slice.
  270. dataLabels: 'value',
  271. showDataLabels: true
  272. }
  273. },
  274. legend: { show:true, location: 'e' }
  275. }
  276. );
  277. });
  278. </script>
  279. <?php } } ?>