PK

ADDRLIN : /HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/tacho/
FLL :
Current File : //HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/tacho/showroom_ventas.asp

<!--#include file="includes/openconn.asp" -->

<!--#include file="includes/checkadmin3.asp" -->

<!DOCTYPE html>
<html lang="en">

<head>

	<!--#include file="includes/metatags.asp" -->

	<link rel="stylesheet" href="lightbox/css/bootstrap-lightbox.min.css">
	<link rel="stylesheet" href="lightbox/prettify/prettify.css">

<script type="text/javascript">
<!--
function del_confirmation(idventa,ven_nombre) {
    var answer = confirm("Quiere borrar la venta a " + ven_nombre + " ?")
     if (answer){
     	location.href="showroom_venta_del.asp?idventa=" + idventa;
     }
}
//-->
</script>

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
           
           	<!--#include file="includes/navup.asp" -->
            
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <%session("seccion") = "Showroom"%>
            <!--#include file="includes/navizq.asp" -->

            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                        Ventas en Showroom</h1>
                        <ol class="breadcrumb">
                          Lista de ventas
                          <li class="active"></li>
                        </ol>	
                    </div>
                     
                </div>
                    <!-- Page Heading -->
                    <form role="form" action="showroom_ventas.asp" method="POST" class="form" id="busca_venta" name="busca_venta">

                    <div class="row">
                        <div class="col-lg-3">
                            <div class="form-group input-group" >
                            <input type="text" class="form-control" name="clave" id="clave" value="<%=request("clave")%>" placeholder="Buscar ...">
                            <span class="input-group-btn"><button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button></span>
                        	</div>
                        </div>

                    </div>   
                  </form>
                    
                <!-- /.row -->
                
                <div class="row">
                    <div class="col-lg-12">
                
                      <div class="table-responsive">
                      
                      <%dim sqlstr,totdia,totmes,antdia,antmes,antano
                    sqlstr="SELECT * FROM Ventas ORDER BY ven_now DESC"
                  
                  if request("clave") <> "" then
                    sqlstr="SELECT * FROM Ventas WHERE ven_nombre LIKE '%" & request("clave") & "%' OR ven_email LIKE '%" & request("clave") & "%' OR ven_telefono LIKE '%" & request("clave") & "%' ORDER BY ven_now DESC"
                  end if
				  

                  'rs.CursorLocation = 3
                  
                  rs.open sqlstr,conn,3,1
				  if rs.EOF then%>
                   <div class="alert alert-danger">
                    <strong>No se encontraron Ventas </strong>Intente nuevamente
                </div>
                <%else
						dim xcant, cantstr
						totdia = 0 
						totmes = 0

						rs.movefirst
						
						  	antdia = day(rs("ven_now"))
						  	antmes = month(rs("ven_now"))
							antano = year(rs("ven_now"))%>
                        
                      <table class="table table-bordered table-hover">
                        <thead>
                          <tr>
                            <th>Fecha/Hora</th>
                            <th>Datos</th>
                            <th>Comentario</th>
                            <th>Detalle</th>
                            <th>Monto</th>
                            <th width="70px"></th>
                          </tr>
                        </thead>
                        <tbody>
                          <%do until rs.EOF
						  	totdia = totdia + rs("ven_monto")
						  	totmes = totmes + rs("ven_monto")%>
                          <tr>
                            <td><%=rs("ven_now")%><br>
IP : <%=rs("ven_IP")%></td>
                            <td><%=rs("ven_nombre")%><br>
  <a href="mailto:<%=rs("ven_email")%>"><%=rs("ven_email")%></a><br>
  <%=rs("ven_telefono")%></td>
                            <td><%=rs("ven_comentario")%></td>
                            <td><%rs1.open "SELECT * FROM Ventas_items WHERE xidventa = " & rs("idventa"),conn,3,1
							if not rs1.EOF then
								rs1.movefirst
								do until rs1.EOF
									for a = 35 to 40
										if rs1("item_cantidad" & a) <> 0 then 
											response.Write(rs1("item_cantidad" & a) & " - " & rs1("item_nombre") & " / " & rs1("item_color") & " ( talle : " & a & " )<bR>")
										end if
									next
									rs1.movenext
								loop
							end if
							rs1.close%>
                            </td>
                            <td><%=rs("ven_tipopago")%><br>
                           <b>$ <%=rs("ven_monto")%></b>
                           <% if not isnull(rs("ven_monto1")) then
   						  	totdia = totdia + rs("ven_monto1")
						  	totmes = totmes + rs("ven_monto1")%><br>
						<%=rs("ven_tipopago1")%> <br>	<b>$ <%=rs("ven_monto1")%></b><%end if%></td>
                            <td><a href="showroom_venta_edit.asp?idventa=<%=rs("idventa")%>" title="Editar Venta"><i class="fa fa-pencil-square fa-2x"></i></a>&nbsp;<a href="#" onclick="del_confirmation(<%=rs("idventa")%>,'<%=rs("ven_nombre")%>');" title="Eliminar venta"><i class="fa fa-times-circle fa-2x"></i></a></td>
                          </tr>
                          <%rs.movenext
						  if rs.EOF then exit do%>
                          <%if antdia <> day(rs("ven_now")) then%>
                              <tr style="background-color:#EEEEEE;">
                                <th>Total dia <%=antdia%>/<%=antmes%></th>
                                <th></th>
                                <th></th>
                                <th></th>
                                <th>$ <%=totdia%></th>
                                <th width="70px"></th>
                              </tr>
                              <%totdia = 0
						  end if%>
                          <%if antmes <> month(rs("ven_now")) then%>
                              <tr style="background-color:#CCCCCC;">
                                <th>Total mes <%=antmes%>/<%=antano%></th>
                                <th></th>
                                <th></th>
                                <th></th>
                                <th>$ <%=totmes%></th>
                                <th width="70px"></th>
                              </tr>
                              <%totmes = 0
						  end if%>                          
						<%antdia = day(rs("ven_now"))
						antmes = month(rs("ven_now"))
						antano = year(rs("ven_now"))
						loop%>
                        </tbody>
                      </table>
                      <%end if
					  rs.close%>
                    </div>
                </div>
                </div>
                
            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <!-- LightBox JavaScript -->
	<script src="lightbox/js/scale.fix.js"></script>
	<script src="lightbox/prettify/prettify.js"></script>
	<script src="lightbox/js/bootstrap-lightbox.min.js"></script>
	
</body>

</html>

<!--#include file="includes/closeconn.asp" -->


PK 99