Example #1
0
    public function getProductsByIdShop($records_per_page = null)
    {
        $pagination = new Zebra_Pagination();
        // set position of the next/previous page links
        $pagination->navigation_position(isset($_GET['navigation_position']) && in_array($_GET['navigation_position'], array('left', 'right')) ? $_GET['navigation_position'] : 'outside');
        $records_per_page = $records_per_page == null ? 25 : $records_per_page;
        $db = PDOQuery::getInstance();
        $db->connect();
        $sql = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT
						product_lang.product, product.id_product, stock_available.stock_available, stock_available.price,
						product.reference
				FROM 	product_lang
				RIGHT JOIN product ON product.id_product = product_lang.id_product
				RIGHT JOIN stock_available ON product.id_product = stock_available.id_product
				WHERE stock_available.id_shop = :id_shop1
				AND product_lang.id_lang=' . _ID_LANG_ . $_SESSION['adminQuery'] . '

		UNION

		SELECT DISTINCT
				product_lang.product, product.id_product, stock_available.stock_available, stock_available.price,
				product.reference
		FROM 	product_lang
		RIGHT JOIN product ON product.id_product = product_lang.id_product
		RIGHT JOIN stock_available ON product.id_product = stock_available.id_product
		RIGHT JOIN product_tag ON product_tag.id_product = product.id_product
		RIGHT JOIN tags ON tags.id_tag = product_tag.id_tag
		WHERE 	stock_available.id_shop = :id_shop2
		AND 	product_lang.id_lang=' . _ID_LANG_ . '
		AND 	tags.tag = :tagQuery
		ORDER BY id_product asc
		LIMIT
			' . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page;
        $stmt = $db->prepareQuery($sql);
        $stmt->bindParam(':id_shop1', $_SESSION['id_shop'], PDO::PARAM_INT);
        $stmt->bindParam(':id_shop2', $_SESSION['id_shop'], PDO::PARAM_INT);
        $stmt->bindParam(':tagQuery', $_SESSION['tagQuery'], PDO::PARAM_STR);
        $stmt->execute();
        $rows = $db->query('SELECT FOUND_ROWS();')->fetch(PDO::FETCH_COLUMN);
        // pass the total number of records to the pagination class
        $pagination->records($rows);
        // records per page
        $pagination->records_per_page($records_per_page);
        $this->pagination_render = $pagination->render();
        $db->close();
        return $stmt;
    }
Example #2
0
    echo $fsConfig->getUrl();
    ?>
index.php/detalleEntradaSalidaBodega/editar?id=<?php 
    echo $detalleEntradaSalidaBodega->id;
    ?>
" class="btn btn-primary btn-xs">Editar</a>
            <a href="#" data-toggle='modal' data-target='#myModal<?php 
    echo $detalleEntradaSalidaBodega->id;
    ?>
' class="btn btn-danger btn-xs">eliminar</a>
            <?php 
    include $fsConfig->getPath() . 'view/partial/modalEliminarDetalleEntradaSalidaBodega.php';
    ?>
</td>       
        </tr>
      <?php 
}
?>
    </tbody>
  </table>
   <?php 
$paginacion->render();
?>
 
</div>
<script src="<?php 
echo $fsConfig->getUrl();
?>
css/js/eliminar.js"></script>
<?php 
include_once $fsConfig->getPath() . 'view/partial/foot.php';
Example #3
0
                                    </div>
                                    <?php 
    }
}
?>
   

                        </div><!--features_items-->
                    </div>
                </div>
            </div>   

            <center>
                <?php 
echo '<ul class="pagination">';
$zebraPage->render();
echo '</ul>';
?>
            </center>
            <br><br><br><br>
        </section>

        <?php 
require_once './footer.php';
?>

        <div class="msg-add" style="display: none">
            <p>Agregado al carrito</p>
        </div>

        <script src="js/jquery.js"></script>
Example #4
0
    ?>
</td>
						<td><a href="javascript:;" class="remfile" data-fn="<?php 
    echo $v['file_name'];
    ?>
"><span class="glyphicon glyphicon-remove text-danger"></span></a></td>
					</tr>
<?php 
}
?>
				</tbody>
				<tfoot class="hide-if-no-paging">
					<tr>
						<td colspan="5">
							<div class="pagination pagination-centered"><?php 
$pagination->render();
?>
</div>
						</td>
					</tr>
				</tfoot>
			</table>
				
			<script type="text/javascript">
				$(document).ready(function(){
					$('.footable').footable();
					
					/* Remove File */
					$(".remfile").click(function(){
						var fn = $(this).data('fn');
						$.ajax({
        echo '<tr>';
        echo '<td><a href="#" class="itemProd" rel="' . $r["int_IdDetalleInv"] . '" title="' . $r["var_Nombre"] . '" ><span class="fa fa-barcode" ></span> ' . $r["var_Nombre"] . '</a></td>';
        echo '<td>' . $r["unidadMedida"] . '</td>';
        echo '<td id="Cant_' . $r["int_IdDetalleInv"] . '" class="text-right" >' . $r["int_Cant"] . '</td>';
        echo '<td><a href="#" class="pull-right quitarProd" rel="' . $r["int_IdDetalleInv"] . '" ><span class="glyphicon glyphicon-remove" ></span></a></td>';
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="4" ><p class="text-center" >Los productos se cargarán al guardar.</p></td></tr>';
}
?>
                                                    </tbody>
                                                </table>
                                                <!-- .table -->
                                                <?php 
$zebra->render();
?>
                                            </div>
                                            <!-- panel-body -->
                                        </div>
                                        <!-- tab-pane -->
                                        <!-- ********** Resultados de busqueda -->
                                        <div role="tabpanel" class="tab-pane" id="Busqueda">
                                            <div class="panel-heading">Resultados de la busqueda</div>
                                            <div class="panel-body">
                                            <!-- .table -->
                                                <table id="tblResultados" class="table" >
                                                    <thead>
                                                    <tr>
                                                        <th>Producto</th>
                                                        <th>Unidad Medida</th>
Example #6
0
    echo $tipoMantenimiento->id;
    ?>
" class="btn btn-primary btn-xs">Editar</a>
            <a href="#" data-toggle='modal' data-target='#myModal<?php 
    echo $tipoMantenimiento->id;
    ?>
' class="btn btn-danger btn-xs">eliminar</a>
            <?php 
    include $fsConfig->getPath() . 'view/partial/modalEliminarTipoMantenimiento.php';
    ?>
          </td>
        </tr>
      <?php 
}
?>
    </tbody>
  </table>
  <?php 
$pagina->render();
?>

</div>
<script src="<?php 
echo $fsConfig->getUrl();
?>
css/js/eliminar.js"></script>
<?php 
include_once $fsConfig->getPath() . 'view/partial/foot.php';
?>

Example #7
0
 function getListData($qs = "", $where = "")
 {
     // how many records should be displayed on a page?
     $records_per_page = 10;
     // include the pagination class
     require 'Zebra_Pagination.php';
     // instantiate the pagination object
     $pagination = new Zebra_Pagination();
     // the MySQL statement to fetch the rows
     // note how we build the LIMIT
     // also, note the "SQL_CALC_FOUND_ROWS"
     // this is to get the number of rows that would've been returned if there was no LIMIT
     // see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
     //if($qs!=""){$limit='' . (($pagination->get_page() - 1) * $records_per_page) . ', ' . $records_per_page . '';}else{$limit="";}
     $limit = 'LIMIT ' . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page . '';
     if ($where != "") {
         $where = "WHERE " . $where . "";
     } else {
         $where = "";
     }
     $data = $this->db->query("SELECT * FROM table_information " . $where . " " . $limit . "");
     // pass the total number of records to the pagination class
     $pagination->records(11);
     // records per page
     $pagination->records_per_page($records_per_page);
     $out['data'] = $data->result_array();
     $out['page'] = $pagination->render();
     //echo $pagination->render(true); die();
     return $out;
 }
Example #8
0
 public function getTotalSaleList($id_order_by = null, $records_per_page = null)
 {
     $pagination = new Zebra_Pagination();
     // set position of the next/previous page links
     $pagination->navigation_position(isset($_GET['navigation_position']) && in_array($_GET['navigation_position'], array('left', 'right')) ? $_GET['navigation_position'] : 'outside');
     $records_per_page = $records_per_page == null ? 15 : $records_per_page;
     $db = PDOQuery::getInstance();
     $db->connect();
     $order_by = $this->orderBySwitcher($id_order_by);
     $asc = $this->getOrderDirection();
     $sql = "SELECT SQL_CALC_FOUND_ROWS DISTINCT  \n\t\t\t\t\tSUM(sales.amount) as total,\n\t\t\t\t\tsales.id_shop_session,\n\t\t\t\t\tshop_session.date\n\t\t\t\tFROM \tsales\n\t\t\t\t\tINNER JOIN shop_session ON shop_session.id_shop_session = sales.id_shop_session\n\t\t\t\tWHERE \tshop_session.id_shop = " . $_SESSION['id_shop'] . "\n\t\t\t\tAND \tshop_session.is_active = 0\n\t\t\t\tGROUP BY shop_session.id_shop_session\n\t\t\t\tORDER BY {$order_by} {$asc}\n\t\t\t\tLIMIT\n   \t\t\t\t" . ($pagination->get_page() - 1) * $records_per_page . ", " . $records_per_page;
     $stmt = $db->prepareQuery($sql);
     $stmt->bindParam(':id_shop', $_SESSION['id_shop'], PDO::PARAM_INT);
     $stmt->execute();
     $rows = $db->query('SELECT FOUND_ROWS();')->fetch(PDO::FETCH_COLUMN);
     // pass the total number of records to the pagination class
     $pagination->records($rows);
     // records per page
     $pagination->records_per_page($records_per_page);
     $this->pagination_render = $pagination->render();
     $db->close();
     return $stmt;
 }