Commit f2ae26da authored by Ehsan Fakhraie's avatar Ehsan Fakhraie

Multiple Files Upload

parent a465348a
This diff is collapsed.
......@@ -5,6 +5,13 @@ $password = "admin";
$dbname = "profile_manager";
//serverInfo
//$servername = "localhost";
//$username = "bookieir_profile";
//$password = "_RV!zie6D@6j";
//$dbname = "bookieir_profiles";
//classes
class User
{
......
<?php
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
*{
direction: rtl;
font-family: 'IranianSansRegular';
font-weight: bold;
text-align: right;
}
video {
width: 100%;
height: auto;
}
#form_border{
padding: 50px;
border-radius: 20px;
......@@ -52,14 +56,10 @@ video {
border-color: #f1b439
}
*{
text-align: right;
font-family:'IRANSans';
}
input{
text-align: left;
}
#sp-line{
.sp-line{
height:1px;
color: #f1b439;
border: hidden;
......@@ -70,6 +70,10 @@ input{
height: 30px;
font-size: 20px;
}
.progress-bar{
height: 30px;
font-size: 20px;
}
#file-container{
display: none;
}
......@@ -93,3 +97,80 @@ input[type="file"] {
color: white;
height: 40px;
}
.box{
background: #f1b439;
padding: 10px;
text-align: center;
margin: 0 auto;
font-family: "B Titr";
}
#form1{
display: block;
}
#form2{
display: none;
}
#form1_button{
background: #f1b439;
border:solid white 0px;
}
#form2_button{
background: grey;
border:solid white 5px;
}
select {
-webkit-appearance: button;
-moz-appearance: button;
-webkit-user-select: none;
-moz-user-select: none;
-webkit-padding-end: 20px;
-moz-padding-end: 20px;
-webkit-padding-start: 2px;
-moz-padding-start: 2px;
background-position: center right;
background-repeat: no-repeat;
border: 1px solid #AAA;
border-radius: 2px;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
color: #555;
font-size: inherit;
margin: 0;
overflow: hidden;
padding-top: 2px;
padding-bottom: 2px;
text-overflow: ellipsis;
white-space: nowrap;
}
#adder{
width: 30px;
height: 30px;
text-align: center;
padding: 6px 0;
font-size: 12px;
line-height: 1.42;
border-radius: 15px;
background: green;
}
#remover{
width: 30px;
height: 30px;
text-align: center;
padding: 6px 0;
font-size: 12px;
line-height: 1.42;
border-radius: 15px;
background: green;
}
.green-btn {
background-color: green;border-color: green;width: 100%;
font-size: larger;
}
#next_button:disabled #previous_button:disabled{
background-color: gray;
}
......@@ -2,6 +2,7 @@
include "../components/functions.php";
include "../components/database/db.php";
session_start();
if(isset($_SESSION["id"]))
$user=getUser($_SESSION["id"]);
if(!$_SESSION["loggedIn"]){
header("location:login.php");
......@@ -70,7 +71,7 @@ if(!$_SESSION["loggedIn"]){
<label for="file1" class="custom-file-upload" id="upload-btn">
آپلود فیلم
</label>
<input id="file1" type="file" onchange="uploadFile()"/>
<input id="file1" type="file" onchange="uploadMovie()"/>
</div>
......
<?php
include "../components/functions.php";
include "../components/database/db.php";
//session_start();
//$user=getUser($_SESSION["id"]);
//if(!$_SESSION["loggedIn"]){
// header("location:login.php");
//
//}else if(isset($_POST["postalCode"])){
// $user->nationalCode=$_POST["nationalCode"];
// $user->address=$_POST["address"];
// if(isset($_SESSION["uploadedVideo"])){
// $movie= new Movie();
// $movie->file=$_SESSION["uploadedVideo"];
// $movie->creator=$user->id;
// $id=insertMovie($movie);
// if($id!=0){
// $user->movies=$id;
// insertUser($user);
// header("location:uploadSuccessful.php");
// }else{
// echo "error";
// exit();
// }
// }else{
// echo "error";
// exit();
// }
// echo "s";
//}else
if(isset($_FILES['myfile'])){
// form submit
$files = $_FILES['myfile'];
$fn = $files['name'];
move_uploaded_file(
$files['tmp_name'],
'../uploads/' . $fn
);
echo "../uploads/$fn";
//echo "<p>فایل با موفقیت آپلود شد.</p>";
$_SESSION["uploadedVideo"]=$fn;
exit();
}
?>
<!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" method="post" action="upload.php">
<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 class="row" 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 STYLE="text-align: right;" value="<?php
if(isset($user->name))
echo $user->name;
?>">
</div>
<div class="form-group">
<label for="phone">شماره موبایل</label>
<input type="text" class="form-control rounded-pill" id="phone" aria-describedby="mcErr" disabled value="<?php
if(isset($user->phone))
echo $user->phone;
?>">
</div>
<div class="form-group">
<label for="mc">کدملی</label>
<input type="text" class="form-control rounded-pill" id="nationalCode" name="nationalCode" 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" name="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" name="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="postalCode" name="postalCode" 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="button" ID="submitBtn" class="btn btn-primary rounded-pill pb-2" style="background-color: green;border-color: green;width: 100%" onclick="sendData()">ارسال</button>
</form>
</div>
</div>
</div>
</div>
<script src="script/uploadVideo.js"></script>
</body>
</html>
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment