PageRenderTime 69ms CodeModel.GetById 41ms RepoModel.GetById 1ms app.codeStats 0ms

/scafold/opportunities/edit.php

https://github.com/heidymadia/sfbackup
PHP | 54 lines | 53 code | 1 blank | 0 comment | 2 complexity | 80abfb42438ccb8c82fc2560f3f288c1 MD5 | raw file
  1. <?php
  2. include('config.php');
  3. if (isset($_GET['id']) ) {
  4. $id = (int) $_GET['id'];
  5. if (isset($_POST['submitted'])) {
  6. foreach($_POST AS $key => $value) { $_POST[$key] = mysql_real_escape_string($value); }
  7. $sql = "UPDATE `opportunities` SET `AccountId` = '{$_POST['AccountId']}' , `Amount` = '{$_POST['Amount']}' , `CampaignId` = '{$_POST['CampaignId']}' , `CloseDate` = '{$_POST['CloseDate']}' , `CreatedById` = '{$_POST['CreatedById']}' , `CreatedDate` = '{$_POST['CreatedDate']}' , `CurrentGenerators__c` = '{$_POST['CurrentGenerators__c']}' , `DeliveryInstallationStatus__c` = '{$_POST['DeliveryInstallationStatus__c']}' , `Description` = '{$_POST['Description']}' , `ExpectedRevenue` = '{$_POST['ExpectedRevenue']}' , `Fiscal` = '{$_POST['Fiscal']}' , `FiscalQuarter` = '{$_POST['FiscalQuarter']}' , `FiscalYear` = '{$_POST['FiscalYear']}' , `ForecastCategory` = '{$_POST['ForecastCategory']}' , `ForecastCategoryName` = '{$_POST['ForecastCategoryName']}' , `HasOpportunityLineItem` = '{$_POST['HasOpportunityLineItem']}' , `IsClosed` = '{$_POST['IsClosed']}' , `IsDeleted` = '{$_POST['IsDeleted']}' , `IsPrivate` = '{$_POST['IsPrivate']}' , `IsWon` = '{$_POST['IsWon']}' , `LastActivityDate` = '{$_POST['LastActivityDate']}' , `LastModifiedById` = '{$_POST['LastModifiedById']}' , `LastModifiedDate` = '{$_POST['LastModifiedDate']}' , `LeadSource` = '{$_POST['LeadSource']}' , `MainCompetitors__c` = '{$_POST['MainCompetitors__c']}' , `Name` = '{$_POST['Name']}' , `NextStep` = '{$_POST['NextStep']}' , `OrderNumber__c` = '{$_POST['OrderNumber__c']}' , `OwnerId` = '{$_POST['OwnerId']}' , `Pricebook2Id` = '{$_POST['Pricebook2Id']}' , `Probability` = '{$_POST['Probability']}' , `StageName` = '{$_POST['StageName']}' , `SystemModstamp` = '{$_POST['SystemModstamp']}' , `TotalOpportunityQuantity` = '{$_POST['TotalOpportunityQuantity']}' , `TrackingNumber__c` = '{$_POST['TrackingNumber__c']}' , `Type` = '{$_POST['Type']}' WHERE `id` = '$id' ";
  8. mysql_query($sql) or die(mysql_error());
  9. echo (mysql_affected_rows()) ? "Edited row.<br />" : "Nothing changed. <br />";
  10. echo "<a href='list.php'>Back To Listing</a>";
  11. }
  12. $row = mysql_fetch_array ( mysql_query("SELECT * FROM `opportunities` WHERE `id` = '$id' "));
  13. ?>
  14. <form action='' method='POST'>
  15. <p><b>AccountId:</b><br /><input type='text' name='AccountId' value='<?= stripslashes($row['AccountId']) ?>' />
  16. <p><b>Amount:</b><br /><input type='text' name='Amount' value='<?= stripslashes($row['Amount']) ?>' />
  17. <p><b>CampaignId:</b><br /><input type='text' name='CampaignId' value='<?= stripslashes($row['CampaignId']) ?>' />
  18. <p><b>CloseDate:</b><br /><input type='text' name='CloseDate' value='<?= stripslashes($row['CloseDate']) ?>' />
  19. <p><b>CreatedById:</b><br /><input type='text' name='CreatedById' value='<?= stripslashes($row['CreatedById']) ?>' />
  20. <p><b>CreatedDate:</b><br /><input type='text' name='CreatedDate' value='<?= stripslashes($row['CreatedDate']) ?>' />
  21. <p><b>CurrentGenerators C:</b><br /><input type='text' name='CurrentGenerators__c' value='<?= stripslashes($row['CurrentGenerators__c']) ?>' />
  22. <p><b>DeliveryInstallationStatus C:</b><br /><input type='text' name='DeliveryInstallationStatus__c' value='<?= stripslashes($row['DeliveryInstallationStatus__c']) ?>' />
  23. <p><b>Description:</b><br /><input type='text' name='Description' value='<?= stripslashes($row['Description']) ?>' />
  24. <p><b>ExpectedRevenue:</b><br /><input type='text' name='ExpectedRevenue' value='<?= stripslashes($row['ExpectedRevenue']) ?>' />
  25. <p><b>Fiscal:</b><br /><input type='text' name='Fiscal' value='<?= stripslashes($row['Fiscal']) ?>' />
  26. <p><b>FiscalQuarter:</b><br /><input type='text' name='FiscalQuarter' value='<?= stripslashes($row['FiscalQuarter']) ?>' />
  27. <p><b>FiscalYear:</b><br /><input type='text' name='FiscalYear' value='<?= stripslashes($row['FiscalYear']) ?>' />
  28. <p><b>ForecastCategory:</b><br /><input type='text' name='ForecastCategory' value='<?= stripslashes($row['ForecastCategory']) ?>' />
  29. <p><b>ForecastCategoryName:</b><br /><input type='text' name='ForecastCategoryName' value='<?= stripslashes($row['ForecastCategoryName']) ?>' />
  30. <p><b>HasOpportunityLineItem:</b><br /><input type='text' name='HasOpportunityLineItem' value='<?= stripslashes($row['HasOpportunityLineItem']) ?>' />
  31. <p><b>IsClosed:</b><br /><input type='text' name='IsClosed' value='<?= stripslashes($row['IsClosed']) ?>' />
  32. <p><b>IsDeleted:</b><br /><input type='text' name='IsDeleted' value='<?= stripslashes($row['IsDeleted']) ?>' />
  33. <p><b>IsPrivate:</b><br /><input type='text' name='IsPrivate' value='<?= stripslashes($row['IsPrivate']) ?>' />
  34. <p><b>IsWon:</b><br /><input type='text' name='IsWon' value='<?= stripslashes($row['IsWon']) ?>' />
  35. <p><b>LastActivityDate:</b><br /><input type='text' name='LastActivityDate' value='<?= stripslashes($row['LastActivityDate']) ?>' />
  36. <p><b>LastModifiedById:</b><br /><input type='text' name='LastModifiedById' value='<?= stripslashes($row['LastModifiedById']) ?>' />
  37. <p><b>LastModifiedDate:</b><br /><input type='text' name='LastModifiedDate' value='<?= stripslashes($row['LastModifiedDate']) ?>' />
  38. <p><b>LeadSource:</b><br /><input type='text' name='LeadSource' value='<?= stripslashes($row['LeadSource']) ?>' />
  39. <p><b>MainCompetitors C:</b><br /><input type='text' name='MainCompetitors__c' value='<?= stripslashes($row['MainCompetitors__c']) ?>' />
  40. <p><b>Name:</b><br /><input type='text' name='Name' value='<?= stripslashes($row['Name']) ?>' />
  41. <p><b>NextStep:</b><br /><input type='text' name='NextStep' value='<?= stripslashes($row['NextStep']) ?>' />
  42. <p><b>OrderNumber C:</b><br /><input type='text' name='OrderNumber__c' value='<?= stripslashes($row['OrderNumber__c']) ?>' />
  43. <p><b>OwnerId:</b><br /><input type='text' name='OwnerId' value='<?= stripslashes($row['OwnerId']) ?>' />
  44. <p><b>Pricebook2Id:</b><br /><input type='text' name='Pricebook2Id' value='<?= stripslashes($row['Pricebook2Id']) ?>' />
  45. <p><b>Probability:</b><br /><input type='text' name='Probability' value='<?= stripslashes($row['Probability']) ?>' />
  46. <p><b>StageName:</b><br /><input type='text' name='StageName' value='<?= stripslashes($row['StageName']) ?>' />
  47. <p><b>SystemModstamp:</b><br /><input type='text' name='SystemModstamp' value='<?= stripslashes($row['SystemModstamp']) ?>' />
  48. <p><b>TotalOpportunityQuantity:</b><br /><input type='text' name='TotalOpportunityQuantity' value='<?= stripslashes($row['TotalOpportunityQuantity']) ?>' />
  49. <p><b>TrackingNumber C:</b><br /><input type='text' name='TrackingNumber__c' value='<?= stripslashes($row['TrackingNumber__c']) ?>' />
  50. <p><b>Type:</b><br /><input type='text' name='Type' value='<?= stripslashes($row['Type']) ?>' />
  51. <p><input type='submit' value='Edit Row' /><input type='hidden' value='1' name='submitted' />
  52. </form>
  53. <? } ?>