<?php session_start();?>
<?php 
if(isset($_POST['a'])){
	
$vu=$_POST['vu'];
$nu=$_POST['nu'];
$h=$_POST['h'];
$bw=$_POST['bw'];

$a=$_POST['a'];
$lp=$_POST['lp'];
$fc=$_POST['fc'];
$fy=$_POST['fy'];
$phicb=$_POST['phicb'];
$phicf=$_POST['phicf'];
$phist=$_POST['phist'];
$phisv=$_POST['phisv'];
$landa=$_POST['landa'];
$cocov=$_POST['cocov'];
$tsfy=$_POST['tsfy'];

$_SESSION['cocov']=$cocov;
$_SESSION['landa']=$landa;
$_SESSION['phisv']=$phisv;
$_SESSION['phist']=$phist;
$_SESSION['phicf']=$phicf;
$_SESSION['phicb']=$phicb;
$_SESSION['fy']=$fy;
$_SESSION['fc']=$fc;
$_SESSION['lp']=$lp;
$_SESSION['a']=$a;
$_SESSION['h']=$h;
$_SESSION['bw']=$bw;
$_SESSION['nu']=$nu;
$_SESSION['vu']=$vu;
$_SESSION['tsfy']=$tsfy;


}
include_once("steel1.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
 content="text/html; charset=utf-8">
<title>CAZALY1 Tube Steel</title>
<link rel="stylesheet" type="text/css" href="./dd/engpop.css" >
</head>
<body>
<table>
  <!--- main table begin-->
  
    <tbody>
  
  <tr>
    <td class="mainpad"><!--- firts main column(1) begin-->
      
      <div class="title">CAZALY with Tube Steel<br>
        For LRFD LOADS<<br>
      </div>
      <br>
      <div style="text-align:center"><i>Select HSS Shape:</i> </div>
      
             
    <!--begin first choose cell-->
      
      
        <table style="width:100%;">
          <tr>
            <td style="width:50%;"><form action="">
               <div > <SELECT NAME=type onchange="this.form.submit();">
                  <OPTION VALUE=0>Choose
                  <?=$options?></OPTION>
                </SELECT></div>
              </form></td>
            <!--end first choose cell-->
            
            <?php include("steel2.php") ?>
            <td style="width:50%;"><form action="">
                <div><SELECT NAME=type2 onchange='this.form.submit();'>
                  <OPTION VALUE=0>Size
                  <?=$options2 ?></OPTION>
                </SELECT></div> 
              </form>
              </td>
          </tr>
        </table>
    
      <?php include("steel3.php") ?>
      <!--End table w/ first & 2nd choose cell--> 
      <!--begin table shape--> 
      
      Shape: <b> <? echo $type2; ?></b>
      <table class="table1 " style="height:61px; width:250px;"  >
        <tbody align="right" >
          <tr>
            <td class="padshape">Area(in<sup>2</sup>)=</td>
            <td class="alignshape"><? echo $AAREA; ?></td>
            <td class="padshape">thk-des(in)=</td>
            <td class="alignshape"><? echo $TTDES; ?></td>
          </tr>
          <tr>
            <td class="padshape">Zx(in<sup>3</sup>)=</td>
            <td class="alignshape"><? echo $ZZX; ?></td>
            <td class="padshape">Zy(in<sup>3</sup>)=</td>
            <td class="alignshape"><? echo $ZZY; ?></td>
          </tr>
        </tbody>
      </table>
      <br>
      
      <!--ends table shape--> 
      
    
	<!-- begin INPUT DATA table -->
      
      <div class="title">Inputa Data </div>
      <form method="post" action="">
        <table>
          <tbody>
            <tr>
              <td style="text-align: right;">Vu(Kip):</td>
              <td><input name="vu"
               value="<?php echo $_SESSION['vu'] ?>" style="width: 85px;" size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">Nu(kip):</td>
              <td><input name="nu"
 value="<?php echo $_SESSION['nu'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">h(in):</td>
              <td><input name="h"
 value="<?php echo $_SESSION['h'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">bw(in):</td>
              <td><input name="bw"
 value="<?php echo $_SESSION['bw'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            
            <tr>
              <td style="text-align: right;">a(in):</td>
              <td><input name="a"
 value="<?php echo $_SESSION['a'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">Lp(in):</td>
              <td><input name="lp"
 value="<?php echo $_SESSION['lp'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">f'c(psi):</td>
              <td><input name="fc"
 value="<?php echo $_SESSION['fc'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">Rebar fy(psi):</td>
              <td><input name="fy"
 value="<?php if(empty($_SESSION['fy']))echo "60000"; else echo $_SESSION['fy'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
  <tr>
              <td style="text-align: right;">TS fy(psi):</td>
              <td><input name="tsfy"
value="<?php if(empty($_SESSION['tsfy']))echo "46000"; else echo $_SESSION['tsfy'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>          
            
            <tr>
              <td style="text-align: right;">&#934cb:</td>
              <td><input name="phicb"
 value="<?php if(empty($_SESSION['phicb']))echo "0.65"; else echo $_SESSION['phicb'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">&#934cf:</td>
              <td><input name="phicf"
 value="<?php if(empty($_SESSION['phicf']))echo "0.75"; else echo $_SESSION['phicf'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">&#934st:</td>
              <td><input name="phist"
 value="<?php if(empty($_SESSION['phist']))echo "0.90"; else echo $_SESSION['phist'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">&#934sv:</td>
              <td><input name="phisv"
 value="<?php if(empty($_SESSION['phisv']))echo "0.60"; else echo $_SESSION['phisv'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">&#955conc:</td>
              <td><input name="landa"
 value="<?php if(empty($_SESSION['landa']))echo "1.0"; else echo $_SESSION['landa'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;">C.Cover(in):</td>
              <td><input name="cocov"
 value="<?php if(empty($_SESSION['cocov']))echo "0.6250"; else echo $_SESSION['cocov'] ?>" style="width: 85px;"
 size="20" type="text"></td>
            </tr>
            <tr>
              <td style="text-align: right;"></td>
              <td><input value="GO" type="submit"></td>
            </tr>
            <tr>
          <td></td>
            <td></td>
            </tbody>
          
        </table>
      </form>
      <br>
      
      <!--begin INPUT DATA table--> 
      
      <!--Begin CAZALY CALC-->
      
      <?php 

if(isset($_POST['a'])){


/* 'g' pz, vu, values for analizing Tube Stell Unit Check see link on main Menu */
$g=$a-$cocov;
$pz=$nu;
$py=$vu;
$b=$BB;
$fbu1=0.85*$phicb*$fc*pow(($bw/$b),0.5);
IF($fbu<=1.1*$fc): $fbu=$fbu1; else: $fbu=1.1*$fc; endif;
$lb=$vu*1000/3/($b*$fbu);
$lst=ROUND((0.5*$lp+$a+3*$a+0.5*$lb),3);
$fts=1.33333*$vu*1000;
/*--Conc Friction check PCI-7th 5.3.6 --*/	
$acra=$bw*$h;


$vumax1=$ff*0.3*pow($landa,2)*$fc/1000*$acra;
$vumax2=$ff*1000*pow($landa,2)*$acra/1000;
$vumax=MIN($vumax1,$vumax2);

/* --As(Avf) fric. Req. PCI7 Eq 5.32a --*/
IF($vu==0):$ue1=0; else: $ue1=1000*$acra*1.4/($fts); endif;
IF($ue1>3.4): $ue=3.4; else: $ue=$ue1; endif;
IF($vu==0): $avf=0; else: $avf=$fts/($phicf*$fy*$ue); endif;

$as=ROUND((MAX($avf,$fts/($phist*$fy))),3);
$asside=$as/2;
$an=ROUND(($nu/($phist*60)),3);


/* Variables NEEDED by this  include("subcal/stca2.php") */
$fy=$tsfy/1000; 
$phia=0.9;
$phiv=0.9;
$phib=0.9; 
$cv=1;

include("subcal/stca2.php");


/* ends  include("subcal/stca2.php") */

}

?>
      
      <!--End CAZALY CALC--> 
      <!--Begin RESULTS  table--> 
      <b>Results:  Shape: <? echo $type2; ?></b>
      <table class="table1">
        <tbody align="right">
          <tr>
            <td>Rebar As<sub>total</sub> (in<sup>2</sup>)=</td>
            <td style="width:100px"><?php echo $as; ?>&nbsp;</td>
          </tr>
          <tr>
            <td>Rebar As<sub>ea side</sub> (in<sup>2</sup>)=</td>
            <td style="width:100px"><?php echo $asside; ?>&nbsp;</td>
          </tr>
          <tr>
            <td>Rebar An(in<sup>2</sup>)=</td>
            <td style="width:100px"><?php echo $an; ?>&nbsp;</td>
          </tr>
          <tr>
            <td>TS Length (in)=</td>
            <td style="width:100px"><?php echo $lst; ?>&nbsp;</td>
          </tr>
          <tr>
            <td>AISC H3-6 eq=</td>
            <td style="width: 100px;"><b>
              <?php if(isset($unitchk))echo $unitchk ; ?>
              </b></td>
          </tr>
          <tr>
            <td><b>Unity Check</b></td>
            <td style="width: 100px;"><?php if(isset($chk1))echo $chk1; ?>
              &nbsp;</td>
          </tr>
          <tr>
            <td>Compact Sec.Check</td>
            <td style="width: 100px;"><?php if(isset($chk4))echo $chk4; ?>
              &nbsp;</td>
          </tr>
          <tr>
            <td>compact b=</td>
            <td style="width: 100px;"><?php if(isset($chk2))echo $chk2; ?>
              &nbsp;</td>
          </tr>
          <tr>
            <td>compact h=</td>
            <td style="width: 100px;"><?php if(isset($chk3))echo $chk3; ?>
              &nbsp;</td>
          </tr>
        </tbody>
      </table>
      <br>
      
      <!-- echos for testing values   
     <? echo "b $b;" ?> <br> 
     <? echo "avf $avf;" ?> <br>
    <? echo "fts $fts; "?> <br> 
      <? echo "lst $lst;" ?> <br>  
       <? echo "ue1 $ue1;" ?> <br> 
       <? echo "vey $vey;" ?> <br> 
      <? echo "vex $vex;" ?> <br>
       <? echo "g $g;" ?> <br>
        <? echo "py $py;" ?> <br>
         <? echo "hty $HHT;" ?> <br>
        <? echo "b $BB;" ?> <br>
          <? echo "axial $axial;" ?> <br>
        <? echo "shear $shear;" ?> <br>
        <? echo "flex $flex;" ?> <br>
        <? echo "shear $shear;" ?> <br>
        <? echo "mx $mx;" ?> <br>
        <? echo "my $my;" ?> <br>
        <? echo "mnx $mnx;" ?> <br>
        <? echo "mny $mny;" ?> <br>
        <? echo "zx $zx;" ?> <br>
        <? echo "fy $fy;" ?> <br>
        <? echo "fy $fy;" ?> <br>  --> 
      
      <!--End RESULTS  table--> 
      
      <!--***** RESET BUTTON ---- ------------------------------------******-->
      
      <form method="post" action="">
        <div style="text-align: center;">
          <input name="reset" value="RESET VALUES"
 type="submit">
        </div>
      </form>
      <?php $aabbcc = 1;
if($_POST['reset']){
session_destroy();
while($aabbcc < 2){
echo "<meta HTTP-EQUIV='refresh' content='1'>";
$aabbcc = 2;
}
}
?>
      
      <!--***** RESET BUTTON ------------------ -----------------------******--> 
      &nbsp; </td>
    <td valign="top" width="81%"><p style="margin-left: 2em;"> <b>Input data
        Key</b> <br>
        <br>
        a= distance(in) between centroid of 'As' to 'Vu' point. <Br>
        co= Concrete cover (in) (Min cover=0.625" default)<br>
        Lp= bearing length (in) at support (pad).<br>
        h =distance up to the flexural reinforcing or below(in). <br>
        Lts,b,d = Tube steel dimensions(in).<br>
        As, An = Rebars cross section areas(in<sup>2</sup>)<br>
        fy = yield strength, for Reabars and TS (psi)<br>
        Ldh, Lnh = development lengths(in) for 'As'and 'An' rebars. <br>
        Φ<sub>cb, Concrete bearing factor</sub>= 0.65 (default) <br>
        Φ<sub>cf, Concrete shear friction factor</sub>= 0.75 (default)<br>
        Φ<sub>st, Steel Tension at flexure factor</sub>= 0.90 (default)<br>
        Φ<sub>sv, Steel actual shear factor</sub>= 0.60 (default)<br>
        &#955<sub>densConc</sub> =1.0 concrete density factor(default) <br>
        <br>
        <img alt="" src="gifpo/cazaly1.jpg"
 height="473" width="528"><br>
      </p></td>
  </tr>
    </tbody>
  
</table>
</body>
</html>
