Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/save_ticket_changes.php
<?PHP if( $Step=="Save Changes" ) { if( isset($_POST['serv_cont'])==True ) { $serv_cont=$_POST['serv_cont'];} else { $serv_cont=Null;} $_Ilifl=$_POST['Ticket_ID'];$_j8LOO=$CONF['TableNameTechHours'];$_Ilifl=mysql_real_escape_string($_Ilifl);if( isset($_POST['TimeSpentHr']) ) { $_j8lQj=mysql_real_escape_string($_POST['TimeSpentHr']);} else { $_j8lQj=0;} if( isset($_POST['TimeSpentMin']) ) { $_j8lLC=mysql_real_escape_string($_POST['TimeSpentMin']);} else { $_j8lLC=0;} if( $_j8lQj=="" || $_j8lQj==Null ) { $_j8lQj=0;} if( $_j8lLC=="" || $_j8lLC==Null ) { $_j8lLC=0;} if( substr( $_j8lQj,0,1)==0 && $_j8lQj !=0 ) { $_j8lQj=substr( $_j8lQj,1,1);} if( substr( $_j8lLC,0,1)==0 && $_j8lLC !=0) { $_j8lLC=substr( $_j8lLC,1,1);} if( $_j8lLC <=9 ) { $_j8lLC="0$_j8lLC";} $_jt0fI=$_j8lQj.".".$_j8lLC;$display_time_spent=$_j8lQj.'hr '.$_j8lLC.'min';if( settype($_jt0fI,"float")==False ) { die("The time positive field only takes integer values");} if( $_jt0fI < 0 ) { die("The time field only takes positive integer values");} $display_time_spent=' Time: '.$display_time_spent;echo($display_time_spent);$_IlLfj=_L00RE($SSID,$inc_dir,$CONF);if( _L0OPO( $inc_dir,$SSID,$CONF )==True ) { $_IlClj=_OFPAC($inc_dir,$CONF['TableNameTicket'],'Store_id','ID = "'.$_Ilifl.'"' );$_IlLfj[1]=$_IlClj[0];$display_time_spent=Null;} $_jt10C=$CONF["DefaultValuesStoreName".$_IlLfj[1]."Date"];$_jjJCf=$CONF["DefaultValuesStoreName".$_IlLfj[1]."Date"];$_jj6oj=$CONF["DefaultValuesStoreName".$_IlLfj[1]."TimeZone"];$_jjf66=$CONF["DefaultValuesStoreName".$_IlLfj[1]."TimeZoneSign"];$_jjfOj=$CONF["DefaultValuesStoreName".$_IlLfj[1]."DayLightSavings"];$_jt1l8=_OF18E("$_jjf66","$_jj6oj","$_jjfOj","$_jt10C");if( empty($Tech_name) ) { die('UPDATE FAILED!, no Tech Name<br><a href ="javascript:history.back()">Please Go Back to Correct your error.</a> <img src="'.ERROR_IMG.'" width="22" height="11" /> ');} $_jtQot=GetStatusAsString2($inc_dir,$CONF,$Status_id);if ( $Tech_Notes !="" && file_exists("$inc_dir/pro/workorder_functions_pro.inc.php")==True ) { $_jtj8L=_OER0E("Tech_Notes",$Ticket_ID,$CONF);$_jtj8L=mysql_real_escape_string($_jtj8L);$_jtjCo=$_jtj8L.$Tech_Notes."\n&nbsp;Last Saved by $Tech_name on ".$_jt1l8." New Status: $_jtQot \n------------------------------\n";}else{ $_jtj8L=_OER0E("Tech_Notes",$Ticket_ID,$CONF);$_jtj8L=mysql_real_escape_string($_jtj8L);$_jtjCo=$_jtj8L;} if ( $Service_Performed !="" ) { $Service_Performed=trim($Service_Performed,"\n\t\r");$Service_Performed=$Service_Performed."\n&nbsp;Last Saved by $Tech_name on ".$_jt1l8.$display_time_spent." New Status: $_jtQot \n------------------------------\n";} else { $Service_Performed=trim($Service_Performed,"\n\t\r");$Service_Performed=$Service_Performed."No Information Added.\n&nbsp;Last Saved by $Tech_name on ".$_jt1l8.$display_time_spent." New Status: $_jtQot \n------------------------------\n";} $_jtJij=_OER0E("Service_Performed",$Ticket_ID,$CONF);$_jtJij=mysql_real_escape_string($_jtJij);if( $debug==1 ) { echo("<br>This is in the database:<br>$_jtJij");echo("<br>And this came in from the tech:<br> $Service_Performed");} $Service_Performed=$_jtJij.$Service_Performed;if( $debug==1 ) { echo("<br>Appended it looks like this:<br>$Service_Performed");} $_jt6o8='update '.$CONF['TableNameTicket'].' set Service_Performed="'.$Service_Performed.'", Tech_Notes="'.$_jtjCo.'",Status_id="'.$Status_id.'", BackStop="'.$BackStop.'" where ID="'.$Ticket_ID.'" ';$_jtffL=mysql_query($_jt6o8,$conn) or die("Failed at update. Error Code 23894724<br>$_jt6o8");if( $debug==1 ) { echo($_jt6o8);} if( $_jt0fI !="" && $_jt0fI !=Null && _L0OPO( $inc_dir,$SSID,$CONF )==False ) { $_jt8Jo=_OFPAC($inc_dir,$CONF['TableNameUsers'].','.$CONF['TableNameUsersLogin'],'User_ID','Login_ssid = "'.$SSID.'" AND User_ID = Login_USER_ID' );$_jt8Jo=$_jt8Jo[0];_OFQQC($inc_dir,$_j8LOO,'User_ID, Ticket_ID, time_spent,posted','"'.$_jt8Jo.'","'.$_Ilifl.'","'.$_jt0fI.'", NOW()');} if( $Status_id==12 ) { $_jt88f="update ".$CONF['TableNameTicket']." set OnsiteTechID = 1 WHERE ID='$Ticket_ID'";$_jttji=mysql_query($_jt88f,$conn) or die("Failed to clear Ticket from User Error 20394wk<br> $_jt88f");} echo("<br>The Workorder with Ticket ID: $Ticket_ID has been updated successfully.<br>   <a href=\"workorder.php?Ticket_ID=$Ticket_ID&Step=EditAddTicket&amp;SSID=$SSID\">Back to Ticket $Ticket_ID</a>");echo('<p><a href="workorder.php?SSID='.$SSID.'">Back to Store Overview</a></p>');} ?>
Return current item: WorkOrder TS