Tuesday, April 30, 2013

RANK ESTIMATOR FOR EAMCET

RANK ESTIMATOR



<?php 
include ("head.php");
include_once"header.php";

?>
<div id="contentwrapper">
                <div class="lm_main_content">
                  <div class="row-fluid">
                        <div class="span8">
                            <h3 class="heading"><p class="text-success"> Eamcet 2013 Rank Estimator For Engineering And Medical</p></h3>
                            <div class="row-fluid">
                                <div class="span12">

                       <!-- custom content start from here -->
<form class="form-horizontal" method="GET" action="" name="rankestimator">
<h3>ENTER YOUR EAMCET ESTIMATED MARKS</h3>
  <div class="control-group">
    <label class="control-label"> Maths/Biology Marks</label>
    <div class="controls">
      <input type="text" id="maths" name="maths" placeholder="40" class="input input-xlarge" required>
    </div>
  </div>
<div class="control-group">
    <label class="control-label">Physics Marks </label>
    <div class="controls">
      <input type="text" id="physics" name="physics" placeholder="37" class="input input-xlarge" required>
    </div>
  </div>
 <div class="control-group">
    <label class="control-label">Chemistry Marks</label>
    <div class="controls">
      <input type="text" id="chemistry" name="chemistry" placeholder="35" class="input input-xlarge" required>
    </div>
  </div>
  
  <H3>ENTER YOUR INTERMIDIATE MARKS</H3>
  <div class="control-group">
    <label class="control-label"> Maths/Biology Marks</label>
    <div class="controls">
      <input type="text" id="mathsip" name="mathsip" placeholder="210" class="input input-xlarge" required>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Physics Marks </label>
    <div class="controls">
      <input type="text" id="physicsip" name="physicsip" placeholder="137" class="input input-xlarge" required>
    </div>
  </div>
 <div class="control-group">
    <label class="control-label">Chemistry Marks</label>
    <div class="controls">
      <input type="text" id="chemistryip" name="chemistryip" placeholder="145" class="input input-xlarge" required>
    </div>
  </div>
  
  <div class="control-group">
    <label class="control-label">Select Your Stream</label>
    <div class="controls">
      <select class="input input-xlarge" name="stream" required>
        <option value="not selected">Select Stream</option>
      <option value="Engineering">Engineering</option>
      <option value="Medical" >Medical</option>
</select>    
    </div>
  </div>
  <div class="control-group">
  <div class="controls">
  <button type="submit" class="btn btn-primary" name="sub">SUBMIT</button>
</div>
</div>
</form>
                 <?php
                          if(isset($_GET['sub']))
                          {
                          $Eamcet_Physics = $_GET['physics'];
                          $Eamcet_Chemistry = $_GET['chemistry'];
                          $Eamcet_Maths = $_GET['maths'];
                          $Eamcet = $Eamcet_Physics+$Eamcet_Chemistry+$Eamcet_Maths;
                             $Eamcet_To = $Eamcet*75;
                             $Eamcet_Total= $Eamcet_To/160;
                          $Ip_Physics = $_GET['physicsip'];
                          $Ip_Chemistry = $_GET['chemistryip'];
                          $Ip_Maths= $_GET['mathsip'];
                          $Ip = $Ip_Physics+$Ip_Chemistry+$Ip_Maths;
                            $Ip_To =$Ip*25;
                            $Ip_Total=$Ip_To/600;
                            $Combined_Total=$Eamcet_Total+$Ip_Total;
                            $Combined_Total_minus=ceil($Combined_Total-1);
                            $Combined_Total_plus=ceil($Combined_Total+1);
            
              }


                           ?>

                          
                            

                           
  <?php if(isset($_GET['sub']) && ($_GET['stream'] == 'Engineering') || ($_GET['stream'] == 'Medical') ) { ?>           
 <table class="table table-bordered table-striped dTableR ">
  <tbody>

<tr>
<th>Eamcet Weightage</th>
<td><?php  echo $Eamcet_Total; ?></td>
</tr>
<tr>
<th>Inter Weightage</th>
<td><?php echo $Ip_Total; ?></td>
</tr>
<tr>
<th>Combined Score</th>
<td><?php if(isset($_GET['sub'])) { echo ceil($Combined_Total); } ?></td>
</tr>
<tr>
<th>Your Rank May Between</th>
<td><?php  
if(($_GET['stream'] == 'Engineering') AND isset($_GET['sub']))
{
$combinedSc = ceil($Combined_Total);
$DBOBJ = new Connect();



            $toScPrepared = $DBOBJ->conn->prepare("SELECT er_rank FROM lm_engineering_results WHERE er_combinedscore > '$combinedSc' ORDER BY er_combinedscore ASC LIMIT 1");
$toScPrepared->execute();
$toScArray = $toScPrepared->fetch();
            echo $toScArray['er_rank'];
                 $ranksuggested=$toScArray['er_rank'];
echo " to ";


$fromScPrepared = $DBOBJ->conn->prepare("SELECT er_rank FROM `lm_engineering_results` WHERE er_combinedscore < '$combinedSc' ORDER BY er_combinedscore DESC LIMIT 1");
$fromScPrepared->execute();
$fromScArray = $fromScPrepared->fetch();
            echo $fromScArray['er_rank']; 
}

  if(($_GET['stream'] == 'Medical') && isset($_GET['sub']))
{
  $combinedSc = ceil($Combined_Total);
$DBOBJ = new Connect();



            $toScPrepared = $DBOBJ->conn->prepare("SELECT em_rank FROM lm_medical_results WHERE em_combinedscore > '$combinedSc' ORDER BY em_combinedscore ASC LIMIT 1");
$toScPrepared->execute();
$toScArray = $toScPrepared->fetch();
            echo $toScArray['em_rank'];

echo " to ";


$fromScPrepared = $DBOBJ->conn->prepare("SELECT em_rank FROM `lm_medical_results` WHERE em_combinedscore < '$combinedSc' ORDER BY em_combinedscore DESC LIMIT 1");
$fromScPrepared->execute();
$fromScArray = $fromScPrepared->fetch();
            echo $fromScArray['em_rank']; 
}


?></td>
</tr>
</tbody>
</table>
<?php
}
?>
<?php if(isset($_GET['sub']) && ($_GET['stream'] == 'Engineering') ) { ?>
<table class="table table-bordered table-striped dTableR ">
  <tbody>
    <tr>
      <th>
<a href="engineering-college-estimator.php" target="_blank">College Estimator </a>
</th>
<td><?php if(($_GET['stream'] == 'Engineering') AND isset($_GET['sub']))
{
  echo "Check It Now With".$ranksuggested." Rank Which Colleges You Will Get";
}

 ?></td>
</tr>
</tbody>
</table>
<?php
}
?>

         <p>Note:-<small class="text-warning">The Above Providing Rank Details Are Based On 2012 Eamcet Results</small></p> 
           
                         

                        <!-- custom content END here -->

                                </div>
                            </div>  
                        </div>


<?php
include"sidebar.php";
include_once"footer.php";
 ?>

Wednesday, April 17, 2013

Image Display Randomly Using rand function

Image Display Randomly Using rand function 


<html>
<body>
<?php
srand ( microtime( ) * 100000 );
$num=rand ( 1 ,6 );
switch ( $num )
{
case 1 : $image_file ="/mahesh/1.jpg";
             break;
case 2 : $image_file = "/mahesh/2.jpg";
             break;
case 3 : $image_file = "/mahesh/3.jpg ";
            break;
case 4 : $image_file = "/mahesh/4.jpg ";
            break;
case 5 : $image_file = "/mahesh/5.jpg ";
            break;
case 6 : $image_file = "/mahesh/6.jpg ";
            break;
}
echo " Random Image :<img src=$image_file />"
?>
</body>
</html>

Tuesday, April 16, 2013

uploading the images and videos


upload form

<html>
<body>
<form action="uploads.php" method="post" enctype="multipart/form-data">
<label for="file">File Name </label>
<input type="text">
<input type="file" name="file" id="file"> <br>
<input type="submit" value="send" name="submit">
</form>
</body>
</html>

uploading code


<?php
$tmp=$_FILES["file"]["tmp_name"];
$name=$_FILES["file"]["name"];
$size=$_FILES["file"]["size"];
$type=$_FILES["file"]["type"];
$error=$_FILES["file"]["error"];
$allowedext=array("jpg","jpeg","png","gif");
$extenstions=end(explode(".",$type));
if(($type == "image/jpg") || ($type == "image/jpeg") || ($type == "image/png") || ($type == "image/gif") || ($type == "image/fdf") &&  ($size<20000) && in_array($extenstions, $allowedext))
{
if ($error>0)
{
echo "Error :".$error;
}else
{
echo $tmp."location of file"."<br>";
echo $name."name of file"."<br>";
echo $size."file size"."<br>";
echo $type."file type"."<br>";
if(is_uploaded_file($name))
{
echo $name;
}else{
if(move_uploaded_file($tmp, "myupload/$name"))
{
echo "file is moved";
}else
{
echo "file is not moved";
}
}
}
}else
{
echo "invalid";
}
?>
<a href="uploadform.php">Back To Upload Form</a>

Sunday, April 14, 2013

Meta Tags - - refresh the page automatically

Page Refresh Automatically

<meta http-equiv="refresh" content="5" url="index.html">

Note the keywords "HTTP-EQUIV", "Name" and "Content" are case-insensitive. Their values are also case-insensitive.

it is used in html for page automatically refreshing purpose.

Here http-equiv is used for purpose of the meta tag and content displays the time or type etc..url specifies particular path of the file.


<meta http-equiv="pragma" content="no-cache">

pragma is used for the deleting the browser temporary data.it deletes data in browsers 




For More Info About Meta Tags Visit Below Link


Monday, April 8, 2013

crating unique numbers


<?php
function lm_unique_number($limitnum){
return substr(number_format(time() * rand(),0,'',''),0,$limitnum);
}
$unique=new connect();
$uniquenumber=$unique->conn->prepare("SELECT cmi_id FROM lm_college_meta_info ");
$uniquenumber->execute();
while($uniquenumberarray=$uniquenumber->fetch()){
$i_lm_unique=lm_unique_number(8);
$unique->conn->exec("UPDATE lm_college_meta_info SET i_lm_unique =$i_lm_unique WHERE cmi_id='$uniquenumberarray[0]' ");
}
?>