{
$view = 'index.html';
$failure = false;
- $option = '';
+ $option = 'default';
$clearData = false;
if ( isset( $_REQUEST['numberProcessed'] ) ) {
$this->numberProcessed = filter_var( $_REQUEST['numberProcessed'], FILTER_VALIDATE_INT );
'addr1', 'addr2', 'city', 'state', 'country', 'zip',
'mailing_addr1', 'mailing_addr2', 'mailing_city', 'mailing_state', 'mailing_zip',
'region', 'county', 'lat', 'lon', 'phone', 'toll_free',
- 'url', 'reservation_url', 'email', 'logo', 'categories', 'amenities' ),
+ 'url', 'reservation_url', 'email', 'logo', 'categories', 'amenities'
+ ),
'type' => 'member',
),
);
$option = $_REQUEST['option'];
}
+ if (isset($_REQUEST['option2']) && $_REQUEST['option2'] != '') {
+ $option2 = $_REQUEST['option2'];
+ }
+
$wpUploadDir = wp_get_upload_dir();
$uploadPath = $wpUploadDir['basedir'] . '/' . 'glm-member-import';
if ( !is_dir( $uploadPath ) ) {
$view = 'processMembers.html';
break;
+ case 'photos':
+ $view= 'photos.html';
+ $fileData = '<pre>$_FILES: ' . print_r( $_FILES, true ) . '</pre>';
+ break;
+
+ case 'files':
+ $view = 'files.html';
+ break;
+
+ case 'default':
default:
$view = 'index.html';
// check upload dir to see if they have any files in yet
}
$templateData = array(
+ 'option' => $option,
'errors' => $this->errors,
'numberProcessed' => $this->numberProcessed,
'totalMembers' => $this->totalMembers,
--- /dev/null
+{include file='admin/import/header.html'}
+
+ <h2>Data Import: Files</h2>
+
+ <table class="glm-admin-table">
+ <tr>
+ <th>Total Member</th>
+ <td>{$totalMembers}</td>
+ </tr>
+ <tr>
+ <th>Processed Member</th>
+ <td>{$numberProcessed}</td>
+ </tr>
+
+ </table>
+
+
+{include file='admin/footer.html'}
<h2>{$glmPluginName} CSV Import</h2>
<h2 class="nav-tab-wrapper">
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">Import CSV</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="nav-tab{if $option==default} nav-tab-active{/if}">Import CSV</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=photos" class="nav-tab{if $option==photos} nav-tab-active{/if}">Import Photos</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=files" class="nav-tab{if $option==files} nav-tab-active{/if}">Import Files</a>
</h2>
<div id="glm-admin-content-container">
--- /dev/null
+{include file='admin/import/header.html'}
+
+ <h2>Data Import: Photos</h2>
+ <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="index" />
+ <input type="hidden" name="option" value="photos" />
+
+ <table class="glm-admin-table">
+ <tr>
+ <th>Upload File</th>
+ <td><input type="file" name="photos_file"></td>
+ </tr>
+
+ </table>
+
+ <input type="submit" value="Continue" class="button button-primary submit-import">
+ </form>
+
+ {if $fileData}
+ {$fileData}
+ {/if}
+
+{include file='admin/footer.html'}
<td>{$numberProcessed}</td>
</tr>
{if !$completed}
+ {$newStart = 1 + $numberProcessed}
<tr>
<td colspan="2">
- <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=processMembers&start=&numberProcessed={$numberProcessed}"
- class="button">Process Next Count Members</a>
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=processMembers&start={$newStart}&numberProcessed={$numberProcessed}">Process Next Count Members</a>
</td>
</tr>
{/if}
</table>
+ {if !$completed}
+ {$newStart = 1 + $numberProcessed}
+ <script>
+ var test = '{$thisUrl}?page={$thisPage}&glm_action=index&option=processMembers&start={$newStart}&numberProcessed={$numberProcessed}';
+ window.location.href = test;
+ </script>
+ {/if}
+
{include file='admin/footer.html'}