diff --git a/.github/workflows/patch-1_pedidosparcialg3.yml b/.github/workflows/patch-1_pedidosparcialg3.yml new file mode 100644 index 000000000..102cc6d9c --- /dev/null +++ b/.github/workflows/patch-1_pedidosparcialg3.yml @@ -0,0 +1,66 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy PHP app to Azure Web App - PedidosParcialG3 + +on: + push: + branches: + - patch-1 + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Check if composer.json exists + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: 'composer.json' + + - name: Run composer install if composer.json exists + if: steps.check_files.outputs.files_exists == 'true' + run: composer validate --no-check-publish && composer install --prefer-dist --no-progress + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: php-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'PedidosParcialG3' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_FE968103DC37469880CCDBA661B60C1D }} + package: . diff --git a/Restaurantes/consultar_pedido.php b/Restaurantes/consultar_pedido.php new file mode 100644 index 000000000..3b4bfee69 --- /dev/null +++ b/Restaurantes/consultar_pedido.php @@ -0,0 +1,47 @@ + "Bdg3", + "Uid" => "unmsmg3", + "PWD" => "S54@a1a1" + ); + + // Intenta establecer la conexión + $conn = sqlsrv_connect($serverName, $connectionOptions); + + // Verifica la conexión + if (!$conn) { + die(print_r(sqlsrv_errors(), true)); + } + + // Consulta SQL para obtener información del pedido + $sql = "SELECT * FROM I01_Pedidos_TC WHERE nro_pedido = ?"; + $params = array($numero_pedido); + $stmt = sqlsrv_query($conn, $sql, $params); + + // Muestra los resultados + if ($stmt) { + while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) { + echo "Número de Pedido: " . $row["nro_pedido"] . "
"; + echo "ID Cliente: " . $row["doc_id_cliente"] . "
"; + echo "Cliente: " . $row["cdsc_cliente"] . "
"; + echo "Subtotal: $" . $row["subtotal"] . "
"; + echo "IGV: $" . $row["igv"] . "
"; + echo "Total: $" . $row["total"] . "
"; + } + } else { + echo "Pedido no encontrado."; + } + + // Cierra la conexión + sqlsrv_close($conn); +} else { + // Redirige a la página principal si se accede directamente a consultar_pedido.php sin enviar datos + header("Location: ../index.html"); +} +?> diff --git a/Restaurantes/restaurante1.php b/Restaurantes/restaurante1.php new file mode 100644 index 000000000..fb280fb69 --- /dev/null +++ b/Restaurantes/restaurante1.php @@ -0,0 +1,37 @@ + + + + + + +

Formulario de pedido para Restaurante 1

+
+
+ + + + + + + + + + +
+
+ +

Consulta de Pedido

+
+
+ + + +
+
+ + + diff --git a/css/styles.css b/css/styles.css new file mode 100644 index 000000000..8e7c4de17 --- /dev/null +++ b/css/styles.css @@ -0,0 +1,82 @@ +/* Reset de estilos */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #f2f2f2; + margin: 0; + padding: 0; +} + +h1 { + background-color: #333; + color: #fff; + padding: 10px; +} + +.formulario { + max-width: 400px; + margin: 0 auto; + background-color: #fff; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +.formulario label { + display: block; + margin: 10px 0; + font-weight: bold; +} + +.formulario input[type="text"], +.formulario select { + width: 100%; + padding: 10px; + margin: 5px 0; + border: 1px solid #ccc; + border-radius: 5px; +} + +.formulario select { + appearance: none; +} + +.formulario input[type="submit"] { + background-color: #333; + color: #fff; + border: none; + border-radius: 5px; + padding: 10px 20px; + cursor: pointer; +} + +.restaurant-list { + display: flex; + justify-content: center; + flex-wrap: wrap; +} + +.restaurant-list a { + text-decoration: none; + margin: 20px; + display: block; + color: #333; +} + +.restaurant-list img { + width: 200px; + height: 150px; +} + +.restaurant-list h2 { + margin-top: 10px; +} + +/* Agrega estilos adicionales según tus preferencias */ diff --git a/images/restaurante1.png b/images/restaurante1.png new file mode 100644 index 000000000..d4d8a8922 Binary files /dev/null and b/images/restaurante1.png differ diff --git a/images/restaurante2.png b/images/restaurante2.png new file mode 100644 index 000000000..0437ebd4a Binary files /dev/null and b/images/restaurante2.png differ diff --git a/index.php b/index.php index 82966e27a..8946a92f2 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,20 @@ - + + + + + +

Seleccione un restaurante

+
+ + Restaurante 1 +

Restaurante 1

+
+ + Restaurante 2 +

Restaurante 2

+
+ +
+ +