Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/uprtou1/www.uprtou.ac.in/
Upload File :
Current File : /var/www/html/mmishra/mm/uprtou1/www.uprtou.ac.in/refinedata.php

<?php

if (!mysql_connect("localhost", "root", "alld"))
	die('Could not connect: ' . mysql_error());
else
	mysql_select_db("uprtou2011");

$tbl = 'examdata';
$bno = 0; $eno = 0; $rno = 0; $nno = 0; $enr = ''; $paper = '';
$webid = 'www.uprtou.ac.in';

echo "Operation in progress...\n";

//$rs = mysql_query("select * from $tbl order by enr,paper");
$rs = mysql_query("select * from $tbl order by enr");
while ($o = mysql_fetch_object($rs)) {
	
	//if ($enr != '' && $enr == $o->enr && $paper == $o->paper) {
	if ($enr != $o->enr) {
		if (file_exists("/srv/www/icdp/$webid/photos/{$o->batchctrl}.jpg")) {
			$bno++;
			echo $bno .'- '. $o->enr ." - ". $o->batchctrl ."\n";
			mysql_query("update examdata1 set batchctrl='$o->batchctrl' where enr='$o->enr'");
			//shell_exec("echo $o->enr >> bnophotos.txt");
		/*} else if (file_exists("/srv/www/icdp/$webid/photos/{$o->enr}.jpg")) {
			$eno++;
			echo $o->enr." on eno\n";
			shell_exec("echo $o->enr >> enophotos.txt");
		} else if (file_exists("/srv/www/icdp/$webid/photos/{$o->roll_no}.jpg")) {
			$rno++;
			echo $o->enr." on rollno\n";
			shell_exec("echo $o->enr >> rnophotos.txt");
		} else {
			$nno++;
			echo $o->enr." no photo\n";
			shell_exec("echo $o->enr >> nophotos.txt");
		*/}
	}
	//mysql_query("delete from $tbl where rowid=$o->rowid");
	
	$enr = $o->enr;
	//$paper = $o->paper;
	//$rollno = $o->roll_no;
	//$batchno = $o->batchctrl;
	//mysql_query("update examdata set roll_no='$rollno' where enr='$eno'");

}
$no = $bno + $eno + $rno;
//echo "$no duplicate records deleted";
echo "$no total photos found (batch $bno eno $eno rollno $rno, nophoto $nno)";

?>