You are on page 1of 5

Orientation =PORTRAIT

$sside = Longer side = 210


$tside= shorter side = 152

$logi_tsu = (thickness*pages/2)= 0.11*340/2 = 18.7


$tkt_tsu = logi_tsu (//thickness of the single book only artplate,cover,insert,text

$rate = rate is coming from db as per selected type


$scfini = no of copies (1000)
$mrc = make ready cost coming from db as per selected type
$val = value to put in input field

PFA
if($type == 'Scoring'){
$rate1 = ($scfini * $val * $rate)+$mrc;
}
else if($type == 'Manual Collating'){
$rate1 = ($scfini * $fi_nos * $rate)+$mrc;
}
else if($type == 'Gathering Manual'){
$rate1 = ($scfini * ($fi_nos + 1) * $rate)+$mrc;
}

else if($type == '3KT' || $type == 'Corner Rounding'){

//$rate11 = ($logi_tsu/60)*$scfini;
$rate11 = 60/$tkt_tsu;
list($int, $dec) = explode('.',$rate11);
//$number_b = ($scfini/$int);

//$rate1 = (($scfini/$number_b) * $rate);


$rate1 = (($rate/$int)*$scfini) + $mrc;

}
else if($type == 'Needle'){
$no_needle = $sside/40;
list($int, $dec) = explode('.',$no_needle); //to count number of niddle
$sql_q12 = mysqli_query($conn,"SELECT * FROM llx_finishinglist_fl_obj WHERE
typ_id='Sewing'");
$fetch_qs2 = mysqli_fetch_array($sql_q12);
$rate2 = $fetch_qs2['rate'];
$mrc2 = $fetch_qs2['mrc'];
//$x = ($fi_nos + 1)* $int * $rate;
$y = ($fi_nos + 1)* $int * $rate2;
$rate1 = (($y)*$scfini) + $mrc;
//$rate1 = $int; //to count number of niddle
}
else if($type == 'PB Manual'){
$x = (($sside + 15)*($logi_tsu + 10))*0.0005; //glue charge=0.000095 and paper
$rate1 = (($x)*$scfini)+$mrc; //0.45 = machine cost
$rate1 = $rate1;
}
else if($type == 'GPT'){
$x = (($sside + 15)*($logi_tsu + 10))*0.000095;
$rate1 = (($x)*$scfini)+$mrc;
}
else if($type == 'BBM'){
//$x = (($sside + 15)*($logi_tsu + 10))*0.000095; //glue charge=0.000095 and
paper
//$y = (($sside + 25)*($logi_tsu + 30))*0.000032; //crape paper
//$rate1 = (($x + $y + 0.045)*$scfini)+$mrc; //0.45 = machine cost
$x = (($sside + 15)*($logi_tsu + 30))*0.000124; //glue charge=0.000095 and
paper
$y = (($sside + 25)*($logi_tsu + 30))*0.000033; //crape paper
$rate1 = (($x + $y + $rate)*$scfini)+$mrc; //0.45 = machine cost
}
else if($type == 'Edge Colouring'){

//$rate1 = 444; //0.45 = machine cost


$rate1 = ((($sside*$logi_tsu)+($tside*$logi_tsu*2))*$rate* $scfini)+$mrc;

else if($type == 'GSS'){


$rate1 = ($rate*$scfini)+$mrc;
}
else if($type == 'GST'){
$sql_q12 = mysqli_query($conn,"SELECT * FROM llx_finishinglist_fl_obj WHERE
typ_id='Gathering Manual'");
$fetch_qs2 = mysqli_fetch_array($sql_q12);
$rate2 = $fetch_qs2['rate'];
//$rate1 = ((($fi_nos *$rate2) + $rate) * $scfini) +$mrc;
$rate1 = ( $rate * $scfini) +$mrc;
}
else if($type == 'Guillotine'){
//$rate11 = (60/$logi_tsu);
//list($int, $dec) = explode('.',$rate11);
//$rate1 = (($int * 6)*$rate)+$mrc;
$rate11 = ($logi_tsu/60)*$scfini;

$rate1 = ($rate11 * $rate) + $mrc;


}
else if($type == 'Case Making'){
if($fi_rb !== '' && $fi_rb !== 'false' && $fi_rb !== 'on'){
$x = (($sside)*($logi_tsu + 10))*0.00041; // spine cost
}else{
$x = 0;
}
$y = ((($tside*2) + ($logi_tsu+50))*($sside + 40))*0.000003; //animal glue
cost
$rate1 = (($x + $y + $rate)*$scfini)+$mrc; //machine cost
$rate1 = $rate1;
}
else if($type == 'Casing In'){
$w = $logi_tsu*$sside*0.000033; //crepe paper
$x = $sside*$logi_tsu*0.000003; // spine glue cost
$y = ($tside*$sside*2)*0.000000723; //cold glue cost

if($fi_rb !== '' && $fi_rb !== 'false' && $fi_rb !== 'on'){
$z = (($logi_tsu+5)*2)*0.004; //HT Band
}
else{
$z = (($logi_tsu)*2)*0.004; //HT Band
}
$rate1 = (($w + $x + $y + $z + $rate)*$scfini)+$mrc; //machine cost
//$rate1 = $rate1;

}
else if($type == 'Lamination' || $type == 'Full Varnish'){

$sql_q1 = mysqli_query($conn,"SELECT * FROM llx_finishinglist_fl_obj WHERE


typ_id='$type' AND label='$val'");
$fetch_qs = mysqli_fetch_array($sql_q1);
$rate3 = $fetch_qs['rate'];
$mrc3 = $fetch_qs['mrc'];
if($type == 'Lamination'){

$lf_len = $fini_lami_len;
$lf_wid = $fini_lami_wid;
$lf_sheet = $fini_lami_sheet;
}
else{
$lf_len = $fini_fv_len;
$lf_wid = $fini_fv_wid;
$lf_sheet = $fini_fv_sheet;
}
//$x = ($sside+30)*(($tside*2)+$logi_tsu+30) ; // lamination paper area
$x = $lf_len*$lf_wid*$lf_sheet; // lamination paper area
$rate1 = ($x*$rate3)+$mrc3; //machine cost
$rate1 = $rate1;

}
else if($type == 'Ribbon' || $type == 'Foiling' || $type == 'Spot Varnish' || $type
== 'Zipper Cost' || $type == 'YAAP Cost' || $type == 'Manual Work'){

$rate1 = $val * $scfini;


}
else if($type == 'Shrink Wrap' || $type == 'Loose Wrap'){

$rate1 = ( $tside * $sside * $rate * $scfini )+ $mrc;

}
else if($type == 'Gilding'){

$rate1 = ((($sside*$logi_tsu)+($tside*$logi_tsu*2))*$rate* $scfini)+$mrc;

}
else if($type == 'Corner Gilding'){

$rate1 = (($logi_tsu*15*2)*$rate* $scfini)+$mrc;

}
else { //Manual Sawing,Casing In,Stitching Manual
$rate1 = ($scfini * $rate)+$mrc;
}

thick = 18.7
BBM
$x = (($sside + 15)*($logi_tsu + 30))*0.000124;
$y = (($sside + 25)*($logi_tsu + 30))*0.000033;
$rate1 = (($x + $y + $rate)*$scfini)+$mrc;

(210+15)*(18.7+30)*0.000124; = 1.35873
((210 + 25)*(18.7 + 30))*0.000033; = 0.3776685
$rate1 = ((1.35873 + 0.3776685 + 2)*1000)+500;
4236.39 +20% = 5083.66

3KT

$rate11 = 60/$tkt_tsu; (60/18.7) = 3


list($int, $dec) = explode('.',$rate11); = 3

$rate1 = (($rate/$int)*$scfini) + $mrc; = ((1.35/3)*1000)+250 = 700 +20% = 840

CORNER ROUNDING

$rate11 = 60/$tkt_tsu;
list($int, $dec) = explode('.',$rate11); = 3
$rate1 = (($rate/$int)*$scfini) + $mrc;= (0.75/3)1000 )+ 374 = 250+374
=624+124.8=748.8

EDGE COLORING
$rate1 = ((($sside*$logi_tsu)+($tside*$logi_tsu*2))*$rate* $scfini)+$mrc;
210*18.7)+152*18.7*2)*0.0000013*1000)+100
22.49+112 = 134.49

GILDING
$rate1 = ((($sside*$logi_tsu)+($tside*$logi_tsu*2))*$rate* $scfini)+$mrc;
210*18.7)+152*18.7*2)*0.0020*1000)+485
19708.6+20% = 23650.32

Corner Gilding
$rate1 = (($logi_tsu*15*2)*$rate* $scfini)+$mrc;
18.7*15*2)0.0002*1000)+251
363.2+72.64
435.84

Case MakiNG

?
Casing In
0.129+0.011781+0.04615+0.14+3)1000)+1320 +20% = ok

Round Back
no change

YAAP Cost
direct

ribbon
direct

zipper cost
direct

GSS
$rate1 = ($rate*$scfini)+$mrc;
0.06*1000)+200 = 260 +20% = 312

Gathering
$rate1 = ($scfini * ($fi_nos + 1) * $rate)+$mrc;
1000*1)*0.055)+0
55+20%=66
GST
$rate1 = ( $rate * $scfini) +$mrc;
0.50*1000)+267
767+153.4=920.4

STICHING
$rate1 = ($scfini * $rate)+$mrc;
0.2*1000)+100
300+60=360

SHRINK WRAP/LOOSE WRAP


$rate1 = ( $tside * $sside * $rate * $scfini )+ $mrc;
210*152*0.00005*1000)+200
1796+359.2=2155.2

MANUAL WORK
$rate1 = $val * $scfini;
10*1000)+20%
12000

You might also like