<?php 
$glb_dbhost="192.168.0.14";
$glb_dbuser="dev";
$glb_dbpass="dev247";
$glb_dbname="dev_supportdesk";
<?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="support_desk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshith_supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="supportdesk4";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 <?php 
$glb_dbhost_1="localhost";
$glb_dbuser_1="root";
$glb_dbpass_1="status";
$glb_dbname_1="roshi_test";
 
/*		$glb_dbhost_1 = "localhost";
		$glb_dbuser_1 = "root";
		$glb_dbpass_1 = "status";
		$glb_dbname_1 = "supportdesk3";

*/
		$conapi = mysql_connect($glb_dbhost_1,$glb_dbuser_1,$glb_dbpass_1) or die(mysql_error());
		mysql_select_db($glb_dbname_1,$conapi) or die(mysql_error());

		function userAdd($loginnameapi,$passwordapi,$companyapi,$emailapi){
				
				global $conapi;
				
				if($loginnameapi != "" && $passwordapi != "" && $companyapi != "" && $emailapi != ""){
				
					$sqlapi = "Select * from sptbl_users where vLogin = '".addslashes($loginnameapi)."'";
					$resultapi = mysql_query($sqlapi,$conapi);
					
					if(mysql_num_rows($resultapi) == 0){
						
						$sqlapi = "Select nCompId from sptbl_companies where vCompName = '".addslashes($companyapi)."'";
						$resultapi = mysql_query($sqlapi,$conapi);
						
						if(mysql_num_rows($resultapi) > 0){	
							
							$rowapi = mysql_fetch_array($resultapi);
							$compidapi = $rowapi[nCompId];
							
							$sqlapi  = " INSERT INTO sptbl_users(`nUserId`,`vUserName`,`nCompId`,`vEmail`,`vLogin`,`vPassword`,`dDate`, `vBanned`, `vDelStatus`) ";
							$sqlapi .= " VALUES('','".addslashes($loginnameapi)."','".addslashes($compidapi)."', '".addslashes($emailapi)."','".addslashes($loginnameapi)."','".addslashes(md5($passwordapi))."',now(),'0','0')";
							$resultapi = mysql_query($sqlapi,$conapi);							
							
						}

					}

				}
				
				
	}		
?>
