exit;
break;
case 'delete':
- if ( isset( $_REQUEST['id'] )
- && isset( $_REQUEST['note_id'] )
- && $lead_id = filter_var( $_REQUEST['id'], FILTER_VALIDATE_INT )
+ $lead_id = filter_var( $_REQUEST['id'], FILTER_VALIDATE_INT );
+ if ( isset( $_REQUEST['note_id'] ) && $lead_id
&& $note_id = filter_var( $_REQUEST['note_id'], FILTER_VALIDATE_INT )
) {
$this->wpdb->delete(
$grouped_interests = array();
switch ( $option ) {
- case 'addLog':
- $this->wpdb->insert(
- GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_notes',
- array(
- 'lead' => $this->entryId,
- 'created' => date( 'Y-m-d H:i:s' ),
- 'updated' => date( 'Y-m-d H:i:s' ),
- 'notes' => filter_var( $_REQUEST['new_log'], FILTER_SANITIZE_STRING )
- ),
- array(
- '%d',
- '%s',
- '%s',
- '%s'
- )
- );
-
- $entry = $this->editEntry( $this->entryId );
- $view = 'edit.html';
- break;
- case 'deleteLog':
- if ( isset( $_REQUEST['id'] )
- && isset( $_REQUEST['note_id'] )
- && $id = filter_var( $_REQUEST['id'], FILTER_VALIDATE_INT )
- && $note_id = filter_var( $_REQUEST['note_id'], FILTER_VALIDATE_INT )
- ) {
- $this->wpdb->delete(
- GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_notes',
- array( 'lead' => $id, 'id' => $note_id ),
- array( '%d', '%d' )
- );
- }
-
- $entry = $this->editEntry( $this->entryId );
- $view = 'edit.html';
- break;
case 'delete':
// echo '<pre>$this->entryId: ' . print_r( $this->entryId, true ) . '</pre>';
if ( $this->entryId ) {
<input type="hidden" name="glm_action" value="travelNotes" />
<input type="hidden" name="id" value="{$lead_id}" />
<input type="hidden" name="option" value="add" />
- <textarea name="new_log" cols="30" rows="5"></textarea>
+ <textarea class="new-log" name="new_log" cols="30" rows="5"></textarea>
<input type="submit" class="button" value="New Note Entry" />
</form>