D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
dash
/
Filename :
add-image.php
back
Copy
<?php session_start(); include 'config.php'; if($_SESSION['design1'] == ''){ echo "<script>location.replace('index.php')</script>"; } /* Marketing Image Here */ $sqlm = "select * from portofolio where category='Marketing Material'"; $resultm = mysqli_query($conn,$sqlm); while($rowm = mysqli_fetch_assoc($resultm)){ $marketingimg = '<div class="col-md-4"><img src="upload/'.$rowm['image'].'"></div>'; } /* 3d Mockup Image Here */ $sql3 = "select * from portofolio where category='3D Mockups'"; $result3 = mysqli_query($conn,$sql3); while($row3 = mysqli_fetch_assoc($result3)){ $mackupimg = '<div class="col-md-4"><img src="upload/'.$row3['image'].'"></div>'; } /* Explainer Video Image Here */ $sqlex = "select * from portofolio where category='Explainer Video'"; $resultex = mysqli_query($conn,$sqlex); while($rowex = mysqli_fetch_assoc($resultex)){ $videoimg = '<div class="col-md-4"><img src="upload/'.$rowex['image'].'"></div>'; } /* Packaging Designing Image Here */ $sqlpd = "select * from portofolio where category='Packaging Designing'"; $resultpd = mysqli_query($conn,$sqlpd); while($rowpd = mysqli_fetch_assoc($resultpd)){ $designimg = '<div class="col-md-4"><img src="upload/'.$rowpd['image'].'"></div>'; } /* Product Photography Image Here */ $sqlpp = "select * from portofolio where category='Product Photography'"; $resultpp = mysqli_query($conn,$sqlpp); while($rowpp = mysqli_fetch_assoc($resultpp)){ $productphotographyimg = '<div class="col-md-4"><img src="upload/'.$rowpp['image'].'"></div>'; } ?> <!DOCTYPE html> <html lang="zxx"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="robots" content="nofollow,noindex"> <meta name="author" content=""> <link rel="icon" href="assets/img/basic/favicon.ico" type="image/x-icon"> <title>DesignPitara | Admin Panel</title> <!-- CSS --> <link rel="stylesheet" href="assets/css/app.css"> <style> .loader { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background-color: #F5F8FA; z-index: 9998; text-align: center; } .plane-container { position: absolute; top: 50%; left: 50%; } </style> <!-- Js --> <!-- --- Head Part - Use Jquery anywhere at page. --- http://writing.colin-gourlay.com/safely-using-ready-before-including-jquery/ --> <script>(function(w,d,u){w.readyQ=[];w.bindReadyQ=[];function p(x,y){if(x=="ready"){w.bindReadyQ.push(y);}else{w.readyQ.push(x);}};var a={ready:p,bind:p};w.$=w.jQuery=function(f){if(f===d||f===u){return a}else{p(f)}}})(window,document)</script> </head> <body class="light"> <!-- Pre loader --> <div id="loader" class="loader"> <div class="plane-container"> <div class="preloader-wrapper small active"> <div class="spinner-layer spinner-blue"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-red"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-yellow"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-green"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> </div> </div> </div> <div id="app"> <?php include 'left-menu.php'; ?> <!--Sidebar End--> <?php include 'top.php'; ?> <!-- Right Sidebar --> <div class="page has-sidebar-left height-full"> <div class="container-fluid relative animatedParent animateOnce"> <div class="tab-content pb-3" id="v-pills-tabContent"> <div class="card mb-3 shadow no-b r-0 mt-3"> <div class="card-header white"> <h6>Upload Images</h6> </div> <div class="card-body"> <form action="" method="post" enctype="multipart/form-data"> <div class="form-row"> <div class="col-md-12 mb-3"> <label for="validationCustom01">Upload Image</label> <input type="file" class="form-control" name="blog_img" required> </div> </div> <div class="form-row mb-3"> <div class="col-md-6"> <label for="validationCustom01">Category</label> <select class="form-control" name="category" required> <option>Select</option> <option>Logo Design</option> <option>Marketing Material</option> <option>3D Mockups</option> <option>Explainer Video</option> <option>Packaging Designing</option> <option>Product Photography</option> <option>Social Media</option> <option>Advertisements</option> <option>Invitations</option> <option>Hanging Dangler</option> <option>Banners & Posters</option> <option>Photo Manipulation</option> <option>Infographics</option> </select> </div> <div class="col-md-6"> <label>Image Alt</label> <input type="text" class="form-control" name="alt" placeholder="Alt" required> </div> </div> <button class="btn btn-primary" name="import" type="submit">Submit form</button> </form> </div> </div> <div class="col-md-12 p-0"> <div class="card no-b"> <div class="card-body"> <div class="row"> <div class="col-3"> <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> <a class="nav-link active show" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Logo Design</a> <a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Marketing Material</a> <a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">3D Mockups</a> <a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Explainer Video</a> <a class="nav-link" id="v-pills-Designing-tab" data-toggle="pill" href="#v-pills-Designing" role="tab" aria-controls="v-pills-Designing" aria-selected="false">Packaging Designing</a> <a class="nav-link" id="v-pills-Product-tab" data-toggle="pill" href="#v-pills-Product" role="tab" aria-controls="v-pills-Product" aria-selected="false">Packaging Photography</a> <a class="nav-link" id="v-pills-Social-tab" data-toggle="pill" href="#v-pills-Social" role="tab" aria-controls="v-pills-Social" aria-selected="false">Social Media</a> <a class="nav-link" id="v-pills-Advertisements-tab" data-toggle="pill" href="#v-pills-Advertisements" role="tab" aria-controls="v-pills-Advertisements" aria-selected="false">Advertisements</a> <a class="nav-link" id="v-pills-Invitations-tab" data-toggle="pill" href="#v-pills-Invitations" role="tab" aria-controls="v-pills-Invitations" aria-selected="false">Invitations</a> <a class="nav-link" id="v-pills-Hanging-tab" data-toggle="pill" href="#v-pills-Hanging" role="tab" aria-controls="v-pills-Hanging" aria-selected="false">Hanging Dangler</a> <a class="nav-link" id="v-pills-Banners-tab" data-toggle="pill" href="#v-pills-Banners" role="tab" aria-controls="v-pills-Banners" aria-selected="false">Banners & Posters</a> <a class="nav-link" id="v-pills-Photo-tab" data-toggle="pill" href="#v-pills-Photo" role="tab" aria-controls="v-pills-Photo" aria-selected="false">Photo Manipulation</a> <a class="nav-link" id="v-pills-Infographics-tab" data-toggle="pill" href="#v-pills-Infographics" role="tab" aria-controls="v-pills-Infographics" aria-selected="false">Infographics</a> </div> </div> <div class="col-9"> <div class="tab-content" id="v-pills-tabContent"> <div class="tab-pane fade active show" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab"> <div class="row"> <?php /* Logo Image Start Here */ $sql = "select * from portofolio where category='Logo Design' order by id desc"; $result = mysqli_query($conn,$sql); while($row = mysqli_fetch_array($result)){ echo $logoimg = '<div class="col-md-3 py-2"><img src="upload/'.$row['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab"> <div class="row"> <?php echo $marketingimg; ?> </div> </div> <div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab"> <div class="row"> <?php echo $mackupimg; ?> </div> </div> <div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab"> <div class="row"> <?php echo $videoimg ?> </div> </div> <div class="tab-pane fade" id="v-pills-Designing" role="tabpanel" aria-labelledby="v-pills-Designing-tab"> <div class="row"> <?php /* Packaging Designing Image Here */ $sqlpd = "select * from portofolio where category='Packaging Designing' order by id desc"; $resultpd = mysqli_query($conn,$sqlpd); while($rowpd = mysqli_fetch_assoc($resultpd)){ echo $designimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowpd['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Product" role="tabpanel" aria-labelledby="v-pills-Product-tab"> <div class="row"> <?php echo $productphotographyimg ?> </div> </div> <div class="tab-pane fade" id="v-pills-Social" role="tabpanel" aria-labelledby="v-pills-Social-tab"> <div class="row"> <?php /* Social Media Image Here */ $sqlso = "select * from portofolio where category='Social Media' order by id desc"; $resultso = mysqli_query($conn,$sqlso); while($rowso = mysqli_fetch_assoc($resultso)){ echo $socialimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowso['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Advertisements" role="tabpanel" aria-labelledby="v-pills-Advertisements-tab"> <div class="row"> <?php /* Advertisements Image Here */ $sqlad = "select * from portofolio where category='Advertisements' order by id desc"; $resultad = mysqli_query($conn,$sqlad); while($rowad = mysqli_fetch_assoc($resultad)){ echo $adverimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowad['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Invitations" role="tabpanel" aria-labelledby="v-pills-Invitations-tab"> <div class="row"> <?php /* Invitations Image Here */ $sqlin = "select * from portofolio where category='Invitations' order by id desc"; $resultin = mysqli_query($conn,$sqlin); while($rowin = mysqli_fetch_assoc($resultin)){ echo $invitationimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowin['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Hanging" role="tabpanel" aria-labelledby="v-pills-Hanging-tab"> <div class="row"> <?php /* Invitations Image Here */ $sqlha = "select * from portofolio where category='Hanging Dangler' order by id desc"; $resultha = mysqli_query($conn,$sqlha); while($rowha = mysqli_fetch_assoc($resultha)){ echo $hongingimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowha['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Banners" role="tabpanel" aria-labelledby="v-pills-Banners-tab"> <div class="row"> <?php /* Invitations Image Here */ $sqlba = "select * from portofolio where category='Banners & Posters' order by id desc"; $resultba = mysqli_query($conn,$sqlba); while($rowba = mysqli_fetch_assoc($resultba)){ echo $bannersimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowba['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Photo" role="tabpanel" aria-labelledby="v-pills-Photo-tab"> <div class="row"> <?php /* Invitations Image Here */ $sqlph = "select * from portofolio where category='Photo Manipulation' order by id desc"; $resultph = mysqli_query($conn,$sqlph); while($rowph = mysqli_fetch_assoc($resultph)){ echo $photoimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowph['image'].'"></div>'; } ?> </div> </div> <div class="tab-pane fade" id="v-pills-Infographics" role="tabpanel" aria-labelledby="v-pills-Infographics-tab"> <div class="row"> <?php /* Invitations Image Here */ $sqlinfo = "select * from portofolio where category='Infographics' order by id desc"; $resultinfo = mysqli_query($conn,$sqlinfo); while($rowinfo = mysqli_fetch_assoc($resultinfo)){ echo $infoimg = '<div class="col-md-3 py-2"><img src="upload/'.$rowinfo['image'].'"></div>'; } ?> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!--/#app --> <script src="assets/js/app.js"></script> </body> </html> <?php if(isset($_POST['import'])){ if(isset($_FILES["blog_img"]) && $_FILES['blog_img']['size'] != 0){ /* Rename Image */ $time_now=mktime(date('h')+5,date('i')+30,date('s')); $serialNo = date('dmYHis', $time_now); $targetDirectory = "upload/"; /* Explode Extension*/ $temp = explode(".", $_FILES["blog_img"]["name"]); $extension = end($temp); $copyPath = $targetDirectory."design_agency_portfolio_".$serialNo.".".$extension; if(file_exists($copyPath)){ unlink($copyPath); } /* New Name Given Here */ $signatureImageName = "design_agency_portfolio_".$serialNo.".".$extension; move_uploaded_file($_FILES["blog_img"]["tmp_name"], $copyPath); } $alt = $_POST['alt']; $category = $_POST['category']; $sql = "INSERT INTO `portofolio`(`image`, `category`, `alt`) VALUES ('$signatureImageName','$category','$alt')"; if(mysqli_query($conn,$sql) == true){ echo '<script>alert("Image Uplaod Successfully")</script>'; }else{ echo '<script>alert("Error ! Image not Uplaod")</script>'; } } ?>