Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/new_ticket.php
<?PHP $row="";$_jJLIt="";$sql="Insert into ".$CONF['TableNameItem']."(Item_customer_id,Item_make,Item_model,Item_required_parts,Item_accessories)    values(   '$Customer_ID',   '$Item_make',   '$Item_model',   '$Item_required_parts',   '$Item_accessories')";mysql_query($sql,$conn) or die("Insert Workorder item failed<br>SQL: $sql<br>mysql_error($sql)");$_j60Lt=mysql_insert_id($conn);if( ($_j61Oj) && $CONF['EnableCustomTicketID']==1 ) { $_j61Oj=strtoupper($_j61Oj);$_j6QQo='Update '.$CONF['TableNameTicket'].' SET Custom_ticket_id = ""   WHERE Custom_ticket_id = "'.$_j61Oj.'"';$_j6QlO=mysql_query( $_j6QQo,$conn) or die("Unable to clear of Custom_ticket_id $sql");} if( _OFFR1( $CONF,$Service_Type)==True ) { $_j6j0j=1;} else { $_j6j0j=1;} $row=$row.'"'.$Customer_ID.'"'.", ";$_jJLIt=$_jJLIt."Customer_ID, ";$row=$row.'"'.$_j60Lt.'"'.", ";$_jJLIt=$_jJLIt."Item_ID, ";$row=$row.'"'.$Service_Desc.'"'.", ";$_jJLIt=$_jJLIt."Service_Desc, ";$row=$row.'"'.$CheckedIn.'"'.", ";$_jJLIt=$_jJLIt."CheckedIn, ";$row=$row.'"'.$CheckedInBy.'"'.", ";$_jJLIt=$_jJLIt."CheckedInBy, ";if( $assigned_tech_id ) { $row=$row.'"'.$assigned_tech_id.'"'.", ";$_jJLIt=$_jJLIt."assigned_tech_id, ";} $row=$row.'"'.$Service_Type.'"'.", ";$_jJLIt=$_jJLIt."Service_Type, ";$row=$row.'"'.$Store_id.'"'.", ";$_jJLIt=$_jJLIt."Store_id, ";if( ($BackStop) ) { $row=$row.'"'.$BackStop.'"'.", ";$_jJLIt=$_jJLIt."BackStop, ";} if( ($_j6Jot && $_j6Jot !='--00' && $_j6Jot !=' --00' && $_j6Jot !=' 00-0-00' ) ) { $row=$row.'"'.$_j6Jot.'"'.", ";$_jJLIt=$_jJLIt."OnsiteScheduled, ";} if( ($User_ID) ) { $row=$row.'"'.$User_ID.'"'.", ";$_jJLIt=$_jJLIt."OnsiteTechID, ";} $row=$row.'"'.$_j6j0j.'"'.", ";$_jJLIt=$_jJLIt."Status_id, ";if( ($GuestKey) && $CONF['EnableGuestKey']==1 ) { $row=$row.'"'.$GuestKey.'"'.", ";$_jJLIt=$_jJLIt."GuestKey, ";} if( ($_j61Oj) && $CONF['EnableCustomTicketID']==1 ) { $row=$row.'"'.strtoupper($_j61Oj).'"'.", ";$_jJLIt=$_jJLIt."Custom_ticket_id, ";} $row=rtrim($row,", ");$_jJLIt=rtrim($_jJLIt,", ");$sql="Insert into ".$CONF['TableNameTicket']."($_jJLIt) values($row)";mysql_query($sql,$conn) or die("Insert Workorder Ticket failed Error: 4325fdg <br>SQL: $sql<br>".mysql_error($conn));$Ticket_ID=mysql_insert_id($conn);$sql="update ".$CONF['TableNameItem']." set Item_ticket_id=\"$Ticket_ID\" where Item_ID=\"$_j60Lt\"";$res=mysql_query($sql,$conn) or die("Update ".$CONF['TableNameItem']." failed<br>SQL: $sql<br>".mysql_error($conn));if ( isset($res) AND empty($SSID)) { echo('The Ticket has been added to the database, no further action is required.<br>Additional Options:<br>   <a href="workorder.php?Step=EditAddTicket&amp;Print=Ticket&amp;Ticket_ID='.$Ticket_ID.'&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">Print Ticket</a><br>   <a href="workorder.php?Step=EditAddTicket&amp;Ticket_ID='.$Ticket_ID.'&amp;SSID='.$SSID.'">Go To Ticket</a>');echo('<p><a href="workorder.php?SSID='.$SSID.'">Back to Store Overview</a></p>');} else{ echo('The Ticket has been added to the database, no further action is required.<br>Additional Options:<br>   <a href="workorder.php?Step=EditAddTicket&amp;Print=Ticket&amp;Ticket_ID='.$Ticket_ID.'&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">Print Ticket</a><br>   <a href="workorder.php?Step=EditAddTicket&amp;Ticket_ID='.$Ticket_ID.'&amp;SSID='.$SSID.'">Go To Ticket</a>');echo('<p><a href="workorder.php?SSID='.$SSID.'">Back to Store Overview</a></p>');} ?>
Return current item: WorkOrder TS