
<!doctype html>
<html class="no-js" lang="">

<head>
<?php error_reporting(0); ?>
    <!-- meta -->
    <meta charset="utf-8">
    <meta name="description" content="Flat, Clean, Responsive, application admin template built with bootstrap 3">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
    <!-- /meta -->

    <title>Carbon Blue</title>

    <!-- page level plugin styles -->
    <link rel="stylesheet" href="plugins/responsive-tables/theme.css">
    <!-- /page level plugin styles -->

    <!-- core styles -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.css">
    <link rel="stylesheet" href="css/themify-icons.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <!-- /core styles -->

    <!-- template styles -->
    <link rel="stylesheet" href="css/skins/palette.css">
    <link rel="stylesheet" href="css/fonts/font.css">
    <link rel="stylesheet" href="css/main.css">
    <!-- template styles -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- load modernizer -->
    <script src="plugins/modernizr.js"></script>
	

	<link rel="stylesheet" href="awesomplete-gh-pages/awesomplete.css" />
<script src="awesomplete-gh-pages/awesomplete.js" async></script>
	
	<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
	
	<link rel="stylesheet" type="text/css" media="all" href="date/jsDatePick_ltr.min.css" />
	<script type="text/javascript" src="date/jsDatePick.min.1.3.js"></script>
	
		 
		<?php
		 
		
		
	$cookie_name = "user_con";
	
if(!isset($_COOKIE[$cookie_name])) {
   // echo "Cookie named '" . $cookie_name . "' is not set!";
	header('Location: sign-in.php');
	exit;
} else {
    //echo "Cookie '" . $cookie_name . "' is set!<br>";
    //echo "Value is: " . $_COOKIE[$cookie_name];
}
?>
<?php
									
										 $_con_id =  $_COOKIE[$cookie_name];
									
									$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
									mysql_select_db('orion9', $con);
								
									$result = mysql_query("select company_name from contractors where con_id=" . $_con_id);
									while($row = mysql_fetch_array($result))
									{    
										$company_name = $row['company_name']; 
									}
									
									$company_name = '';
									$abn = '';
									$street = '';
									$suburb = '';
									$state = '';
									$postcode = '';
									$representative   = '';
									$position = '';
									$dob  = '';
									$phone = '';
									$mobile = '';
									$email  = '';
									$licence_number = '';

									
									$result1 = mysql_query("select * from contractors where con_id=" . $_con_id);
									while($row = mysql_fetch_array($result1))
									{    
										$company_name = $row['company_name']; 
										$abn  = $row['abn']; 
										$street  = $row['street']; 
										$suburb  = $row['suburb']; 
										$state  = $row['state']; 
										$postcode  = $row['postcode']; 
										$representative   = $row['representative']; 
										$position  = $row['position']; 
										$dob   = $row['dob']; 
										$phone  = $row['phone']; 
										$mobile  = $row['mobile']; 
										$email   = $row['email']; 
										$licence_number  = $row['licence_number']; 
									}
								 
									?>
 
</head>

<!-- body -->

<body>

 							  
    <div class="app">
        <!-- top header -->
        
 
 
  

<header class="header header-fixed navbar" style="background-color:#59b2ff;">

            <div class="brand" style="background-color:#ccc;"><center>
                <!-- toggle offscreen menu -->
          
                <a href="home.php?x=ocNvi07amIHwp7J6Zfr3fIvqLNE4h0UFdHbvHiF31nAqujxtzZxPI2ftQUx7VrN89YEQhkUiHvJbOhFogceYftr5oZckrZsAY6rf" class="navbar-brand">
                    <img src="unnamed.png"  alt="">
                     
                </a> </center>
            </div>

            <ul class="nav navbar-nav">
                <li class="hidden-xs"> 
                     
                </li> 
            </ul> 
            <ul class="nav navbar-nav navbar-right"> 
                <li class="off-right">
                    <a href="javascript:;" data-toggle="dropdown">
                        
                         <span class="hidden-xs ml10" style='font-family:calibri;'><?php echo $company_name;?></span>
                        <i class="ti-angle-down ti-caret hidden-xs"></i>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight">
                     
                        <li>
                            
							 <a href="log_con_out.php" onclick="">Logout</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </header>
        <!-- /top header -->

        <section class="layout">
            <!-- sidebar menu -->
           <aside style='display:none;' class="sidebar offscreen-left" style="border-right:solid 1px #ccc;">
                <!-- main navigation -->
                <nav class="main-navigation" data-height="auto" data-size="6px" data-distance="0" data-rail-visible="true" data-wheel-step="10">
                    <br/>
                    <ul class="nav">
                        <!-- dashboard -->
                        <li style="background-color:#008362; font-family:calibri;  color:white; border-bottom:solid 1px white;">
                            <a href="home.php" onclick="checkChangesSideBar('home.php','ocNvi07amIHwp7J6Zfr3fIvqLNE4h0UFdHbvHiF31nAqujxtzZxPI2ftQUx7VrN89YEQhkUiHvJbOhFogceYftr5oZckrZsAY6rf')">
                              
                                <span style="color:white;"><i class="fa fa-rocket" style='font-size:15px;' aria-hidden="true"></i> PROJECTS</span>
                            </a>
                        </li>  
						   <li style="background-color:#438dcc;  font-family:calibri;  color:white; border-bottom:solid 1px white;">
                             <a href="contacts.php" >
                              
                                <span style="color:white;"><i class="fa fa-user" style='font-size:15px;' aria-hidden="true"></i> CONTACTS</span>
                            </a>
							<ul class="sub-menu" style="display: block;">
                                <li class="active">
                                    
									<a href="internal-contacts.php">
                                        <span>Internal Contacts</span>
                                    </a>
									<a href="contacts.php">
                                        <span>External Contacts</span>
                                    </a>
                                </li>
                             
                            </ul>
                        </li> 
						 <li style="background-color:#438dcc; font-family:calibri;   color:white; border-bottom:solid 1px white;">
                            <?php

if (date('D') == 'Sun')
	$lastSunday = date('d-m-Y');
else
	$lastSunday = date('d-m-Y', strtotime('last Sunday'));

?>



							<a href="timesheet.php?periodA=<?php echo $lastSunday; ?>">
                              
                                <span style="color:white;"><i class="fa fa-clock-o" style='font-size:15px;' aria-hidden="true"></i> TIMESHEETS</span>
                            </a>
                        </li> 
						 
						 <li style="background-color:#438dcc;   font-family:calibri;  color:white; border-bottom:solid 1px white;">
                           <a href="report-module.php">
                              
                                <span style="color:white;"><i class="fa fa-table" style='font-size:15px;' aria-hidden="true"></i> REPORTS</span>
                            </a>
                        </li>
                        <!-- /dashboard -->
     
                    </ul> 
                </nav>
            </aside>
            <!-- /sidebar menu -->

            <!-- main content -->
            <section class="main-content">

                <!-- content wrapper -->
                <div class="content-wrap">

								
				<br/>
				<br/><br/><br/><br/>
				
				
				
				
				
								
				<script>
function checkUn(inVal)
{
	//alert(inVal);
	
	var txt = document.getElementById("f_" + inVal).value;
	
	
		var xmlhttp = new XMLHttpRequest();
							xmlhttp.onreadystatechange = function() {
								if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
									var response = xmlhttp.responseText;
									if (response == 'error')
									{
										document.getElementById("f_" + inVal).style.borderColor = "red";
										alert('Value Must be Unique');
										 document.getElementById("f_" + inVal).value = "";
									}
									if (response == 'ok')
									{
											document.getElementById("f_" + inVal).style.borderColor = "#e3e6f3";
									}
									
								}
							};
							xmlhttp.open("GET", "check-un.php?val=" + inVal + "&txt=" + txt , true);
							xmlhttp.send();
				
	
}


</script>
				
				<script>
				 
				
					function getParams5()
					{
						var values = $('#ftype').val();
						document.getElementById("statuses").value = values;
					}
				
					function getParams2()
					{
						var values = $('#orgys').val(); 
						document.getElementById("organisations").value = values;
					}
					
					function getParams3()
					{
						var values = $('#pm').val();
						document.getElementById("pms").value = values;
					}
				
				
					function getParams()
					{
						
					document.getElementById("ftype").options.length = 0;
					
					
						
						//alert(document.getElementById("stt").value);
						var values = $('#stt').val();
						document.getElementById("stages").value = values;
						
						if (document.getElementById("stages").value.indexOf("LEAD") >= 0)
						{	
							var x = document.getElementById("ftype");
							var option = document.createElement("option");option.text = "NEW";x.add(option);
							option = document.createElement("option");option.text = "SITE ASSESSMENT";x.add(option);
							option = document.createElement("option");option.text = "CONVERTED";x.add(option);	
						}
						
						if (document.getElementById("stages").value.indexOf("OPPORTUNITY") >= 0)
						{
							
							var x = document.getElementById("ftype");
							var option = document.createElement("option");option.text = "QUOTE DEVELOPMENT";x.add(option);
							option = document.createElement("option");option.text = "QUOTE DELIVERED";x.add(option);
							option = document.createElement("option");option.text = "CONVERTED";x.add(option);	
							option = document.createElement("option");option.text = "DECLINED";x.add(option);
							option = document.createElement("option");option.text = "ON HOLD";x.add(option);
						}
						
						if (document.getElementById("stages").value.indexOf("PROJECT") >= 0)
						{
							var x = document.getElementById("ftype");
							var option = document.createElement("option");option.text = "PRE-INSTALL";x.add(option);
							option = document.createElement("option");option.text = "INSTALLATION";x.add(option);
							option = document.createElement("option");option.text = "POST-INSTALL";x.add(option);	
							option = document.createElement("option");option.text = "RESA SUBMITTED";x.add(option);
							option = document.createElement("option");option.text = "ESCs TRADED";x.add(option);
							option = document.createElement("option");option.text = "AUDIT COMPLETE";x.add(option);
						} 
					}
				
				</script>
				
				
		<script type="text/javascript">
		
		window.onload = function()
		{
			new JsDatePick({useMode:2,cellColorScheme:"lightgreen",target:"datefrom",dateFormat:"%d/%m/%Y" }); 
			new JsDatePick({useMode:2,cellColorScheme:"lightgreen",target:"dateto",dateFormat:"%d/%m/%Y" }); };</script>										
							
				
				
				
                    <!-- inner content wrapper -->
                    <div class="wrapper">
					
					                        <section class="panel">
                            <!--<header class="panel-heading" style="background-color:#15acdc; color:white;">Home</header>-->
                            <div class="panel-body" style='padding:0px;'>
							
							 
							   
							   
							   
							   <?php
									
									$pid= $_GET['pid'];
									
									$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
									mysql_select_db('orion9', $con);
								
									$prjTitle = '';
								
									$result = mysql_query("select  descr from projects where pid=" . $pid);
									while($row = mysql_fetch_array($result))
									{    
										$prjTitle = $row['descr']; 
									}
									?>
							   
							   
							   
							   
							   <!-- search -->
							   
							   	<div id="searchNow1" style="background-color:white; border: solid 1px #e8e8e8;;">
							 	<div id="ggg" style="background-color:white;  padding:20px; padding-top:3px; ">
							<form class="form-inline" id="searchNow" name="searchNow" action="save-contractor-details.php?con_id=<?php echo $_con_id?>" method="POST">
										
									
								<div style='height:10px;'></div>
									 
									  
		 
		<!--<div style='background-color:#ccc; font-family:calibri;padding:2px;color:white;'><center>PROJECT DETAILS</center></div>-->
					
					
<div id="sResults" class="table-responsive">
								
								<?php
									
									$pid= $_GET['pid'];
									
									$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
									mysql_select_db('orion9', $con);
									
									$result = mysql_query("select a.bid, a.b_key,a.status,a.title,a.created,a.currency,a.approved_date,a.approved_by,
									b.descr from budget a, projects b where a.pid=b.pid and a.retired is null and a.pid=" . $pid);
									$totalResults = mysql_num_rows($result);
									
									 
									
								?>
								
								
								
								<!--<small><a href="project-view.php?pid=<?php echo $pid;?>"><i class="fa fa-caret-left" aria-hidden="true"></i> back to <i>project view</i></a></small>
								-->
								
							<div align='right'>
								<a href="contractor-home.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>Requests and Tasks</a>
								<a href="contractor-projects.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>My Projects</a>
								<a href="contractor-documents.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>My Documents</a>
								<a href="contractor-details.php" class="btn btn-info" style='background-color:#59b2ff; border:solid 1px #59b2ff;'>My Details</a>

<a href="contractor-managed-projects.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>Projects I'm Managing</a>
								</div>
								
							 
								
								<br>	<br>
                                 
                                </div>

								<div class="row" id='b1'>
									<div class="col-md-6">
										<span style="font-size:25px; font-family:calibri;"><u><?php echo $totalResults;?></u> Edit My Details</span>
									<br/><br/>
									</div>
									<div class="col-md-6" align='right'>
									<button type='submit' style='width:150px;' class="btn btn-success">SAVE</button>
								
									 </div>
								</div>
								
								<div class="row">
								<div class="col-md-12">
								  <table class="table table-bordered table-striped" style="font-size:15px; font-family:calibri;" id='b2'>
                                         
                                        <tbody> 
										<tr>

										
										    <td style='width:180px;'><b>Name</b></td>
											 <td style='width:300px;'><input required='required' style='width:300px;' class='form-control' id='representative' name='representative' value='<?php echo $representative;?>' /></td>
											 
											    </tr>
										  <tr>
										    <td style='width:180px;'><b>Company Name</b></td>
											 <td style='width:300px;'><input required='required'  style='width:300px;'  class='form-control' id='company_name' name='company_name' value='<?php echo $company_name;?>' /></td>
											    </tr>
												<tr>
												  <td style='width:180px;'><b>ABN</b></td>
											 <td style='width:300px;'><input required='required'  style='width:300px;'  id='abn' class='form-control' name='abn' value='<?php echo $abn;?>' /></td>
											    </tr>
												  <tr>
										    <td><b>Street</b></td>
											 <td><input id='street' required='required'  style='width:300px;'  class='form-control' name='street' value='<?php echo $street;?>' /></td>
											    </tr>
										 <tr>
										    <td><b>Suburb</b></td>
											 <td><input id='suburb' required='required'  style='width:300px;'  class='form-control' name='suburb' value='<?php echo $suburb;?>' /></td>
											</tr>
										     <tr>
										    <td><b>Postcode</b></td>
											 <td><input id='postcode' required='required'  style='width:300px;'   class='form-control' name='postcode' value='<?php echo $postcode;?>' /></td>
											    </tr>
												  <tr>
										    <td><b>State</b></td>
											 <td><select id='state' required='required'  style='width:300px;'  name='state' class='form-control' >
												<option>-</option>
												<option <?php if ($state == 'ACT') echo "selected";?> value='ACT'>ACT</option>
												<option <?php if ($state == 'NSW') echo "selected";?> value='NSW'>NSW</option>
												<option <?php if ($state == 'NT') echo "selected";?> value='NT'>NT</option>
												<option <?php if ($state == 'QLD') echo "selected";?> value='QLD'>QLD</option>
												<option <?php if ($state == 'SA') echo "selected";?> value='SA'>SA</option>
												<option <?php if ($state == 'TAS') echo "selected";?> value='TAS'>TAS</option>
												<option <?php if ($state == 'VIC') echo "selected";?> value='VIC'>VIC</option>
												<option <?php if ($state == 'WA') echo "selected";?> value='WA'>WA</option>
											 
											 
											 </td>
											    </tr>
												 <tr>
										    <td><b>Phone</b></td>
											<td><input id='phone' required='required'  style='width:300px;'   name='phone' class='form-control' value='<?php echo $phone;?>' /></td>
											    </tr>
												 <tr>
										    <td><b>Mobile</b></td>
											<td><input id='mobile' required='required'  style='width:300px;' name='mobile' class='form-control' value='<?php echo $mobile;?>' /></td>
											    </tr>
												 <tr>
										    <td><b>Email</b></td>
											<td><input id='email'  required='required'  style='width:300px;' name='email' class='form-control' value='<?php echo $email;?>' /></td>
											    </tr>
												 <tr>
										    <td><b>Licence Number</b></td>
											<td><input id='licence_number' required='required'  style='width:300px;'  class='form-control' name='licence_number' value='<?php echo $licence_number;?>' /></td>
											    </tr>
                                        </tbody>
                                    </table>
								
								
								
								
								
			            </section>
					</div>
					</div>
			 
					
					<input type="hidden" value="">
                    </div>
                    <!-- /inner content wrapper -->

                </div>
                <!-- /content wrapper -->
                <a class="exit-offscreen"></a>
            </section>
            <!-- /main content -->
        </section>

    </div>
    <!-- core scripts -->
    <script src="plugins/jquery-1.11.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>
    <script src="plugins/jquery.slimscroll.min.js"></script>
    <script src="plugins/jquery.easing.min.js"></script>
    <script src="plugins/appear/jquery.appear.js"></script>
    <script src="plugins/jquery.placeholder.js"></script>
    <!-- /core scripts -->

    <!-- page level scripts -->
    <script src="plugins/responsive-tables/responsive-tables.js"></script>
    <!-- /page level scripts -->

    <!-- template scripts -->
    <script src="js/offscreen.js"></script>
    <script src="js/main.js"></script>
    <!-- /template scripts -->

    <!-- page script -->
    <!-- /page script -->

	
	
</body>
<!-- /body --> 
</html>
