-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
142 lines (127 loc) · 5.55 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
if (isset($_COOKIE['TF-Mobile'])){
header('location:user/?c=index&a=index');
}
?>
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<title>کلینیک زیبایی توت فرنگی | ورود به حساب کاربری</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="global_assets/css/login.css" />
<style>
.swal2-styled.swal2-confirm {
background-color: #e12b26!important;
border-radius : 50px!important;
}
</style>
</head>
<body class="img js-fullheight" style="background-image: url(/global_assets/images/bg.jpg)">
<section class="ftco-section">
<div class="container mt-5">
<div class="row justify-content-center align-items-center ">
<div class="col-md-6 col-lg-4">
<div class="login-wrap p-0" >
<!-- <h3 class="mb-4 text-center">حساب کاربری دارید ؟</h3> -->
<form method="post" enctype="multipart/form-data" class="signin-form p-2" >
<div class="form-group">
<input
id="mobile"
type="text"
class="form-control"
placeholder="شماره همراه"
required
/>
</div>
<div class="form-group">
<input
id="password"
type="password"
class="form-control"
placeholder="رمز عبور"
/>
<span
toggle="#password-field"
class="fa fa-fw fa-eye field-icon toggle-password"
></span>
</div>
</form>
<div class="form-group">
<button onclick="login()"
type="submit"
class="form-control btn btn-primary submit px-3"
>
ورود
</button>
<button
type="submit"
class="form-control btn mt-2 btn-outline-primary submit px-3"
>
<a href="/guest.php" >
ورود به عنوان مهمان
</a>
</button>
</div>
<div class="form-group ">
<div class="w-100 mb-0">
<label class="checkbox-wrap checkbox-primary mr-2"
>من را در حساب کاربری وارد نگه دار
<input type="checkbox" checked />
<span class="checkmark"></span>
</label>
</div>
</div>
<p class="w-100 text-center">— سایر گزینه ها —</p>
<div class="social d-flex text-center">
<a href="/register.php" class="px-2 py-2 ml-md-1 rounded"><span class="ion-logo-facebook mr-2"></span> عضویت</a>
<a href="/forgetPassword.php" class="px-2 py-2 mr-md-1 rounded"><span class="ion-logo-twitter mr-2"></span> فراموشی رمز عبور</a>
</div>
</div>
</div>
</div>
</div>
</section>
<script src="global_assets/js/jquery.min.js"></script>
<script src="global_assets/js/popper.js"></script>
<script src="global_assets/js/bootstrap.min.js"></script>
<script src="global_assets/js/main.js"></script>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
async function makeRequest(url, method, body) {
try {
let response = await fetch(url, {
method,
body
})
console.log(response)
let result = await response.json();
return result
} catch(err) {
console.error(err)
}
}
async function login() {
var body = new FormData()
body.append("action", "login")
body.append("mobile", document.getElementById('mobile').value)
body.append("password", document.getElementById('password').value)
let status = await makeRequest(`/app/controllers/api/request_handler.php`, "POST", body)
console.log(status)
if (status.error){
Swal.fire({
title: 'خطا!',
text: `${status.error}`,
icon: 'error',
confirmButtonText: 'متوجه شدم'
})
}
if (status == true){
window.location.href = "/user/login.php";
}
}
</script>
</body>
</html>