header("Location:/FFXBD/Others6/SC_Item_list.php?a=return");
?>
Untitled Document
include('dbcon.php');
$scno=$_POST['pcno'];
$seqno=$_POST['seq'];
$pcprice=$_POST['pc3price'];
//echo $pcprice;
$nochk=$_POST['nochk'];
$f1=$_POST['f1'];
$f2=$_POST['f2'];
$f3=$_POST['f3'];
$f4=$_POST['f4'];
$f5=$_POST['f5'];
$f6=$_POST['f6'];
$f7=$_POST['f7'];
$f8=$_POST['f8'];
$f9=$_POST['f9'];
$f10=$_POST['f10'];
$f11=$_POST['f11'];
$f12=$_POST['f12'];
$f13=$_POST['f13'];
$f14=$_POST['f14'];
$f15=$_POST['f15'];
$f16=$_POST['f16'];
$chka=$_POST['chk1'];
//echo $chka;
/////////DELETE
$deletesqr=mysqli_query($conn,"DELETE From FrameComponents_SCwise WHERE Sc_No='$scno' AND Seq_No='$seqno' ");
/////////////////////////
//$frokplushb=
$sqlstr1=mysqli_query($conn,"Select * FROM SC_Item WHERE Sc_No='$scno' AND Seq_No='$seqno'");
$record1=mysqli_fetch_array($sqlstr1);
$gspno=$record1['GSP_NO'];
$sqlstr2=mysqli_query($conn,"Select * FROM Gsp_Bom_costing WHERE Internal='$gspno' ");
$record2=mysqli_fetch_array($sqlstr2);
$forkprice=$record2['loc_fork'];
$hbprice=$record2['loc_hb'];
$frameprice=$record2['loc_frame'];
if($f1 > 0)
{
//$percentage=$_POST['f13'];
$price=($f1*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f1;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f1)/100;
}
$fa="F/Triangle";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($fa)."','$f1','$price','$price1','1')");
}
if($f2 > 0)
{
//$percentage=$_POST['f13'];
$price=($f2*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f2;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f2)/100;
}
$fb="RR Triangle";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection)
values('$scno','$seqno','FR30','".addslashes($fb)."','$f2','$price','$price1','1')");
}
//////////fr3
if($f3 > 0)
{
//$percentage=$_POST['f13'];
$price=($f3*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f3;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f3)/100;
}
$fc="LR Triangle";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($fc)."','$f3','$price','$price1','1')");
}
/////
if($f4 > 0)
{
//$percentage=$_POST['f13'];
$price=($f4*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f4;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f4)/100;
}
$fd="Top Tube";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($fd)."','$f4','$price','$price1','1')");
}
if($f5 > 0)
{
//$percentage=$_POST['f13'];
$price=($f5*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f5;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f5)/100;
}
$fe="Down Tube";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($fe)."','$f5','$price','$price1','1')");
}
//////
if($f6 > 0)
{
//$percentage=$_POST['f13'];
$price=($f6*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f6;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f6)/100;
}
$ff="Seat Tube";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff)."','$f6','$price','$price1','1')");
}
///////
if($f7 > 0)
{
//$percentage=$_POST['f13'];
$price=($f7*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f7;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f7)/100;
}
$ff1="Head Tube";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff1)."','$f7','$price','$price1','1')");
}
if($f8 > 0)
{
//$percentage=$_POST['f13'];
$price=($f8*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f8;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f8)/100;
}
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes(BB)."','$f8','$price','$price1','1')");
}
/////
if($f9 > 0)
{
//$percentage=$_POST['f13'];
$price=($f9*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f9;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f9)/100;
}
$ff3="R/C Stay";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff3)."','$f9','$price','$price1','1')");
}
if($f10 > 0)
{
//$percentage=$_POST['f13'];
$price=($f10*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f10;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f10)/100;
}
$ff4="L/C Stay";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff4)."','$f10','$price','$price1','1')");
}
if($f11 > 0)
{
//$percentage=$_POST['f13'];
$price=($f11*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f11;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f11)/100;
}
$ff6="R/S Stay";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff6)."','$f11','$price','$price1','1')");
}
if($f12 > 0)
{
//$percentage=$_POST['f13'];
$price=($f12*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f12;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f12)/100;
}
$ff7="L/S Stay";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($ff7)."','$f12','$price','$price1','1')");
}
if($f13 > 0)
{
//$percentage=$_POST['f13'];
$price=($f13*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$f13;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$f13)/100;
}
$xx="Frame Ends";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($xx)."','$f13','$price','$price1','1')");
}
///
if($f14 > 0)
{
//$percentage=$_POST['f13'];
$price=($f14*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
//$forkhb=$f14+$f15;
//$percentageremain=100-$forkhb;
$price1=$forkprice;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
//$price1=($frameprice*$f2)/100;
}
$yy="Fork parts";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($yy)."','$f14','$price','$price1','1')");
}
if($f15 > 0)
{
//$percentage=$_POST['f13'];
$price=($f15*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
//$forkhb=$f14+$f15;
//$percentageremain=100-$forkhb;
$price1=$hbprice;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
//$price1=($frameprice*$f2)/100;
}
$xx="H/B Tubes";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR30','".addslashes($xx)."','$f15','$price','$price1','1')");
}
/////////////////////////////
$frbits=$f16/$nochk;
$chka=$_POST['chk1'];
$chkb=$_POST['chk2'];
//echo $chka;
$chkc=$_POST['chk3'];
//echo $chkc;
$chkd=$_POST['chk4'];
$chke=$_POST['chk5'];
$chkf=$_POST['chk6'];
$chkg=$_POST['chk7'];
$chkh=$_POST['chk8'];
$chki=$_POST['chk9'];
$yy="1-".$_POST['chk1']."-2-".$chkb."-3-".$chkc."-4-".$chkd."-5-".$chke."-6-".$chkf."-7-".$chkg."-8-".$chkh."-9-".$chki;
echo $yy;
if($_POST['chk1'] == "checkbox01")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes(Bridge)."','$frbits','$price','$price1','1')");
}
////////////////////////////
if($_POST['chk2'] == "checkbox02")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$xx1="Chain Guard Bracket";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($xx1)."','$frbits','$price','$price1','1')");
}
////////////////////////////
/*
if($chkb == "Yes")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$xx1="Chain Guard Bracket";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($xx1)."','$frbits','$price','$price1','1')");
echo "aaa";
}
*/
if($_POST['chk3'] == "checkbox03")
{
echo $chkc;
echo "AAA";
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$xx2="Brake Pivots";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($xx2)."','$frbits','$price','$price1','1')");
echo "INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($xx2)."','$frbits','$price','$price1','1')";
}
if($_POST['chk4'] == "checkbox04")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$ffc="K/S Bracket";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($ffc)."','$frbits','$price','$price1','1')");
}
//echo $chka;
if($_POST['chk5'] == "checkbox05")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$cc="Cable Guide";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($cc)."','$frbits','$price','$price1','1')");
}
if($_POST['chk6'] == "checkbox06")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$ff="Cable Stopper";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($ff)."','$frbits','$price','$price1','1')");
}
if($_POST['chk7'] == "checkbox07")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$rr="Shock Mount";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($rr)."','$frbits','$price','$price1','1')");
}
if($_POST['chk8'] == "checkbox08")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$ccv="Seat Clamp";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($ccv)."','$frbits','$price','$price1','1')");
}
/////////////////////
if($_POST['chk9'] == "checkbox09")
{
//$percentage=$_POST['f13'];
$price=($frbits*$pcprice)/100;
if($forkprice > 0 OR $hbprice > 0 )
{
$forkhb=$f14+$f15;
$percentageremain=100-$forkhb;
$price1=($frameprice/$percentageremain)*$frbits;
//$price1=
}
if($forkprice == 0 AND $hbprice == 0)
{
$price1=($frameprice*$frbits)/100;
}
$vv="Tube Gusset";
$sqlinsert=mysqli_query($conn,"INSERT INTO FrameComponents_SCwise(Sc_No,Seq_No,Item_Cat,Item,Percentage,price,price1,Item_selection) values('$scno','$seqno','FR31','".addslashes($vv)."','$frbits','$price','$price1','1')");
}
?>