PK

ADDRLIN : /home/anibklip/pcfcindia.com/bkp2023-24/
FLL :
Current File : /home/anibklip/pcfcindia.com/bkp2023-24/fix_clients.php

<?php
session_start();
putenv("TZ=Asia/Calcutta");

//echo $_SESSION['city'];

if($_SERVER['HTTP_HOST']=='localhost'){
	if($_SESSION['city']=="ludhiana"){
		$conn=mysql_connect("localhost","root","") or  die('Could not connect to Server');
		mysql_select_db("pratyush_pcfc_2019bk",$conn) or die('database not found');
	}else{
		$conn=mysql_connect("localhost","root","") or  die('Could not connect to Server');
		mysql_select_db("pratyush_pcfc_2019bk",$conn) or die('database not found');
	}
}else{
	if($_SESSION['city']=="ludhiana"){
		//echo $_SESSION['city'];
		$conn=mysql_connect("localhost","pcfcindi_web2018","P_+4+l*P1o))") or  die('Could not connect to Server');
		mysql_select_db("pcfcindi_bkp19-20",$conn) or die('database not found');
		/*
		$conn=mysql_connect("localhost","pcfcindi_web2018","P_+4+l*P1o))") or  die('Could not connect to Server');
		mysql_select_db("pcfcindi_bkpgst17-18",$conn) or die('database not found');
		*/
	}else{
		$conn=mysql_connect("localhost","pcfcindi_web2018","P_+4+l*P1o))") or  die('Could not connect to Server');
		mysql_select_db("pcfcindi_bkp19-20",$conn) or die('database not found');
	}
}
?>
<style>
body {
	font-size: 11px;
	font-family: arial;
	line-height: 131%;
}
</style>
<?php
/*
$q="select * from head_NN ";
$q=mysql_query($q) or die(mysql_error());
$cnt=0;
while($r=mysql_fetch_array($q)){
	$qh="select * from head where headname='$r[headname]'  and headaddress='$r[headaddress]'";	//
	$qh=mysql_query($qh) or die(mysql_error());
	if($rh=mysql_fetch_array($qh)){
		//echo "<strong>Already EXISTS</strong> - $r[headname] <br />";
	}else{
		$cnt++;
		$qh="insert into head set
			headname='$r[headname]',
			headaddress='$r[headaddress]',
			headperson='$r[headperson]',
			headphone='$r[headphone]',
			headdebit='$r[headdebit]',
			headcredit='$r[headcredit]',
			headdecp='$r[headdecp]',
			headdate='$r[headdate]',
			parhead='$r[parhead]',
			gst='$r[gst]',
			status='$r[status]'
		";
		mysql_query($qh) or die(mysql_error());
		$headid=mysql_insert_id();
		//echo "<br><strong>$qh </strong><br>";
		echo "<br>$cnt). <strong>".strip_tags($qh)."</strong><br>";

		$q1="select * from clients_NN where clntid='$r[headid]' ";
		$q1=mysql_query($q1) or die(mysql_error());
		while($r1=mysql_fetch_array($q1)){
			$qi="insert into clients set
				clntid='$headid',
				subname='$r1[subname]',
				subaddress='$r1[subaddress]',
				subperson='$r1[subperson]',
				subphone='$r1[subphone]',
				`date`='$r1[date]',
				status='$r1[status]'
			";
			mysql_query($qi) or die(mysql_error());
			//echo "$qi <br>";
			echo strip_tags($qi)."<br>";
		}
	}
}*/
?>


PK 99