Design razor view pages

I will design mvc razor view page

Simple layout

Admin Lte Layout

    Admin

    User

    Multiusers

https://www.fiverr.com/share/RBvPal

Removing Blemishes

Steps:
1. Removing blemishes is a great place to start skin retouching 2. Create a new layer 3. Select “Spot Healing Brush” tool 4. Click on “Sample All Layers” 5. Choose “Content-Aware” option 6. "Zoom In" so you can clearly see blemishes 7. Press the Right Mouse Button 8. Choose a “brush size” little larger than the blemish 9. Decrease the “Hardness” to get smoother blending 10. Now click over the blemish to remove it 11. You can also change the “brush size” with braces “]" 'Increase' "[" ' Decrease'

https://www.youtube.com/watch?v=uPR7AO2mE5A

Admin Page in PHP

<html>
<head>
 <meta charset="UTF-8">
  <meta name="author" content="Muhammad Yasir">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="admin.css">
  <title>Admin</title>
</head>
<body>

<form method="post" action="admin.php">
<table>
<tbody>
<tr>
<td>User Name:</td>
<td><input type="text" name="name" placeholder="Enter your User ID"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" placeholder="Enter your Password"></td>
</tr>
<tr align="right">
<td>
<button type="submit" name="submit" class="btn">LOGIN</button>
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>


<?php
 include('admin.php');
if(isset($_POST['submit'])){
$name = $_POST['name'];
$password = $_POST['password'];

$querry = "SELECT * FROM login WHERE name='$name' AND password='$password'";
$run = mysqli_query($db,$querry);
$ret=mysqli_num_rows($run);
if($ret == true)
{
echo "<script>window.open('index.php','_self')</script>";
}
else
{
echo "<script>alert('Wrong Login Details, Try Again!')</script>";
}

}


?>



SQL DATABASE

<?php

$db=mysqli_connect('localhost','root','','erp');
?>
CSS FILE
body
{
font-size:19px;
}

table{
width:70%;
margin:30px auto;
border-collapse:collapse;
text-align:left;

}
tr
{
border-bottom:6px solid #cbcbcb;
}
th
{
border:5px;
height:20px;
padding:5px;
}

td
{
border:none;
height:20px;
padding:2px;
}
tr:hover
{
background:#F5F5F5;
}
form
{
width:45%;
margin:50px auto;
text-align:left;
padding:20px;
border:3px solid #bbbbbb;
border-radius:5px;
background-color:yellow;
}




HTML,CSS and PHP Code for Insert, Delete and Update Querris

First file that save in Name of insertdelupdate.php
<?php
 include('server.php');
if(isset($_GET['edit']))
{
$id=$_GET['edit'];
$edit_state=true;
$rec = mysqli_query($db,"SELECT * FROM info where id=$id");
$record=mysqli_fetch_array($rec);
$name=$record['name'];
$address=$record['address'];
$id=$record['id'];

}
 ?>

<html>
<head>
<title>Insert, Update, Delete Demo</title>
<link rel="stylesheet" href="insertdelupadate.css">
</head>
<body>
<?php if(isset($_SESSION['msg'])): ?>
<div class="msg">
<?php
echo $_SESSION['msg'];
unset($_SESSION['msg']);
?>
</div>
<?php endif ?>

<table>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<?php while($row=mysqli_fetch_array($result))
{ ?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['address']; ?></td>
<td><a href="insertdelupdate.php?edit=<?php echo $row['id']; ?> ">Edit</a></td>
<td><a href="server.php?del=<?php echo $row['id'];?>">Delete</a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<form method="post" action="server.php">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<div class="input-group">
<label>Name</label>
<input type="text" name="name" value="<?php echo $name; ?>">
</div>
<div class="input-group">
<label>Address</label>
<input type="text" name="address" value="<?php echo $address; ?>">
</div>
<div class="input-group">
<?php if($edit_state==false): ?>
<button type="submit" name="save"  class="btn">Save</button>
<?php else: ?>
<button type="submit" name="Update"  class="btn">Update</button>
<?php endif ?>
</div>
</form>
</body>
</html>

Second file save name of server.php

<?php
session_start();
$name="";
$address="";
$id=0;
$edit_state=false;
$db=mysqli_connect('localhost','root','','insertdelupdate');
if(isset($_POST['save']))
{
$name=$_POST['name'];
$address=$_POST['address'];
//insert recod
$query = "INSERT INTO info (name,address) VALUES ('$name','$address')";
mysqli_query($db, $query);
$_SESSION['msg']="Data is Inseted";
header('location:insertdelupdate.php');//redirect to page

}
//update Record
if(isset($_POST['Update']))
{
$name=mysqli_real_escape_string($db,$_POST['name']);
$address=mysqli_real_escape_string($db,$_POST['address']);
$id=mysqli_real_escape_string($db,$_POST['id']);
mysqli_query($db,"UPDATE info SET name='$name',address='$address' WHERE id=$id");
$_SESSION['msg']="Data is updated";
header('location:insertdelupdate.php');//redirect to page

}
//Delete Record
if(isset($_GET['del']))
{
$id=$_GET['del'];
mysqli_query($db,"DELETE FROM info where id=$id");
$_SESSION['msg']="Data is Deleted";
header('location:insertdelupdate.php');

}
//Retrive Record
$result = mysqli_query($db,"SELECT *FROM info");
//redirect to page


?>


css file
body
{
font-size:19px;
}
table{
width:50%;
margin:30px auto;
border-collapse:collapse;
text-align:left;
}
tr
{
border-bottom:1px solid #cbcbcb;
}
th,td
{
border:none;
height:20px;
padding:2px;
}
tr:hover
{
background:#F5F5F5;
}
form
{
width:45%;
margin:50px auto;
text-align:left;
padding:20px;
border:1px solid #bbbbbb;
border-radius:5px;
}
.msg
{
width:45%;
margin:50px auto;
text-align:left;
padding:20px;
border:1px solid #bbbbbb;
border-radius:5px;


}

Inset, Delete and Update in PHP

Coding of Calculator in C++ using Class

#include<iostream>
#include<conio>
class calc
{
public:
void add()
{
int a,b,c;
cout<<"enter the values"<<endl;
cin>>a>>b;
c=a+b;
cout<<"result is "<<c<<endl;
}
void sub()
{
int aa,bb,cc;
cout<<"enter the values"<<endl;
cin>>aa,bb;
cc=aa-bb;
cout<<"result is "<<cc<<endl;
}
void mul()
{
int aaa,bbb,ccc;
cout<<"enter the values"<<endl;
cin>>aaa>>bbb;
ccc=aaa*bbb;
cout<<"result is "<<ccc<<endl;
}
};
main()
{
calc q;
char ch;
cout<<"enter the choice"<<endl;
cin>>ch;
switch(ch)
{
case 'A':
q.add();
break;
case 'S':
q.sub();
break;
case'M':
q.mul();
break;
default:
cout<<"invalid input"<<endl;
}
getch();
}
Calculator in C++ using Class

Total Pageviews