Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data: data,
  2. dataType: 'json',
  3. success: function(json) {
  4.     if (json !== null) {
  5.         var id = json[0]; //get id
  6.         var employee = json[1]; //get employee
  7.         var date = json[2]; //get employee
  8.         var companyName = json[3]; //get company
  9.         var notes = json[4]; //get company
  10.         var companyPhone = json[5]; //get company
  11.         var contact = json[6]; //get company
  12.         var fulfilledStatus = json[7];
  13.  
  14.         for (
  15.         var i = 0;
  16.         i < json.length;
  17.         i++)
  18.             {
  19.             var item = json[i];
  20.  
  21.             if (json === null) {
  22.                 alert("No ID Found");
  23.             }
  24.  
  25.             if (item.fulfilledStatus == "1") {
  26.                 var checked = "style='display:none'";
  27.             }
  28.             else {
  29.                 var checked = "";
  30.             };
  31.  
  32.             $('#output').append("<div class='lead'><input type='hidden' class='id' name='leadId[" + item.id + "]' value=" + item.id + " /><p class='id' id='id' value=" + item.id + ">Lead ID: " + item.id + "</p><p> Date: " + item.date + "</p><p> Company Name: " + item.companyName + "</p><p>Contact: " + item.contact + "</p><p>Phone: " + item.companyPhone + "</p><p>Lead info: " + item.notes + "</p><label>Fulfilled</label><input type='checkbox' name='status[" + item.id + "]' id='status' class='status' value=" + item.fulfilledStatus + " " + checked + " /></div>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement