Friday, 20 September 2019

Approval files

Hi all,

See the files associated with approval.


-------------------------------------
adminhome.php

<html>
<body>
<a href='approvestudent.php'>Approve student</a><br>
<a href='approvefaculty.php'>Approve faculty</a><br>
</body>
</html>

------------------------------------
approvestudent.php
----------------------------------
<?php
include('dbconnect.php');

$query = "select * from login where type='student' and

status='0'";
$result = mysql_query($query);
if (!$result)
{
 $message = 'ERROR:' . mysql_error();
 return $message;
}
else
{
 $i = 0;
 echo '<html><body><table border=1 align=center><tr>';
 while ($i < mysql_num_fields($result))
 {
  $meta = mysql_fetch_field($result, $i);
  echo '<th>' . ucfirst($meta->name) . '</th>';
  $i = $i + 1;
 }
 echo '<th>Approve</th><th>Delete</th></tr>';
 $i = 0;
 while ($row = mysql_fetch_row($result))
 {
  echo '<tr>';
  $count = count($row);
  $y = 0;
  $idval='1';
  while ($y < $count)
  {
   $c_row = current($row);
   if($y==0)
    $idval=$c_row;
if($y==1)
    $c_row="****";
   echo '<td>' . $c_row . '</td>';
   next($row);
   $y = $y + 1;
  }
  echo '<td><a href=approvestudent1.php?id='.

$idval.'>Approve</a></td><td><a href=deletestudent.php?id='.

$idval.'>Delete</a></td>';
  echo '</tr>';
  $i = $i + 1;
 }
 echo '</table></body></html>';
 mysql_free_result($result);
}
mysql_close ($con);

?>
----------------------------------------
approvestudent1.php
--------------------
<?php
include('dbconnect.php');
$id=$_GET['id'];
$qr="update login set status='1' where username='$id'";
mysql_query($qr,$con);
header("location:approvestudent.php");



?>
--------------------------
deletestudent.php
---------------------
<?php
include('dbconnect.php');
$id=$_GET['id'];
$qr="delete from login where username='$id'";
mysql_query($qr,$con);
header("location:approvestudent.php");



?>

Monday, 16 September 2019

PHP Upload Auto Num Validation Display Image

Hi All,
Use this code
-------------------------------------
Table SQL

CREATE TABLE IF NOT EXISTS `login` (
  `username` text NOT NULL,
  `password` text NOT NULL,
  `type` text NOT NULL,
  `status` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `studentreg` (
  `sid` int(11) NOT NULL,
  `name` text NOT NULL,
  `address` text NOT NULL,
  `email` text NOT NULL,
  `phone` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--------------------------------------------------------
dbconnect.php

<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("snit",$con);

?>

------------------------------------------------
studentform.php
-----------------------------------------------------
<html>
<body>
<?php
include('dbconnect.php');

//Code to insert into both registration and Login table
if(isset($_POST['btnsubmit']))
{
$sql="insert into studentreg values('$_POST[id1]','$_POST

[name]','$_POST[address]','$_POST[email]','$_POST

[phone]')";
echo $sql;
$sql1="insert into login values('$_POST[id1]','$_POST[password]','student','0')";
mysql_query($sql,$con);
mysql_query($sql1,$con);

$target_dir = "uploads/";
$target_file=$target_dir .$_POST['id1'].'.jpg';
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],

$target_file) or die('Error'.mysql_error());


}

?>

<?php

//Auto generate next id in the screen.

//Query to get the highest value in table

$sql="select max(sid) as mid from studentreg";
$data=mysql_query($sql);
$id=0;
while($row=mysql_fetch_array($data))
{
$id=$row['mid'];
}

$id=$id+1;
echo $id;
?>
<form action=# method=post  enctype="multipart/form-data">
<pre>
Id      <input name=id disabled=disabled value="<?php echo

$id ; ?>" pattern="[a-zA-Z]{2,10}" title="Enter only

characters">
<input type=hidden name=id1 value="<?php echo $id ; ?>" >
Name    <input name=name required=required maxlength=18>
Address <input name=address>
Email   <input type=email name=email>
Phone   <input name=phone pattern="[0-9]{10,12}">
Password<input name=password >
Photo   <input type="file" name="fileToUpload"

id="fileToUpload">
<input type=submit name=btnsubmit value='Save'>
</pre>
</form>

<?php

//Showing image in the table

$query = 'select * from studentreg';
$result = mysql_query($query);
if (!$result)
{
 $message = 'ERROR:' . mysql_error();
 return $message;
}
else
{
 $i = 0;
 echo '<html><body><table border=1 align=center><tr>';
 while ($i < mysql_num_fields($result))
 {
  $meta = mysql_fetch_field($result, $i);
  echo '<th>' . ucfirst($meta->name) . '</th>';
  $i = $i + 1;
 }
 echo '<th>Delete</th></tr>';
 $i = 0;
 while ($row = mysql_fetch_row($result))
 {
  echo '<tr>';
  $count = count($row);
  $y = 0;
  $idval='1';
  while ($y < $count)
  {
   $c_row = current($row);
   if($y==0)
    $idval=$c_row;
   echo '<td>' . $c_row . '</td>';
   next($row);
   $y = $y + 1;
  }
  echo "<td><img width=30 height=30 src='uploads/

$idval.jpg'></td><td><a href=delComplaint.php?id='.

$idval.'>Delete</a></td>";
  echo '</tr>';
  $i = $i + 1;
 }
 echo '</table></body></html>';
 mysql_free_result($result);
}
mysql_close ($con);

?>
</body>
</html>



Thursday, 8 August 2019

View Table

Hi

<?php
include('dbconnect.php');

$query = 'select * from tbl_Complaint';
$result = mysql_query($query);
if (!$result)
{
$message = 'ERROR:' . mysql_error();
return $message;
}
else
{
$i = 0;
echo '<html><body><table border=1 align=center><tr>';
while ($i < mysql_num_fields($result))
{
$meta = mysql_fetch_field($result, $i);
echo '<th>' . ucfirst($meta->name) . '</th>';
$i = $i + 1;
}
echo '<th>Delete</th></tr>';
$i = 0;
while ($row = mysql_fetch_row($result))
{
echo '<tr>';
$count = count($row);
$y = 0;
$idval='1';
while ($y < $count)
{
$c_row = current($row);
if($y==0)
$idval=$c_row;
echo '<td>' . $c_row . '</td>';
next($row);
$y = $y + 1;
}
echo '<td><a href=delComplaint.php?id='.$idval.'>Delete</a></td>';
echo '</tr>';
$i = $i + 1;
}
echo '</table></body></html>';
mysql_free_result($result);
}
mysql_close ($con);

?>

Wednesday, 21 November 2018

How to create JSON object in PHP

Hi all,

Use this code

<?php

$con= new mysqli('localhost','user','huppassword','databasename')or die("Could not connect to mysql".mysqli_error($con));

$qr="select * from questions";

$result = mysqli_query($con, $qr);

$data = array();

while ( $row = $result->fetch_assoc() ){
   // $data[] = json_encode($row);
   $data[]=$row;
}
    echo json_encode( $data );//this will be sent as response to the requesting device

  
?>

How to retrive the result of url without refresh



Hi All,

See the code

<?php
//echo "HUP";

$url='http://servetechnoresearch.com/test/fetchquestion.php';
$ch=curl_init($url);
$data = curl_exec($ch);
print($data);

?>

Monday, 5 November 2018

Convert to Pdf and Print

<!---sample pdf---!--->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.container {
  border: 2px solid #ccc;
  background-color: midnightblue ;
  border-radius: 150px;
  padding: 16px;
  margin: 30px 0
}
body  {
   
    background-color: black;
height: 800px;
background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
.container::after {
  content: "";
  clear: both;
  display: table;
}


.container span {
  font-size: 30px;
  margin-right: 15px;
}

@media (max-width: 500px) {
  .container {
      text-align: center;
  }

}

</style>
</head>
<body>
<center><h1>AthiraRaj</h1></center>


<a href="admin.php"><font color=white>back</a>
<h1><font color=white>RECRUITERS ARE</h1>
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("prjt",$con);
$sq="select * from  company";
$res=mysql_query($sq,$con);
while($row=mysql_fetch_array($res))
{
?>
<form action="update_rec.php" method="POST">
<div class="container"><input type=hidden name = id value=<?php echo "$row[tcom_id]"?> >

  <p><center><span><?php echo "$row[tcom_name]"?></span><p>company contact : <?php echo "$row[tcom_cont],    company email :$row[tcom_email]"?> </p><p> <?php echo "  company details :$row[tcom_details]"?> </p>
<p>company status  : <?php echo "  $row[tcomp_status]  "?> </p>
<p><input type="submit" value="SUBMIT" name="register" class="btn" ></p>
</div>
</form>
<?php }?>



</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script>

<script>
         let doc = new jsPDF('p', 'pt', 'a4');
         doc.addHTML(document.body, function () {
             doc.save('result.pdf');
         });

    </script>
</html>
<!--count--->

<!-------------->

Wednesday, 5 September 2018

TCSR Organization Profile


Hi All,
Please find the Organization Profile of TCSR


                    Technology Centre for Software and Research (TCSR) is a dynamic group of highly competent IT professionals providing cost effective and cutting-edge IT solutions with integration of Data Mining/Research tools and Applications. Their focus is greater return for their client’s technology investment. They are a dynamic company where teamwork and common goals are the main driving force. Expert and timely delivery of customized solutions is what they can do best.
Technology Centre for Software and Research (TCSR) is a professional web design company, offering first-class website development services, Internet Marketing and Promotion, E-Commerce and Content Management solutions to clients. Their services include new domain name search and registration, site design and development (including photography, graphics, and writing), and ongoing maintenance of your sites. 
  • Custom Design & Layout
  • Custom HTML Programming
  • Custom Graphic Design (GUI)
  • Professional Digital Photography
  • Library of Over thousands of Professional Web Templates
  • Available JavaScript, Java, Perl, ASP, .Net, VC++, PHP, VB Programming
  • Flash & Shockwave Programming Technology
  • Online Forms & E-mail
  • Search Engine Optimization (SEO)
  • Custom Web Site Performance Statistics
  • Business Analytics
Company’s Mission Statement
Technology Centre for Software and Research (TCSR) powering is innovative, cost-effective and quality solutions in Web applications, Intelligent Systems and Software Applications.