Appnitro Software Forums » MachForm

Select Files to download

(4 posts)
  • Started 1 year ago by matthewnoyes
  • Latest reply from redityo

  1. matthewnoyes
    Member

    I have a form where I would like to upload files to be available for users to download, but I do not want them to download all of the files for the form. Is there a away to populate a checkbox list with the files that have been uploaded so the user can select the files, the information can be collected and user can select which files they would like emailed to them or the link included in there receipt email..

    Posted 1 year ago #
  2. Do you want to create a "check box" list with uploaded file list from another form (upload form) ? or the check box and upload file field is in the same form ?

    Posted 1 year ago #
  3. matthewnoyes
    Member

    Sorry, I was out of town a couple of days.
    The Check Box List and the upload file list is part of the same form.

    Posted 1 year ago #
  4. I think you can customize "includes/helper-functions.php" file for this.
    For example you have form 1 with check box (element 4) and 3 upload field (element 1~ 3). I assume that, when a user select first check box option (element_4_1), they will get upload field 1 link in the mail. Try to follow these steps :

    1. Edit the file and go to line 232 for this code:

    $email_body = '';

    then put these code exactly bellow that line

    if ($form_id == 1) {
    	$res = do_query("select element_4_1,element_4_2,element_4_3 from ap_form_{$form_id} where id='{$entry_id}'");
    	$row_select = do_fetch_result($res);
    }

    2. Go to around line 349 ~ 358 for these code :

    if($data['element_type'] == 'textarea'){
    	$data['value'] = nl2br($data['value']);
    }elseif ($data['element_type'] == 'file'){
    
    	if($target_is_admin === false){
    		$data['value'] = strip_tags($data['value']);
    	}else{
    		$data['value'] = strip_tags($data['value'],'<a>');
    	}
    }

    and change those code with this one

    if($data['element_type'] == 'textarea'){
    	$data['value'] = nl2br($data['value']);
    }elseif ($data['element_type'] == 'file'){
    
    	if ($form_id == 1) {
    		if ($data['element_id'] == 1 && $row_select['element_4_1'] == 0 ) {
    			continue;
    		} elseif ($data['element_id'] == 2 && $row_select['element_4_2'] == 0 ) {
    			continue;
    		} elseif ($data['element_id'] == 3 && $row_select['element_4_3'] == 0 ) {
    			continue;
    		}
    	}
    
    	if($target_is_admin === false){
    		$data['value'] = strip_tags($data['value']);
    	}else{
    		$data['value'] = strip_tags($data['value'],'<a>');
    	}
    }

    Don't forget to change those id's with yours. That would send the link in email notification based on selected check box.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.