Advertisement
Guest User

Untitled

a guest
Oct 31st, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. // This function will run within each post array including multi-dimensional arrays
  4.  
  5. function ExtendedAddslash(&$params)
  6.  
  7. {
  8.  
  9. foreach ($params as &$var) {
  10.  
  11. // check if $var is an array. If yes, it will start another ExtendedAddslash() function to loop to each key inside.
  12.  
  13. is_array($var) ? ExtendedAddslash($var) : $var=addslashes($var);
  14.  
  15. unset($var);
  16.  
  17. }
  18.  
  19. }
  20.  
  21. // Initialize ExtendedAddslash() function for every $_POST variable
  22.  
  23. ExtendedAddslash($_POST);
  24.  
  25. $submission_id = $_POST['submission_id'];
  26.  
  27. $ticketid = $_POST['ticketNo'];
  28.  
  29. $region = $_POST['region30'];
  30.  
  31. $companycode = $_POST['companycode'];
  32.  
  33. $companyname = $_POST['companyname'];
  34.  
  35. $customername = $_POST['customername'];
  36.  
  37. $phonenumber = $_POST['phonenumber'];
  38.  
  39. $email = $_POST['email5'];
  40.  
  41. $suitabletime = $_POST['suitabletime20'];
  42.  
  43. $teamviewerid = $_POST['teamviewerid'];
  44.  
  45. $teamviewerPas = $_POST['teamviewerpassword'];
  46.  
  47. $uploadError = $_POST['uploaderror'];
  48.  
  49. $describeThe = $_POST['describethe'];
  50.  
  51. $describeproblemvoice = $_POST['describeproblem'];
  52.  
  53. $location = $_POST['clickto27'];
  54.  
  55. $code = $_POST['code'];
  56.  
  57. $ticketStatus = $_POST['ticketstatus'];
  58.  
  59. $answerDate = $_POST['answerdate'];
  60.  
  61. $confirmationCode = $_POST['confirmationcode'];
  62.  
  63. $closedBy = $_POST['closedby'];
  64.  
  65. $answerBy = $_POST['answerby'];
  66.  
  67. $monetaryTerm = $_POST['monetaryterm'];
  68.  
  69. $modeOf = $_POST['modeof'];
  70.  
  71. $supportCharges = $_POST['supportcharges'];
  72.  
  73. $solutionProvided = $_POST['solutionprovided'];
  74.  
  75. $uploadSupporting = $_POST['uploadsupporting'];
  76.  
  77. $closingDate = $_POST['closingdate'];
  78.  
  79. $responsetime = $_POST['responsetime'];
  80.  
  81. $pageurl = $_POST['typea'];
  82.  
  83.  
  84.  
  85. $db_host = 'localhost';
  86.  
  87. $db_username = 'Your Username';
  88.  
  89. $db_password = 'Your Password';
  90.  
  91. $db_name = 'Your Database';
  92.  
  93. mysql_connect( $db_host, $db_username, $db_password) or die(mysql_error());
  94.  
  95. mysql_select_db($db_name);
  96.  
  97. // search submission ID
  98.  
  99. $query = "SELECT * FROM Cloneof3DSystemsOpenTicket WHERE `submission_id` = '$submission_id'";
  100.  
  101. $sqlsearch = mysql_query($query);
  102.  
  103. $resultcount = mysql_num_rows($sqlsearch);
  104.  
  105.  
  106. if ($resultcount > 0) {
  107.  
  108. mysql_query("UPDATE `Cloneof3DSystemsOpenTicket` SET `submissionID` = '$submission_id',`TicketNo` = '$ticketid',`Region` = '$region',`CompanyCode` = '$companycode',`CompanyName` = '$companyname',`CustomerName` = '$customername',`PhoneNumber` = '$phonenumber',`Email` = '$email',`Suitabletimetocontactorremote` = '$suitabletime',`TeamviewerID` = '$teamviewerid',`TeamviewerPassword` = '$teamviewerPas',`UploadErrorScreenShot` = '$uploadError',`DescribetheProblem` = '$describeThe',`DescribeProblemvoice` = '$describeproblemvoice',`DetectedLocation` = '$location',`Code` = '$code',`TicketStatus` = '$ticketStatus',`AnswerDate` = '$answerDate',`ConfirmationCode` = '$confirmationCode',`ClosedBy` = '$closedBy',`AnswerBy` = '$answerBy',`MonetaryTerm` = '$monetaryTerm ',`ModeOfpayment` = '$modeOf',`SupportCharges` = '$supportCharges',`SolutionProvided` = '$solutionProvided',`UploadSupportingdocument` = '$uploadSupporting',`ClosingDate` = '$closingDate',`ResponsetimeDays` = '$responsetime',`GetPageURL` = '$pageurl' WHERE `submission_id` = '$submission_id'")
  109.  
  110. or die(mysql_error());
  111.  
  112. } else {
  113.  
  114. mysql_query("INSERT INTO `Cloneof3DSystemsOpenTicket` (`submissionID`,`TicketNo`,`Region`,`CompanyCode`,`CompanyName`,`CustomerName`,`PhoneNumber`,`Email`,`Suitabletimetocontactorremote`,`TeamviewerID`,`TeamviewerPassword`,`UploadErrorScreenShot`,`DescribetheProblem`,`DescribeProblemvoice`,`DetectedLocation`,`Code`,`TicketStatus`,`AnswerDate`,`ConfirmationCode`,`ClosedBy`,`AnswerBy`,`MonetaryTerm`,`ModeOfpayment`,`SupportCharges`,`SolutionProvided`,`UploadSupportingdocument`,`ClosingDate`,`ResponsetimeDays`,`GetPageURL`) VALUES ( '$submission_id', '$ticketid', '$region', '$companycode', '$companyname', '$customername', '$phonenumber', '$email', '$suitabletime', '$teamviewerid', '$teamviewerPas', '$uploadError', '$describeThe', '$describeproblemvoice', '$location', '$code', '$ticketStatus', '$answerDate', '$confirmationCode', '$closedBy', '$answerBy', '$monetaryTerm ', '$modeOf', '$supportCharges', '$solutionProvided', '$uploadSupporting', '$closingDate', '$responsetime', '$pageurl') ")
  115.  
  116. or die(mysql_error());
  117.  
  118. }
  119.  
  120. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement