Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Profile Manager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ehsan Fakhraie
Profile Manager
Commits
6267e053
Commit
6267e053
authored
Jan 20, 2020
by
Ehsan Fakhraie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C
parent
8eea1857
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
205 additions
and
15 deletions
+205
-15
login.php
pages/login.php
+1
-4
ChangeNumbers.min.js
pages/script/ChangeNumbers.min.js
+0
-11
uploadVideo.js
pages/script/uploadVideo.js
+94
-0
upload.php
pages/upload.php
+110
-0
No files found.
pages/login.php
View file @
6267e053
...
...
@@ -6,13 +6,10 @@ include "../components/functions.php";
<
!
DOCTYPE
>
<html>
<head>
<link
rel=
'stylesheet'
href=
'style.css'
>
<?php
echo
css_include
();
?>
<?php
echo
script_include
();
?>
</head>
...
...
pages/script/ChangeNumbers.min.js
deleted
100644 → 0
View file @
8eea1857
/**
*
* @Name : ChangeNumbers.js
* @Version : 1.0
* @Programmer : Max
* @Date : 2018-06-24
* @Released under : https://github.com/BaseMax/ChangeNumbersJs/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/ChangeNumbersJs
*
**/
!
function
(
r
,
e
){
"use strict"
;
var
s
=
[
"۰"
,
"۱"
,
"۲"
,
"۳"
,
"۴"
,
"۵"
,
"۶"
,
"۷"
,
"۸"
,
"۹"
],
l
=
[
"٠"
,
"١"
,
"٢"
,
"٣"
,
"٤"
,
"٥"
,
"٦"
,
"٧"
,
"٨"
,
"٩"
],
h
=
[
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
],
t
=
function
(
e
,
r
,
a
){
if
(
"fa"
==
r
||
"pa"
==
r
||
"en"
==
r
||
"ar"
==
r
||
"fa"
==
a
||
"pa"
==
a
||
"en"
==
a
||
"ar"
==
a
){
var
n
,
t
;
"fa"
==
r
?
t
=
s
:
"pa"
==
r
?
t
=
s
:
"ar"
==
r
?
t
=
l
:
"en"
==
r
&&
(
t
=
h
),
"fa"
==
a
?
n
=
s
:
"pa"
==
a
?
n
=
s
:
"ar"
==
a
?
n
=
l
:
"en"
==
a
&&
(
n
=
h
);
for
(
var
c
=
0
;
c
<
n
.
length
;
c
++
)
u
=
e
,
f
=
t
[
c
],
i
=
n
[
c
],
o
=
void
0
,
e
=
u
.
replace
(
new
RegExp
(
f
.
replace
(
/
([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])
/g
,
"
\\
$&"
),
o
?
"gi"
:
"g"
),
"string"
==
typeof
i
?
i
.
replace
(
/
\$
/g
,
"$$$$"
):
i
)}
var
u
,
f
,
i
,
o
;
return
e
},
c
=
function
(
e
,
r
){
return
"fa"
==
r
||
"pa"
==
r
?(
e
=
t
(
e
,
"ar"
,
r
),
e
=
t
(
e
,
"en"
,
r
)):
"ar"
==
r
?(
e
=
t
(
e
,
"fa"
,
r
),
e
=
t
(
e
,
"en"
,
r
)):
"en"
==
r
&&
(
e
=
t
(
e
,
"fa"
,
r
),
e
=
t
(
e
,
"ar"
,
r
)),
e
};
r
.
numbers
=
{
checks
:
function
(
e
,
r
){
var
a
=
e
.
innerHTML
;
if
(
e
.
hasAttribute
(
"data-number-from"
)
&&
"auto"
!=
e
.
getAttribute
(
"data-number-from"
)){
var
n
=
e
.
getAttribute
(
"data-number-from"
);
a
=
t
(
a
,
n
,
r
)}
else
a
=
c
(
a
,
r
);
e
.
innerHTML
=
a
},
check
:
c
,
check_from
:
t
,
persian
:
s
,
arabic
:
l
,
english
:
h
},
r
.
addEventListener
(
"load"
,
function
(){
e
.
querySelectorAll
(
"[data-number-target=fa]"
).
forEach
(
function
(
e
){
r
.
numbers
.
checks
(
this
,
"fa"
)}),
e
.
querySelectorAll
(
"[data-number-target=en]"
).
forEach
(
function
(
e
){
r
.
numbers
.
checks
(
this
,
"en"
)}),
e
.
querySelectorAll
(
"[data-number-target=ar]"
).
forEach
(
function
(
e
){
r
.
numbers
.
checks
(
this
,
"ar"
)})},
!
1
)}(
window
,
document
)
pages/script/uploadVideo.js
0 → 100644
View file @
6267e053
function
_
(
el
)
{
return
document
.
getElementById
(
el
);
}
function
getExtension
(
filename
)
{
var
parts
=
filename
.
split
(
'.'
);
return
parts
[
parts
.
length
-
1
];
}
function
isVideo
(
filename
)
{
var
ext
=
getExtension
(
filename
);
switch
(
ext
.
toLowerCase
())
{
case
'm4v'
:
case
'avi'
:
case
'mpg'
:
case
'mp4'
:
return
true
;
}
return
false
;
}
function
uploadFile
()
{
var
file
=
_
(
"file1"
).
files
[
0
];
// alert(file.name+" | "+file.size+" | "+file.type);
var
error
=
""
;
if
(
file
.
size
>=
100000000
){
error
+=
"حجم فایل نامناسب است."
}
if
(
!
isVideo
(
file
.
name
)){
error
+=
"نوع فایل باید ویدیو باشد."
}
if
(
error
!==
""
){
_
(
"status"
).
innerHTML
=
error
;
}
else
{
_
(
"file-input"
).
style
.
display
=
"none"
;
_
(
"upload-btn"
).
style
.
display
=
"none"
;
_
(
"file-container"
).
style
.
display
=
"block"
;
var
formdata
=
new
FormData
();
formdata
.
append
(
"myfile"
,
file
);
var
ajax
=
new
XMLHttpRequest
();
ajax
.
upload
.
addEventListener
(
"progress"
,
progressHandler
,
false
);
ajax
.
addEventListener
(
"load"
,
completeHandler
,
false
);
ajax
.
addEventListener
(
"error"
,
errorHandler
,
false
);
ajax
.
addEventListener
(
"abort"
,
abortHandler
,
false
);
ajax
.
open
(
"POST"
,
"../videoTest/upload.php"
);
// http://www.developphp.com/video/JavaScript/File-Upload-Progress-Bar-Meter-Tutorial-Ajax-PHP
//use file_upload_parser.php from above url
ajax
.
send
(
formdata
);
}
}
function
progressHandler
(
event
)
{
var
percent
=
(
event
.
loaded
/
event
.
total
)
*
100
;
// _("progressBar").setAttribute("aria-valuenow",""+Math.round(percent));
var
current_progress
=
Math
.
round
(
percent
);
$
(
"#dynamic"
)
.
css
(
"width"
,
current_progress
+
"%"
)
.
attr
(
"aria-valuenow"
,
current_progress
)
.
text
(
current_progress
.
toString
().
toPersianDigit
()
+
" %"
);
//$("#dynamic").attr("aria-valuenow", Math.round(percent));
//_("progressBar").value = Math.round(percent);
// _("status").innerHTML = Math.round(percent) + "% uploaded... please wait";
}
function
completeHandler
(
event
)
{
_
(
"status"
).
style
.
color
=
"green"
;
_
(
"status"
).
innerHTML
=
event
.
target
.
responseText
;
// _("dynamic").style.display="none";
}
function
errorHandler
(
event
)
{
_
(
"status"
).
innerHTML
=
"در آپلود مشکلی رخ داده."
;
_
(
"file-input"
).
style
.
display
=
"block"
;
_
(
"upload-btn"
).
style
.
display
=
"block"
;
}
function
abortHandler
(
event
)
{
_
(
"status"
).
innerHTML
=
"آپلود لغو شد."
;
_
(
"file-input"
).
style
.
display
=
"block"
;
_
(
"upload-btn"
).
style
.
display
=
"block"
;
}
String
.
prototype
.
toPersianDigit
=
function
()
{
return
this
.
replace
(
/
\d
+/g
,
function
(
digit
)
{
var
ret
=
''
;
for
(
var
i
=
0
,
len
=
digit
.
length
;
i
<
len
;
i
++
)
{
ret
+=
String
.
fromCharCode
(
digit
.
charCodeAt
(
i
)
+
1728
);
}
return
ret
;
});
};
pages/upload.php
0 → 100644
View file @
6267e053
<?php
include
"../components/functions.php"
;
?>
<
!
DOCTYPE
>
<html>
<head>
<?php
echo
css_include
();
echo
script_include
();
?>
</head>
<style>
</style>
<body
>
<div
class=
"container"
>
<div
class=
"flex-container"
>
<div
class=
"container "
id=
"register_container"
>
<form
class=
"border"
id=
"form_border"
>
<div
class=
"form-group py-4"
>
<span
class=
"login_title py-3"
style=
"font-family:'B Titr'"
>
آپلود ویدیو
</span>
</div>
<div
class=
"form-group"
style=
"text-align: center"
id=
"file-input"
>
<label
for=
"exampleFormControlFile1"
>
فایل خود را انتخاب کنید
</label>
<label
for=
"file1"
class=
"custom-file-upload"
id=
"upload-btn"
>
آپلود فیلم
</label>
<input
id=
"file1"
type=
"file"
onchange=
"uploadFile()"
/>
</div>
<div
class=
"flex-container"
id=
"file-container"
>
<div
class=
"form-group"
>
<div
class=
"flex-container"
>
<div
id=
"dynamic"
class=
"progress-bar progress-bar-success progress-bar-striped active"
role=
"progressbar"
aria-valuenow=
"0"
aria-valuemin=
"0"
aria-valuemax=
"100"
style=
"width: 0%"
>
<span
id=
"current-progress"
></span>
</div>
</div>
<br>
</div>
</div>
<div
id=
"status"
style=
"color:red"
></div>
<hr
id=
"sp-line"
>
<div
class=
"form-group"
>
<p
style=
"text-align: center;font-size: 30px"
>
اطلاعات شخصی
</p>
</div>
<div
class=
"form-group"
>
<label
for=
"fullName"
>
نام و نام خانوادگی
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"fullName"
aria-describedby=
"mcErr"
disabled
>
<small
id=
"mcErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"phone"
>
شماره موبایل
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"phone"
aria-describedby=
"mcErr"
disabled
>
<small
id=
"mcErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"mc"
>
کدملی
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"mc"
aria-describedby=
"mcErr"
placeholder=
"0021234567"
>
<small
id=
"mcErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"fixedNumber"
>
تلفن ثابت
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"fixedNumber"
aria-describedby=
"ftErr"
placeholder=
"02122334455"
>
<small
id=
"ftErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"address"
>
آدرس
</label>
<textarea
class=
"form-control"
id=
"address"
rows=
"3"
></textarea>
<small
id=
"addressErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"zip"
>
کدپستی
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"zip"
aria-describedby=
"zipErr"
>
<small
id=
"zipErr"
style=
"color:red"
></small>
</div>
<hr
id=
"sp-line"
>
<div
class=
"form-group"
>
<p
style=
"text-align: center;font-size: 30px"
>
اطلاعات فیلم
</p>
</div>
<div
class=
"form-group"
>
<label
for=
"groupMembers"
>
نام اعضای گروه
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"groupMembers"
aria-describedby=
"gpmErr"
style=
"text-align: right"
>
<small
id=
"gpmErr"
style=
"color:red"
></small>
</div>
<div
class=
"form-group"
>
<label
for=
"movieName"
>
نام فیلم
</label>
<input
type=
"text"
class=
"form-control rounded-pill"
id=
"movieName"
aria-describedby=
"mnErr"
style=
"text-align: right"
>
<small
id=
"mnErr"
style=
"color:red"
></small>
</div>
<button
type=
"submit"
class=
"btn btn-primary rounded-pill pb-2"
style=
"background-color: green;border-color: green;width: 100%"
>
ارسال
</button>
</form>
</div>
</div>
</div>
</div>
<script
src=
"script/uploadVideo.js"
></script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment