Yitan Posted August 26, 2015 Report Share Posted August 26, 2015 Hola me podrían ayudar en esto necesito crear algo que acumule puntos al comprar un producto y después el cliente los pueda canjear como podía hacer eso ????? gracias Link to comment Share on other sites More sharing options...
cañangasñangas Posted August 26, 2015 Report Share Posted August 26, 2015 lenguaje? Link to comment Share on other sites More sharing options...
Yitan Posted August 26, 2015 Author Report Share Posted August 26, 2015 php html necesito ocupar mysql Link to comment Share on other sites More sharing options...
cañangasñangas Posted August 26, 2015 Report Share Posted August 26, 2015 (edited) algo asi: mysql id|rut|nombre|puntosel form para obtener los puntos del cliente con el rut del user: <form method="post" action="pesos.php"> <input type="text" name="rut-cliente" /><br /> <input type="submit" value="Ver puntos clientes" /> </form>el php <?php .....mysql <- toda la mierdis de conexion y seleccion del usuario $ususario = select_con_el_rut; echo "El usuario "+$usuario["nombre"]+" tiene un total de: "+$usuario["puntos"]+" puntos"; ?>Ahora para agregar puntos al ususariio con el rut <form method="post" action="compra.php"> <input type="text" name="rut-cliente"><br /> <input type="text" name="compra" / ><br /> <imput type="submit" value="Ingresar"> </form>el php <?php $puntosPorPeso = 1000; //aca elijes.. $compra = $_POST["compra"]; .....mysql <- toda la mierdis de conexion y seleccion del usuario $usaurio = slelect_por_rut: $puntos = $usuario["puntos"]+($compra*$puntosPorPeso); insert_en_el_usuario_puntos = $puntos; ?>Para usar puntos por rut <form method="post" action="usar.php"> <input type="text" name="rut-cliente" /><br/> <input type="text" name="puntos" /><br/> <input type="submit" value="usar"> </form>el php <?php $puntos = $_POST["puntos"]; .....mysql <- toda la mierdis de conexion y seleccion del usuario $ususario = select_con_el_rut; $puntos2 = $usuario["puntos"]-$puntos; insert_en_el_usuario_puntos = $puntos2; ?>no quise poner las declaraciones de mysql porque me dió lata hacerlo todo... Edito, es algo super vago pero es la idea... si necesitas más ayuda mande.... Edited August 28, 2015 by cañangasñangas Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now