0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.133.113.24


Current Path : /proc/thread-self/root/var/www/html/demo/qptran/admin/
Upload File :
Current File : //proc/thread-self/root/var/www/html/demo/qptran/admin/adduser.php

<?php require_once('auth.php'); ?>
<?php include("header.php"); ?>
<?php 
function VerifyForm(&$values, &$errors)
{
		
     if (strlen($values['FCOLLCODE']) < 3)
        $errors['FCOLLCODE'] = 'Center code should be Max Four Characters';		

     if (strlen($values['FCOLLCODE']) == 0)
        $errors['FCOLLCODE'] = 'Required Field';
		
     if (strlen($values['FCOLLCODE']) > 4)
        $errors['FCOLLCODE'] = 'Center code should not be greater than Four Characters';								

     if (strlen($values['registrationcode']) == 0)
        $errors['registrationcode'] = 'Required Field';
	
     if (strlen($values['examtype']) == 0)
        $errors['examtype'] = 'Required Field';

     if (strlen($values['collegename']) == 0)
        $errors['collegename'] = 'Required Field';
	if (strlen($values['designation']) == 0)
        $errors['designation'] = 'Required Field';

     if (strlen($values['username']) == 0)
        $errors['username'] = 'Required Field';

     if (strlen($values['password']) == 0)
        $errors['password'] = 'Required Field';		
		
     if ((strlen($values['password'])) != (strlen($values['confirmpassword'])))
        $errors['confirmpassword'] = 'Confirm Password should be same as Password';
		
     if (strlen($values['confirmpassword']) == 0)
        $errors['confirmpassword'] = 'Required Field';								

     if (strlen($values['location']) == 0)
        $errors['location'] = 'Required Field';
		
     if (!ereg('.*@.*\..{2,4}', $values['email']))
        $errors['email'] = 'Email ID Invalid';
 
     if (strlen($values['email']) == 0)
        $errors['email'] = 'Required Field';

     if (strlen($values['mobile']) == 0)
        $errors['mobile'] = 'Required Field';		
	
		
    return (count($errors) == 0);
}
 
function DisplayForm($values, $errors)
{
?>
<?php
 if (count($errors) > 0)
?>	

<style type="text/css">
<!--
.style2 {font-family: Georgia; padding-left:5px;}
.style4 {color: #000000; padding-left:5px;}
.style6 {color: #000000; font-family: Georgia; padding-left:5px;}
-->
</style>

<div class="cont">
<p>&nbsp;</p>
<div style="width:800px; height:30px; text-align:center; margin:0 auto; padding-top:10px;"><h3>ADD CENTER DETAILS</h3><p>&nbsp;</p></div>
<!--- Header Over -->
<?php
$a_id=$_SESSION['SESS_MEMBER_ID'];
?>
<form name="form1" action="<?= $_SERVER['PHP_SELF'] ?>" method="POST">
  <table width="552" border="0" align="center" cellpadding="4" cellspacing="1">
    <tr>
	  <td width="441"></td>
      <td width="39" height="36" style="padding-left:5px;"><a href="adminfunction.php">Home</a></td>
       <td width="44" height="36"  style="padding-left:5px;"><a href="logout.php">Logout</a></td>
	</tr>
  </table>
  	  
  <table width="552" border="0" align="center" cellpadding="4" cellspacing="1" bordercolor="#999999" bgcolor="#999999">
    <tr>
      <td width="131" height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Center Code</font></div></td>
      <td width="350" height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><input type="text" name="FCOLLCODE" size="30" value="<?= htmlentities($values['FCOLLCODE']) ?>"  style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" />
      </font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['FCOLLCODE'] ?></span>    </td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Registration Code</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="2">
          <input type="text" name="registrationcode" size="30" value="<?= htmlentities($values['registrationcode']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['registrationcode'] ?></span>
      </div></td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Exam Type </font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><span style="color: #000000">
        <select name="examtype"  value="<?= htmlentities($values['examtype']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; color: #000000; background-color:#F8F7FD">
          <option value=''>Select Exam Type</option>
          <option value="UG">UG</option>
          <option value="PG">PG</option>
          <option value="PARA">PARA</option>
        </select>&nbsp;&nbsp;<span class="error_msg"><?= $errors['examtype'] ?></span></span>
     </td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Center 
      Name</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="collegename" size="30" value="<?= htmlentities($values['collegename']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['collegename'] ?></span>
      </div></td>
    </tr>


    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Designation</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="designation" size="30" value="<?= htmlentities($values['designation']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['designation'] ?></span>
      </div></td>
    </tr>
	
 <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Username</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="username" size="30" value="<?= htmlentities($values['username']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['username'] ?></span>
      </div></td>
    </tr>
	
 <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Password</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="password" size="30" value="<?= htmlentities($values['password']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['password'] ?></span>
      </div></td>
    </tr>
	
 <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Confirm Password</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="confirmpassword" size="30" value="<?= htmlentities($values['confirmpassword']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['confirmpassword'] ?></span>
      </div></td>
    </tr>			
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Location</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="location" size="30" value="<?= htmlentities($values['location']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['location'] ?></span>
</div></td>

    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">E-Mail</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="email" size="30" value="<?= htmlentities($values['email']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['email'] ?></span>
</div></td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Phone 
      Number</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="phone" size="30" value="<?= htmlentities($values['phone']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>
      </div></td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">Moblie 
      Number</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="mobile" size="30" value="<?= htmlentities($values['mobile']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" /></font>&nbsp;&nbsp;<span class="error_msg"><?= $errors['mobile'] ?></span>
      </div></td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"><font size="2" style="padding-left:5px;">FAX 
      Number</font></div></td>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;"><div align="left"> <font size="3" face="Verdana, Arial, Helvetica, sans-serif">
          <input type="text" name="fax" size="30" value="<?= htmlentities($values['fax']) ?>" style="border:1px solid #000000; font-family: Verdana; font-size: 12px; background-color:#F8F7FD" />
      </font></div></td>
    </tr>
    <tr>
      <td height="36" bgcolor="#f4f2f3"  style="padding-left:5px;">&nbsp;</td>
      <td height="36" valign="middle" bgcolor="#f4f2f3" style="padding-left:5px;"><input type="image" src="images/submit.jpg" name="submit"/>
      &nbsp;&nbsp; <a href="javascript:document.form1.reset()"><img src="images/reset.jpg" border="0" alt="Reset" /></a></td>
    </tr>
</table>  

</form>

 <?php
}
 
function ProcessForm($values)
{
?>
<?php
include('link.php');
$FCOLLCODE=$_REQUEST['FCOLLCODE'];	
$registrationcode=$_REQUEST['registrationcode'];	
$examtype=$_REQUEST['examtype'];	
$collegename=$_REQUEST['collegename'];	
$location=$_REQUEST['location'];
$email=$_REQUEST['email'];	
$username=$_REQUEST['username'];	
$password=$_REQUEST['password'];	
$confirmpassword = $_REQUEST['confirmpassword'];
$designation = $_REQUEST['designation'];
$phone=$_REQUEST['phone'];	
$mobile=$_REQUEST['mobile'];	
$fax=$_REQUEST['fax'];	



//$dateTime = new DateTime("now", new DateTimeZone('Europe/Warsaw'));
//echo $dateTime->format("d-m-Y H:i:s");

$dtRegistered = date('d-m-Y H:i:s');
//echo"DATE :".$dtRegistered;
$status ='enable';	

$query1="SELECT * FROM usertable WHERE FCOLLCODE='$FCOLLCODE'";
$result1=mysql_query($query1) or die("Query 1 Failed".mysql_error());
$num=mysql_num_rows($result1);
if($num <= 0)
{

$query="INSERT INTO usertable SET  FCOLLCODE='$FCOLLCODE',registrationcode='$registrationcode', examtype='$examtype',
username='$username', fpassword='$password', confirmpassword='$confirmpassword', designation='$designation', collegename='$collegename',
location='$location',phone='$phone', mobile='$mobile', femail='$email', fax='$fax',dtRegistered='$dtRegistered', fstatus='$status'"; 

$result=mysql_query($query) or die("Query Failed".mysql_error());
?>

<table width="600" height="300" border="0" align="center" cellpadding="2" cellspacing="1">
<tbody>
<tr>
<td class="Display_msg">
  <div align="center">Center details added successfully in the Database.</div></td>
 </tr>
</tbody>
</table>
<meta http-equiv="refresh" content="3; url=adduser.php">

<?php
 }
else
{
?>
<table width="600" height="300" border="0" align="center" cellpadding="2" cellspacing="1">
<tbody>
<tr>
<td height="20" class="Display_msg">
  <div align="center">Center code 
    <?php $FCOLLCODE ?>  
    already exists in the Database.<br />
    <br />
  </div>
	<div align="center">PLEASE WAIT FOR A MOMENT....</div></td>
 </tr>
</tbody>
</table>
<meta http-equiv="refresh" content="2; url=adduser.php">


<?php 
 }
}
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
    $formValues = $_POST;
    $formErrors = array();
 
    if (!VerifyForm($formValues, $formErrors))
        DisplayForm($formValues, $formErrors);
    else
        ProcessForm($formValues);
}
else
    DisplayForm(null, null);
?>



<p>&nbsp;</p>

<p>&nbsp;</p>

<?php include("footer.php"); ?>