repo stringlengths 7 63 | file_url stringlengths 81 284 | file_path stringlengths 5 200 | content stringlengths 0 32.8k | language stringclasses 1 value | license stringclasses 7 values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:02:33 2026-01-05 05:24:06 | truncated bool 2 classes |
|---|---|---|---|---|---|---|---|---|
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/filter/add_product_filter_update.php | seller/assets/backend/filter/add_product_filter_update.php | <?php
require('../../../../utility/utility.php');
$value=json_decode($_POST['json']);
$productId=$value[count($value)-1];
mysqli_query($con,"delete from p_filter where pid='$productId'");
for($i=0;$i<count($value)-1;$i++){
$query='insert into p_filter (pid,fid) values("'.$productId.'","'.$value[$i].'")';
mysqli_query($con,$query);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/filter/add_product_filter.php | seller/assets/backend/filter/add_product_filter.php | <?php
require('../../../../utility/utility.php');
$value=json_decode($_POST['json']);
$productId=$value[count($value)-1];
for($i=0;$i<count($value)-1;$i++){
$query='insert into p_filter (pid,fid) values("'.$productId.'","'.$value[$i].'")';
mysqli_query($con,$query);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/filter/get_subfilter.php | seller/assets/backend/filter/get_subfilter.php | <?php
require('../../../../utility/utility.php');
$pcat=get_safe_value($con,$_POST['pcat']);
$template='';
$q="select * from filter where subcat_id='$pcat'";
$res=mysqli_query($con,$q);
if(mysqli_num_rows($res)==0){
$template="<option>No Data found</option>";
}else{
while($row=mysqli_fetch_assoc($res)){
$template=$template.'
<div class="formrow">
<div class="heading">
Filter
</div>
<select name="productFiltersName" id="addfiltername">
<option value="'.$row['id'].'">'.$row['filter'].'</option>
</select>
</div>
<div class="formrow">
<div class="heading">
Sub Filter
</div>
<div id="subfilters" style="background-color: #f8f8fb;width:98%;padding: 0.8rem;
border: 0.5px solid #74788d;
border-radius: 5px;">';
$filtername=$row['id'];
$q2="select * from sub_filter where filter_id='$filtername'";
$res2=mysqli_query($con,$q2);
while($row2=mysqli_fetch_assoc($res2)){
$template=$template.'<span style="font-size:1.2rem;float:left; margin:0 0.8rem">
<input type="checkbox" name="productSubFiltersName" style="display:block;height: 1.5rem;
background-color: #f8f8fb;
width: 1.5rem;
padding: 0 0.8rem;
border: 0.5px solid #74788d;
border-radius: 5px;float:left" value="'.$row2['id'].'">
'.$row2['subfilter'].'
</span>';
}
$template=$template.'</div> </div>';
}
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updatefimage.php | seller/assets/backend/product/updatefimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Fourth Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp); $location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/pt_acdc.php | seller/assets/backend/product/pt_acdc.php | <?php
require('../../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
$status=get_safe_value($con,$_POST['status']);
$q="update product set status='$status' where id='$id'";
if(mysqli_query($con,$q)){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updateproductlist.php | seller/assets/backend/product/updateproductlist.php | <?php
require('../../../../utility/utility.php');
$sellerid=$_SESSION['ID'];
$query="select * from product where added_by='$sellerid' order by id desc";
$res=mysqli_query($con,$query);
$i=1;
$template='';
while($row=mysqli_fetch_assoc($res)){
$st='';
$cb='';
$img1=$row['img1'];
$name=$row['product_name'];
$id=$row['id'];
if($row['status']==1){
$st="Active";
$cb="<button class='deactive' onclick='product_acdc($id, 0)'>
<i class='fa fa-eye-slash' aria-hidden='true'></i>Deactive
</button>";
}else{
$st="Deactive";
$cb="
<button class='active' onclick='product_acdc($id, 1)'>
<i class='fa fa-eye' aria-hidden='true'></i>Active
</button>
";
}
$template=$template."
<div class='p_row'>
<div class='slno'>$i</div>
<div class='p_image'>
<img src='../media/product/$img1' alt='product' />
</div>
<div class='p_name'>$name </div>
<div class='p_status'>
$st
</div>
<div class='p_action'>
<button class='edit' onclick='showdetailproduct($id)'>
<i class='fa fa-wifi' aria-hidden='true'></i>View
</button>
$cb
<button class='delete'>
<i class='fa fa-trash' aria-hidden='true'></i>Delete
</button>
</div>
</div>
";
$i++;
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/addfimage.php | seller/assets/backend/product/addfimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Fourth Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/addproduct.php | seller/assets/backend/product/addproduct.php | <?php
require('../../../../utility/utility.php');
$name=get_safe_value($con,$_POST['name']);
$category=get_safe_value($con,$_POST['category']);
$subcategory=get_safe_value($con,$_POST['subcat']);
$img1=get_safe_value($con,$_POST['img1']);
$img2=get_safe_value($con,$_POST['img2']);
$img3=get_safe_value($con,$_POST['img3']);
$img4=get_safe_value($con,$_POST['img4']);
$qty=get_safe_value($con,$_POST['quantity']);
$price=get_safe_value($con,$_POST['price']);
$sellprice=get_safe_value($con,$_POST['sellprice']);
$sd=get_safe_value($con,$_POST['sd']);
$dc=get_safe_value($con,$_POST['d']);
$fa=get_safe_value($con,$_POST['fa']);
$sku=get_safe_value($con,$_POST['sku']);
$tc=get_safe_value($con,$_POST['tc']);
$tax=get_safe_value($con,$_POST['tax']);
$added_by= $_SESSION['SELLER_ID'];
$jkl=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$added_by'"));
$added_city=$jkl['city'];
$status=1;
$inapprove=0;
$cq="select * from product where product_name='$name'and cat_id='$category' and scat_id='$subcategory'";
$cr=mysqli_query($con,$cq);
$cro=mysqli_num_rows($cr);
$return=array();
if($cro==0){
$qyery="insert into product(cat_id,scat_id,product_name,img1,img2,img3,img4,price,sell_price,fa,shrt_desc,description,qty,disclaimer,isappp,isnew,bs,status,added_by,belonging_city,tax,sku) values('$category','$subcategory','$name','$img1','$img2','$img3','$img4','$price','$sellprice','$fa','$sd','$dc','$qty','$tc','$inapprove','1','0','$status','$added_by','$added_city','$tax','$sku')";
if(mysqli_query($con,$qyery)){
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from product where product_name='$name' and cat_id='$category' and scat_id='$subcategory'"));
$product_id=$row['id'];
$return['code']=1;
$return['id']=$product_id;
mysqli_query($con,"insert into product_ad_on(pid) values('$product_id')");
echo json_encode($return);
}else{
$return['code']=0;
echo json_encode($return);
}
}else{
$return['code']=3;
echo json_encode($return);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updatetimage.php | seller/assets/backend/product/updatetimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Third Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updatesimage.php | seller/assets/backend/product/updatesimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Second Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/product_delete.php | seller/assets/backend/product/product_delete.php | <?php
require('../../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
$query="select * from product where id='$id'";
$res=mysqli_query($con,$query);
$row=mysqli_fetch_assoc($res);
$img1=$row['img1'];
$img2=$row['img2'];
$img3=$row['img3'];
$img4=$row['img4'];
$link1="../../../../media/product/$img1";
$link2="../../../../media/product/$img2";
$link3="../../../../media/product/$img3";
$link4="../../../../media/product/$img4";
unlink($link1);
unlink($link2);
unlink($link3);
unlink($link4);
$q="delete from product where id='$id'";
if(mysqli_query($con,$q)){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updateproduct.php | seller/assets/backend/product/updateproduct.php | <?php
require('../../../../utility/utility.php');
$name=get_safe_value($con,$_POST['name']);
$category=get_safe_value($con,$_POST['category']);
$subcategory=get_safe_value($con,$_POST['subcat']);
$img1=get_safe_value($con,$_POST['img1']);
$img2=get_safe_value($con,$_POST['img2']);
$img3=get_safe_value($con,$_POST['img3']);
$img4=get_safe_value($con,$_POST['img4']);
$qty=get_safe_value($con,$_POST['quantity']);
$price=get_safe_value($con,$_POST['price']);
$sellprice=get_safe_value($con,$_POST['sellprice']);
$tax=get_safe_value($con,$_POST['tax']);
$fa=get_safe_value($con,$_POST['fa']);
$sd=get_safe_value($con,$_POST['sd']);
$id=get_safe_value($con,$_POST['id']);
$dc=get_safe_value($con,$_POST['d']);
$tc=get_safe_value($con,$_POST['tc']);
$added_by= $_SESSION['SELLER_ID'];
$status=1;
$inapprove=0;
$test="select * from product where id='$id'";
$testres=mysqli_query($con,$test);
$testrow=mysqli_fetch_assoc($testres);
if($img1==''){
$temp=$testrow['img1'];
$img1=$temp;
}else{
$temp=$testrow['img1'];
$link="../../../../media/product/$temp";
unlink($link);
}
if($img2==''){
$temp=$testrow['img2'];
$img2=$temp;
}else{
$temp=$testrow['img2'];
$link="../../../../media/product/$temp";
unlink($link);
}
if($img3==''){
$temp=$testrow['img3'];
$img3=$temp;
}else{
$temp=$testrow['img3'];
$link="../../../../media/product/$temp";
unlink($link);
}
if($img4==''){
$temp=$testrow['img4'];
$img4=$temp;
}else{
$temp=$testrow['img4'];
$link="../../../../media/product/$temp";
unlink($link);
}
$cq="select * from product where product_name='$name'and cat_id='$category' and scat_id='$subcategory'";
$cr=mysqli_query($con,$cq);
$cro=mysqli_num_rows($cr);
if($cro==0){
$qyery="update product set product_name='$name',img1='$img1',img2='$img2',img3='$img3',img4='$img4',cat_id='$category',scat_id='$subcategory',qty='$qty',price='$price',sell_price='$sellprice',tax='$tax',fa='$fa',shrt_desc='$sd',description='$dc',disclaimer='$tc',isappp='$inapprove',status='$status',isnew='1' where id='$id'";
if(mysqli_query($con,$qyery)){
$queryv="select * from p_reject where product_id='$id'";
$resv=mysqli_query($con,$queryv);
$rowv=mysqli_num_rows($resv);
if($rowv>0){
mysqli_query($con,"delete from p_reject where product_id='$id'");
}
$return['code']=1;
$return['id']=$id;
echo json_encode($return);
}else{
$return['code']=0;
echo json_encode($return);
}
}else{
$r=mysqli_fetch_assoc($cr);
$rg=$r['id'];
if($cro>=1 && $rg==$id){
$q="update product set product_name='$name',img1='$img1',img2='$img2',img3='$img3',img4='$img4',cat_id='$category',scat_id='$subcategory',qty='$qty',price='$price',sell_price='$sellprice',tax='$tax',fa='$fa',shrt_desc='$sd',description='$dc',disclaimer='$tc',isappp='$inapprove',status='$status',isnew='1' where id='$id'";
if(mysqli_query($con,$q)){
$queryv="select * from p_reject where product_id='$id'";
$resv=mysqli_query($con,$queryv);
$rowv=mysqli_num_rows($resv);
if($rowv>0){
mysqli_query($con,"delete from p_reject where product_id='$id'");
}
$return['code']=1;
$return['id']=$id;
echo json_encode($return);
}else{
$return['code']=0;
echo json_encode($return);
}
}else{
$return['code']=3;
echo json_encode($return);
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/updatemainimage.php | seller/assets/backend/product/updatemainimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of First Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp); $location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/addtimage.php | seller/assets/backend/product/addtimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Third Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp); $location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/addsimage.php | seller/assets/backend/product/addsimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Second Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/product/addmainimage.php | seller/assets/backend/product/addmainimage.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of First Image Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/product/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/promo/add.php | seller/assets/backend/promo/add.php | <?php
require('../../../../utility/utility.php');
$response=array();
$scat=get_safe_value($con,$_POST['scat']);
$code=get_safe_value($con,$_POST['code']);
$minbal=get_safe_value($con,$_POST['minbal']);
$disc=get_safe_value($con,$_POST['disc']);
$seller_id=$_SESSION['SELLER_ID'];
$u=mysqli_num_rows(mysqli_query($con,"select * from promo where adb='$seller_id' and code='$code'"));
if($u>0){
$response['error_code']=0;
$response['msg']="Code Already Exists";
$json=json_encode($response);
echo $json;
}else{
$q="insert into promo(code,dis,minbal,scat,adb) values('$code','$disc','$minbal','$scat','$seller_id')";
mysqli_query($con,$q);
$response['error_code']=1;
$response['msg']="Added Successfully";
$json=json_encode($response);
echo $json;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/promo/del.php | seller/assets/backend/promo/del.php | <?php
require('../../../../utility/utility.php');
$response=array();
$id=get_safe_value($con,$_POST['oid']);
$response['error_code']=1;
$response['msg']="Deleted successfully";
mysqli_query($con,"delete from promo where id='$id'");
echo json_encode($response);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/witdraw/witdraw.php | seller/assets/backend/witdraw/witdraw.php | <?php
require('../../../../utility/utility.php');
$response=array();
$value=get_safe_value($con,$_POST['oid']);
$seller_id=$_SESSION['SELLER_ID'];
$u=mysqli_fetch_assoc(mysqli_query($con,"select * from seller_wallet where seller_id='$seller_id'"));
$e_a=$u['ballance'];
if($value>$e_a){
$response['error_code']=0;
$response['msg']="Invalid Amount";
$json=json_encode($response);
echo $json;
}else{
$q="insert into witdraw_req(s_id,amount_w,amount_r,isnew) values('$seller_id','$e_a','$value','1')";
mysqli_query($con,$q);
$response['error_code']=1;
$response['msg']="Witdraw Requested. Process may take upto 3 days.";
$msg="Witdraw Requested";
mysqli_query($con,"insert into seller_w_msg(s_id,cod,msg,balance) values('$seller_id','0','$msg','0')");
$json=json_encode($response);
echo $json;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/addgstcfrt.php | seller/assets/backend/profile/addgstcfrt.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of GST Certificate Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/addadhar.php | seller/assets/backend/profile/addadhar.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Adhar Card Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/addpan.php | seller/assets/backend/profile/addpan.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Pan Card Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/updateall_d.php | seller/assets/backend/profile/updateall_d.php | <?php
require('../../../../utility/utility.php');
$fullname=get_safe_value($con,$_POST['fullname']);
$type=get_safe_value($con,$_POST['type']);
$bname=get_safe_value($con,$_POST['bname']);
$cntry=get_safe_value($con,$_POST['cntry']);
$state=get_safe_value($con,$_POST['state']);
$city=get_safe_value($con,$_POST['city']);
$pin=get_safe_value($con,$_POST['pin']);
$is_gst=get_safe_value($con,$_POST['is_gst']);
$gstnum=get_safe_value($con,$_POST['gstnum']);
$acn=get_safe_value($con,$_POST['acn']);
$ach=get_safe_value($con,$_POST['ach']);
$bank=get_safe_value($con,$_POST['bank']);
$branch=get_safe_value($con,$_POST['branch']);
$ifsc=get_safe_value($con,$_POST['ifsc']);
$email=get_safe_value($con,$_POST['email']);
$mobile=get_safe_value($con,$_POST['mobile']);
$address=get_safe_value($con,$_POST['address']);
$id=$_SESSION['SELLER_ID'];
$cp=1;
$u="select * from rejection where s_id='$id'";
$us=mysqli_query($con,$u);
$o=mysqli_num_rows($us);
if($o>0){
mysqli_query($con,"delete from rejection where s_id='$id'");
}
$j=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
$verified=$j['isapp'];
if($verified==2){
$verified=0;
}
$q="update sellers set email='$email',isapp='$verified',mobile='$mobile',address='$address',f_name='$fullname',tob='$type',b_name='$bname',country='$cntry',state='$state',city='$city',pin='$pin',is_gst='$is_gst',gst_id='$gstnum',acc_num='$acn',acc_holder='$ach',bank='$bank',branch='$branch',ifsc='$ifsc',is_cp='$cp',is_new='1' where id='$id'";
if(mysqli_query($con,$q)){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/updateadhar.php | seller/assets/backend/profile/updateadhar.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg['msg']="Format of Business Certificate Is Not supported";
$msg['code']=0;
echo json_encode($msg);
}else{
$id=$_SESSION['SELLER_ID'];
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
if(!empty($row['adhar'])){
$path="../../../../media/seller_profile/".$row['adhar'];
unlink($path);
}
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){
$msg['code']=1;
$msg['filename']=$filename;
mysqli_query($con,"update sellers set adhar='$filename' where id='$id'");
echo json_encode($msg);
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/updatepan.php | seller/assets/backend/profile/updatepan.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg['msg']="Format of Business Certificate Is Not supported";
$msg['code']=0;
echo json_encode($msg);
}else{
$id=$_SESSION['SELLER_ID'];
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
if(!empty($row['pan'])){
$path="../../../../media/seller_profile/".$row['pan'];
unlink($path);
}
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){
$msg['code']=1;
$msg['filename']=$filename;
mysqli_query($con,"update sellers set pan='$filename' where id='$id'");
echo json_encode($msg);
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/update.php | seller/assets/backend/profile/update.php | <?php
require('../../../../utility/utility.php');
$fullname=get_safe_value($con,$_POST['fullname']);
$type=get_safe_value($con,$_POST['type']);
$bname=get_safe_value($con,$_POST['bname']);
$cntry=get_safe_value($con,$_POST['cntry']);
$state=get_safe_value($con,$_POST['state']);
$city=get_safe_value($con,$_POST['city']);
$pin=get_safe_value($con,$_POST['pin']);
$is_gst=get_safe_value($con,$_POST['is_gst']);
$gstnum=get_safe_value($con,$_POST['gstnum']);
$acn=get_safe_value($con,$_POST['acn']);
$ach=get_safe_value($con,$_POST['ach']);
$bank=get_safe_value($con,$_POST['bank']);
$branch=get_safe_value($con,$_POST['branch']);
$ifsc=get_safe_value($con,$_POST['ifsc']);
$email=get_safe_value($con,$_POST['email']);
$mobile=get_safe_value($con,$_POST['mobile']);
$address=get_safe_value($con,$_POST['address']);
$id=$_SESSION['SELLER_ID'];
$j=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
$q="update sellers set email='$email',mobile='$mobile',address='$address',f_name='$fullname',tob='$type',b_name='$bname',country='$cntry',state='$state',city='$city',pin='$pin',is_gst='$is_gst',gst_id='$gstnum',acc_num='$acn',acc_holder='$ach',bank='$bank',branch='$branch',ifsc='$ifsc' where id='$id'";
if(mysqli_query($con,$q)){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/updatebscfrt.php | seller/assets/backend/profile/updatebscfrt.php | <?php
require('../../../../utility/utility.php');
$msg=array();
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg['msg']="Format of Business Certificate Is Not supported";
$msg['code']=0;
echo json_encode($msg);
}else{
$id=$_SESSION['SELLER_ID'];
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
if(!empty($row['b_crft'])){
$path="../../../../media/seller_profile/".$row['b_crft'];
unlink($path);
}
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){
$msg['code']=1;
$msg['filename']=$filename;
mysqli_query($con,"update sellers set b_crft='$filename' where id='$id'");
echo json_encode($msg);
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/addbscfrt.php | seller/assets/backend/profile/addbscfrt.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg="Format of Business Certificate Is Not supported";
echo $msg;
}else{
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location))
{
echo $filename;
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/addall_d.php | seller/assets/backend/profile/addall_d.php | <?php
require('../../../../utility/utility.php');
$fullname=get_safe_value($con,$_POST['fullname']);
$type=get_safe_value($con,$_POST['type']);
$bname=get_safe_value($con,$_POST['bname']);
$cntry=get_safe_value($con,$_POST['cntry']);
$state=get_safe_value($con,$_POST['state']);
$city=get_safe_value($con,$_POST['city']);
$pin=get_safe_value($con,$_POST['pin']);
$is_gst=get_safe_value($con,$_POST['is_gst']);
$gstnum=get_safe_value($con,$_POST['gstnum']);
$acn=get_safe_value($con,$_POST['acn']);
$ach=get_safe_value($con,$_POST['ach']);
$bank=get_safe_value($con,$_POST['bank']);
$branch=get_safe_value($con,$_POST['branch']);
$ifsc=get_safe_value($con,$_POST['ifsc']);
$bc=get_safe_value($con,$_POST['bc']);
$gstc=get_safe_value($con,$_POST['gstc']);
$adhar=get_safe_value($con,$_POST['adhar']);
$pan=get_safe_value($con,$_POST['pan']);
$email=get_safe_value($con,$_POST['email']);
$mobile=get_safe_value($con,$_POST['mobile']);
$address=get_safe_value($con,$_POST['address']);
$id=$_SESSION['SELLER_ID'];
$cp=1;
$z=0;
$u="select * from rejection where s_id='$id'";
$us=mysqli_query($con,$u);
$o=mysqli_num_rows($us);
if($o>0){
mysqli_query($con,"delete from rejection where s_id='$id'");
}
$q="update sellers set email='$email',mobile='$mobile',address='$address',f_name='$fullname',tob='$type',b_name='$bname',b_crft='$bc',country='$cntry',state='$state',city='$city',pin='$pin',is_gst='$is_gst',gst_id='$gstnum',gst_crft='$gstc',acc_num='$acn',acc_holder='$ach',bank='$bank',branch='$branch',ifsc='$ifsc',adhar='$adhar',pan='$pan',is_cp='$cp',isapp='$z',is_new='1' where id='$id'";
if(mysqli_query($con,$q)){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/profile/updategst.php | seller/assets/backend/profile/updategst.php | <?php
require('../../../../utility/utility.php');
if($_FILES['file']['type']!='' && $_FILES['file']['type']!='image/jpeg' && $_FILES['file']['type']!='image/jpg'&& $_FILES['file']['type']!='image/png'){
$msg['msg']="Format of Business Certificate Is Not supported";
$msg['code']=0;
echo json_encode($msg);
}else{
$id=$_SESSION['SELLER_ID'];
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from sellers where id='$id'"));
// echo $row['gst_certificate'];
// die();
if($row['gst_crft']!="0"){
$path="../../../../media/seller_profile/".$row['gst_crft'];
unlink($path);
}
$temp = explode(".", $_FILES["file"]["name"]);
$filename = rand(111111111,999999999).round(microtime(true)) . '.' . end($temp);
$location = "../../../../media/seller_profile/".$filename;
if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){
$msg['code']=1;
$msg['filename']=$filename;
mysqli_query($con,"update sellers set gst_crft='$filename' where id='$id'");
echo json_encode($msg);
}
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/location/getpinlist.php | seller/assets/backend/location/getpinlist.php | <?php
require('../../../../utility/utility.php');
$name=get_safe_value($con,$_POST['id']);
$query2="select * from pin where c_id='$name' order by id desc";
$res2=mysqli_query($con,$query2);
$r=mysqli_num_rows($res2);
$template='';
if($r==0){
$template='<option value="#">No Pincode Listed</option>';
}else{
$template='<option value="#">Select Pincode</option>';
while($rowt=mysqli_fetch_assoc($res2)){
$template=$template.'
<option value="'.$rowt['id'].'">'.$rowt['pincode'].'</option>
';
}
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/location/getstatelist.php | seller/assets/backend/location/getstatelist.php | <?php
require('../../../../utility/utility.php');
$name=get_safe_value($con,$_POST['id']);
$query2="select * from state where c_id='$name' order by id desc";
$res2=mysqli_query($con,$query2);
$r=mysqli_num_rows($res2);
$template='';
if($r==0){
$template='<option value="#">No State Listed</option>';
}else{
$template='<option value="#">Select State</option>';
while($rowt=mysqli_fetch_assoc($res2)){
$template=$template.'
<option value="'.$rowt['id'].'">'.$rowt['state_name'].'</option>
';
}
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/assets/backend/location/getcitylist.php | seller/assets/backend/location/getcitylist.php | <?php
require('../../../../utility/utility.php');
$name=get_safe_value($con,$_POST['id']);
$query2="select * from city where s_id='$name' order by id desc";
$res2=mysqli_query($con,$query2);
$r=mysqli_num_rows($res2);
$template='';
if($r==0){
$template='<option value="#">No City Listed</option>';
}else{
$template='<option value="#">Select City</option>';
while($rowt=mysqli_fetch_assoc($res2)){
$template=$template.'
<option value="'.$rowt['id'].'">'.$rowt['city_name'].'</option>
';
}
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/require/head.php | seller/require/head.php | <div class="head">
<div class="ham-name">
<div class="mnu vy" onclick="hide()" id="mn">
<span></span>
<span></span>
<span></span>
</div>
<div class="mnu ty" onclick="op_n()" id="mn">
<span></span>
<span></span>
<span></span>
</div>
<div class="nm">Dashbord</div>
</div>
<div class="profile">
<a href="javascript:void(0)">
<img src="assets/images/pic1.jpg" alt="" />
</a>
<div class="name">
<span style="width: 4rem; text-overflow: ellipsis; overflow: hidden;">
<?php
print_r(explode(" ",seller_name($con))[0]);
?>
</span>
<small>seller</small>
</div>
<div class="hover-bot">
<ul>
<li>
<a href="profile.php?<?php echo R_v(); ?>=<?php echo hash_code() ?>&v=<?php echo hash_code() ?>">
<i class="uil uil-user"></i>
<span>Profile</span>
</a>
</li>
<li>
<a href="javascript:void(0)" onclick="logout()">
<i class="uil uil-sign-out-alt"></i>
<span>Logout</span>
</a>
</li>
</ul>
</div>
</div>
</div> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/require/top.php | seller/require/top.php | <?php
require("../utility/utility.php");
authorise($con);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Seller Dashboard</title>
<link rel="stylesheet" href="assets/css/style.css" />
<script src="assets/js/jquery.js"></script>
<script src="assets/js/sweetalert.js"></script>
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css" />
</head>
<body>
<section class="main">
<?php require("nav.php"); ?>
<div class="right-part">
<?php require("head.php"); ?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/require/foot.php | seller/require/foot.php | </div>
</section>
<script src="assets/js/script.js"></script>
</body>
</html> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/seller/require/nav.php | seller/require/nav.php | <div class="left-part" id="lft">
<div class="logo">
<a href="javascript:void(0)">
<img src="../assets/images/logo.png" alt="logo" />
</a>
<svg viewBox="0 0 339.4 75.201" xmlns="http://www.w3.org/2000/svg">
<g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="19pt" stroke="#000"
stroke-width="0.25mm" fill="none" style="
stroke: rgb(255, 255, 255);
stroke-width: 0.35mm;
fill: #fff;
">
<path
d="M 18.4 38 L 50.1 68.4 L 43.5 75.2 L 9.5 41.8 L 9.5 74 L 0 74 L 0 4 L 9.5 4 L 9.5 35.9 L 39.3 3.7 L 45.7 9.6 L 18.4 38 Z M 300.1 69.8 L 303.9 62.3 A 17.402 17.402 0 0 0 307.252 64.603 A 23.322 23.322 0 0 0 310.45 66 A 24.791 24.791 0 0 0 317.922 67.383 A 28.367 28.367 0 0 0 318.9 67.4 Q 324.292 67.4 327.135 65.685 A 7.738 7.738 0 0 0 327.35 65.55 Q 330.2 63.7 330.2 60.8 A 7.211 7.211 0 0 0 329.816 58.432 A 6.796 6.796 0 0 0 329.65 58 A 5.377 5.377 0 0 0 328.937 56.803 Q 328.549 56.304 328.019 55.821 A 10.185 10.185 0 0 0 327.65 55.5 A 12.59 12.59 0 0 0 326.415 54.607 Q 325.731 54.169 324.902 53.737 A 27.422 27.422 0 0 0 323.7 53.15 Q 322.02 52.377 319.664 51.492 A 115.589 115.589 0 0 0 317.2 50.6 A 47.106 47.106 0 0 1 312.946 48.945 Q 308.675 47.022 306.2 44.65 A 11.347 11.347 0 0 1 302.969 38.736 A 16.941 16.941 0 0 1 302.6 35.1 Q 302.6 32.1 303.95 29.5 A 13.242 13.242 0 0 1 306.936 25.704 A 15.791 15.791 0 0 1 307.85 24.95 A 17.33 17.33 0 0 1 311.266 22.934 A 22.664 22.664 0 0 1 314.05 21.9 A 24.963 24.963 0 0 1 318.192 21.046 A 34.316 34.316 0 0 1 322.4 20.8 Q 327.052 20.8 330.664 21.674 A 24.48 24.48 0 0 1 331.35 21.85 A 38.541 38.541 0 0 1 335.657 23.291 A 31.513 31.513 0 0 1 338.3 24.5 L 335.8 31.9 Q 333.1 30.3 329.65 29.3 A 25.024 25.024 0 0 0 325.167 28.453 A 31.837 31.837 0 0 0 322 28.3 A 20.632 20.632 0 0 0 319.063 28.495 Q 315.977 28.94 314.1 30.4 A 9.322 9.322 0 0 0 312.742 31.673 Q 312.04 32.492 311.705 33.365 A 4.529 4.529 0 0 0 311.4 35 A 5.568 5.568 0 0 0 311.594 36.488 A 4.93 4.93 0 0 0 311.85 37.2 Q 312.224 38.032 313.117 38.794 A 7.753 7.753 0 0 0 313.5 39.1 Q 314.7 40 316.7 40.9 A 38.11 38.11 0 0 0 318.341 41.589 Q 319.825 42.175 321.7 42.8 Q 325.452 44.102 328.324 45.432 A 45.049 45.049 0 0 1 330 46.25 A 27.212 27.212 0 0 1 332.715 47.841 Q 334.015 48.713 335.041 49.659 A 15.68 15.68 0 0 1 335.5 50.1 A 13.836 13.836 0 0 1 337.438 52.502 A 11.394 11.394 0 0 1 338.5 54.65 A 14.613 14.613 0 0 1 339.294 58.102 A 18.255 18.255 0 0 1 339.4 60.1 A 14.031 14.031 0 0 1 338.871 64.009 A 12.235 12.235 0 0 1 337.9 66.4 Q 336.4 69.2 333.7 71.15 A 17.953 17.953 0 0 1 330.194 73.104 A 23.774 23.774 0 0 1 327.15 74.15 Q 323.3 75.2 318.6 75.2 A 41.103 41.103 0 0 1 313.093 74.848 A 30.514 30.514 0 0 1 307.9 73.7 A 30.72 30.72 0 0 1 304.094 72.215 Q 302.125 71.283 300.544 70.133 A 18.536 18.536 0 0 1 300.1 69.8 Z M 157.7 74 L 157.7 0 L 166.7 0 L 166.7 27.4 A 17.447 17.447 0 0 1 167.671 26.418 Q 168.185 25.936 168.788 25.436 A 29.965 29.965 0 0 1 169.2 25.1 A 19.429 19.429 0 0 1 171.869 23.315 A 22.041 22.041 0 0 1 172.55 22.95 A 18.788 18.788 0 0 1 175.038 21.899 A 23.04 23.04 0 0 1 176.7 21.4 A 18.56 18.56 0 0 1 179.971 20.865 A 22.623 22.623 0 0 1 181.7 20.8 Q 186.2 20.8 190.35 22.6 Q 194.5 24.4 197.65 27.8 A 23.706 23.706 0 0 1 201.246 32.952 A 29.885 29.885 0 0 1 202.7 36.2 Q 204.6 41.2 204.6 47.5 A 33.315 33.315 0 0 1 203.913 54.388 A 27.75 27.75 0 0 1 202.6 58.8 A 30.149 30.149 0 0 1 199.592 64.609 A 25.829 25.829 0 0 1 197.3 67.55 Q 194 71.2 189.75 73.2 A 20.584 20.584 0 0 1 183.154 75.09 A 19.225 19.225 0 0 1 181.1 75.2 A 22.394 22.394 0 0 1 173.177 73.805 A 21.462 21.462 0 0 1 172.65 73.6 Q 168.7 72 166.1 69.7 L 166.1 74 L 157.7 74 Z M 292.3 51.7 L 255.9 51.7 A 24.088 24.088 0 0 0 257.039 56.725 Q 258.375 60.538 261 63.1 Q 265.2 67.2 272.1 67.2 Q 276.6 67.2 280.2 66.25 Q 283.8 65.3 287.1 63.8 L 289.2 71.5 A 35.406 35.406 0 0 1 284.381 73.342 A 44.267 44.267 0 0 1 281.1 74.2 A 40.711 40.711 0 0 1 276.008 74.98 A 54.607 54.607 0 0 1 271 75.2 A 29.178 29.178 0 0 1 265.204 74.647 A 23.608 23.608 0 0 1 260.9 73.35 Q 256.4 71.5 253.25 68.05 A 22.127 22.127 0 0 1 249.604 62.55 A 27.574 27.574 0 0 1 248.4 59.55 A 31.581 31.581 0 0 1 247.049 53.593 A 42.813 42.813 0 0 1 246.7 48 A 34.878 34.878 0 0 1 247.504 40.403 A 30.597 30.597 0 0 1 248.4 37.2 A 27.699 27.699 0 0 1 251.214 31.251 A 24.152 24.152 0 0 1 253.2 28.55 Q 256.3 24.9 260.6 22.85 Q 264.9 20.8 270.2 20.8 A 27.908 27.908 0 0 1 275.104 21.211 A 20.619 20.619 0 0 1 280 22.7 Q 284.2 24.6 287 27.9 Q 289.8 31.2 291.2 35.6 A 30.348 30.348 0 0 1 292.597 44.442 A 34.055 34.055 0 0 1 292.6 44.9 A 75.204 75.204 0 0 1 292.309 51.597 A 69.426 69.426 0 0 1 292.3 51.7 Z M 131.6 26.2 L 131.6 22 L 139.8 22 L 139.8 61.4 A 12.15 12.15 0 0 0 139.902 63.036 Q 140.234 65.47 141.65 66.35 Q 143.5 67.5 145.7 67.5 L 143.8 74.5 A 17.722 17.722 0 0 1 139.535 74.028 Q 133.898 72.628 132.303 67.08 A 13.59 13.59 0 0 1 132.2 66.7 Q 131 68.3 129.45 69.85 A 18.204 18.204 0 0 1 126.156 72.444 A 20.291 20.291 0 0 1 125.9 72.6 A 17.462 17.462 0 0 1 122.767 74.067 A 20.704 20.704 0 0 1 121.4 74.5 A 18.765 18.765 0 0 1 118.08 75.102 A 23.457 23.457 0 0 1 115.9 75.2 Q 111 75.2 106.75 73.3 Q 102.5 71.4 99.35 67.9 A 24.891 24.891 0 0 1 95.493 62.12 A 30.206 30.206 0 0 1 94.35 59.45 Q 92.5 54.5 92.5 48.3 Q 92.5 42.5 94.3 37.45 A 27.784 27.784 0 0 1 97.46 31.144 A 24.797 24.797 0 0 1 99.35 28.7 Q 102.6 25 107.15 22.9 A 23.124 23.124 0 0 1 115.929 20.825 A 27.082 27.082 0 0 1 117.1 20.8 A 22.584 22.584 0 0 1 121.894 21.29 A 18.703 18.703 0 0 1 125.25 22.35 A 26.002 26.002 0 0 1 129.537 24.644 A 22.103 22.103 0 0 1 131.6 26.2 Z M 225.6 0 L 225.6 56.8 A 20.644 20.644 0 0 0 225.788 59.688 Q 226.25 62.952 227.85 64.8 A 7.363 7.363 0 0 0 232.434 67.276 A 10.724 10.724 0 0 0 234.1 67.4 Q 236 67.4 237.8 66.95 Q 239.6 66.5 241 65.9 L 243.2 73.2 Q 241.801 73.822 239.888 74.323 A 34.978 34.978 0 0 1 238.75 74.6 A 23.816 23.816 0 0 1 235.595 75.085 A 30.514 30.514 0 0 1 232.9 75.2 A 21.419 21.419 0 0 1 228.789 74.819 A 18.058 18.058 0 0 1 226.45 74.2 Q 223.5 73.2 221.3 71.1 A 13.281 13.281 0 0 1 218.822 67.827 A 16.994 16.994 0 0 1 217.85 65.7 Q 216.6 62.4 216.6 57.7 L 216.6 0 L 225.6 0 Z M 90 21.4 L 87.3 30.7 A 9.763 9.763 0 0 0 85.155 30.088 Q 84.059 29.9 82.8 29.9 Q 80 29.9 77.35 31.1 A 13.202 13.202 0 0 0 73.238 34.049 A 15.59 15.59 0 0 0 72.65 34.7 Q 70.661 37.029 69.425 40.628 A 26.039 26.039 0 0 0 69.35 40.85 A 22.895 22.895 0 0 0 68.453 44.662 Q 68.166 46.554 68.112 48.697 A 40 40 0 0 0 68.1 49.7 L 68.1 74 L 59.1 74 L 59.1 22 L 67.8 22 L 67.8 33.3 Q 68.7 30.9 70.2 28.6 Q 71.7 26.3 73.75 24.6 A 16.676 16.676 0 0 1 77.591 22.23 A 19.32 19.32 0 0 1 78.5 21.85 Q 81.2 20.8 84.5 20.8 Q 86 20.8 87.45 20.95 A 19.695 19.695 0 0 1 88.652 21.11 Q 89.244 21.209 89.764 21.338 A 11.443 11.443 0 0 1 90 21.4 Z M 130.8 60.7 L 130.8 32.8 Q 128.1 30.9 124.85 29.75 Q 121.6 28.6 118 28.6 A 16.142 16.142 0 0 0 113.533 29.203 A 14.448 14.448 0 0 0 111.4 30 Q 108.4 31.4 106.25 33.95 A 17.393 17.393 0 0 0 103.743 37.953 A 21.502 21.502 0 0 0 102.9 40.1 A 23.426 23.426 0 0 0 101.817 45.381 A 28.621 28.621 0 0 0 101.7 48 A 25.723 25.723 0 0 0 102.169 52.996 A 21.781 21.781 0 0 0 102.9 55.75 A 19.283 19.283 0 0 0 104.776 59.774 A 16.545 16.545 0 0 0 106.3 61.85 Q 108.5 64.4 111.45 65.8 A 14.679 14.679 0 0 0 117.249 67.188 A 17.126 17.126 0 0 0 117.9 67.2 Q 121.7 67.2 125.1 65.4 Q 128.5 63.6 130.8 60.7 Z M 166.7 35.4 L 166.7 63.2 A 17.99 17.99 0 0 0 170.33 65.385 A 21.802 21.802 0 0 0 172.1 66.1 A 19.462 19.462 0 0 0 178.264 67.196 A 22.039 22.039 0 0 0 178.7 67.2 A 16.26 16.26 0 0 0 184.518 66.166 A 15.526 15.526 0 0 0 185.4 65.8 Q 188.5 64.4 190.7 61.85 A 17.95 17.95 0 0 0 193.442 57.514 A 21.678 21.678 0 0 0 194.15 55.75 A 21.806 21.806 0 0 0 195.222 50.996 A 27.857 27.857 0 0 0 195.4 47.8 Q 195.4 43.3 194.15 39.75 Q 192.9 36.2 190.75 33.7 Q 188.6 31.2 185.75 29.9 Q 182.9 28.6 179.7 28.6 A 14.741 14.741 0 0 0 174.073 29.663 A 14.054 14.054 0 0 0 171.95 30.75 Q 168.5 32.9 166.7 35.4 Z M 255.8 44.4 L 284.3 44.4 A 24.355 24.355 0 0 0 283.896 39.815 Q 283.4 37.231 282.296 35.207 A 12.422 12.422 0 0 0 280.5 32.7 A 12.488 12.488 0 0 0 273.539 28.924 A 18.395 18.395 0 0 0 270 28.6 Q 264.1 28.6 260.35 32.6 A 14.739 14.739 0 0 0 257.557 37.005 Q 256.732 38.961 256.252 41.361 A 32.287 32.287 0 0 0 255.8 44.4 Z"
vector-effect="non-scaling-stroke" />
</g>
</svg>
<div class="close-left-nav" onclick="close_res_nav()">
<i class="uil uil-times"></i>
</div>
</div>
<div class="list-nav">
<ul class="nav-list">
<?php
if(profile_completed($con)==1 && profle_verified($con)==1){
?>
<li class="outer-list">
<a href="index.php">
<i class="uil uil-estate"></i>
<span>Dashbaord</span>
</a>
</li>
<li class="outer-list">
<a href="product.php">
<i class="uil uil-box"></i>
<span>Product</span>
</a>
</li>
<li class="outer-list">
<a href="order_received.php">
<i class="uil uil-archive"></i>
<span>Order Received <span style="color:red;font-size:1.2rem;font-weight:700"></span></span>
</a>
</li>
<li class="outer-list">
<a href="order_assigned.php">
<i class="uil uil-parcel"></i>
<span>Order Assigned</span>
</a>
</li>
<li class="outer-list">
<a href="outfordelivery.php">
<i class="uil uil-car-sideview"></i>
<span>Out For Delivery</span>
</a>
</li>
<li class="outer-list">
<a href="delivery_c.php">
<i class="uil uil-voicemail-rectangle"></i>
<span>Delivery Confirmation</span>
</a>
</li>
<li class="outer-list">
<a href="delivered.php">
<i class="uil uil-gift"></i>
<span>Delivered</span>
</a>
</li>
<li class="outer-list">
<a href="issue.php">
<i class="uil uil-toilet-paper"></i>
<span>Issue</span>
</a>
</li>
<li class="outer-list">
<a href="order_setteled.php">
<i class="uil uil-bag"></i>
<span>Order Setteled</span>
</a>
</li>
<li class="outer-list">
<a href="undelivered_c.php">
<i class="uil uil-channel"></i>
<span>Undeliver Confirmation</span>
</a>
</li>
<li class="outer-list">
<a href="undelivered.php">
<i class="uil uil-cube"></i>
<span>Undelivered</span>
</a>
</li>
<li class="outer-list">
<a href="promo.php">
<i class="uil uil-no-entry"></i>
<span>Promo Code</span>
</a>
</li>
<?php }else{ ?>
<li class="outer-list">
<a href="index.php">
<i class="uil uil-estate"></i>
<span>Dashbaord</span>
</a>
</li>
<?php } ?>
</ul>
</div>
<div class="copyright">
<p>Developed by Ayondip Jana</p>
</div>
</div> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/logout.php | assets/backend/auth/logout.php | <?php
require('../../../utility/utility.php');
$result=array();
unset($_SESSION['USER_LOGIN']);
unset($_SESSION['USER_ID']);
$result['status']=1;
echo json_encode($result);
die();
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/verify_otp_email.php | assets/backend/auth/verify_otp_email.php | <?php
require('../../../utility/utility.php');
$otp=get_safe_value($con,$_POST['id']);
$email=get_safe_value($con,$_POST['email']);
$s_otp=$_SESSION['OTP'];
$result=array();
if($s_otp==$otp){
unset($_SESSION['OTP']);
$uid=$_SESSION['USER_ID'];
mysqli_query($con,"update users set e_vfd='1',email='$email' where id='$uid'");
$result['res']=1;
$result['msg']="Email Verified";
$JSON = json_encode($result);
echo $JSON;
}else{
$result['res']=0;
$result['msg']="Enter Correct OTP";
$JSON = json_encode($result);
echo $JSON;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/register.php | assets/backend/auth/register.php | <?php
require('../../../utility/utility.php');
$email=get_safe_value($con,$_POST['email']);
$password=get_safe_value($con,$_POST['password']);
$mobile=get_safe_value($con,$_POST['mobile']);
$name=get_safe_value($con,$_POST['name']);
$q="select * from users where email='$email' and status='1'";
$result=array();
if ($name == "") {
$result['status']=0;
$result['msg']="Enter Name";
} else if ($password == "") {
$result['status']=0;
$result['msg']="Enter Password";
} else if ($email == "") {
$result['status']=0;
$result['msg']="Enter Email";
} else if ($mobile == "") {
$result['status']=0;
$result['msg']="Enter Mobile";
} else {
$query="select * from users where email='$email'";
$res=mysqli_query($con,$query);
$n=mysqli_num_rows($res);
if($n>0){
$result['status']=0;
$result['msg']="Email is not available";
}else{
$password=password_hash($password, PASSWORD_DEFAULT);
$q="insert into users(name,password,mobile,email,status) values('$name','$password','$mobile','$email','1')";
if(mysqli_query($con,$q)){
$row=mysqli_fetch_assoc(mysqli_query($con,"select * from users where mobile='$mobile' and email='$email'"));
$_SESSION['USER_LOGIN']="YES";
$_SESSION['USER_ID']=$row['id'];
$result['status']=1;
$idd=$row['id'];
$result['msg']="Account Created Successfully";
$msg="Wallet created";
mysqli_query($con,"insert into user_wallet (user_id,ballance) values ('$idd','0')");
mysqli_query($con,"insert into user_w_msg (u_id,cod,msg,balance,is_new) values ('$idd','1','$msg','0','1')");
}else{
$result['status']=0;
$result['msg']="Something Went Wrong";
}
}
}
if(isset($_SESSION['USER_CART'])){
foreach($_SESSION['USER_CART'] as $cti){
add_cart_a_login($con,$cti);
}
unset($_SESSION['USER_CART']);
}
if(isset($_SESSION['CART_QTY'])){
unset($_SESSION['CART_QTY']);
}
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/sent_otp_mobile.php | assets/backend/auth/sent_otp_mobile.php | <?php
require('../../../utility/utility.php');
$otp=OTP($con);
$_SESSION['OTP']=$otp;
echo $otp;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/sent_otp_email.php | assets/backend/auth/sent_otp_email.php | <?php
require('../../../utility/utility.php');
$otp=OTP($con);
$_SESSION['OTP']=$otp;
echo $otp;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/verify_otp_mobile.php | assets/backend/auth/verify_otp_mobile.php | <?php
require('../../../utility/utility.php');
$otp=get_safe_value($con,$_POST['id']);
$mobile=get_safe_value($con,$_POST['mobile']);
$s_otp=$_SESSION['OTP'];
$result=array();
if($s_otp==$otp){
unset($_SESSION['OTP']);
$uid=$_SESSION['USER_ID'];
mysqli_query($con,"update users set m_vfd='1',mobile='$mobile' where id='$uid'");
$result['res']=1;
$result['msg']="Mobile Verified";
$JSON = json_encode($result);
echo $JSON;
}else{
$result['res']=0;
$result['msg']="Enter Correct OTP";
$JSON = json_encode($result);
echo $JSON;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/auth/validate.php | assets/backend/auth/validate.php | <?php
require('../../../utility/utility.php');
$username=get_safe_value($con,$_POST['username']);
$password=get_safe_value($con,$_POST['password']);
$q="select * from users where email='$username' and status='1'";
$q2="select * from users where mobile='$username' and status='1'";
$rs=mysqli_query($con,$q);
$rs2=mysqli_query($con,$q2);
$nor=mysqli_num_rows($rs);
$nor2=mysqli_num_rows($rs2);
$result=array();
if ($password == "") {
$result['status']=0;
$result['msg']="Enter Password";
} else if ($username == "") {
$result['status']=0;
$result['msg']="Enter Username";
}else if($nor==0 && $nor2==0){
$result['status']=0;
$result['msg']="Invalid Credentials";
}else{
if($nor>0){
$rs=$rs;
}else{
$rs=$rs2;
}
$row=mysqli_fetch_assoc($rs);
$dps=$row['password'];
$verify = password_verify($password, $dps);
if ($verify) {
$_SESSION['USER_LOGIN']="YES";
$_SESSION['USER_ID']=$row['id'];
$result['status']=1;
$result['msg']="Login Successfull";
} else {
$result['status']=2;
$result['msg']="Something Went Wrong";
}
}
if(isset($_SESSION['USER_CART'])){
foreach($_SESSION['USER_CART'] as $cti){
add_cart_a_login($con,$cti);
}
unset($_SESSION['USER_CART']);
}
if(isset($_SESSION['CART_QTY'])){
unset($_SESSION['CART_QTY']);
}
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/wishlist/wish.php | assets/backend/wishlist/wish.php | <?php
require('../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
$return_msg=array();
if(!isset($_SESSION['USER_LOGIN'])){
$return_msg['err_code']=0;
$return_msg['msg']="Login to access wishlist";
echo json_encode($return_msg);
}else{
$uid=$_SESSION['USER_ID'];
mysqli_query($con,"insert into wishlist (u_id,p_id) values ('$uid','$id')");
$return_msg['err_code']=1;
$return_msg['msg']="Added";
echo json_encode($return_msg);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/wishlist/del_wish.php | assets/backend/wishlist/del_wish.php | <?php
require('../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
mysqli_query($con,"delete from wishlist where id='$id'");
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/user/match_address.php | assets/backend/user/match_address.php | <?php
require('../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
$uid=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$res=mysqli_fetch_assoc(mysqli_query($con,"select * from user_address where id='$id'"));
if($res['user_city']==$utm){
echo 1;
}else{
echo 0;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/user/add_new_address.php | assets/backend/user/add_new_address.php | <?php
require('../../../utility/utility.php');
$name=get_safe_value($con,$_POST['name']);
$mobile=get_safe_value($con,$_POST['mobile']);
$city=get_safe_value($con,$_POST['city']);
$address=get_safe_value($con,$_POST['address']);
$pin=get_safe_value($con,$_POST['pin']);
$locality=get_safe_value($con,$_POST['landmark']);
$type=get_safe_value($con,$_POST['type']);
$uid=$_SESSION['USER_ID'];
$query="insert into user_address(uid,type_ad,user_name,user_mobile,user_city,user_add,user_pin,user_local) values('$uid','$type','$name','$mobile','$city','$address','$pin','$locality')";
mysqli_query($con,$query);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/user/update_address.php | assets/backend/user/update_address.php | <?php
require('../../../utility/utility.php');
$name=get_safe_value($con,$_POST['name']);
$mobile=get_safe_value($con,$_POST['mobile']);
$city=get_safe_value($con,$_POST['city']);
$address=get_safe_value($con,$_POST['address']);
$pin=get_safe_value($con,$_POST['pin']);
$locality=get_safe_value($con,$_POST['landmark']);
$type=get_safe_value($con,$_POST['type']);
$id=get_safe_value($con,$_POST['id']);
$query="update user_address set type_ad='$type',user_name='$name',user_mobile='$mobile',user_city='$city',user_add='$address',user_pin='$pin',user_local='$locality' where id='$id'";
mysqli_query($con,$query);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/user/delete_address.php | assets/backend/user/delete_address.php | <?php
require('../../../utility/utility.php');
$id=get_safe_value($con,$_POST['id']);
$query="delete from user_address where id='$id'";
mysqli_query($con,$query);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/user/fetch_address.php | assets/backend/user/fetch_address.php | <?php
require('../../../utility/utility.php');
$template='';
$uid=$_SESSION['USER_ID'];
$res=mysqli_query($con,"select user_address.*,city.city_name from user_address,city where user_address.uid='$uid' and user_address.user_city=city.id");
while($row=mysqli_fetch_assoc($res)){
$template=$template.'
<div class="address-item">
<input type="radio" name="dv-ad" value="'.$row['id'].'"
style="width:2rem; height:1.5rem;margin-right:0.8rem;margin-top:0;">
<div class="address-icon1">
<i class="uil uil-home"></i>
</div>
<div class="address-dt-all">
<h4>'.$row['type_ad'].'</h4>
<p>
'.$row['user_name'].', '.$row['user_local'].', '.$row['user_add'].',
'.$row['city_name'].', '.$row['user_pin'].',<br>'.$row['user_mobile'].'
</p>
</div>
</div>
';
}
echo $template;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/remove_promo.php | assets/backend/order/remove_promo.php | <?php
require('../../../utility/utility.php');
$result=array();
$utm=$_SESSION['utm_source'];
$uid=$_SESSION['USER_ID'];
$rs=mysqli_query($con,"select * from cart where u_id='$uid' and belonging_city='$utm'");
$ct=mysqli_fetch_assoc($rs);
$cid=$ct['id'];
$promo=$ct['promo'];
$promo=$promo+$ct['final_amt'];
mysqli_query($con,"update cart set is_applied='0',promo='0',final_amt='$promo' where u_id='$uid' and belonging_city='$utm'");
update_cart($con,$cid);
$result['status_code']=1;
$result['msg']="Removed successfully";
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/apply_wallet.php | assets/backend/order/apply_wallet.php | <?php
require('../../../utility/utility.php');
$promo=get_safe_value($con,$_POST['promo']);
$result=array();
$uid=$_SESSION['USER_ID'];
$res=mysqli_query($con,"select * from user_wallet where user_id='$uid'");
$wt=mysqli_fetch_assoc($res);
$d=mysqli_fetch_assoc($res);
if($wt['ballance']==0){
$result['status_code']=0;
$result['msg']="Wallet ballance is 0";
}else{
$utm=$_SESSION['utm_source'];
$uid=$_SESSION['USER_ID'];
$rs=mysqli_query($con,"select * from cart where u_id='$uid' and belonging_city='$utm'");
$ct=mysqli_fetch_assoc($rs);
$cid=$ct['id'];
if($ct['is_applied']==1){
$result['status_code']=0;
$result['msg']="Promo and wallet can not be used toghether";
}else{
$wallet=$wt['ballance'];
$carttotal=$ct['final_amt'];
if($carttotal>$wallet){
$wlamt=$wallet;
}else if($carttotal<=$wallet){
$wlamt=$carttotal-1;
}
$utm=$_SESSION['utm_source'];
$uid=$_SESSION['USER_ID'];
mysqli_query($con,"update cart set is_add_w='1',wl_amt='$wlamt' where u_id='$uid' and belonging_city='$utm'");
update_cart($con,$cid);
$msg="Used in purchase";
$ghj=$wallet-$wlamt;
mysqli_query($con,"insert into user_w_msg(u_id,cod,msg,balance,is_new) values ('$uid','0','$msg','$wlamt','1')");
mysqli_query($con,"update user_wallet set ballance='$ghj' where user_id='$uid'");
$result['status_code']=0;
$result['msg']="Applied";
}
}
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/remove_wallet.php | assets/backend/order/remove_wallet.php | <?php
require('../../../utility/utility.php');
$result=array();
$utm=$_SESSION['utm_source'];
$uid=$_SESSION['USER_ID'];
$rs=mysqli_query($con,"select * from cart where u_id='$uid' and belonging_city='$utm'");
$ct=mysqli_fetch_assoc($rs);
$cid=$ct['id'];
$promo=$ct['wl_amt'];
$pm=$promo;
$promo=$promo+$ct['final_amt'];
$msg="get form purchase";
mysqli_query($con,"insert into user_w_msg(u_id,cod,msg,balance,is_new) values ('$uid','1','$msg','$pm','1')");
mysqli_query($con,"update user_wallet set ballance=ballance+'$pm' where user_id='$uid'");
mysqli_query($con,"update cart set is_add_w='0',wl_amt='0',final_amt='$promo' where u_id='$uid' and belonging_city='$utm'");
update_cart($con,$cid);
$result['status_code']=1;
$result['msg']="Removed successfully";
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/cnfrm.php | assets/backend/order/cnfrm.php | <?php
require('../../../utility/utility.php');
$oid=get_safe_value($con,$_POST['id']);
mysqli_query($con,"delete from cnfrm_delivery where od_id='$oid'");
mysqli_query($con,"update orders set u_cnfrm='1' where id='$oid'");
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/ncnfrm.php | assets/backend/order/ncnfrm.php | <?php
require('../../../utility/utility.php');
$oid=get_safe_value($con,$_POST['id']);
mysqli_query($con,"insert into isue(oid) values('$oid')");
mysqli_query($con,"insert into order_time(oid,o_status) values('$oid','7')");
mysqli_query($con,"delete from cnfrm_delivery where od_id='$oid'");
mysqli_query($con,"update orders set order_status='7' where id='$oid'");
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/apply_promo.php | assets/backend/order/apply_promo.php | <?php
require('../../../utility/utility.php');
$promo=get_safe_value($con,$_POST['promo']);
$result=array();
$res=mysqli_query($con,"select * from promo where code='$promo'");
$isExists=mysqli_num_rows($res);
if($isExists==0){
$result['status_code']=0;
$result['msg']="Enter a vald promocode";
}else{
$row=mysqli_fetch_assoc($res);
$subcat=$row['scat'];
$minbal=$row['minbal'];
$disc=$row['dis'];
$checkout=get_chekout_products($con);
$totalPrice=0;
foreach($checkout as $product){
if($subcat==$product['scat_id']){
$totalPrice+=$product['fa'];
}
}
if($totalPrice!=0){
if($totalPrice>=$minbal){
$pcntg=($totalPrice*$disc)/100;
$pcntg=round($pcntg,2);
$utm=$_SESSION['utm_source'];
$uid=$_SESSION['USER_ID'];
$rs=mysqli_query($con,"select * from cart where u_id='$uid' and belonging_city='$utm'");
$ct=mysqli_fetch_assoc($rs);
$cid=$ct['id'];
if($ct['is_add_w']==1){
$result['status_code']=0;
$result['msg']="Promo and wallet can not be used toghether";
}else{
mysqli_query($con,"update cart set is_applied='1',promo='$pcntg' where u_id='$uid' and belonging_city='$utm'");
update_cart($con,$cid);
$result['status_code']=1;
$result['msg']="Applied successfully";
}
}else{
$result['status_code']=0;
$result['msg']="Minimum Balance not satisfied";
}
}else{
$result['status_code']=0;
$result['msg']="Promo code is not valid for these products";
}
}
echo json_encode($result);
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/order/checkout.php | assets/backend/order/checkout.php | <?php
require('../../../utility/utility.php');
$address=get_safe_value($con,$_POST['address']);
$time=get_safe_value($con,$_POST['time']);
$time_type=get_safe_value($con,$_POST['time_type']);
$pay=get_safe_value($con,$_POST['pay']);
$order_id=get_new_orderid();
$uid=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$cart=mysqli_fetch_assoc(mysqli_query($con,"select * from cart where u_id='$uid' and belonging_city='$utm'"));
$total_amt=$cart['total'];
$ship=$cart['ship_fee'];
$final_amt=$cart['final_amt'];
$is_applied=$cart['is_applied'];
$promo=$cart['promo'];
$is_add_w=$cart['is_add_w'];
$wl_amt=$cart['wl_amt'];
$txnid= substr(hash('sha256', mt_rand() . microtime()), 0, 20);
$query="INSERT INTO `orders`(`o_id`, `u_id`, `ad_id`, `dv_date`, `dv_time`, `payment_type`, `payment_status`, `order_status`, `txnid`,`total_amt`, `ship_fee_order`, `final_val`, `isnew`,`is_p_app`,`is_w_ap`,`prmo`,`wlmt`) VALUES ('$order_id','$uid','$address','$time','$time_type','$pay','0','1','$txnid','$total_amt','$ship','$final_amt','1','$is_applied','$is_add_w','$promo','$wl_amt')";
mysqli_query($con,$query);
$order=mysqli_fetch_assoc(mysqli_query($con,"select * from orders where u_id='$uid' and o_id='$order_id'"));
$order_table_id=$order['id'];
$cart_id=$cart['id'];
$res=mysqli_query($con,"select * from cart_detail where cart_id='$cart_id'");
while($row=mysqli_fetch_assoc($res)){
$pid=$row['p_id'];
$qty=$row['qty'];
mysqli_query($con,"insert into order_detail(oid,p_id,qty) values('$order_table_id','$pid','$qty')");
}
echo $order_table_id;
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/cart/del_cart.php | assets/backend/cart/del_cart.php | <?php
require('../../../utility/utility.php');
$productid=get_safe_value($con,$_POST['id']);
if(!isset($_SESSION['USER_LOGIN'])){
$index=array_search($productid,$_SESSION['USER_CART']);
unset($_SESSION['CART_QTY'][$index]);
unset($_SESSION['USER_CART'][$index]);
}else{
$uid=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$query= "SELECT cart.belonging_city,cart_detail.id,cart_detail.qty FROM cart,cart_detail WHERE cart.u_id='$uid' AND cart.belonging_city='$utm' and cart_detail.cart_id=cart.id AND cart_detail.p_id='$productid'";
$h=mysqli_fetch_assoc(mysqli_query($con,$query));
$d=$h['id'];
mysqli_query($con,"DELETE FROM cart_detail WHERE id='$d' AND p_id='$productid'");
$ih=mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM cart WHERE u_id='$uid' AND belonging_city='$utm'"));
update_cart($con,$ih['id']);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/cart/cart_i.php | assets/backend/cart/cart_i.php | <?php
require('../../../utility/utility.php');
$productid=get_safe_value($con,$_POST['id']);
$qty=get_safe_value($con,$_POST['cq']);
$d=mysqli_fetch_assoc(mysqli_query($con,"select * from product where id='$productid'"));
$cqty=$d['qty'];
$result=array();
if($qty==$cqty){
$result['msg']="Out of Stock";
$result['code']=0;
echo json_encode($result);
}else{
if(!isset($_SESSION['USER_LOGIN'])){
$index=array_search($productid,$_SESSION['USER_CART']);
$qty++;
$_SESSION['CART_QTY'][$index]=$qty;
}else{
$uid=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$query= "SELECT cart.belonging_city,cart_detail.id,cart_detail.qty FROM cart,cart_detail WHERE cart.u_id='$uid' AND cart.belonging_city='$utm' and cart_detail.cart_id=cart.id AND cart_detail.p_id='$productid'";
$h=mysqli_fetch_assoc(mysqli_query($con,$query));
$fq=$h['qty']+1;
$d=$h['id'];
mysqli_query($con,"UPDATE cart_detail SET qty='$fq' WHERE id='$d'");
$ih=mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM cart WHERE u_id='$uid' AND belonging_city='$utm'"));
update_cart($con,$ih['id']);
}
$result['msg']="Added to Cart";
$result['code']=1;
echo json_encode($result);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/cart/add.php | assets/backend/cart/add.php | <?php
require('../../../utility/utility.php');
$productid=get_safe_value($con,$_POST['id']);
$qty=get_safe_value($con,$_POST['qty']);
$d=mysqli_fetch_assoc(mysqli_query($con,"select * from product where id='$productid'"));
$cqty=$d['qty'];
$result=array();
if($qty>$cqty){
$result['msg']="Out of Stock";
$result['code']=0;
echo json_encode($result);
}else{
if(!isset($_SESSION['USER_LOGIN'])){
if(!isset($_SESSION['USER_CART'])){
$_SESSION['USER_CART']=array();
$_SESSION['CART_QTY']=array();
array_push($_SESSION['USER_CART'],$productid);
array_push($_SESSION['CART_QTY'],$qty);
}else{
if(!in_array($productid,$_SESSION['USER_CART'])){
array_push($_SESSION['USER_CART'],$productid);
array_push($_SESSION['CART_QTY'],$qty);
}
}
}else{
$u_id=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$res=mysqli_query($con,"select * from cart where u_id='$u_id' and belonging_city='$utm'");
$count=mysqli_num_rows($res);
if($count>0){
$f=mysqli_fetch_assoc($res);
$cart_id=$f['id'];
mysqli_query($con,"insert into cart_detail(cart_id,p_id,qty) values('$cart_id','$productid','$qty')");
update_cart($con,$cart_id);
}else{
$query="insert into cart(u_id,belonging_city) values('$u_id','$utm')";
mysqli_query($con,$query);
$f=mysqli_fetch_assoc(mysqli_query($con,"select * from cart where u_id='$u_id' and belonging_city='$utm'"));
$cart_id=$f['id'];
$pd=product_detail($con,$productid);
$ta=$pd['fa']*$qty;
mysqli_query($con,"insert into cart_detail(cart_id,p_id,qty) values('$cart_id','$productid','$qty')");
update_cart($con,$cart_id);
}
}
$result['msg']="Added to Cart";
$result['code']=1;
echo json_encode($result);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/assets/backend/cart/cart_d.php | assets/backend/cart/cart_d.php | <?php
require('../../../utility/utility.php');
$productid=get_safe_value($con,$_POST['id']);
$qty=get_safe_value($con,$_POST['cq']);
if(!isset($_SESSION['USER_LOGIN'])){
$index=array_search($productid,$_SESSION['USER_CART']);
$qty--;
$_SESSION['CART_QTY'][$index]=$qty;
}else{
$uid=$_SESSION['USER_ID'];
$utm=$_SESSION['utm_source'];
$query= "SELECT cart.belonging_city,cart_detail.id,cart_detail.qty FROM cart,cart_detail WHERE cart.u_id='$uid' AND cart.belonging_city='$utm' and cart_detail.cart_id=cart.id AND cart_detail.p_id='$productid'";
$h=mysqli_fetch_assoc(mysqli_query($con,$query));
$fq=$h['qty']-1;
$d=$h['id'];
mysqli_query($con,"UPDATE cart_detail SET qty='$fq' WHERE id='$d'");
$ih=mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM cart WHERE u_id='$uid' AND belonging_city='$utm'"));
update_cart($con,$ih['id']);
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/csOwl.php | require/csOwl.php | <script>
$(document).ready(function () {
$(".owl-carousel").owlCarousel();
});
var owl = $(".main-slider");
owl.owlCarousel({
items: 4,
loop: true,
responsive: {
0: {
items: 1,
},
600: {
items: 2,
},
1000: {
items: 3,
},
1200: {
items: 4,
},
1400: {
items: 4,
},
},
margin: 10,
autoplay: true,
autoplayTimeout: 2500,
autoplayHoverPause: true,
dots: false,
});
$(".cate-slider").owlCarousel({
loop: true,
margin: 30,
nav: true,
dots: false,
navText: [
"<i class='uil uil-angle-left'></i>",
"<i class='uil uil-angle-right'></i>",
],
responsive: {
0: {
items: 2,
},
375: {
items: 2,
},
600: {
items: 3,
},
1000: {
items: 4,
},
1200: {
items: 6,
},
1400: {
items: 6,
},
},
});
$(".product-slider").owlCarousel({
loop: true,
margin: 30,
nav: true,
dots: false,
navText: [
"<i class='uil uil-angle-left'></i>",
"<i class='uil uil-angle-right'></i>",
],
responsive: {
0: {
items: 1,
},
610: {
items: 2,
},
600: {
items: 3,
},
1000: {
items: 4,
},
},
});
</script> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/last.php | require/last.php | </body>
</html> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/ac-left.php | require/ac-left.php | <div class="left">
<div class="ul-wrapper">
<ul>
<li <?php if($_SERVER['PHP_SELF']==D."/myac.php"){ echo "class='active'"; } ?>>
<i class="uil uil-box"></i>
<a href="myac.php">My Orders</a>
</li>
<li <?php if($_SERVER['PHP_SELF']==D."/wallet.php"){ echo "class='active'"; } ?>>
<i class="uil uil-wallet"></i>
<a href="wallet.php">My Wallet</a>
</li>
<li <?php if($_SERVER['PHP_SELF']==D."/wishlist.php"){ echo "class='active'"; } ?>>
<i class="uil uil-heart"></i>
<a href="wishlist.php">My Wishlist</a>
</li>
<li <?php if($_SERVER['PHP_SELF']==D."/address.php" || $_SERVER['PHP_SELF']==D."/edit_address.php" || $_SERVER['PHP_SELF']==D."/add_address.php"){ echo "class='active'"; } ?>>
<i class="uil uil-location-point"></i>
<a href="address.php">My Address</a>
</li>
<li onclick="logout()">
<i class="uil uil-sign-out-alt"></i>
<a href="javascript:void(0)">Logout</a>
</li>
</ul>
</div>
</div> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/headbanner.php | require/headbanner.php | <?php
$userid=$_SESSION['USER_ID'];
$userData=mysqli_fetch_assoc(mysqli_query($con,"select users.*,user_wallet.ballance from users,user_wallet where users.id='$userid' and user_wallet.user_id=users.id"));
?>
<div class="headbanner">
<div class="userimage">
<img src="assets/images/img-5.jpg" alt="" />
</div>
<h4><?php echo $userData['name'] ?></h4>
<p>
+91 <?php echo $userData['mobile'] ?>
<a href="#"><i class="uil uil-edit"></i></a>
</p>
<div class="earn-points">
<img src="assets/images/Dollar.svg" alt="" />Ballance :
<span>₹<?php echo $userData['ballance'] ?></span>
</div>
</div> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/top.php | require/top.php | <?php
require("utility/utility.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="assets/images/logo.png" type="image/x-icon" />
<title>Document</title>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/sweetalert.js"></script>
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css" />
<link rel="stylesheet" href="assets/css/owl.carousel.min.css" />
<link rel="stylesheet" href="assets/css/owl.theme.default.min.css" />
</head>
<body>
<div class="responsive-search" id="rss">
<div class="closediv">
<i class="uil uil-times" onclick="closerss()"></i>
</div>
<div class="seachbox">
<form action="view.php" method="GET">
<input type="hidden" value="" name="n" id="cat" />
<input type="text" placeholder="Search Products" name="k" />
<button>
<i class="uil uil-search"></i>
</button>
</form>
<div class="location fadeup">
<input type="text" placeholder="Search category here" id="locatin_search" oninput="search_city()" />
<ul>
<?php
$res=mysqli_query($con,"select * from categories");
while($row=mysqli_fetch_assoc($res)){
?>
<li onclick="set(<?php echo $row['id']; ?>)">
<i class="uil uil-apps"></i>
<a href="javascript:void(0)" class="cn-search"><?php echo $row['category']; ?></a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
<header class="header">
<div class="top-header">
<div class="th">
<div class="logo">
<a href="index.php">
<img src="assets/images/logo.png" alt="logo" />
</a>
</div>
<div class="name">
Krables <br />
<span>Market</span>
</div>
<div class="selecloc">
<div class="dropdown" tabindex="0">
<div class="text">
<i class="uil uil-location-point"></i>
<?php
if(isset($_GET['utm_source'])){
$source=$_GET['utm_source'];
$c=mysqli_num_rows(mysqli_query($con,"select * from city where id='$source'"));
if($c==0){
redirect('index.php');
die();
}
if(isset($_SESSION['utm_source'])){
if($_GET['utm_source']!=$_SESSION['utm_source']){
if(isset($_SESSION['USER_CART'])){
unset($_SESSION['USER_CART']);
unset($_SESSION['CART_QTY']);
}
$_SESSION['utm_source']=$source;
echo getcity($con,$_SESSION['utm_source']);
}else{
echo getcity($con,$_SESSION['utm_source']);
}
}else{
$_SESSION['utm_source']=$source;
echo getcity($con,$_SESSION['utm_source']);
}
}else{
if(isset($_SESSION['utm_source'])){
echo getcity($con,$_SESSION['utm_source']);
}else{
echo "Location";
}
}
?>
</div>
<i class="uil uil-angle-down icon__14"></i>
</div>
<div class="location fadeup" id="lcnpnl">
<input type="text" placeholder="Search here" id="location_search" oninput="search_city()" />
<ul>
<?php
$res=mysqli_query($con,"select * from city");
while($row=mysqli_fetch_assoc($res)){
?>
<li>
<i class="uil uil-location-point"></i>
<a href="index.php?utm_source=<?php echo $row['id']; ?>"
class="lcn-search"><?php echo $row['city_name']; ?></a>
</li>
<?php } ?>
</ul>
</div>
</div>
<div class="searchbox">
<span>
<i class="uil uil-create-dashboard" onclick="show_cat()"></i>
<i class="uil uil-angle-down icon__14" onclick="show_cat()"></i>
</span>
<form action="view.php" method="GET">
<input type="hidden" value="" name="n" id="cat" />
<input type="text" placeholder="Search Products" name="k" />
<button>
<i class="uil uil-search"></i>
</button>
</form>
<div class="location fadeup" id="ctcnpnl">
<input type="text" placeholder="Search here" id="cat_search" oninput="search_cat()" />
<ul>
<?php
$res=mysqli_query($con,"select * from categories");
while($row=mysqli_fetch_assoc($res)){
?>
<li onclick="set(<?php echo $row['id']; ?>)">
<i class="uil uil-apps"></i>
<a href="javascript:void(0)" class="cn-search"><?php echo $row['category']; ?></a>
</li>
<?php } ?>
</ul>
</div>
</div>
<div class="rightbox">
<ul>
<li>
<a href="" class="rightlink">
<i class="uil uil-phone-alt"></i>
1800-000-0000
</a>
</li>
<li>
<a href="" class="rightlink">
<i class="uil uil-gift"></i>
Offers
</a>
</li>
<li>
<a href="" class="rightlink">
<i class="uil uil-question-circle"></i>
Help
</a>
</li>
<li>
<a href="wishlist.php" class="rightlink wl">
<i class="uil uil-heart icon_wishlist"></i>
<span class="noti_count1">
<?php
if(isset($_SESSION['USER_LOGIN'])){
$uid=$_SESSION['USER_ID'];
$num=mysqli_num_rows(mysqli_query($con,"select * from wishlist where u_id='$uid'"));
echo $num;
}else{
echo 0;
}
?>
</span>
</a>
</li>
<li class="user">
<a href="javascript:void(0)" class="rightlink">
<i class="uil uil-user-circle bg" onclick="show_userpanel()">
</i>
</a>
<div class="userpanel fadeup" id="userpanel">
<ul>
<li>
<i class="uil uil-chat-bubble-user"></i><a href="myac.php">My Account</a>
</li>
<li><i class="uil uil-box"></i><a href="myac.php">My Orders</a></li>
<li>
<i class="uil uil-heart-alt"></i><a href="wishlist.php">My Wishlist</a>
</li>
<li>
<i class="uil uil-shopping-cart"></i><a href="cart.php">My Cart</a>
</li>
<li>
<i class="uil uil-wallet"></i><a href="wallet.php">My Wallet</a>
</li>
<li>
<i class="uil uil-map-marker-alt"></i><a href="address.php">My Address</a>
</li>
<?php if(isset($_SESSION['USER_LOGIN'])){
?>
<li onclick="logout()">
<i class="uil uil-signout"></i><a href="javascript:void(0)">Logout</a>
</li>
<?php
}else{
?>
<li>
<i class="uil uil-signin"></i><a href="auth/v2/">Login</a>
</li>
<?php
} ?>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="bottom-header">
<div class="sub-header">
<div class="hamberger" onclick="sidebar()">
<i class="uil uil-bars"></i>
</div>
<nav>
<div class="div"><a href="index.php">Home</a></div>
<?php
$res=mysqli_query($con,"select * from categories limit 10");
while($row=mysqli_fetch_assoc($res)){
?>
<div class="div">
<?php
echo $row['category'];
?>
<i class="uil uil-angle-down icon__14"></i>
<div class="userpanel fadeup" id="userpanel">
<ul>
<?php
$cid=$row['id'];
$res2=mysqli_query($con,"select * from subcategories where cat_id='$cid'");
while($row2=mysqli_fetch_assoc($res2)){
?>
<li>
<a href="view.php?n=<?php echo $row['id'] ?>&k=&scat=<?php echo $row2['id'] ?>"><?php echo $row2['subcat']; ?></a>
</li>
<?php } ?>
</ul>
</div>
</div>
<?php
}
?>
</nav>
<div class="cart-right" onclick="control.redirect('cart.php')">
<i class="uil uil-shopping-cart-alt"></i>Cart
</div>
<div class="srch" onclick="openrss()">
<i class="uil uil-search"></i>
</div>
</div>
</div>
</header>
<div class="slider" id="sidebar">
<ul>
<li class="flex flex-center"><a href=""> Home </a></li>
<?php
$res=mysqli_query($con,"select * from categories limit 10");
while($row=mysqli_fetch_assoc($res)){
?>
<li>
<span class="flex flex-center" onclick="expand(this)">
<?php
echo $row['category'];
?>
<i class="uil uil-angle-down icon__14"></i>
</span>
<ul class="inner-ul">
<?php
$cid=$row['id'];
$res2=mysqli_query($con,"select * from subcategories where cat_id='$cid'");
while($row2=mysqli_fetch_assoc($res2)){
?>
<li class="inner-li">
<a href="view.php?n=<?php echo $row['id'] ?>&k=&scat=<?php echo $row2['id'] ?>"><?php echo $row2['subcat']; ?></a>
</li>
<?php } ?>
</ul>
</li>
<?php } ?>
</ul>
</div>
| php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/require/foot.php | require/foot.php | <section class="defaultPadding mt4 footer">
<div class="footer-row1">
<div class="container">
<div class="row flex">
<ul class="ul1">
<li>
<a href="#">
<i class="uil uil-dialpad-alt"></i>
1800-000-000
</a>
</li>
<li>
<a href="#">
<i class="uil uil-envelope-alt"></i>
info@Krables.com
</a>
</li>
</ul>
<ul class="ul2">
<li>
<a href="#">
<i class="uil uil-facebook-f"></i>
</a>
</li>
<li>
<a href="#">
<i class="uil uil-twitter"></i>
</a>
</li>
<li>
<a href="#">
<i class="uil uil-google"></i>
</a>
</li>
<li>
<a href="#">
<i class="uil uil-linkedin-alt"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="footer-row2">
<div class="container">
<div class="row">
<ul class="ul1">
<li class="heading">
<h4>Categories</h4>
</li>
<ul class="ul-sub">
<li>Fruits and Vegetables</li>
<li>Grocery & Staples</li>
<li>Dairy & Eggs</li>
<li>Beverages</li>
<li>Snacks</li>
<li>Fruits and Vegetables</li>
<li>Grocery & Staples</li>
<li>Dairy & Eggs</li>
<li>Beverages</li>
<li>Snacks</li>
</ul>
</ul>
<ul class="ul1">
<li class="heading">
<h4>Usefull Links</h4>
</li>
<ul class="ul-sub">
<li>Fruits and Vegetables</li>
<li>Dairy & Eggs</li>
<li>Beverages</li>
<li>Snacks</li>
<li>Snacks</li>
<li>Beverages</li>
<li>Snacks</li>
</ul>
</ul>
<ul class="ul1">
<li class="heading">
<h4>Top Cities</h4>
</li>
<ul class="ul-sub">
<li>Fruits and Vegetables</li>
<li>Grocery & Staples</li>
<li>Snacks</li>
<li>Fruits and</li>
<li>Grocery & Staples</li>
<li>Dairy & Eggs</li>
<li>Beverages</li>
<li>Snacks</li>
</ul>
</ul>
<ul class="ul1">
<li class="heading">
<h4>Download App</h4>
</li>
<ul class="ul-sub da">
<li class="dbnt">
<a href="">
<img src="assets/images/svg/download-1.svg" alt="" />
</a>
</li>
<li class="dbnt">
<a href="">
<img src="assets/images/svg/download-2.svg" alt="" />
</a>
</li>
</ul>
<li class="heading thd">
<h4><b>Payment Mode</b></h4>
</li>
<ul class="ul-sub t flex">
<li class="dbnt">
<a href="">
<img src="assets/images/svg/pyicon-1.svg" alt="" />
</a>
</li>
<li class="dbnt">
<a href="">
<img src="assets/images/svg/pyicon-2.svg" alt="" />
</a>
</li>
<li class="dbnt">
<a href="">
<img src="assets/images/svg/pyicon-3.svg" alt="" />
</a>
</li>
<li class="dbnt">
<a href="">
<img src="assets/images/svg/pyicon-4.svg" alt="" />
</a>
</li>
<li class="dbnt">
<a href="">
<img src="assets/images/svg/pyicon-6.svg" alt="" />
</a>
</li>
</ul>
<li class="heading thd">
<h4><b>News Letter</b></h4>
</li>
<ul class="ul-sub t flex nl">
<form action="#">
<input type="text" name="" placeholder="Email Address" />
<button><i class="uil uil-telegram-alt"></i></button>
</form>
</ul>
</ul>
</div>
</div>
</div>
<div class="footer-3">
<span> Developed by Ayondip Jana</span>
</div>
</section>
<script src="assets/js/script.js"></script>
<script src="assets/js/owl.carousel.min.js"></script> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/utility/function.php | utility/function.php | <?php
function pre($arr)
{
echo '<pre>';
print_r($arr);
}
function prx($arr)
{
echo '<pre>';
print_r($arr);
die();
}
function get_safe_value($con, $str)
{
if ($str != '') {
$str = trim($str);
return mysqli_real_escape_string($con, $str);
}
}
function redirect($path)
{
?>
<script>
window.location.href = '<?php echo $path; ?>';
</script>
<?php
}
function get_code()
{
$code = chr(64 + rand(1, 25)) . rand(11, 99) . chr(64 + rand(1, 25)) . chr(64 + rand(1, 25)) . rand(11, 99) . chr(64 + rand(1, 25));
return $code;
}
function get_subcat_product($con, $p_id, $s_id)
{
$sql = "select * from product where category='$p_id' and subcat='$s_id' and isapp='1' and status='1' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_subcat_product_filter($con, $p_id, $s_id, $f_id)
{
$sql = "select product.*,filters.name from product,filters where product.category='$p_id' and product.subcat='$s_id' and filters.subcat=product.subcat and filters.name='$f_id' and product.isapp='1' and product.status='1' order by product.id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_subcat_product_sfilter($con, $p_id, $s_id, $f_id, $sf_id)
{
$sql = "select product.*,filters.name,product_subfilters.subfilter from product,filters,product_subfilters where product.category='$p_id' and product.subcat='$s_id' and filters.subcat=product.subcat and filters.name='$f_id' and product.isapp='1' and product.status='1' and product_subfilters.subfilter='$sf_id' and product_subfilters.pid=product.id order by product.id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function product_detail($con, $id)
{
$sql = "select product.*,sellers.f_name from product,sellers where product.id='$id' and product.added_by=sellers.id";
$res = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($res);
return $row;
}
function encryptid($id)
{
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$encryption_iv = '1234567891011121';
$key = "1top8ku";
$encryption = openssl_encrypt($id, $ciphering, $key, $options, $encryption_iv);
return $encryption;
}
function decryptid($id)
{
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$decryption_iv = '1234567891011121';
$key = "1top8ku";
$decryption = openssl_decrypt($id, $ciphering, $key, $options, $decryption_iv);
return $decryption;
}
function get_treanding_products($con)
{
$sql = "select * from product where status='1' and bs='1' and isapp='1' order by id desc limit 6";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_bestsell_products($con)
{
$sql = "select * from product where status='1' and bs='1' and isapp='1' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_all_products($con)
{
$sql = "select * from product where status='1' and isapp='1' order by id desc limit 12";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_all_categories($con)
{
$sql = "select * from categories where status='1' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_all_sub_categories($con, $p_cat)
{
$sql = "select * from subcategories where cat_id='$p_cat' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_all_sub_categories_filters($con, $p_cat)
{
$sql = "select * from filter where subcat_id='$p_cat' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_all_sub_filters($con, $p_cat)
{
$sql = "select * from sub_filter where filter_id='$p_cat' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function search_product($con, $search_name, $cat, $scat = '', $filter = '', $sfilter = '')
{
$add = "";
$sql = "";
if ($scat != '') {
$add = " and scat_id='$scat'";
}
if (isset($cat) && $cat != '') {
$gg = "and cat_id='$cat'";
} else {
$gg = '';
}
if ($filter == '' && $sfilter == '') {
$sql = "select * from product where status='1' $gg and(product_name like '%$search_name%' or description like '%$search_name%') $add";
} else {
if ($filter != '' && $sfilter == '') {
$sql = "select product.*,p_filter.fid from product,p_filter where product.status='1' and product.cat_id='$cat' and product.scat_id='$scat' and(product.product_name like '%$search_name%' or product.description like '%$search_name%') and p_filter.pid=product.id and p_filter.fid='$filter'";
} else {
$sql = "select product.*,p_filter.fid,p_sfilter.sfid from product,p_filter,p_sfilter where product.status='1' and product.cat_id='$cat' and product.scat_id='$scat' and(product.product_name like '%$search_name%' or product.description like '%$search_name%') and p_filter.pid=product.id and p_sfilter.pid=product.id and p_filter.fid='$filter' and p_sfilter.sfid='$sfilter'";
}
}
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_cart_products($con)
{
if (!isset($_SESSION['USER_LOGIN'])) {
if (isset($_SESSION['USER_CART'])) {
$cart = array();
foreach ($_SESSION['USER_CART'] as $cart_item) {
array_push($cart, product_detail($con, $cart_item));
}
for ($i = 0; $i < count($cart); $i++) {
$cart[$i]['product_qty'] = $_SESSION['CART_QTY'][$i];
}
return $cart;
} else {
return array();
}
} else if (isset($_SESSION['USER_LOGIN'])) {
$uid = $_SESSION['USER_ID'];
$utm = $_SESSION['utm_source'];
$sql = "select cart.belonging_city,cart_detail.qty,product.img1,product.product_name,product.fa,product.id from cart,cart_detail,product where cart.u_id='$uid' and cart.belonging_city='$utm' and cart_detail.cart_id=cart.id and cart_detail.p_id=product.id";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
}
function get_id()
{
$code = chr(97 + rand(1, 25)) . rand(11, 99) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . rand(11, 99) . chr(97 + rand(1, 25));
return $code;
}
function OTP()
{
$code = chr(65 + rand(1, 25)) . rand(11, 99) . chr(65 + rand(1, 25)) . chr(65 + rand(1, 25)) . rand(11, 99) . chr(65 + rand(1, 25));
return $code;
}
function calc_discount($price, $discount)
{
$t = ($price * $discount) / 100;
$fp = $price - $t;
return $fp;
}
function add_cart_a_login($con, $productid)
{
$qty = 1;
$u_id = $_SESSION['USER_ID'];
$utm = $_SESSION['utm_source'];
$res = mysqli_query($con, "select * from cart where u_id='$u_id' and belonging_city='$utm'");
$count = mysqli_num_rows($res);
if ($count > 0) {
$f = mysqli_fetch_assoc($res);
$cart_id = $f['id'];
mysqli_query($con, "insert into cart_detail(cart_id,p_id,qty) values('$cart_id','$productid','$qty')");
update_cart($con, $cart_id);
} else {
$query = "insert into cart(u_id,belonging_city) values('$u_id','$utm')";
mysqli_query($con, $query);
$f = mysqli_fetch_assoc(mysqli_query($con, "select * from cart where u_id='$u_id' and belonging_city='$utm'"));
$cart_id = $f['id'];
$pd = product_detail($con, $productid);
$ta = $pd['fa'] * $qty;
mysqli_query($con, "insert into cart_detail(cart_id,p_id,qty) values('$cart_id','$productid','$qty')");
update_cart($con, $cart_id);
}
}
function get_user_address($con)
{
$id = $_SESSION['USER_ID'];
$sql = "select * from user_address where u_id='$id' order by id desc";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function is_address_added($con)
{
$id = $_SESSION['USER_ID'];
$sql = "select * from users where id='$id'";
$res = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($res);
$isa = $row['a_added'];
return $isa;
}
function is_mobile_verified($con)
{
$id = $_SESSION['USER_ID'];
$sql = "select * from users where id='$id'";
$res = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($res);
$isa = $row['m_vfd'];
return $isa;
}
function is_email_verified($con)
{
$id = $_SESSION['USER_ID'];
$sql = "select * from users where id='$id'";
$res = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($res);
$isa = $row['e_vfd'];
return $isa;
}
function fetch_address($con)
{
$id = $_SESSION['USER_ID'];
$sql = "select * from user_address where u_id='$id'";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function get_new_orderid()
{
$code = "OD" . chr(65 + rand(1, 25)) . rand(1, 99) . time();
return $code;
}
function get_total_categories($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from categories"));
return $n;
}
function get_total_subcat($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from sub_cat"));
return $n;
}
function get_total_order($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from orders"));
return $n;
}
function get_total_orders_successfull($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from orders where order_status='5'"));
return $n;
}
function get_total_orders($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from orders"));
return $n;
}
function get_total_revenew($con)
{
$rs = mysqli_query($con, "select * from orders where order_status='5'");
$total = 0;
while ($tu = mysqli_fetch_assoc($rs)) {
$id = $tu['id'];
$order_total = $tu['final_val'];
$order_ship = $tu['ship_fee_order'];
$fc = mysqli_query($con, "select * from order_stlmnt where oid='$id'");
$paid = 0;
while ($w = mysqli_fetch_assoc($fc)) {
$paid += $w['val'];
}
$total += ($order_total + $order_ship) - $paid;
}
return round($total, 2);
}
function get_total_order_seller($con, $id)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from orders where seller_id='$id'"));
return $n;
}
function get_total_product($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from product"));
return $n;
}
function get_total_product_seller($con, $id)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from product where added_by='$id'"));
return $n;
}
function get_total_seller($con)
{
$n = mysqli_num_rows(mysqli_query($con, "select * from sellers"));
return $n;
}
function getMyOrders2($con, $type, $uc = '')
{
$sellerId = $_SESSION['SELLER_ID'];
$int = 2;
if ($type == 2) {
$int = 2;
} else if ($type == 3) {
$int = 3;
} else if ($type == 4) {
$int = 4;
}
if ($type == 5) {
$int = 5;
}
if ($type == 6) {
$int = 6;
}
if ($type == 7) {
$int = 7;
}
if ($uc != '') {
$uc = "and orders.u_cnfrm='$uc'";
}
$query = "SELECT
orders.o_id,
order_time.added_on,
order_detail.p_id,
product.added_by
FROM
orders,
order_time,
order_detail,
product
WHERE
order_detail.oid = orders.id AND order_time.oid = orders.id AND order_time.o_status = orders.order_status AND order_detail.p_id = product.id AND product.added_by = '$sellerId' AND orders.order_status='$int' $uc";
$res = mysqli_query($con, $query);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return filterOrders($product_arr);
}
function filterOrders($order)
{
$finalArray = array();
foreach ($order as $product) {
if (!in_array($product['o_id'], $finalArray)) {
array_push($finalArray, $product['o_id']);
}
}
return $finalArray;
}
function getMyOrders($con, $type, $f = '')
{
$product_arr = array();
$allOrders = getMyOrders2($con, $type, $f);
foreach ($allOrders as $order) {
$od = $order;
$res = mysqli_query($con, "select orders.id,orders.o_id,order_time.added_on from orders,order_time where orders.o_id='$od' and order_time.oid = orders.id and order_time.o_status = orders.order_status");
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
}
return $product_arr;
}
function getSubArray($arr, $size)
{
$temp = array();
for ($i = 0; $i < count($arr); $i += $size) {
array_push($temp, array_slice($arr, $i, $i + $size));
}
return $temp;
}
function authorise_user()
{
if (!isset($_SESSION['USER_LOGIN'])) {
redirect('auth/v2/');
}
}
function authorise_user2()
{
if (!isset($_SESSION['USER_LOGIN'])) {
redirect('auth/v2/');
}
}
function authorise($con)
{
if (!isset($_SESSION['SELLER_LOGIN'])) {
redirect('auth/v2/');
}
}
function authorise_delivery($con)
{
if (!isset($_SESSION['DELIVERY_LOGIN'])) {
redirect('auth/v2/');
}
}
function profile_completed($con)
{
$seller_id = $_SESSION['SELLER_ID'];
$row = mysqli_fetch_assoc(mysqli_query($con, "select * from sellers where id='$seller_id'"));
return $row['is_cp'];
}
function seller_name($con)
{
$name = '';
$seller_id = $_SESSION['SELLER_ID'];
$row = mysqli_fetch_assoc(mysqli_query($con, "select * from sellers where id='$seller_id'"));
if ($row['f_name'] == '') {
return "Hii";
} else {
return $row['f_name'];
}
}
function R_v()
{
$h = chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25));
return $h;
}
function access_token()
{
$code = chr(97 + rand(1, 25)) . rand(11, 99) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . rand(11, 99) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . chr(97 + rand(1, 25)) . rand(11, 99) . chr(97 + rand(1, 25));
$sv_name = R_v();
$_SESSION[$sv_name] = $code;
$final = $code . "&verify=" . $sv_name;
return $final;
}
function authenticate_user($con, $access_token, $verify)
{
if (!isset($_SESSION[$verify])) {
redirect('index.php');
} else {
if ($_SESSION[$verify] != $access_token) {
unset($_SESSION[$verify]);
redirect('index.php');
} else {
unset($_SESSION[$verify]);
}
}
}
function hash_code()
{
return password_hash($_SESSION['SELLER_ID'], PASSWORD_DEFAULT);
}
function authenticate_seller($access_token)
{
if (!password_verify($_SESSION['SELLER_ID'], $access_token)) {
redirect('index.php');
}
}
function profle_verified($con)
{
$seller_id = $_SESSION['SELLER_ID'];
$row = mysqli_fetch_assoc(mysqli_query($con, "select * from sellers where id='$seller_id'"));
return $row['isapp'];
}
function get_all_param($g)
{
$result = array();
foreach ($_GET as $j => $g) {
array_push($result, $j);
}
return $result;
}
function get_featured_products($con)
{
$source = $_SESSION['utm_source'];
$sql = "select * from product where belonging_city='$source' and status='1' and isappp='1'";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function verify_source($con, $source)
{
$c = mysqli_num_rows(mysqli_query($con, "select * from city where id='$source'"));
if ($c == 0) {
redirect('index.php');
} else {
if (isset($_SESSION['utm_source'])) {
if ($_SESSION['utm_source'] != $source) {
if (isset($_SESSION['USER_CART'])) {
unset($_SESSION['USER_CART']);
unset($_SESSION['CART_QTY']);
}
$_SESSION['utm_source'] = $source;
}
} else {
$_SESSION['utm_source'] = $source;
}
}
}
function getcity($con, $source)
{
$y = mysqli_fetch_assoc(mysqli_query($con, "select * from city where id='$source'"));
return $y['city_name'];
}
function user_vfd_efd($con)
{
$id = $_SESSION['USER_ID'];
$m = mysqli_fetch_assoc(mysqli_query($con, "select * from users where id='$id'"));
if ($m['m_vfd'] != 1 && $m['e_vfd'] != 1) {
redirect('verify_ME.php');
}
}
function user_vfd_efd2($con)
{
$id = $_SESSION['USER_ID'];
$m = mysqli_fetch_assoc(mysqli_query($con, "select * from users where id='$id'"));
if ($m['m_vfd'] == 1 && $m['e_vfd'] == 1) {
redirect('index.php');
}
}
function myOrders($con,$source)
{
$sql = "select * from product where belonging_city='$source' and status='1' and isappp='1'";
$res = mysqli_query($con, $sql);
$product_arr = array();
while ($row = mysqli_fetch_assoc($res)) {
$product_arr[] = $row;
}
return $product_arr;
}
function update_cart($con, $cart_id)
{
$res = mysqli_query($con, "select * from cart_detail where cart_id='$cart_id'");
$totalPrice = 0;
$finalPrice = 0;
$ship = 0;
$isship = 1;
$wallet_amt = 0;
$promo = 0;
while ($row = mysqli_fetch_assoc($res)) {
$product = product_detail($con, $row['p_id']);
$totalPrice += ($product['fa'] * $row['qty']);
}
$f = mysqli_fetch_assoc(mysqli_query($con, "select * from cart where id='$cart_id'"));
$fn = mysqli_fetch_assoc(mysqli_query($con, "select * from dc"));
if ($totalPrice <= $fn['dc']) {
$ship = $fn['pc'];
} else {
$ship = 0;
$isship = 0;
}
if ($f['is_add_w'] == 1) {
$wallet_amt = $f['wl_amt'];
} else {
$wallet_amt = 0;
}
if ($f['is_applied'] == 1) {
$promo = $f['promo'];
} else {
$promo = 0;
}
$finalPrice = ($totalPrice + $ship) - ($wallet_amt + $promo);
mysqli_query($con, "update cart set total='$totalPrice',ship_fee='$ship',final_amt='$finalPrice' where id='$cart_id'");
}
function get_chekout_products($con)
{
$id = $_SESSION['USER_ID'];
$utm = $_SESSION['utm_source'];
$query = "SELECT cart.belonging_city,cart.total,cart.promo,cart.is_add_w,cart.wl_amt,cart.is_applied,cart.final_amt,cart.ship_fee,cart_detail.id,cart_detail.p_id,cart_detail.qty,product.scat_id,product.img1,product.product_name,product.fa,product.price FROM cart,cart_detail,product WHERE cart.u_id='$id' AND cart.belonging_city='$utm' and cart_detail.cart_id=cart.id AND cart_detail.p_id=product.id";
$h = mysqli_query($con, $query);
$product = array();
while ($row = mysqli_fetch_assoc($h)) {
$product[] = $row;
}
return $product;
}
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/utility/connection.php | utility/connection.php | <?php
session_start();
$con= mysqli_connect('db','root','passwd');
mysqli_select_db($con,'grocerry');
define('D',"/backend_projects/grocerry");
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
detronetdip/E-commerce | https://github.com/detronetdip/E-commerce/blob/a9368863c2fb493bb9f14582bcf6410377e06521/utility/utility.php | utility/utility.php | <?php
require('connection.php');
require('function.php');
?> | php | MIT | a9368863c2fb493bb9f14582bcf6410377e06521 | 2026-01-05T05:22:32.990752Z | false |
Voronenko/PHPOTP | https://github.com/Voronenko/PHPOTP/blob/901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9/code/example.php | code/example.php | <?php
require_once('rfc6238.php');
$secretkey = 'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ';
$currentcode = '571427';
if (TokenAuth6238::verify($secretkey,$currentcode)) {
echo "Code is valid\n";
} else {
echo "Invalid code\n";
}
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl('','',$secretkey,'My%20App'));
print TokenAuth6238::getTokenCodeDebug($secretkey,0); | php | MIT | 901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9 | 2026-01-05T05:22:36.337638Z | false |
Voronenko/PHPOTP | https://github.com/Voronenko/PHPOTP/blob/901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9/code/base32static.php | code/base32static.php | <?php
/**
* Encode in Base32 based on RFC 4648.
* Requires 20% more space than base64
* Great for case-insensitive filesystems like Windows and URL's (except for = char which can be excluded using the pad option for urls)
*
* @package default
* @author Bryan Ruiz
**/
class Base32Static {
private static $map = array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
'=' // padding character
);
private static $flippedMap = array(
'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
);
/**
* Use padding false when encoding for urls
*
* @return base32 encoded string
* @author Bryan Ruiz
**/
public static function encode($input, $padding = true) {
if(empty($input)) return "";
$input = str_split($input);
$binaryString = "";
for($i = 0; $i < count($input); $i++) {
$binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
}
$fiveBitBinaryArray = str_split($binaryString, 5);
$base32 = "";
$i=0;
while($i < count($fiveBitBinaryArray)) {
$base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
$i++;
}
if($padding && ($x = strlen($binaryString) % 40) != 0) {
if($x == 8) $base32 .= str_repeat(self::$map[32], 6);
else if($x == 16) $base32 .= str_repeat(self::$map[32], 4);
else if($x == 24) $base32 .= str_repeat(self::$map[32], 3);
else if($x == 32) $base32 .= self::$map[32];
}
return $base32;
}
public static function decode($input) {
if(empty($input)) return;
$paddingCharCount = substr_count($input, self::$map[32]);
$allowedValues = array(6,4,3,1,0);
if(!in_array($paddingCharCount, $allowedValues)) return false;
for($i=0; $i<4; $i++){
if($paddingCharCount == $allowedValues[$i] &&
substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
}
$input = str_replace('=','', $input);
$input = str_split($input);
$binaryString = "";
for($i=0; $i < count($input); $i = $i+8) {
$x = "";
if(!in_array($input[$i], self::$map)) return false;
for($j=0; $j < 8; $j++) {
$x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
}
$eightBits = str_split($x, 8);
for($z = 0; $z < count($eightBits); $z++) {
$binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
}
}
return $binaryString;
}
}
| php | MIT | 901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9 | 2026-01-05T05:22:36.337638Z | false |
Voronenko/PHPOTP | https://github.com/Voronenko/PHPOTP/blob/901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9/code/rfc6238.php | code/rfc6238.php | <?php
// http://www.faqs.org/rfcs/rfc6238.html
require_once(dirname(__FILE__).'/base32static.php');
class TokenAuth6238 {
/**
* verify
*
* @param string $secretkey Secret clue (base 32).
* @return bool True if success, false if failure
*/
public static function verify($secretkey, $code, $rangein30s = 3) {
$key = base32static::decode($secretkey);
$unixtimestamp = time()/30;
for($i=-($rangein30s); $i<=$rangein30s; $i++) {
$checktime = (int)($unixtimestamp+$i);
$thiskey = self::oath_hotp($key, $checktime);
if ((int)$code == self::oath_truncate($thiskey,6)) {
return true;
}
}
return false;
}
public static function getTokenCode($secretkey,$rangein30s = 3) {
$result = "";
$key = base32static::decode($secretkey);
$unixtimestamp = time()/30;
for($i=-($rangein30s); $i<=$rangein30s; $i++) {
$checktime = (int)($unixtimestamp+$i);
$thiskey = self::oath_hotp($key, $checktime);
$result = $result." # ".self::oath_truncate($thiskey,6);
}
return $result;
}
public static function getTokenCodeDebug($secretkey,$rangein30s = 3) {
$result = "";
print "<br/>SecretKey: $secretkey <br/>";
$key = base32static::decode($secretkey);
print "Key(base 32 decode): $key <br/>";
$unixtimestamp = time()/30;
print "UnixTimeStamp (time()/30): $unixtimestamp <br/>";
for($i=-($rangein30s); $i<=$rangein30s; $i++) {
$checktime = (int)($unixtimestamp+$i);
print "Calculating oath_hotp from (int)(unixtimestamp +- 30sec offset): $checktime basing on secret key<br/>";
$thiskey = self::oath_hotp($key, $checktime, true);
print "======================================================<br/>";
print "CheckTime: $checktime oath_hotp:".$thiskey."<br/>";
$result = $result." # ".self::oath_truncate($thiskey,6,true);
}
return $result;
}
public static function getBarCodeUrl($username, $domain, $secretkey, $issuer) {
$url = "http://chart.apis.google.com/chart";
$url = $url."?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/";
$url = $url.$username . "@" . $domain . "%3Fsecret%3D" . $secretkey . '%26issuer%3D' . rawurlencode($issuer);
return $url;
}
public static function generateRandomClue($length = 16) {
$b32 = "234567QWERTYUIOPASDFGHJKLZXCVBNM";
$s = "";
for ($i = 0; $i < $length; $i++)
$s .= $b32[rand(0,31)];
return $s;
}
private static function hotp_tobytestream($key) {
$result = array();
$last = strlen($key);
for ($i = 0; $i < $last; $i = $i + 2) {
$x = $key[$i] + $key[$i + 1];
$x = strtoupper($x);
$x = hexdec($x);
$result = $result.chr($x);
}
return $result;
}
private static function oath_hotp ($key, $counter, $debug=false) {
$result = "";
$orgcounter = $counter;
$cur_counter = array(0,0,0,0,0,0,0,0);
if ($debug) {
print "Packing counter $counter (".dechex($counter).")into binary string - pay attention to hex representation of key and binary representation<br/>";
}
for($i=7;$i>=0;$i--) { // C for unsigned char, * for repeating to the end of the input data
$cur_counter[$i] = pack ('C*', $counter);
if ($debug) {
print $cur_counter[$i]."(".dechex(ord($cur_counter[$i])).")"." from $counter <br/>";
}
$counter = $counter >> 8;
}
if ($debug) {
foreach ($cur_counter as $char) {
print ord($char) . " ";
}
print "<br/>";
}
$binary = implode($cur_counter);
// Pad to 8 characters
str_pad($binary, 8, chr(0), STR_PAD_LEFT);
if ($debug) {
print "Prior to HMAC calculation pad with zero on the left until 8 characters.<br/>";
print "Calculate sha1 HMAC(Hash-based Message Authentication Code http://en.wikipedia.org/wiki/HMAC).<br/>";
print "hash_hmac ('sha1', $binary, $key)<br/>";
}
$result = hash_hmac ('sha1', $binary, $key);
if ($debug) {
print "Result: $result <br/>";
}
return $result;
}
private static function oath_truncate($hash, $length = 6, $debug=false) {
$result="";
// Convert to dec
if($debug) {
print "converting hex hash into characters<br/>";
}
$hashcharacters = str_split($hash,2);
if($debug) {
print_r($hashcharacters);
print "<br/>and convert to decimals:<br/>";
}
for ($j=0; $j<count($hashcharacters); $j++) {
$hmac_result[]=hexdec($hashcharacters[$j]);
}
if($debug) {
print_r($hmac_result);
}
// http://php.net/manual/ru/function.hash-hmac.php
// adopted from brent at thebrent dot net 21-May-2009 08:17 comment
$offset = $hmac_result[19] & 0xf;
if($debug) {
print "Calculating offset as 19th element of hmac:".$hmac_result[19]."<br/>";
print "offset:".$offset;
}
$result = (
(($hmac_result[$offset+0] & 0x7f) << 24 ) |
(($hmac_result[$offset+1] & 0xff) << 16 ) |
(($hmac_result[$offset+2] & 0xff) << 8 ) |
($hmac_result[$offset+3] & 0xff)
) % pow(10,$length);
return $result;
}
} | php | MIT | 901d2024ce3754d9cd57c6bb7e8f84b44dbbdbc9 | 2026-01-05T05:22:36.337638Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/NumberBase/NumberBase.php | src/Crisu83/Conversion/NumberBase/NumberBase.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\NumberBase;
/**
* Class NumberBase
* @package Crisu83\Conversion\NumberBase
*/
class NumberBase
{
const BINARY = 2;
const OCTAL = 8;
const DECIMAL = 10;
const HEXADECIMAL = 16;
const VIGESIMAL = 20;
/**
* @var mixed current value
*/
protected $value;
/**
* @var string unit name
*/
protected $unit;
/**
* Creates a new number base conversion.
* @param string $value value
* @param int $unit base name, see class constants
*/
public function __construct($value = null, $unit = null)
{
if ($unit !== null) {
$this->setUnit($unit);
}
if ($unit === null && $value !== null) {
$this->setUnit(self::getNumberBaseFromString($value));
}
if ($value !== null) {
$this->setValue($value);
}
}
/**
* Sets the value
* @param string $value value
* @return NumberBase
*/
public function setValue($value)
{
$this->value = $this->parseValue($value);
return $this;
}
/**
* Sets the unit
* @param string $unit unit name
* @return NumberBase
*/
public function setUnit($unit)
{
$this->unit = $unit;
return $this;
}
public function getUnit()
{
return $this->unit;
}
/**
* Recognize current number base of string
* @param string $value
* @return int
* @throws \Exception
*/
public static function getNumberBaseFromString($value)
{
if (substr($value, 0, 1) == 'b')
return self::BINARY;
if (substr($value, 0, 1) == 'o')
return self::OCTAL;
if (substr($value, 0, 2) == '0x')
return self::HEXADECIMAL;
if (is_numeric($value))
return self::DECIMAL;
throw new \Exception ("not a number ".$value);
}
protected function parseValue($value)
{
if ($this->unit == self::BINARY && substr($value, 0, 1) == 'b') {
return substr($value, 1);
} else if ($this->unit == self::OCTAL && substr($value, 0, 1) == 'o') {
return substr($value, 1);
} else if ($this->unit == self::HEXADECIMAL && substr($value, 0, 2) == '0x') {
return substr($value, 2);
}
return $value;
}
/**
* Converts this quantity to another unit.
* @param int $unit unit to convert to
* @return NumberBase
*/
public function to($unit)
{
$this->value = $this->convert($unit, $this->value);
$this->unit = $unit;
return $this;
}
/**
* Converts a value from one unit to another.
* @param int $to unit to convert to
* @param mixed $val value to convert
* @return float converted value
*/
protected function convert($to, $val)
{
$val = $this->parseValue($val);
return base_convert($val, $this->unit, $to);
}
public function format()
{
if ($this->unit == self::BINARY) {
return 'b'.$this->value;
}
if ($this->unit == self::OCTAL) {
return 'o'.$this->value;
}
if ($this->unit == self::HEXADECIMAL) {
return '0x'.$this->value;
}
return $this->value;
}
/**
* Magic function for outputting this quantity.
* @return string this quantity as a string
*/
public function __toString()
{
return $this->format();
}
}
| php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Currency/Currency.php | src/Crisu83/Conversion/Currency/Currency.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Currency;
/**
* Class Currency
* @package Crisu83\Conversion\Currency
*/
class Currency
{
/**
* @var mixed current value
*/
protected $value;
/**
* @var string unit name
*/
protected $unit;
/**
* @var string native unit name
* Override this in each currency subclass.
*/
protected static $native;
/**
* @var array conversion map (unit => native unit)
* Override this in each quantity subclass.
*/
protected static $conversionMap = array();
/**
* @var CurrencyData currency data
*/
private $currencyData;
/**
* Creates a new currency conversion.
* @param float $value currency value
* @param string $fromCurrency currency
* @param CurrencyData $currencyData
*/
public function __construct($value = null, $fromCurrency = null, CurrencyData $currencyData = null)
{
if ($value !== null) {
$this->setValue($value);
}
if ($fromCurrency !== null) {
$this->setFromUnit($fromCurrency);
}
if ($currencyData !== null) {
$this->setCurrencyData($currencyData);
}
}
/**
* Sets the currency value
* @param float $value currency value
* @return Currency
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
/**
* Sets the currency
* @param string $fromCurrency currency
* @return Currency
*/
public function setFromUnit($fromCurrency)
{
$this->unit = $fromCurrency;
return $this;
}
/**
* Sets the currency conversion data
* @param CurrencyData $currencyData
* @return $this
*/
public function setCurrencyData(CurrencyData $currencyData)
{
self::$conversionMap = $currencyData->getCurrencies();
self::$native = $currencyData->getNative();
return $this;
}
/**
* Adds a quantity to this quantity.
* @param float $quantity value to add
* @param string $unit quantity unit
* @return Currency this quantity
*/
public function add($quantity, $unit = null)
{
if ($unit === null) {
$unit = $this->unit;
}
$quantity = new static($quantity, $unit, $this->currencyData);
/** @var Currency $quantity */
$quantity->to($this->unit);
$this->value += $quantity->getValue();
return $this;
}
/**
* Subtracts a quantity from this quantity,
* @param float $quantity value to subtract
* @param string $unit quantity unit
* @return Currency this quantity
*/
public function sub($quantity, $unit = null)
{
if ($unit === null) {
$unit = $this->unit;
}
$quantity = new static($quantity, $unit, $this->currencyData);
/** @var Currency $quantity */
$quantity->to($this->unit);
$this->value -= $quantity->getValue();
return $this;
}
/**
* Converts this quantity to another unit.
* @param string $unit unit to convert to
* @return Currency this quantity
*/
public function to($unit)
{
$this->value = $this->convert($this->unit, $unit, $this->value);
$this->unit = $unit;
return $this;
}
/**
* Converts this quantity to native unit.
* @return Currency this quantity
*/
public function toNativeUnit()
{
return $this->to(self::$native);
}
/**
* Converts a value from one unit to another.
* @param string $from unit to convert from
* @param string $to unit to convert to
* @param mixed $value value to convert
* @return float converted value
*/
protected function convert($from, $to, $value)
{
return ($value * $this->getConversionRate($from)) / $this->getConversionRate($to);
}
/**
* Returns the conversion rate for a unit.
* @param string $unit unit name
* @return mixed conversion rate
* @throws \Exception if the conversion rate is not defined.
*/
protected function getConversionRate($unit)
{
if (!isset(static::$conversionMap[$unit])) {
throw new \Exception(sprintf(
'Conversion rate between "%s" and "%s" is not defined.',
static::$native,
$unit
));
}
return static::$conversionMap[$unit];
}
/**
* Formats this quantity.
* @param int $decimals number of decimals (default to 2)
* @param string $decPoint decimal symbol (defaults to '.')
* @param string $thousandSep thousand separator (defaults to ',')
* @return string formatted quantity
*/
public function format($decimals = 2, $decPoint = '.', $thousandSep = ',')
{
return number_format($this->value, $decimals, $decPoint, $thousandSep);
}
/**
* Converts this quantity into a string
* @param int $decimals number of decimals (default to 2)
* @param string $decPoint decimal symbol (defaults to '.')
* @param string $thousandSep thousand separator (defaults to ',')
* @return string this quantity as a string
*/
public function out($decimals = 2, $decPoint = '.', $thousandSep = ',')
{
return $this->format($decimals, $decPoint, $thousandSep) . ' ' . $this->unit;
}
/**
* Returns the unit for this quantity.
* @return string unit
*/
public function getUnit()
{
return $this->unit;
}
/**
* Returns the value for this quantity.
* @return mixed value
*/
public function getValue()
{
return $this->value;
}
/**
* Magic function for outputting this quantity.
* @return string this quantity as a string
*/
public function __toString()
{
return $this->out();
}
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Currency/CurrencyData.php | src/Crisu83/Conversion/Currency/CurrencyData.php | <?php
namespace Crisu83\Conversion\Currency;
class CurrencyData
{
private $currencies = array();
private $native;
public function addCurrency($name, $value)
{
$this->currencies[$name] = $value;
}
public function setNative($name)
{
$this->currencies[$name] = 1;
$this->native = $name;
}
public function getCurrencies()
{
return $this->currencies;
}
public function getNative()
{
return $this->native;
}
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/Size.php | src/Crisu83/Conversion/Size/Size.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size;
/**
* Class Size
* @package Crisu83\Conversion\Size
*/
class Size
{
/**
* @var string
*/
protected $value;
/**
* @var string
*/
protected $system;
/**
* @var array conversion table between different systems
* Override this in each quantity subclass.
*/
protected static $conversionTable = array();
/**
* Creates a new size.
* @param mixed $size size value
* @param string $system sizing system
*/
public function __construct($size, $system)
{
$this->system = $system;
$this->value = (string)$size;
}
/**
* Finds this size in another system.
* @param string $system system name
* @return string the value
* @throws \Exception if the lookup fails
*/
protected function lookup($system)
{
foreach (static::$conversionTable as $row) {
if (isset($row[$this->system], $row[$system]) && $row[$this->system] === $this->value) {
return $row[$system];
}
}
throw new \Exception(sprintf(
'Failed to look up value "%s" from system "%s" to system "%s"',
$this->value,
$this->system,
$system
));
}
/**
* Converts this size to another system.
* @param string $system system to convert to
* @return Size this size
*/
public function to($system)
{
$this->value = $this->lookup($system);
$this->system = $system;
return $this;
}
/**
* Get the system
* @return string
*/
public function getSystem()
{
return $this->system;
}
/**
* Converts this size into a string
* @return string this size as a string without system
*/
public function format()
{
return $this->value;
}
/**
* Converts this size into a string
* @return string this size as a string with system
*/
public function __toString()
{
return sprintf('%s %s', $this->format(), $this->getSystem());
}
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/System.php | src/Crisu83/Conversion/Size/System.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size;
/**
* Class System
* @package Crisu83\Conversion\Size
*/
class System
{
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/ShoeSize/System.php | src/Crisu83/Conversion/Size/ShoeSize/System.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size\ShoeSize;
use \Crisu83\Conversion\Size\System as BaseSystem;
/**
* Class System
* @package Crisu83\Conversion\Size\ShoeSize
*/
class System extends BaseSystem
{
const EUROPEAN = 'EUR';
const AMERICAN = 'US';
const BRITISH = 'UK';
const CENTIMETRE = 'cm';
const INCH = 'in';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/ShoeSize/ChildShoeSize.php | src/Crisu83/Conversion/Size/ShoeSize/ChildShoeSize.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size\ShoeSize;
/**
* Class ChildShoe
* @package Crisu83\Conversion\Size\ShoeSize
*/
class ChildShoeSize extends ShoeSize
{
/**
* @var array conversion table between different systems
*/
protected static $conversionTable = array(
// infant sizes (0 - 12 months)
array('EUR' => '16', 'UK' => '0 - 0.5', 'US' => '0.5 - 1', 'cm' => '8.3', 'in' => '3.25'),
array('EUR' => '17', 'UK' => '1', 'US' => '1.5 - 2', 'cm' => '9.2', 'in' => '3.625'),
array('EUR' => '18', 'UK' => '1.5 - 2', 'US' => '2.5 - 3', 'cm' => '10.2', 'in' => '4'),
array('EUR' => '19', 'UK' => '2.5 - 3', 'US' => '3.5 - 4', 'cm' => '10.8', 'in' => '4.25'),
array('EUR' => '20', 'UK' => '3.5 - 4', 'US' => '4.5 - 5', 'cm' => '11.7', 'in' => '4.625'),
// kids sizes (1 - 5 years)
array('EUR' => '21', 'UK' => '4.5', 'US' => '5.5', 'cm' => '12.7', 'in' => '5'),
array('EUR' => '22', 'UK' => '5 - 5.5', 'US' => '6 - 6.5', 'cm' => '13', 'in' => '5.125'),
array('EUR' => '23', 'UK' => '6 - 6.5', 'US' => '7 - 7.5', 'cm' => '14', 'in' => '5.5'),
array('EUR' => '24', 'UK' => '7', 'US' => '8', 'cm' => '14.6', 'in' => '5.75'),
array('EUR' => '25', 'UK' => '7.5 - 8', 'US' => '8.5 - 9', 'cm' => '15.2', 'in' => '6'),
array('EUR' => '26', 'UK' => '8.5', 'US' => '9.5', 'cm' => '15.9', 'in' => '6.25'),
array('EUR' => '27', 'UK' => '9 - 9.5', 'US' => '10 - 10.5', 'cm' => '16.5', 'in' => '6.5'),
array('EUR' => '28', 'UK' => '10', 'US' => '11', 'cm' => '17.1', 'in' => '6.75'),
array('EUR' => '29', 'UK' => '10.5', 'US' => '11.5', 'cm' => '17.8', 'in' => '7'),
array('EUR' => '30', 'UK' => '11', 'US' => '12', 'cm' => '18.1', 'in' => '7.125'),
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/ShoeSize/ShoeSize.php | src/Crisu83/Conversion/Size/ShoeSize/ShoeSize.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size\ShoeSize;
use Crisu83\Conversion\Size\Size;
/**
* Class Shoe
* @package Crisu83\Conversion\Size\ShoeSize
*/
class ShoeSize extends Size
{
/**
* @var array conversion table between different systems
*/
protected static $conversionTable = array(
array('EUR' => '32', 'UK' => '0 - 0.5'),
array('EUR' => '33', 'UK' => '0.5 - 1.5'),
array('EUR' => '34', 'UK' => '1.5 - 2.5'),
array('EUR' => '35', 'UK' => '2.5 - 3.5'),
array('EUR' => '36', 'UK' => '3.5'),
array('EUR' => '37', 'UK' => '4 - 4.5'),
array('EUR' => '38', 'UK' => '4.5 - 5.5'),
array('EUR' => '39', 'UK' => '5.5 - 6'),
array('EUR' => '40', 'UK' => '6 - 7'),
array('EUR' => '41', 'UK' => '7 - 7.5'),
array('EUR' => '42', 'UK' => '7.5 - 8.5'),
array('EUR' => '43', 'UK' => '8.5 - 9'),
array('EUR' => '44', 'UK' => '9.5 - 10'),
array('EUR' => '45', 'UK' => '10 - 11'),
array('EUR' => '46', 'UK' => '11 - 11.5'),
array('EUR' => '47', 'UK' => '11.5 - 12.5'),
array('EUR' => '48', 'UK' => '12.5 - 13'),
array('EUR' => '49', 'UK' => '13-14'),
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/HatSize/HatSize.php | src/Crisu83/Conversion/Size/HatSize/HatSize.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size\HatSize;
use Crisu83\Conversion\Size\Size;
/**
* Class HatSize
* @package Crisu83\Conversion\Size\HatSize
*/
class HatSize extends Size
{
/**
* @var array conversion table between different systems
*/
protected static $conversionTable = array(
array('cm' => '34', 'UK' => '4 1/8', 'US' => '4 1/4', 'in' => '13.386'),
array('cm' => '35', 'UK' => '4 1/4', 'US' => '4 3/8', 'in' => '13.78'),
array('cm' => '36', 'UK' => '4 3/8', 'US' => '4 1/2', 'in' => '14.173'),
array('cm' => '37', 'UK' => '4 1/2', 'US' => '4 5/8', 'in' => '14.567'),
array('cm' => '38', 'UK' => '4 5/8', 'US' => '4 3/4', 'in' => '14.961'),
array('cm' => '39', 'UK' => '4 3/4', 'US' => '4 7/8', 'in' => '15.354'),
array('cm' => '40', 'UK' => '4 7/8', 'US' => '4', 'in' => '15.748'),
array('cm' => '41', 'UK' => '5', 'US' => '5 1/8', 'in' => '16.142'),
array('cm' => '42', 'UK' => '5 1/8', 'US' => '5 1/4', 'in' => '16.535'),
array('cm' => '43', 'UK' => '5 1/4', 'US' => '5 3/8', 'in' => '16.929'),
array('cm' => '44', 'UK' => '5 3/8', 'US' => '5 1/2', 'in' => '17.323'),
array('cm' => '45', 'UK' => '5 1/2', 'US' => '5 5/8', 'in' => '17.717'),
array('cm' => '46', 'UK' => '5 5/8', 'US' => '5 3/4', 'in' => '18.11'),
array('cm' => '47', 'UK' => '5 3/4', 'US' => '5 7/8', 'in' => '18.504'),
array('cm' => '48', 'UK' => '5 7/8', 'US' => '6', 'in' => '18.898'),
array('cm' => '49', 'UK' => '6', 'US' => '6 1/8', 'in' => '19.291'),
array('cm' => '50', 'UK' => '6 1/8', 'US' => '6 1/4', 'in' => '19.685'),
// todo: add more values
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Size/HatSize/System.php | src/Crisu83/Conversion/Size/HatSize/System.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Size\HatSize;
use \Crisu83\Conversion\Size\System as BaseSystem;
/**
* Class System
* @package Crisu83\Conversion\Size\HatSize
*/
class System extends BaseSystem
{
const CENTIMETRE = 'cm';
const AMERICAN = 'US';
const BRITISH = 'UK';
const INCH = 'in';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Quantity.php | src/Crisu83/Conversion/Quantity/Quantity.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity;
/**
* Class Quantity
* @package Crisu83\Conversion\Quantity
*/
abstract class Quantity
{
/**
* @var mixed current value
*/
protected $value;
/**
* @var string unit name
*/
protected $unit;
/**
* @var string native unit name
* Override this in each quantity subclass.
*/
protected static $native;
/**
* @var array conversion map (unit => native unit)
* Override this in each quantity subclass.
*/
protected static $conversionMap = array();
/**
* Creates a new quantity.
* @param float $quantity quantity value
* @param string $unit quantity unit
*/
public function __construct($quantity, $unit)
{
$this->unit = $unit;
$this->value = $quantity;
}
/**
* Adds a quantity to this quantity.
* @param float $quantity value to add
* @param string $unit quantity unit
* @return Quantity this quantity
*/
public function add($quantity, $unit = null)
{
if ($unit === null) {
$unit = $this->unit;
}
$quantity = new static($quantity, $unit);
/** @var Quantity $quantity */
$quantity->to($this->unit);
$this->value += $quantity->getValue();
return $this;
}
/**
* Subtracts a quantity from this quantity,
* @param float $quantity value to subtract
* @param string $unit quantity unit
* @return Quantity this quantity
*/
public function sub($quantity, $unit = null)
{
if ($unit === null) {
$unit = $this->unit;
}
$quantity = new static($quantity, $unit);
/** @var Quantity $quantity */
$quantity->to($this->unit);
$this->value -= $quantity->getValue();
return $this;
}
/**
* Converts this quantity to another unit.
* @param string $unit unit to convert to
* @return Quantity this quantity
*/
public function to($unit)
{
$this->value = $this->convert($this->unit, $unit, $this->value);
$this->unit = $unit;
return $this;
}
/**
* Converts a value from one unit to another.
* @param string $from unit to convert from
* @param string $to unit to convert to
* @param mixed $value value to convert
* @return float converted value
*/
protected function convert($from, $to, $value)
{
return ($value * $this->getConversionRate($from)) / $this->getConversionRate($to);
}
/**
* Returns the conversion rate for a unit.
* @param string $unit unit name
* @return mixed conversion rate
* @throws \Exception if the conversion rate is not defined.
*/
protected function getConversionRate($unit)
{
if (!isset(static::$conversionMap[$unit])) {
throw new \Exception(sprintf(
'Conversion rate between "%s" and "%s" is not defined.',
static::$native,
$unit
));
}
return static::$conversionMap[$unit];
}
/**
* Formats this quantity.
* @param int $decimals number of decimals (default to 2)
* @param string $decPoint decimal symbol (defaults to '.')
* @param string $thousandSep thousand separator (defaults to ',')
* @return string formatted quantity
*/
public function format($decimals = 2, $decPoint = '.', $thousandSep = ',')
{
return number_format($this->value, $decimals, $decPoint, $thousandSep);
}
/**
* Converts this quantity into a string
* @param int $decimals number of decimals (default to 2)
* @param string $decPoint decimal symbol (defaults to '.')
* @param string $thousandSep thousand separator (defaults to ',')
* @return string this quantity as a string
*/
public function out($decimals = 2, $decPoint = '.', $thousandSep = ',')
{
return $this->format($decimals, $decPoint, $thousandSep) . ' ' . $this->unit;
}
/**
* Returns the unit for this quantity.
* @return string unit
*/
public function getUnit()
{
return $this->unit;
}
/**
* Returns the value for this quantity.
* @return mixed value
*/
public function getValue()
{
return $this->value;
}
/**
* Magic function for outputting this quantity.
* @return string this quantity as a string
*/
public function __toString()
{
return $this->out();
}
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Unit.php | src/Crisu83/Conversion/Quantity/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity
*/
class Unit
{
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Mass/Mass.php | src/Crisu83/Conversion/Quantity/Mass/Mass.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Mass;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Mass
* @package Crisu83\Conversion\Quantity\Mass
*/
class Mass extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::KILOGRAM;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::MICROGRAM => 1e-7,
Unit::MILLIGRAM => 1e-6,
Unit::GRAM => 0.001,
Unit::KILOGRAM => 1,
Unit::METRIC_TON => 1000,
Unit::OUNCE => 0.0283495,
Unit::POUND => 0.453592,
Unit::STONE => 6.35029,
Unit::SHORT_TON => 907.185,
Unit::LONG_TON => 1016.0469088,
);
}
| php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Mass/Unit.php | src/Crisu83/Conversion/Quantity/Mass/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Mass;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Mass
*/
class Unit extends BaseUnit
{
// Metric system
const MICROGRAM = 'mcg';
const MILLIGRAM = 'mg';
const GRAM = 'g';
const KILOGRAM = 'kg';
const METRIC_TON = 't';
// Imperial system
const OUNCE = 'oz';
const POUND = 'lb';
const STONE = 'st';
const SHORT_TON = 's. t.';
const LONG_TON = 'l. t.';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Pressure/Pressure.php | src/Crisu83/Conversion/Quantity/Pressure/Pressure.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Pressure;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Pressure
* @package Crisu83\Conversion\Quantity\Pressure
*/
class Pressure extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::PASCAL;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::PASCAL => 1,
Unit::KILOPASCAL => 1000,
Unit::MEGAPASCAL => 1e6,
Unit::BAR => 1e5,
Unit::MILLIMETRES_OF_MERCURY => 133.3224,
Unit::INCHES_OF_MERCURY => 3.386389e3,
Unit::POUNDS_PER_SQUARE_INCH => 6.894757e3,
Unit::ATMOSPHERE => 101325,
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Pressure/Unit.php | src/Crisu83/Conversion/Quantity/Pressure/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Pressure;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Pressure
*/
class Unit extends BaseUnit
{
const PASCAL = 'Pa';
const KILOPASCAL = 'kPa';
const MEGAPASCAL = 'MPa';
const BAR = 'bar';
const MILLIMETRES_OF_MERCURY = 'mmHg';
const ATMOSPHERE = 'atm';
const INCHES_OF_MERCURY = 'inHg';
const POUNDS_PER_SQUARE_INCH = 'psi';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/ElectricCurrent/ElectricCurrent.php | src/Crisu83/Conversion/Quantity/ElectricCurrent/ElectricCurrent.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\ElectricCurrent;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class ElectricCurrent
* @package Crisu83\Conversion\Quantity\ElectricCurrent
*/
class ElectricCurrent extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::AMPERE;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::STATAMPERE => 3.33564e-10,
Unit::MICROAMPERE => 1e-06,
Unit::MILLIAMPERE => 0.001,
Unit::AMPERE => 1,
Unit::ABAMPERE => 10,
Unit::KILOAMPERE => 1000,
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/ElectricCurrent/Unit.php | src/Crisu83/Conversion/Quantity/ElectricCurrent/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\ElectricCurrent;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\ElectricCurrent
*/
class Unit extends BaseUnit
{
const STATAMPERE = 'statA';
const MICROAMPERE = 'uA';
const MILLIAMPERE = 'mA';
const ABAMPERE = 'aA';
const AMPERE = 'A';
const KILOAMPERE = 'kA';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Power/Unit.php | src/Crisu83/Conversion/Quantity/Power/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Power;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Power
*/
class Unit extends BaseUnit
{
const WATT = 'W';
const KILOWATT = 'KW';
const MEGAWATT = 'MW';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Power/Power.php | src/Crisu83/Conversion/Quantity/Power/Power.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Power;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Power
* @package Crisu83\Conversion\Quantity\Power
*/
class Power extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::WATT;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::WATT => 1,
Unit::KILOWATT => 1000,
Unit::MEGAWATT => 1000000,
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Energy/Energy.php | src/Crisu83/Conversion/Quantity/Energy/Energy.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Energy;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Energy
* @package Crisu83\Conversion\Quantity\Energy
*/
class Energy extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::JOULE;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = [
Unit::JOULE => 1,
Unit::CALORIE => 4.184,
Unit::KILOWATT_HOUR => 3.6e+6,
];
}
| php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Energy/Unit.php | src/Crisu83/Conversion/Quantity/Energy/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Energy;
use Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Power
*/
class Unit extends BaseUnit
{
const JOULE = 'J';
const CALORIE = 'Cal';
const KILOWATT_HOUR = 'kWh';
}
| php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Length/Unit.php | src/Crisu83/Conversion/Quantity/Length/Unit.php | <?php
namespace Crisu83\Conversion\Quantity\Length;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Length
*/
class Unit extends BaseUnit
{
// Metric system
const MILLIMETRE = 'mm';
const CENTIMETRE = 'cm';
const METRE = 'm';
const KILOMETRE = 'km';
// Imperial system
const INCH = 'in';
const FOOT = 'ft';
const YARD = 'yd';
const MILE = 'mi';
// Other systems
const NAUTICAL_MILE = 'nmi';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Length/Length.php | src/Crisu83/Conversion/Quantity/Length/Length.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Length;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Length
* @package Crisu83\Conversion\Quantity\Length
*/
class Length extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::METRE;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::MILLIMETRE => 0.001,
Unit::CENTIMETRE => 0.01,
Unit::METRE => 1,
Unit::KILOMETRE => 1000,
Unit::INCH => 0.0254,
Unit::FOOT => 0.3048,
Unit::YARD => 0.9144,
Unit::MILE => 1609.34,
Unit::NAUTICAL_MILE => 1852,
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Angle/Angle.php | src/Crisu83/Conversion/Quantity/Angle/Angle.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Angle;
use Crisu83\Conversion\Quantity\Quantity;
/**
* Class Angle
* @package Crisu83\Conversion\Quantity\Angle
*/
class Angle extends Quantity
{
/**
* @var string native unit name
*/
protected static $native = Unit::RADIAN;
/**
* @var array conversion map (unit => native unit)
*/
protected static $conversionMap = array(
Unit::TURN => 6.28318531,
Unit::RADIAN => 1,
Unit::DEGREE => 0.0174532925,
Unit::GRADIAN => 0.015707963267949,
);
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
crisu83/php-conversion | https://github.com/crisu83/php-conversion/blob/0dff0e374a49070b436188dced52226bbc4cbe3c/src/Crisu83/Conversion/Quantity/Angle/Unit.php | src/Crisu83/Conversion/Quantity/Angle/Unit.php | <?php
/*
* This file is part of Conversion.
*
* (c) 2013 Christoffer Niska
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Crisu83\Conversion\Quantity\Angle;
use \Crisu83\Conversion\Quantity\Unit as BaseUnit;
/**
* Class Unit
* @package Crisu83\Conversion\Quantity\Angle
*/
class Unit extends BaseUnit
{
const TURN = 'turn';
const RADIAN = 'rad';
const DEGREE = 'deg';
const GRADIAN = 'grad';
} | php | Apache-2.0 | 0dff0e374a49070b436188dced52226bbc4cbe3c | 2026-01-05T05:22:45.144188Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.