public function Init() { $strCsv = FBContestApplication::ExportToCSV(); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"my-data.csv\""); die($strCsv); }
public function RenderEntries() { foreach (admin::$arrEntries as $intIndex => $objEntry) { FBContestApplication::SetCurrentEntry($objEntry); $strTemplate = $this->GetTemplateLoc('_displaySingleEntry'); require $strTemplate; } }
public static function RenderEntries() { self::$arrEntries = FBContestApplication::GetContestEntries(); foreach (index::$arrEntries as $intIndex => $objEntry) { FBContestApplication::SetCurrentEntry($objEntry); require __APP_TPL_ASSETS__ . '/displaySingleEntry.tpl.php'; } }
<?php header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"my-data.csv\""); $strReturn = FBContestApplication::ExportToCSV(); die($strReturn);
<?php class index extends indexBase { } FBContestApplication::Run('index');
public static function ExportToCSV($arrHiddenFields = array()) { $strReturn = ''; $arrEntries = FBContestApplication::GetContestEntries(); $objEntry = $arrEntries[0]; $arrFields = $objEntry->GetContestFormAnswerAsIdArray(); foreach ($arrFields as $intFieldIndex => $objField) { if (!array_search($objField->name, $arrHiddenFields)) { $strReturn .= $objField->name . ','; } } $strReturn = substr($strReturn, 0, strlen($strReturn) - 1); $strReturn .= "\n"; foreach ($arrEntries as $intIndex => $objEntry) { if ($intIndex != 0) { $arrFields = $objEntry->GetContestFormAnswerAsIdArray(); } foreach ($arrFields as $intFieldIndex => $objField) { if (!array_search($objField->name, $arrHiddenFields)) { switch ($objField->idContestFormFieldType) { case MFBContestFormFieldType::Select: case MFBContestFormFieldType::Text: case MFBContestFormFieldType::LongText: $strReturn .= $objField->value . ','; break; case MFBContestFormFieldType::Upload: $objAttachment = Attachment::Load($objField->value); if (!is_null($objAttachment)) { $strReturn .= AWS_BUCKET_URL . DS . AWS_BUCKET_NAME . DS . $objAttachment->value . ','; } break; } } } $strReturn = substr($strReturn, 0, strlen($strReturn) - 1); $strReturn .= "\n"; } return $strReturn; }
<tr> <?php foreach (admin::$arrAnswerFields as $intIndex => $strAnswerField) { ?> <td> <?php echo FBContestApplication::RenderContestField($strAnswerField); ?> </td> <?php } ?> <td> <a class='MFBDeleteBtn' href='#' action_parameter='<?php echo FBContestApplication::GetCurrentEntry()->IdContestEntry; ?> '> Delete </a> </td> </tr>
<?php class exportToCsv extends exportToCsvBase { } FBContestApplication::Run('exportToCsv');
<div class="entrycontent"> <h4><?php FBContestApplication::RenderContestField('FirstName'); ?> <?php FBContestApplication::RenderContestField('LastName'); ?> <span class="details"><?php FBContestApplication::RenderContestField('City'); ?> <?php FBContestApplication::RenderContestField('State'); ?> </span></h4> <h5 class="right"><?php FBContestApplication::RenderContestField('Credate', 'M j, Y'); ?> </h5> </div> </div> </div> --> <?php /* Photos and Firstname //Randy: Here are the other fields if you wish to pull them <br> LastName: <?php FBContestApplication::RenderContestField('LastName'); ?><br> Address: <?php FBContestApplication::RenderContestField('Address'); ?><br> Address2: <?php FBContestApplication::RenderContestField('Address2'); ?><br>
<?php FBContestApplication::RenderContestField('FullName');
<?php require APP_BACKEND_DIR . '/_core/inc/php/ClassicContestApplicationBase.class.php'; require __APP_PHP_ASSETS__ . '/FBContestApplication.class.php'; FBContestApplication::Init();