Jump to content

jor133d

New Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jor133d's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yeah, gosh, that was silly. I have it working now. You have been so helpful. PM me your paypal. At the very least I can buy you a beer, ha!
  2. I tried your code and all I seem to get is a blank document. Would you consider taking a look at my code? I can zip it all up for you. If you would consider this, how much would you charge? Thanks!
  3. Yes, they will always be in the same order and position. The titles can change to match the position if that is easier. Same with name, there is no real reason to have first and last name in different columns. There can be just one field for it called name.
  4. Is this what you are looking for? {"content":"{\"2\":{\"label\":\"\",\"value\":\"\",\"type\":null,\"validation\":null,\"required\":null,\"min\":null,\"max\":null,\"tooltip\":null,\"custom\":null,\"custom2\":null},\"3\":{\"label\":\"Based+on+your+most+recent+call+to+our+Call+Center%2C+how+likely+is+it+that+you+would+recommend+CitizensFirst+Credit+Union+to+a+friend+or+colleague%3F\",\"value\":\"10 (Very Likely)\",\"type\":\"radio\",\"validation\":\"\",\"required\":\"1\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field0\",\"custom\":null,\"custom2\":null},\"4\":{\"label\":\"What+is+the+primary+reason+for+the+rating+you+gave%3F\",\"value\":\"Because Anna is absolutely incredible. \",\"type\":\"para\",\"validation\":\"\",\"required\":\"0\",\"min\":\"0\",\"max\":\"60\",\"tooltip\":\"field1\",\"custom\":null,\"custom2\":null},\"5\":{\"label\":\"divider\",\"value\":\"\",\"type\":\"divider\",\"validation\":\"divider\",\"required\":null,\"min\":null,\"max\":null,\"tooltip\":null,\"custom\":null,\"custom2\":null},\"6\":{\"label\":\"Gender\",\"value\":\"Female\",\"type\":\"dropdown\",\"validation\":\"\",\"required\":\"1\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field3\",\"custom\":null,\"custom2\":null},\"7\":{\"label\":\"Age\",\"value\":\"30-45\",\"type\":\"dropdown\",\"validation\":\"\",\"required\":\"1\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field4\",\"custom\":null,\"custom2\":null},\"8\":{\"label\":\"Marital+Status\",\"value\":\"Married with children\",\"type\":\"dropdown\",\"validation\":\"\",\"required\":\"1\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field5\",\"custom\":null,\"custom2\":null},\"9\":{\"label\":\"Household+income\",\"value\":\"Prefer not to answer\",\"type\":\"dropdown\",\"validation\":\"\",\"required\":\"1\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field6\",\"custom\":null,\"custom2\":null},\"10\":{\"label\":\"City+you+reside+in\",\"value\":\"Oshkosh\",\"type\":\"dropdown\",\"validation\":\"\",\"required\":\"0\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field7\",\"custom\":null,\"custom2\":null},\"11\":{\"label\":\"If+other%2C+please+specify\",\"value\":\"Neenah\",\"type\":\"text\",\"validation\":\"\",\"required\":\"0\",\"min\":\"0\",\"max\":\"60\",\"tooltip\":\"field8\",\"custom\":null,\"custom2\":null},\"12\":{\"label\":\"divider\",\"value\":\"If you would like CitizensFirst to contact you regarding your responses, please complete the following:\",\"type\":\"divider\",\"validation\":\"divider\",\"required\":null,\"min\":null,\"max\":null,\"tooltip\":null,\"custom\":null,\"custom2\":null},\"13\":{\"label\":\"Name\",\"value\":\"Betsy Doran\",\"type\":\"text\",\"validation\":\"\",\"required\":\"0\",\"min\":\"0\",\"max\":\"60\",\"tooltip\":\"field10\",\"custom\":null,\"custom2\":null},\"14\":{\"label\":\"Email\",\"value\":\"[email protected]\",\"type\":\"email\",\"validation\":\"email\",\"required\":\"0\",\"min\":\"\",\"max\":\"\",\"tooltip\":\"field11\",\"custom\":\"\",\"custom2\":\"\"},\"15\":{\"label\":\"Phone\",\"value\":\"920-236-7040\",\"type\":\"text\",\"validation\":\"\",\"required\":\"0\",\"min\":\"0\",\"max\":\"60\",\"tooltip\":\"field12\",\"custom\":null,\"custom2\":null},\"16\":{\"label\":\"Best+time+to+call\",\"value\":\"8am - 5pm \",\"type\":\"text\",\"validation\":\"\",\"required\":\"0\",\"min\":\"0\",\"max\":\"60\",\"tooltip\":\"field13\",\"custom\":null,\"custom2\":null},\"17\":{\"label\":\"title\",\"value\":\"Rate your most recent call to our Call Center\",\"type\":null,\"validation\":null,\"required\":null,\"min\":null,\"max\":null,\"tooltip\":null,\"custom\":null,\"custom2\":null}}","added":"23 Aug 2013 (09:45)","form_id":"1","form_name":"Call Center","seen":"1"}
  5. I am really a novice PHP user and exhausted my knowledge at this point. I need some help with exporting to .xls. I had found some form builder code. It exports the data now but instead of horizontally displaying the field responses, it creates a new line each time. See my attachment. Would anybody be able to assit me in having the export properly display in a new cell in the same row instead of a new row? Here is the code: <?php if ($handle = opendir('../submissions/')) { if (!isset($_SESSION)) { session_start(); } if (!(isset($_SESSION['user_email']))) { header( 'Location: login.php'); } $i = 1; // Loop through the submissions while (false !== ($entry = readdir($handle))) { if ((substr($entry, 0, 4)=='subm')) { $temp = json_decode(file_get_contents('../submissions/'.$entry), 1); $i++; $set_it[$i]=0; //if ( $temp['seen']=='1' ) { $seen = 'Read'; } else { $seen = 'Unread'; } $new = json_decode($temp['content'],1); // Loop through the input fields within a submission foreach ($new as $skey=>$value) { $skey++; if ( !(empty($value['type'])) && !($value['type']=='captcha')) { $mess[$skey] = "$value[value]"; if (!($set_it[$i])) { $set_it[$i]=1; $line[$i*$skey] = "$temp[added]\t$temp[form_id]\t$mess[$skey]"; } else { $line[$i*$skey] = "\t\t$mess[$skey]"; } } } // End of foreach (field loop) $i++; } } // End of While (submission loop) closedir($handle); } $header = 'Form Submission Data'; $sz = sizeof($line); $a=0; $data=''; foreach($line as $key=>$row) { $data.="$row\n"; } $data = "Date\tForm Id\tFirst Name\tLast Name\tEmail\tPhone Number\tBest time to contact\tCity\tRating\tReason for rating\n$data"; header("Content-type: application/x-msdownload"); header("Content-Disposition: attachment; filename=form_data.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$data"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.