????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.37 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/project/ |
Upload File : |
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
session_start();
require_once("createNewProject.php");
$Projectname = $_POST['Projectname'];
$IDs = explode("EEE",$_POST['customer']);
if($IDs[1] == ""){
$IDs[1] = $_POST['customer'];
}
$sql = "SELECT * FROM SystemUser where SystemUserId = ".$IDs[1];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$UserGroupId = $row['UserGroupId'];
$Name =$row['Name'];
$Email = $row['Username'];
$Phone = $row['Phone'];
$CompanyId = $row['CompanyId'];
}
$deliverydate = $_POST['deliverydate'];
if($deliverydate == ""){
$deliverydate = "0000-00-00 00:00:00";
}else{
$deliverydate = $deliverydate . " 00:00:00";
}
$Type =$_POST['type'];
//echo($Type ."<br>" );
if(strpos($Type,"#") !== false){
$Type = explode("#",$Type)[0];
// echo($Type ."<br>" );
}
if($_GET['from'] == "customer"){
$Status = 18;
}if($_GET['from'] == "production"){
$Status = 4;
}else{
$Status = 1;
}
$rfqorder = $_POST['rfqorder'];
$ProjectManager = $_POST['salesresponsible'];
if($ProjectManager == ""){$ProjectManager = "1041";}
$ProductionManagerId = $_POST['productionmanager'];
$SalesresponsibleId = $_POST['salesresponsible'];
$Timeframe = $_POST['timeframe'];
$Size = $_POST['size'];
$InternInfo = $_POST['descriptionastacus'];
$Country = $_POST['country'];
$Description = $_POST['description'];
$model_hrs = $_POST['model_hrs'];
$result = createNewProject($Projectname,$Description,$InternInfo,$CompanyId,$SystemUserId ,$UserGroupId ,$Name,$Email,$Phone,$Type,date("Y-m-d h:m"),$Status,$rfqorder,$deliverydate,$ProjectManager,$ProductionManagerId,$Country);
// echo("$Projectname $InternInfo $CompanyId $SystemUserId $UserGroupId $Name $Email $Phone $Type $Status $rfqorder $deliverydate $ProjectManager $ProductionManagerId $Country");
$ProjectId = $result;
if($Timeframe != ""){
$sql = "UPDATE Project SET DeliveryNotes = '".$Timeframe." weeks', STATSize_PROD = '".$Size."' WHERE ProjectId = $ProjectId";
mysql_query($sql);
}else{
$Timeframe = $deliverydate;
}
if($model_hrs != ""){
$sql = "UPDATE Project SET STATHrsModel = '".$model_hrs."' WHERE ProjectId = $ProjectId";
mysql_query($sql);
}
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$_SESSION['ASTACUS_SSO_INFO'][2]."\r\n";
$sql = "SELECT * FROM SystemUser where SystemUserId = ". $_POST['salesresponsible'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$Projectmanager = $row['Username'];
}
$sql = "SELECT * FROM SystemUser where SystemUserId = ".$SalesresponsibleId;
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$Salesresponsible = $row['Username'];
}
$sql = "INSERT INTO ProjectFavorite VALUES(NULL,".$_POST['salesresponsible'].",".$ProjectId .") ";
mysql_query($sql);
$sql = "INSERT INTO ICADBalls VALUES(NULL,".$ProjectId .",".$SalesresponsibleId.",'".date("Y-m-d")."') ";
mysql_query($sql);
$sql = "SELECT * FROM SystemUser where SystemUserId = ".$_POST['productionmanager'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$Productionmanager = $row['Username'];
}
$sql = "SELECT * FROM Company where CompanyId = ".$CompanyId;
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$CompanyName = $row['Name'];
}
$sql = "SELECT * FROM ProjectType where ProjectTypeId = ".$_POST['type'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$ProjectType = $row['ProjectTypeDisplayValue'];
}
$sql = "SELECT * FROM JobType where JobTypeId = ".$_POST['rfqorder'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$JobType = $row['JobTypeDisplayValue'];
}
$subject = "Astacus Project: New Project created: - ".$CompanyId."_".$Projectname." (".$ProjectId.")";
$message = "
Dear Sir,
A new project has been created for the customer: ".$CompanyName."
Customer account number: ".$CompanyId."
The project has the name: ".$Projectname." (".$ProjectId.")
Expected time frame: ".$Timeframe." week(s)
Project type: ".$ProjectType."
Job Type: ".$JobType."
Sales Responsible: ".$Salesresponsible."
";
if($_POST['sendmail_prod'] == "send"){
mail($Productionmanager, $subject, nl2br($message), $headers);
}
if($_POST['sendmail_sales'] == "send"){
mail($Salesresponsible, $subject, nl2br($message), $headers);
}
if($Status == 18){
$subject = "[IMPORTANT]: New Project created by client: - ".$CompanyId."_".$Projectname." (".$ProjectId.")";
$message = "
Dear Sir,
A new project has been created by the customer: ".$CompanyName."
Customer account number: ".$CompanyId."
The project has the name: ".$Projectname." (".$ProjectId.")
Expected delivery date: ".$_POST['deliverydate']." (<a href='#'>Confirm delivery date</a>)
Project type: ".$ProjectType."
Job Type: ".$JobType."
SoW: ".$description."
";
mail("sales@astacus.se", $subject, nl2br($message), $headers);
}
$LogDate = date("Y-m-d H:i:s");
$ProjectId = $ProjectId;
$SystemUserId = $_SESSION['ASTACUS_SSO_INFO'][0];
$Subject = "Automatic function";
$Message = nl2br ("The project has been created: ".$LogDate);
$prio = "4";
$sql = "INSERT IGNORE INTO ProjectLog VALUES (NULL,'$LogDate',$ProjectId,$SystemUserId,'$Message',$prio,'$Subject');";
$result = mysql_query($sql);
$sql = "";
header("Location:index.php?companyId=$CompanyId&page=".$_GET['page']."&projectId=$ProjectId");
?>