Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landlord khatam #74

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .next/trace

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions config/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
let config = {
MONGO_URL:
"mongodb+srv://admin:[email protected]/myFirstDatabase?retryWrites=true&w=majority",
MONGO_URL: `mongodb+srv://Anuj:[email protected]/test`,
DB_CONNECTION_RETTEMPT_LIMIT_NODE: 5,
SECRET_KEY: "jksdo",
};
Expand Down
12 changes: 7 additions & 5 deletions pages/auth/LandlordSignin.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Lsignin() {
router.push(redirect || "/profile/landlord");
} catch (err) {
console.log(err);
enqueueSnackbar(err.response?.data?.message, { variant: "error" });
// enqueueSnackbar(err.response?.data?.message, { variant: "error" });
}
};
return (
Expand All @@ -79,9 +79,11 @@ function Lsignin() {
/>
<section className="sign-in">
<div className="container pr_container prj">
<div className="fish1">
<Image src={Home_fill} alt="sub" />
</div>
<Link href="/homepage/HomePage">
<div className="fish1">
<Image src={Home_fill} alt="sub" />
</div>
</Link>
<div className="fishes1">
<Image src={Ellipse47} alt="sub" />
</div>
Expand Down Expand Up @@ -140,7 +142,7 @@ function Lsignin() {
Remember Me
</label>
</div>
<div className="form-group pr_form-group form-button pr_form-button">
<div className="form-group form-button pr_form-button">
<button
type="submit"
name="signin"
Expand Down
51 changes: 42 additions & 9 deletions pages/auth/LandlordSignup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import Landlord from "../../public/images/Landlord.png";
import Home_fill from "../../public/images/Home_fill.png";
import Ellipse47 from "../../public/images/Ellipse47.png";
Expand Down Expand Up @@ -44,7 +45,11 @@ function Lsignup() {

const onSubmit = (e) => {
e.preventDefault();
submitHandler(details);
if (!details.contact.match(`[0-9]{10}`)) {
alert("Please provide valid phone number");
} else {
submitHandler(details);
}
};

if (state.userInfo) {
Expand Down Expand Up @@ -83,9 +88,11 @@ function Lsignup() {
/>
<section className="signup">
<div className="container pr_container praj">
<div className="fish">
<Image src={Home_fill} alt="sub" />
</div>
<Link href="/homepage/HomePage">
<div className="fish">
<Image src={Home_fill} alt="sub" />
</div>
</Link>
<div className="fishes">
<Image src={Ellipse47} alt="sub" />
</div>
Expand All @@ -110,6 +117,32 @@ function Lsignup() {
placeholder="Your Name"
/>
</div>
<div className="form-group pr_form-group">
<label htmlFor="email">
<i className="fas fa-envelope"></i>
</label>
<input
className="pa_input"
type="text"
name="email"
id="email"
onChange={(e) => onChange(e)}
placeholder="Your Email"
/>
</div>
<div className="form-group pr_form-group">
<label htmlFor="name">
<i className="fas fa-phone-square-alt"></i>
</label>
<input
className="pa_input"
type="number"
name="contact"
id="contact"
onChange={(e) => onChange(e)}
placeholder="Your Contact"
/>
</div>
{/* <div className="form-group pr_form-group">
<label htmlFor="email">
<i className="fas fa-envelope"></i>
Expand All @@ -123,7 +156,7 @@ function Lsignup() {
placeholder="Your Last Name"
/>
</div> */}
<div className="form-group pr_form-group">
{/* <div className="form-group pr_form-group">
<label className="pr_label" htmlFor="email">
<i className="fas fa-envelope"></i>
</label>
Expand All @@ -135,8 +168,8 @@ function Lsignup() {
onChange={(e) => onChange(e)}
placeholder="Your Email"
/>
</div>
<div className="form-group pr_form-group">
</div> */}
{/* <div className="form-group pr_form-group">
<label className="pr_label" htmlFor="contact">
<i className="fas fa-phone-square-alt"></i>
</label>
Expand All @@ -148,7 +181,7 @@ function Lsignup() {
onChange={(e) => onChange(e)}
placeholder="Your Contact"
/>
</div>
</div> */}

{/* <div className="form-group pr_form-group">
<label htmlFor="contact">
Expand Down Expand Up @@ -202,7 +235,7 @@ function Lsignup() {
</a>
</label>
</div>
<div className="form-group pr_form-group form-button pr_form-button">
<div className="form-group form-button pr_form-button">
<button
type="submit"
onClick={(e) => onSubmit(e)}
Expand Down
1 change: 1 addition & 0 deletions pages/charges/components/HorizontalInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function HorizontalInput(props) {
</label>
<div className="col-sm-10">
<input
style={{ width: "40%" }}
type="number"
className="form-control"
id="inputEmail3"
Expand Down
30 changes: 26 additions & 4 deletions pages/charges/generateCharges.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function GenerateCharges() {
if (charges_param[data].fixed) {
tempCharges[data] = charges_param[data].value;
} else {
tempCharges[data] = 0;
tempCharges[data] = -1;
}
setDescription(tempCharges);
});
Expand All @@ -85,9 +85,10 @@ export default function GenerateCharges() {
authorization: "b " + JSON.parse(Cookies.get("userInfo")).data.token,
},
};
console.log(state.siteDetail);
var details = {
site_id: state.siteDetail?._id,
tenant_id: state.siteDetail?.current_tenant[0]?._id,
tenant_id: state.siteDetail?.tenantsDetails[0]?._id,
description,
};
console.log(details);
Expand All @@ -97,7 +98,7 @@ export default function GenerateCharges() {
"/api/charges",
{
site_id: state.siteDetail?._id,
tenant_id: state.siteDetail?.current_tenant[0]?._id,
tenant_id: state.siteDetail?.tenantsDetails[0]?._id,
description,
},
config
Expand All @@ -119,7 +120,28 @@ export default function GenerateCharges() {
};

const submitHandler = () => {
generateSiteCharges();
var correct = 0;
var total = 0;
Object.keys(description ? description : {}).map((data, index) => {
total++;
console.log(description[data] + " " + data);
if (description[data].fixed) {
correct++;
} else {
if (description[data] == -1) {
alert("Enter the value for the field " + data);
return;
} else if (description[data] < 0 || description[data] > 1000000) {
alert("Please enter valid value for " + data);
return;
} else {
correct++;
}
}
});
if (correct == total) {
generateSiteCharges();
}
};

return (
Expand Down
1 change: 1 addition & 0 deletions pages/createSite/components/HorizontalInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function HorizontalInput(props) {
name={props.name}
onChange={props.onChange}
defaultValue={props.name == "country" ? "India" : ""}
required
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions pages/editProfile2/components/EditBirthday.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function EditBirthday(props) {
name="date"
className="form-select form-select-sm"
aria-label="form-select"
style={{ width: "80px" }}
style={{ width: "100px" }}
onChange={onChange}
>
{runCallback(() => {
Expand Down Expand Up @@ -126,7 +126,7 @@ function EditBirthday(props) {
name="year"
className="form-select form-select-sm"
aria-label="form-select"
style={{ width: "80px" }}
style={{ width: "100px" }}
onChange={onChange}
>
{runCallback(() => {
Expand Down
67 changes: 36 additions & 31 deletions pages/landing/components/RentersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,42 @@ const RentersList = (props) => {
</tr>
</thead>
<tbody>
{props.historyDetail && props.historyDetail.map((hist, index) => {
console.log(hist)
return (
<tr key={index}>
{/* after populate completed */}
<td scope="row">{props.tenantsDetail[index].firstName}</td>
<td>
{hist.joined_at ? (
<Moment format="MMMM Do YYYY">
{hist.joined_at}
</Moment>
) : (
hist.rejected_at? "Rejected": "Requested"
)}{" "}
</td>
<td>
{hist.rejected_at ? "Rejected" : (hist.joined_at
? (hist.left_at
? <Moment format="MMMM Do YYYY">
{hist.left_at}
</Moment>
: "Presently Living")
: "Requested")}
</td>
<td>{props.rent}</td>
<td>
<i className="fas fa-rupee-sign"></i> {props.deposit}
</td>
</tr>
)
})}
{props.historyDetail &&
props.historyDetail.map((hist, index) => {
console.log(hist);
return (
<tr key={index}>
{/* after populate completed */}
<td scope="row">{props.tenantsDetail[index]?.firstName}</td>
<td>
{hist.joined_at ? (
<Moment format="MMMM Do YYYY">{hist.joined_at}</Moment>
) : hist.rejected_at ? (
"Rejected"
) : (
"Requested"
)}{" "}
</td>
<td>
{hist.rejected_at ? (
"Rejected"
) : hist.joined_at ? (
hist.left_at ? (
<Moment format="MMMM Do YYYY">{hist.left_at}</Moment>
) : (
"Presently Living"
)
) : (
"Requested"
)}
</td>
<td>{props.rent}</td>
<td>
<i className="fas fa-rupee-sign"></i> {props.deposit}
</td>
</tr>
);
})}
</tbody>
</table>
</div>
Expand Down
Loading