https://preview.themeforest.net/item/pronia-plant-store-bootstrap-5-template/full_screen_preview/32337065

http://preview.themeforest.net/item/botanical-html5-ecommerce-template/full_screen_preview/24961852

https://stackblitz.com/edit/angular-mat-table-filter-example?file=src%2Fapp%2Fmat-table-filter%2Fmat-table-filter.component.html
https://morioh.com/p/eb59620c0e80
https://www.digitalocean.com/community/tutorials/angular-reactive-forms-custom-validator
https://stackblitz.com/edit/angular-child-parent-communication-example?file=src%2Fapp%2Fchild.component.html,src%2Fapp%2Fchild.component.ts
https://www.youtube.com/watch?v=5Hs1bB4jpyg
https://www.youtube.com/watch?v=Blxk3IOcUgM

https://i0.wp.com/www.onceuponachef.com/images/2017/07/Ratatouille-14.jpg?resize=850%2C638&ssl=1

static String ORDER_DETAILS = BASE_URL + "getorderdetails.php";
static String ORDER_ITEMS = BASE_URL + "getorderitems.php";

Register

import 'package:firstapp/resources/AppColors.dart';
import 'package:firstapp/resources/UrlResources.dart';
import 'package:firstapp/ui/auth/LoginScreen.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:form_field_validator/form_field_validator.dart';
import 'package:http/http.dart' as http;

class RegisterScreen extends StatefulWidget {

@override
State<RegisterScreen> createState() => _RegisterScreenState();
}

class _RegisterScreenState extends State<RegisterScreen> {

final formkey = GlobalKey<FormState>();

TextEditingController _name = TextEditingController();
TextEditingController _contact = TextEditingController();
TextEditingController _email = TextEditingController();
TextEditingController _password = TextEditingController();

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// title: Text('Registeration Activity'),
),
body: SingleChildScrollView(
child: Column(
children: [
Card(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Form(
key: formkey,
autovalidateMode: AutovalidateMode.always,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
alignment: Alignment.center,
child: CircleAvatar(
backgroundColor: AppColors.primarycol,
backgroundImage: AssetImage('img/plant.png'),
radius: 50.0,
)
),

⎗
✓
                  SizedBox(height: 20.0,),
                  Center(
                    child:
                    Text("Register Here",style: TextStyle(letterSpacing: 1.0, color: AppColors.primarycol,fontSize: 30.0,fontWeight: FontWeight.normal),),
                  ),


                                  SizedBox(height: 20.0,),
                                  // Text("Name",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
                                  TextFormField(
                                    controller: _name,
                                    keyboardType: TextInputType.text,
                                      decoration: InputDecoration(
                                          border: OutlineInputBorder(),
                                          labelText: 'Name',
                                          hintText: 'Enter Name'),
                                    validator: (val)
                                    {
                                      if(val.length<=0)
                                        {
                                          return "Please Enter Name";
                                        }
                                      return null;
                                    },

                                  ),

                                  SizedBox(height: 20.0,),
                                  // Text("Contatct Number",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
                                  TextFormField(
                                    controller: _contact,
                                    keyboardType: TextInputType.phone,
                                      decoration: InputDecoration(
                                          border: OutlineInputBorder(),
                                          labelText: 'Mobile Number',
                                          hintText: 'Enter 10 digit contact number'),
                                    validator: (val)
                                    {
                                      if(val.length<=0)
                                        {
                                          return "Please enter Mobile Number";
                                        }
                                      else if(val.length!=10)
                                        {
                                          return "please enter valid mobile number";
                                        }
                                      return null;
                                    },
                                  ),

                                  SizedBox(height: 20.0,),
                                  // Text("Email ID",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
                                  // TextField(
                                  //   controller: _email,
                                  //   keyboardType: TextInputType.emailAddress,
                                  //     decoration: InputDecoration(
                                  //         border: OutlineInputBorder(),
                                  //         labelText: 'Email ID',
                                  //         hintText: 'Enter Email Id')
                                  //
                                  // ),
                                  TextFormField(
                                      controller: _email,
                                      keyboardType: TextInputType.emailAddress,
                                      decoration: InputDecoration(
                                          border: OutlineInputBorder(),
                                          labelText: 'Email ID',
                                          hintText: 'Enter Email Id'),
                                      validator: (val){
                                        const pattern = r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$';
                                        final regExp = RegExp(pattern);
                                        if(val.length<=0)
                                        {
                                          return "Please Enter Email";
                                        }
                                        else if(!regExp.hasMatch(val))
                                        {
                                          return "Please Enter Valid Email ID";
                                        }
                                        return null;
                                      },

                                  ),


                                  SizedBox(height: 20.0,),
                                  // Text("Password",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
                                  // TextField(
                                  //   controller: _password,
                                  //   keyboardType: TextInputType.text,
                                  //   obscureText: true,
                                  //     decoration: InputDecoration(
                                  //         border: OutlineInputBorder(),
                                  //         labelText: 'Password',
                                  //         hintText: 'Enter password')
                                  //
                                  // ),
                                  TextFormField(
                                    controller: _password,
                                    keyboardType: TextInputType.text,
                                    obscureText: true,
                                      decoration: InputDecoration(
                                          border: OutlineInputBorder(),
                                          labelText: 'Password',
                                          hintText: 'Enter password'),
                                    validator: (val){
                                      if(val.length<=0)
                                      {
                                        return "Please Enter Password";
                                      }
                                      else if(val.length<8)
                                      {
                                        return "Password Must be of minimum 8 characters";
                                      }
                                      return null;
                                    },
                                  ),


                                  SizedBox(height: 20.0),
                                  GestureDetector(
                                    onTap: () async{

                                     if(formkey.currentState.validate())
                                       {
                                         var name = _name.text.toString();
                                         var email = _email.text.toString();
                                         var contact = _contact.text.toString();
                                         var password = _password.text.toString();

                                         Map<String,String> params={
                                           "name":name,
                                           "email":email,
                                           "contact":contact,
                                           "password":password
                                         };

                                         Uri url = Uri.parse(UrlResources.REGISTER);
                                         var response = await http.post(url,body: params);

                                         if(response.statusCode==200)
                                         {
                                           var body = response.body.toString();
                                           if(body=="yes")
                                           {
                                             print("Register Successfully!");
                                             Fluttertoast.showToast(
                                                 msg: "Register Successfully!",
                                                 toastLength: Toast.LENGTH_SHORT,
                                                 gravity: ToastGravity.BOTTOM,
                                                 timeInSecForIosWeb: 1,
                                                 backgroundColor: Colors.green,
                                                 textColor: Colors.white,
                                                 fontSize: 16.0);
                                             Navigator.of(context).pop();
                                             Navigator.of(context).push(MaterialPageRoute(
                                                 builder: (context) => LoginScreen()));
                                           }
                                           else
                                           {
                                             print("Register Error");
                                           }
                                         }
                                       }


                                      // Uri url = Uri.parse("http://192.168.137.1/api/demo.php");
                                      // var response = await http.get(url);
                                      // if(response.statusCode==200)
                                      //   {
                                      //     var body = response.body.toString();
                                      //     print("Result : "+body);
                                      //   }
                                      // else
                                      //   {
                                      //     print("API Error");
                                      //   }
                                      //200 ok 400 api not found 500 server error
                                    },
                                    child: Container(
                                      // width: MediaQuery.of(context).size.width,
                                      height: 60.0,
                                      // color: Colors.purple,
                                      alignment: Alignment.center,
                                      decoration: BoxDecoration(
                                        // color: Colors.blue, borderRadius: BorderRadius.circular(20)
                                          color: const Color(0xff145A32), borderRadius: BorderRadius.circular(20)
                                      ),
                                      // height: 50,
                                      // width: 250,
                                      child: Text("Register",style: TextStyle(color: Colors.white)),
                                    ),
                                  )
                ],
              ),
            ),
          ),
        )
      ],
    ),
  ),
);

}
}

dotted_decoration:

Container(
width: 300,
height: 150,
decoration: DottedDecoration(
shape: Shape.box,
borderRadius: BorderRadius.circular(10),
),

⎗
✓
  // decoration: BoxDecoration(
  //   //color: Colors.black12,
  //   // border: Border.all(
  //   //   color: Colors.black12,
  //   //   width: 1,
  //   //
  //   // ),
  //
  //  // borderRadius: BorderRadius.circular(4),
  //
  //
  // ),
   child: (
   Column(
     children: [
       Padding(
         padding: const EdgeInsets.only(left: 8.0),
         child: Text(venue,style: TextStyle(
             color: Colors.black54,
             fontSize: 16.0,
             fontWeight: FontWeight.w400,
             letterSpacing: 1.0
         ),),
       ),
       Padding(
         padding: const EdgeInsets.only(left: 8.0),
         child: Text(address,style: TextStyle(
             color: Colors.black54,
             fontSize: 16.0,
             fontWeight: FontWeight.w400,
             letterSpacing: 1.0
         ),),
       ),
       Padding(
         padding: const EdgeInsets.only(left: 8.0),
         child: Text(cityname+" , "+pincode,style: TextStyle(
             color: Colors.black54,
             fontSize: 16.0,
             fontWeight: FontWeight.w400,
             letterSpacing: 1.0
         ),),
       ),
     ],
   )
   ),


),

<?php
header('Access-Control-Allow-Origin: *');

⎗
✓
include 'connection.php';

$response=array();

$id=$_POST['id'];
$oid=$_POST['oid'];
// $result=mysqli_query($con,"select i.*,o.*,p.* from items as i 
// left join orders as o on o.orderid=i.orderid
// left join product as p on p.productid=i.productid
// where i.orderid = o.orderid and i.productid=p.productid and o.orderid=33");

$result=mysqli_query($con,"SELECT i.*,o.*,p.* FROM `items` as i LEFT JOIN orders AS o ON o.orderid = i.orderid LEFT JOIN product AS p ON p.productid = i.productid WHERE i.orderid = o.orderid and i.productid=p.productid and i.orderid='$oid' and o.userid='$id';");


// $result=mysqli_query($con,"select i.*,o.*,p.* from items as i,product as p,orders as o where i.orderid = o.orderid and i.productid=p.productid and i.orderid=33");

while($row=mysqli_fetch_assoc($result))
{
    $response[]=$row;
}
echo json_encode($response);

?>

SELECT i.,o.,p.* FROM items as i,product as p,orders as o WHERE i.orderid = o.orderid and i.productid=p.productid and i.orderid=33;

<?php
header('Access-Control-Allow-Origin: *');

⎗
✓
include 'connection.php';

$response=array();

$id=$_POST['id'];
$oid=$_POST['oid'];
$result=mysqli_query($con,"select i.*,o.*,p.* from items as i,product as p,orders as o where i.orderid = o.orderid and i.productid=p.productid and i.orderid='$oid' and o.userid='$id'");

while($row=mysqli_fetch_assoc($result))
{
    $response=$row;
}
echo json_encode($response);

?>

H6CrPdPQ

Edit

Pub: 05 Dec 2022 11:48 UTC

Edit: 01 Apr 2023 06:35 UTC

Views: 104