| Current Path : /var/www/html/mmishra/iws8/html/indem/student/class/ |
| Current File : /var/www/html/mmishra/iws8/html/indem/student/class/list.class.php |
<?php
$ABS_ROOT_PATH =str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']);
$arrPath = @explode("/",$_SERVER[PHP_SELF]);
if(in_array("website",$arrPath) )
{
$ABS_ROOT_PATH.="/".$arrPath[1]."/".$arrPath[2];
require_once($ABS_ROOT_PATH."/includes/config.php");
}
else
{
require_once($ABS_ROOT_PATH."/includes/config.php");
}
class user extends rahul
{
private $strIds;
private $nor;
private $row;
private $result;
private $sql;
private $singleResult;
//**--------------- To get post data input for user -----------------**//
public function processRequest()
{
$noError=true;
if($_POST)
{
//@extract($_POST);
//print "<pre>";
//print_r($_POST);
//print "</pre>";
$_SESSION['postValue']='';
global $THIS_MODULE_PATH;
//$this->state = $_POST['state'];
//$this->zone = $this->getZoneName($_POST['state']);
$this->nameOfUniver = $_POST['nameOfUniver'];
$this->participantStatus = $_POST['participantStatus'];
$this->areaOfInterest = $_POST['areaOfInterest'];
//$this->aeraOfInterOther = $_POST['aeraOfInterOther'];
//$this->DOB = $_POST['yearDob']."/".$_POST['monthDob']."/".$_POST['dateDob'];
$this->gender = $_POST['gender'];
$this->currentProgEnroll = $_POST['currentProgEnroll'];
$this->yearOfStudy = $_POST['yearOfStudy'];
//$this->nameOfExam1 = $_POST['nameOfExam1'];
$this->university1 = $_POST['university1'];
$this->yearOfPassing1 = $_POST['yearOfPassing1'];
$this->percentage1 = $_POST['percentage1'];
$this->division1 = $_POST['division1'];
$this->sizeOfStudent1 = $_POST['sizeOfStudent1'];
//$this->nameOfExam2 = $_POST['nameOfExam2'];
$this->university2 = $_POST['university2'];
$this->yearOfPassing2 = $_POST['yearOfPassing2'];
$this->percentage2 = $_POST['percentage2'];
$this->division2 = $_POST['division2'];
$this->sizeOfStudent2 = $_POST['sizeOfStudent2'];
//$this->Achievements = $_POST['Achievements'];
//$this->highestDegree = $_POST['highestDegree'];
$this->universityName = $_POST['universityName'];
$this->year = $_POST['year'];
$this->yearinTeaching = $_POST['yearinTeaching'];
//$this->yearInResearch = $_POST['yearInResearch'];
$this->noOfPubJournals = $_POST['noOfPubJournals'];
//$this->noOfPubConferences = $_POST['noOfPubConferences'];
//$this->noOfPubBooks = $_POST['noOfPubBooks'];
//$this->otherAcheivments = $_POST['otherAcheivments'];
//$this->projectNameYear = $_POST['projectNameYear'];
//$this->broadArea = $_POST['broadArea'];
//$this->nameOfPerson1 = $_POST['nameOfPerson1'];
//$this->nameOfPerson2 = $_POST['nameOfPerson2'];
//$this->nameOfPerson3 = $_POST['nameOfPerson3'];
//$this->nameOfPerson4 = $_POST['nameOfPerson4'];
//$this->guideName = $_POST['guideName'];
//$this->howLong = $_POST['howLong'];
//$this->displayed = $_POST['displayed'];
//$this->displayedWhere = $_POST['displayedWhere'];
//$this->winAward = $_POST['winAward'];
//$this->nameofAward = $_POST['nameofAward'];
//$this->descriptionOfProject = $_POST['descriptionOfProject'];
//$this->facilityNeeded = $_POST['facilityNeeded'];
//$this->projectSafe = $_POST['projectSafe'];
//$this->innovationDone = $_POST['innovationDone'];
$this->email = $_POST['email'];
$this->firstName = $_POST['firstName'];
if($_POST['middleName']=="Middle Name")
{
$this->middleName = "";
}
else
{
$this->middleName = $_POST['middleName'];
}
$this->lastName = $_POST['lastName'];
//$this->category = $_POST['category'];
$this->typeOfProject = $_POST['typeOfProject'];
$this->commAddress = $_POST['commAddress'];
//$this->phone = $_POST['phone'];
$this->mobile = $_POST['mobile'];
//$this->bloodGroup = $_POST['bloodGroup'];
//$this->disease = $_POST['disease'];
$this->emergencyName = $_POST['emergencyName'];
$this->emergencyRelation = $_POST['emergencyRelation'];
$this->emergencyPhone = $_POST['emergencyPhone'];
$this->emergencyMobile = $_POST['emergencyMobile'];
$this->emergencyEmail = $_POST['emergencyEmail'];
$this->registrationId= $this->getRollNumber($_POST['areaOfInterest'],$_POST['gender'],$_POST['participantStatus']);
$this->IPAddress=$_SERVER['REMOTE_ADDR'];
$this->recordId=$_POST['recordId'];
$this->age=$_POST['age'];
if($this->isFieldDuplicateEntry($firstName=$this->firstName,$middleName=$this->middleName,$lastName=$this->lastName,$DOB=$this->DOB,$autoIdName='recordId',$this->recordId,$isNullAllowed=false,$extra=''))
{
$_SESSION['sessMsg'] = "This Record Already entered. ";
$_SESSION['postValue']=$_POST;
$go=$THIS_MODULE_PATH."/listAe.php";
header("location: $go");
exit();
}
if(isset($_POST['Add']))
{
$this->sql="insert into tbl_record set
`registrationId` = '$this->registrationId',
`nameOfUniver` = '$this->nameOfUniver',
`participantStatus` = '$this->participantStatus',
`areaOfInterest` = '$this->areaOfInterest',
`gender` = '$this->gender',
`currentProgEnroll` = '$this->currentProgEnroll',
`yearOfStudy` = '$this->yearOfStudy',
`university1` = '$this->university1',
`yearOfPassing1` = '$this->yearOfPassing1',
`percentage1` = '$this->percentage1',
`division1` = '$this->division1',
`university2` = '$this->university2',
`yearOfPassing2` = '$this->yearOfPassing2',
`percentage2` = '$this->percentage2',
`division2` = '$this->division2',
`yearinTeaching` = '$this->yearinTeaching',
`noOfPubJournals` = '$this->noOfPubJournals',
`email` = '$this->email',
`firstName` = '$this->firstName',
`middleName` = '$this->middleName',
`lastName` = '$this->lastName',
`commAddress` = '$this->commAddress',
`mobile` = '$this->mobile',
`age` = '$this->age',
`emergencyName` = '$this->emergencyName',
`emergencyRelation` = '$this->emergencyRelation',
`emergencyPhone` = '$this->emergencyPhone',
`emergencyMobile` = '$this->emergencyMobile',
`emergencyEmail` = '$this->emergencyEmail',
`IPAddress` = '$this->IPAddress'
";
$this->executeQuery($this->sql);
$go="listManager.php";
$_SESSION['sessMsg'] = "New Participant Added Successfully.";
header("location: $go");
exit();
}
else
{
$this->sql="UPDATE `tbl_record` SET
`nameOfUniver` = '$this->nameOfUniver',
`participantStatus` = '$this->participantStatus',
`areaOfInterest` = '$this->areaOfInterest',
`gender` = '$this->gender',
`currentProgEnroll` = '$this->currentProgEnroll',
`yearOfStudy` = '$this->yearOfStudy',
`university1` = '$this->university1',
`yearOfPassing1` = '$this->yearOfPassing1',
`percentage1` = '$this->percentage1',
`division1` = '$this->division1',
`university2` = '$this->university2',
`yearOfPassing2` = '$this->yearOfPassing2',
`percentage2` = '$this->percentage2',
`division2` = '$this->division2',
`yearinTeaching` = '$this->yearinTeaching',
`noOfPubJournals` = '$this->noOfPubJournals',
`email` = '$this->email',
`firstName` = '$this->firstName',
`middleName` = '$this->middleName',
`lastName` = '$this->lastName',
`commAddress` = '$this->commAddress',
`mobile` = '$this->mobile',
`age` = '$this->age',
`emergencyName` = '$this->emergencyName',
`emergencyRelation` = '$this->emergencyRelation',
`emergencyPhone` = '$this->emergencyPhone',
`emergencyMobile` = '$this->emergencyMobile',
`emergencyEmail` = '$this->emergencyEmail',
`IPAddress` = '$this->IPAddress'
where recordId='$this->recordId'
";
$this->executeQuery($this->sql);
if($_POST['Sel']==1)
{
$go="selectedListManager.php";
}
else
{
$go="listManager.php";
}
$_SESSION['sessMsg'] = "User Details Editted Successfully";
header("location: $go");
exit();
}
}
}
//--------------end-----------------//
//**--------------- To Select Site Users -----------------**//
public function getUserList()
{
$this->sql="select * from tbl_record where 1=1 ";
if($_REQUEST)
{
@extract($_REQUEST);
if($_REQUEST['firstName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='firstName',$requestField='firstName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['lastName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='lastName',$requestField='lastName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['middleName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='middleName',$requestField='middleName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['state']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='state',$requestField='state',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['zone']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='zone',$requestField='zone',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['selected']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='selected',$requestField='selected',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['registrationId']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='registrationId',$requestField='registrationId',$method='get',$whCondition='and',$whOpreator='like');
}
if(($_REQUEST['datefrom']!="")&& ($_REQUEST['dateto']!=""))
{
$ED=date("Y/m/d",strtotime($_REQUEST['dateto'])+86400);
//echo $ED;
$this->sql.= " and (createDate between '$_REQUEST[datefrom]' and '$ED') ";
}
}
$this->sql.=" order by recordId ASC";
//echo $this->sql;
$this->result=$this->executeQuery($this->dopaging($this->sql,100));
$this->row=$this->fetch_rows($this->result);
return $this->row;
}
//--------------end-----------------//
public function getSelectedUserList()
{
$this->sql="select * from tbl_record where selected = 1 ";
if($_REQUEST)
{
@extract($_REQUEST);
if($_REQUEST['firstName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='firstName',$requestField='firstName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['lastName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='lastName',$requestField='lastName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['middleName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='middleName',$requestField='middleName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['state']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='state',$requestField='state',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['zone']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='zone',$requestField='zone',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['selected']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='selected',$requestField='selected',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['registrationId']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='registrationId',$requestField='registrationId',$method='get',$whCondition='and',$whOpreator='like');
}
}
$this->sql.=" order by recordId ASC";
//echo $this->sql;
$this->result=$this->executeQuery($this->dopaging($this->sql,100));
$this->row=$this->fetch_rows($this->result);
return $this->row;
}
public function getScreenUserList()
{
$this->sql="select * from tbl_record where screen = 1 ";
if($_REQUEST)
{
@extract($_REQUEST);
if($_REQUEST['firstName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='firstName',$requestField='firstName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['lastName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='lastName',$requestField='lastName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['middleName']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='middleName',$requestField='middleName',$method='get',$whCondition='and',$whOpreator='like');
}
if($_REQUEST['state']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='state',$requestField='state',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['zone']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='zone',$requestField='zone',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['selected']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='selected',$requestField='selected',$method='get',$whCondition='and',$whOpreator='=');
}
if($_REQUEST['registrationId']!="")
{
$this->sql.=$this->concatSql($isSql=false,$sqlVal='',$tblField='registrationId',$requestField='registrationId',$method='get',$whCondition='and',$whOpreator='like');
}
}
$this->sql.=" order by recordId ASC";
//echo $this->sql;
$this->result=$this->executeQuery($this->dopaging($this->sql,100));
$this->row=$this->fetch_rows($this->result);
return $this->row;
}
//--------------end-----------------//
//**--------------- To Select Site Users -----------------**//
public function activeInactiveDelete()
{
global $THIS_MODULE_PATH;
if($_POST)
{
@extract($_POST);
if(is_array($chkIds))
{
$this->strIds=implode(',',$chkIds);
if($Submit=='Confirm')
{
$this->sql= " update tbl_record set selected =1 where recordId in ($this->strIds) ";
$this->executeQuery($this->sql);
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
if($_REQUEST['zone']!="")
{
$go="listManager.php?zone=".$_REQUEST['zone'];
}
else
{
$go="listManager.php";
}
}
$_SESSION['sessMsg'] = "Selected Record(s) Are Now Confirmed.";
header("location: $go");
exit();
}
if($Submit=='Not Confirm')
{
$this->sql= " update tbl_record set selected =0 where recordId in ($this->strIds) ";
$this->executeQuery($this->sql);
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
if($_REQUEST['zone']!="")
{
$go="listManager.php?zone=".$_REQUEST['zone'];
}
else
{
$go="listManager.php";
}
}
$_SESSION['sessMsg'] = "Selected Record(s) Are Not Confirmed.";
header("location: $go");
exit();
}
if($Submit=='Screened')
{
$this->sql= " update tbl_record set screen =1 where recordId in ($this->strIds) ";
$this->executeQuery($this->sql);
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
if($_REQUEST['zone']!="")
{
$go="listManager.php?zone=".$_REQUEST['zone'];
}
else
{
$go="listManager.php";
}
}
$_SESSION['sessMsg'] = "Selected Record(s) Are Screened.";
header("location: $go");
exit();
}
if($Submit=='Not Screened')
{
$this->sql= " update tbl_record set screen =0 where recordId in ($this->strIds) ";
$this->executeQuery($this->sql);
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
if($_REQUEST['zone']!="")
{
$go="listManager.php?zone=".$_REQUEST['zone'];
}
else
{
$go="listManager.php";
}
}
$_SESSION['sessMsg'] = "Selected Record(s) Are Not Screened.";
header("location: $go");
exit();
}
if($Submit=='Delete')
{
//$this->sql= "delete from tbl_recordelectiveselect where recordId in ($this->strIds) ";
//$this->executeQuery($this->sql);
$this->sql= "delete from tbl_record where recordId in ($this->strIds) ";
$this->executeQuery($this->sql);
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
if($_REQUEST['zone']!="")
{
$go="listManager.php?zone=".$_REQUEST['zone'];
}
else
{
$go="listManager.php";
}
}
$_SESSION['sessMsg'] = "Selected Record(s) Are Deleted Successfully.";
header("location: $go");
exit();
}
}
else
{
if($Sel==1)
{
$go="selectedListManager.php";
}
else if($Sel==2)
{
$go="screenedListManager.php";
}
else
{
$go="listManager.php";
}
$_SESSION['sessMsg'] = "Please Select at least one Checkbox for Desire Action.";
header("location: $go");
exit();
}
}
}
//--------------end-----------------//
//**--------------- To get user details -----------------**//
public function getUserDetail($recordId)
{
$this->recordId=$recordId;
$this->sql="select * from tbl_record where recordId='$this->recordId'";
$this->result=$this->executeQuery($this->sql);
$this->row=$this->fetchSingleRow($this->result);
return $this->row;
}
public function getRollNumber($areaOfInterest,$gender,$participantStatus)
{
//print_r($chkIds);exit;
$tempSub=strtoupper(substr($areaOfInterest,0,2));
if($participantStatus==2)
{
$tempparticipantStatus="T";
}
else
{
$tempparticipantStatus="S";
}
if($gender==1)
{
$tempgender="F";
}
else
{
$tempgender="M";
}
$tempNo=rand(100000, 999999);
$registrationId="SC7-".$tempSub."-".$tempparticipantStatus."-".$tempgender."-".$tempNo;
return $registrationId;
}
public function getStateCode($state)
{
if($state=="Jammu & Kashmir"){$stateCode="JK";}if($state=="Himachal Pradesh"){$stateCode="HP";}if($state=="Punjab"){$stateCode="PB";}if($state=="Haryana"){$stateCode="HR";}if($state=="Uttarakhand"){$stateCode="UK";}if($state=="Uttar Pradesh"){$stateCode="UP";}if($state=="Delhi"){$stateCode="DL";}if($state=="New Delhi"){$stateCode="ND";}if($state=="Chandigarh"){$stateCode="CH";}if($state=="Lakshadweep"){$stateCode="LD";}if($state=="Karnataka"){$stateCode="KA";}if($state=="Andhra Pradesh"){$stateCode="AP";}if($state=="Tamil Nadu"){$stateCode="TN";}if($state=="Kerala"){$stateCode="KL";}if($state=="Puducherry"){$stateCode="PY";}if($state=="Bihar"){$stateCode="BH";}if($state=="Jharkhand"){$stateCode="JH";}if($state=="West Bengal"){$stateCode="WB";}if($state=="Orissa"){$stateCode="OR";}if($state=="Chhattisgarh"){$stateCode="CG";}if($state=="Andaman & Nicobar"){$stateCode="AN";}if($state=="Rajasthan"){$stateCode="RJ";}if($state=="Gujarat"){$stateCode="GJ";}if($state=="Maharashtra"){$stateCode="MH";}if($state=="Madhya Pradesh"){$stateCode="MP";}if($state=="Goa"){$stateCode="GA";}if($state=="Daman & Diu"){$stateCode="DD";}if($state=="Dadra & Nagar Haveli"){$stateCode="DN";}if($state=="Sikkim"){$stateCode="SK";}if($state=="Arunachal Pradesh"){$stateCode="AR";}if($state=="Assam"){$stateCode="AS";}if($state=="Meghalaya"){$stateCode="ML";}if($state=="Tripura"){$stateCode="TR";}if($state=="Mizoram"){$stateCode="MZ";}if($state=="Manipur"){$stateCode="MN";}if($state=="Nagaland"){$stateCode="NL";}
return $stateCode;
}
public function getZoneName($state)
{
//echo $state;exit;
if($state=="Jammu & Kashmir"||$state=="Himachal Pradesh"||$state=="Punjab"||$state=="Haryana"||$state=="Uttarakhand"||$state=="Uttar Pradesh"||$state=="Delhi"||$state=="New Delhi"||$state=="Chandigarh"||$state=="Lakshadweep")
{
$zonename="North";
}
if($state=="Karnataka"||$state=="Andhra Pradesh"||$state=="Tamil Nadu"||$state=="Kerala"||$state=="Puducherry")
{
$zonename="South";
}
if($state=="Bihar"||$state=="Jharkhand"||$state=="West Bengal"||$state=="Orissa"||$state=="Chhattisgarh"||$state=="Andaman & Nicobar")
{
$zonename="East";
}
if($state=="Rajasthan"||$state=="Gujarat"||$state=="Maharashtra"||$state=="Madhya Pradesh"||$state=="Goa"||$state=="Daman & Diu"||$state=="Dadra & Nagar Haveli")
{
$zonename="West";
}
if($state=="Sikkim"||$state=="Arunachal Pradesh"||$state=="Assam"||$state=="Meghalaya"||$state==""||$state=="Tripura"||$state=="Mizoram"||$state=="Manipur"||$state=="Nagaland")
{
$zonename="North East";
}
return $zonename;
}
function getUsList()
{
$this->sql="SELECT * from tbl_admin";
$this->result=$this->executeQuery($this->dopaging($this->sql,100));
$this->row=$this->fetch_rows($this->result);
return $this->row;
}
}
?>