/**
  * @desc Constructs a {@link FileTemplateLoader} from the file's identifier.
  * @param string $identifier The file's identifier
  * @param TemplateData $data The data which is associated to the loader. It is used to assign
  * the PICTURES_DATA_PATH variable that corresponds the the module's pictures data path (it depends on
  * whether the theme redefines them or not).
  */
 public function __construct($identifier, TemplateData $data)
 {
     $this->filepath = $identifier;
     $this->compute_real_file_path();
     $this->compute_cache_file_path();
     $data->put('PICTURES_DATA_PATH', $this->pictures_data_path);
 }
Exemple #2
0
 function index()
 {
     if ($this->input->post('emails')) {
         $this->load->library('validation');
         $rules['emails'] = 'valid_emails|required';
         $fields['emails'] = 'referree emails';
         $this->validation->set_fields($fields);
         $this->validation->set_rules($rules);
         $this->validation->set_message('valid_emails', 'All email addresses entered into %s must be valid, seperated by commas');
         if ($this->validation->run() === TRUE) {
             $emails = explode(',', $this->input->post('emails'));
             $this->load->model('referral');
             foreach ($emails as $email) {
                 $referral = new Referral();
                 $referral->set('user', $this->_getUser());
                 $referral->set('referee', trim($email));
                 $referral->set('ipRequested', @$_SERVER['REMOTE_ADDR']);
                 if ($referral->create()) {
                     $viewData['checkpoints'][] = "You have successfully sent a referral email to {$email}.";
                 } else {
                     $viewData['errors'][] = "A referral email has already been sent to {$email}.";
                 }
             }
         }
     }
     if ($this->validation->error_string) {
         $viewData['errors'][] = $this->validation->error_string;
     }
     $viewData['token'] = $this->_token();
     $this->load->library('templatedata');
     $templateData = new TemplateData();
     $templateData->setHead('Refer a friend and get cash back');
     $templateData->setView($viewData);
     $this->_template('user/referral', $templateData);
 }
Exemple #3
0
 function setChart($file, $info)
 {
     $tp = new TemplateData($file);
     echo '<script type="text/javascript">';
     echo "data_{$this->id}=" . $tp->changeInfo($info) . ';';
     echo "function ofc_get_dataOf{$this->id}(){return JSON.stringify(data_{$this->id});}";
     echo "swfobject.embedSWF('" . $this->path . "/open-flash-chart.swf', '{$this->id}', '{$this->width}','{$this->height}','9.0.0','expressInstall.swf',{'get-data':'ofc_get_dataOf{$this->id}'} )";
     echo '</script>';
 }
Exemple #4
0
 /**
  * Loads standard Exambuff template, either using title, and bodyid or a complete TemplateData object passed as the second arg.
  * @param $view Name of view required
  * @param $title String || $templateData TemplateData - either title string or complete TemplateData object
  * @param $bodyID String
  * @param $viewData array
  */
 function _template($view, $title = null, $bodyID = null, $viewData = null)
 {
     if (get_class(func_get_arg(1)) === 'TemplateData') {
         $templateData = $title;
     } else {
         $this->load->library('templatedata');
         $templateData = new TemplateData();
         $templateData->setHead($title);
         $templateData->setPage($bodyID);
         $templateData->setView($viewData);
     }
     if ($templateData->page) {
         $templateData->setPage(array_merge($templateData->page, array('userAuth' => @$this->session->userdata('email'), 'markerAuth' => @$this->session->userdata('markerEmail'))));
     } else {
         $templateData->setPage(array('userAuth' => @$this->session->userdata('email'), 'markerAuth' => @$this->session->userdata('markerEmail')));
     }
     $templateData->setFooter($templateData->footer + $this->_fbToken());
     $this->load->view('html_head.php', $templateData->head);
     $this->load->view('page_head.php', $templateData->page);
     $this->load->view($view, $templateData->view);
     $this->load->view('footer', $templateData->footer);
 }
<script>// <![CDATA[
jQuery.noConflict(); jQuery(document).ready(function($) {     $( ".dtr div input[type=text]" ).datepicker({         changeMonth: true,       changeYear: true,       dateFormat: 'dd/mm/yy',       maxDate: '0'      });     $(".dtr div input[type=text]").prop('readonly', true); });
// ]]></script>

<?php 
$data = TemplateData::get_entry_by_lead($id);
if (!empty($data)) {
    $data = $data[0];
    $formdata = RGFormsModel::get_form($data["form_id"]);
    $title = $formdata->title;
    add_filter('gform_pre_render', array("TemplateMerge", 'template_restore_saved'));
} else {
}
gravity_form($form_id, false, false, false, '', false);
function cron_statusUpdate($lead_id, $status, $message)
{
    global $wpdb;
    $table_name = TemplateData::get_tpl_docs_table_name();
    $values = array("cron_status" => $status, "cron_desc" => $message);
    $return = $wpdb->update($table_name, $values, array("lead_id" => $lead_id), array("%d", "%s"), array("%d"));
    return true;
}
            <label for="invoices_form" class="left_header"><?php 
_e("Gravity Form", "invoices");
?>
 <?php 
gform_tooltip("invoices_gravity_form");
?>
</label>

            <select id="invoices_form" name="invoices_form" onchange="SelectForm(jQuery(this).val());"  required>
                <option value=""><?php 
_e("Select a form", "invoices");
?>
 </option>
                <?php 
$active_form = rgar($config, 'form_id');
$available_forms = TemplateData::get_available_forms($active_form);
foreach ($available_forms as $current_form) {
    if (in_array(absint($current_form->id), $showform_ids)) {
        $d = rgar($config, 'form_id');
        if (!empty($d)) {
            $selected = absint($current_form->id) == rgar($config, 'form_id') ? 'selected="selected" ' : 'disabled';
        } else {
            $selected = "";
        }
        ?>

                          <option value="<?php 
        echo absint($current_form->id);
        ?>
" <?php 
        echo $selected;
            <div class="margin_vertical_10 ">
            <?php 
if ($validation_error) {
    ?>
                    <span><?php 
    _e('There was an issue saving your feed. Please address the errors below and try again.');
    ?>
</span>
                    <?php 
}
?>
            </div> 
            <div class="table_block">
            <?php 
$forms = TemplateData::get_available_forms();
?>
      
            <table class="widefat " cellspacing="0">
            <thead>
              <tr>
                  <th scope="col" class="manage-column" style="width:25%"><?php 
_e("Form", "templatemerge");
?>
</th>
                  <th scope="col" class="manage-column" style="width:25%"><?php 
_e("Name Field", "templatemerge");
?>
</th>
                  <th scope="col" class="manage-column" style="width:25%"><?php 
_e("Email Field", "templatemerge");
function cron_statusUpdate($lead_id, $status, $message)
{
    $wpdb = new wpdb('tpocom_dash', 'w2P!9A-Si0', 'tpocom_dash', 'localhost');
    $table_name = TemplateData::get_tpl_docs_table_name();
    $values = array("cron_status" => $status, "cron_desc" => $message);
    $return = $wpdb->update($table_name, $values, array("lead_id" => $lead_id), array("%d", "%s"), array("%d"));
    return true;
}
                            <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
                            <th scope="col" id="active" class="manage-column check-column"></th>
                            <th scope="col" class="manage-column"><?php 
_e("Form", "letters");
?>
</th>
                            <th scope="col" class="manage-column"><?php 
_e("TemplateFiles", "letters");
?>
</th>
                        </tr>
                    </tfoot>

                    <tbody class="list:user user-list">
                        <?php 
$settings = TemplateData::get_letters_feeds();
if (is_array($settings) && sizeof($settings) > 0) {
    foreach ($settings as $setting) {
        ?>
                                <tr class='author-self status-inherit' valign="top">
                                    <th scope="row" class="check-column"><input type="checkbox" name="feed[]" value="<?php 
        echo $setting["id"];
        ?>
"/></th>
                                    <td><img src="<?php 
        echo self::get_base_url();
        ?>
/images/active<?php 
        echo intval($setting["is_active"]);
        ?>
.png" alt="<?php 
    _e("Download Letter", "templatemerge");
    ?>
</th>
        <th scope="col" class=""><?php 
    _e("Download Invoice", "templatemerge");
    ?>
</th>
        <!--<th scope="col" class="manage-column"><?php 
    //_e("Action", "templatemerge")
    ?>
</th> --> 
      </tr>
    </thead>
    <tbody class="">
      <?php 
    $docs = TemplateData::get_doc_entries($form_id, $name, $email, $file_id, $paging, $current_user_id);
    // print_r($forms);
    if (is_array($docs) && sizeof($docs) > 0) {
        $i = 0;
        foreach ($docs as $doc) {
            ?>
      <tr class='' valign="top">
        <td class="" ><?php 
            echo ++$i;
            ?>
</td>
        <td class="" ><?php 
            echo date('m/d/Y', strtotime($doc["datetime"]));
            ?>
</td>
        <td class="" ><?php 
            $config['meta']['files'][$file_id]['dir_url'] = ConvertFileUrl($dir_url);
            $config['meta']['files'][$file_id]['filepath'] = ConvertDirectoryPath($movefile['file']);
            $config['meta']['files'][$file_id]['fileurl'] = ConvertFileUrl($movefile['url']);
            $config['meta']['files'][$file_id]['operator_value'] = trim($_POST['letters_operator_value'][$i]);
            $config['meta']['files'][$file_id]['form_field'] = trim($_POST['form_field'][$i]);
            $config['meta']['files'][$file_id]['operator_value_e'] = trim($_POST['letters_operator_value_e'][$i]);
            $config['meta']['files'][$file_id]['form_field_e'] = trim($_POST['form_field_e'][$i]);
            $config['meta']['files'][$file_id]['operator_value_f'] = trim($_POST['letters_operator_value_f'][$i]);
            $config['meta']['files'][$file_id]['form_field_f'] = trim($_POST['form_field_f'][$i]);
            $config['meta']['files'][$file_id]['enable'] = isset($_POST['letters_enable'][$i]) && $_POST['letters_enable'][$i] == 1 ? 1 : 1;
        }
        //$file_id++;
    }
    if (!empty($config['meta'])) {
        //printp($config['meta']);exit;
        $id = TemplateData::update_letters_data($id, $config["form_id"], $config["is_active"], $config["meta"]);
        ?>
                <div class="updated fade" style="padding:6px"><?php 
        echo sprintf(__("Feed Updated. %sback to list%s", "letters"), "<a href='?page=letters'>", "</a>");
        ?>
</div>
            <?php 
    } else {
        $is_validation_error = true;
    }
}
$total_files = 0;
if (isset($config['meta']['files'])) {
    $total_files = count($config['meta']['files']);
}
if ($total_files > 0) {
    private static function mydocuments_saved_list($form_id, $name, $email, $file_id)
    {
        if (!self::is_gravityforms_supported()) {
            die(__(sprintf("Template Merge Add-On requires Gravity Forms %s. Upgrade automatically on the %sPlugin page%s.", self::$min_gravityforms_version, "<a href='plugins.php'>", "</a>"), "gravityformspaypal"));
        }
        $current_user = wp_get_current_user();
        if (!$current_user instanceof WP_User) {
            die(__("Please Login", "gravityformspaypal"));
        }
        $current_user_id = $current_user->ID;
        if (rgpost('action') == "delete") {
            $id = absint(decrypt_doc_url($_POST["action_argument"]));
            TemplateData::delete_doc_saved($id);
            ?>
            <div class="updated fade" style="padding:6px"><?php 
            _e("Feed deleted.", "templatemerge");
            ?>
</div>
            <?php 
        }
        require_once self::get_base_path() . DIRECTORY_SEPARATOR . "mydocument_saved_list.php";
    }
              <td class="" ><?php if($doc['letters_url'] != "") : ?>
                <a href="<?php echo str_replace('\\','/',$doc['letters_url']);?>" target="_blank" class="down-icon">Download</a>
                <?php endif;?></td>
              <td class="" ><?php if($doc['invoices_url'] != "") : ?>
                <a href="<?php echo str_replace('\\','/',$doc['invoices_url']);?>" target="_blank" class="down-icon">Download</a>
                <?php endif;?></td>  */
            ?>
          <td>
            <?php 
            if ($doc['fid'] == TemplateData::companyform_id()) {
                echo TemplateData::get_certificates($doc['leadid']);
                echo "<br/>";
            } else {
                ?>
            <?php 
                if ($doc['fid'] == TemplateData::newfundform_id() && !empty($doc['unique_id'])) {
                    ?>
				<a href="http://abn.glenister.com.au/ABRWeb?uid=<?php 
                    echo $doc['unique_id'];
                    ?>
" target="_blank" class="down-icon">Apply ABN/TFN</a><br/>
			<?php 
                }
                ?>
			<?php 
                if ($doc['file_url'] != "") {
                    ?>
				<a href="<?php 
                    echo str_replace('\\', '/', $doc['file_url']);
                    ?>
" target="_blank" class="down-icon">Document</a><br/>
            $config['meta']['files'][$file_id]['dir_url'] = ConvertFileUrl($dir_url);
            $config['meta']['files'][$file_id]['filepath'] = ConvertDirectoryPath($movefile['file']);
            $config['meta']['files'][$file_id]['fileurl'] = ConvertFileUrl($movefile['url']);
            $config['meta']['files'][$file_id]['operator_value'] = trim($_POST['invoices_operator_value'][$i]);
            $config['meta']['files'][$file_id]['form_field'] = trim($_POST['form_field'][$i]);
            $config['meta']['files'][$file_id]['operator_value_e'] = trim($_POST['invoices_operator_value_e'][$i]);
            $config['meta']['files'][$file_id]['form_field_e'] = trim($_POST['form_field_e'][$i]);
            $config['meta']['files'][$file_id]['operator_value_f'] = trim($_POST['invoices_operator_value_f'][$i]);
            $config['meta']['files'][$file_id]['form_field_f'] = trim($_POST['form_field_f'][$i]);
            $config['meta']['files'][$file_id]['enable'] = isset($_POST['invoices_enable'][$i]) && $_POST['invoices_enable'][$i] == 1 ? 1 : 1;
        }
        //$file_id++;
    }
    if (!empty($config['meta'])) {
        //printp($config['meta']);exit;
        $id = TemplateData::update_invoices_data($id, $config["form_id"], $config["is_active"], $config["meta"]);
        ?>
                <div class="updated fade" style="padding:6px"><?php 
        echo sprintf(__("Feed Updated. %sback to list%s", "invoices"), "<a href='?page=invoices'>", "</a>");
        ?>
</div>
            <?php 
    } else {
        $is_validation_error = true;
    }
}
$total_files = 0;
if (isset($config['meta']['files'])) {
    $total_files = count($config['meta']['files']);
}
if ($total_files > 0) {
Exemple #16
0
 public function forgottenPassword()
 {
     $this->load->library('templatedata');
     $viewData['formAction'] = $this->_selfURL . '/forgottenpassword';
     if ($this->input->post('resetPass')) {
         $rules['email'] = 'required|valid_email';
         $fields['email'] = 'email';
         $this->validation->set_rules($rules);
         $this->validation->set_fields($fields);
         if ($this->validation->run() === true) {
             if ($this->_checkToken()) {
                 // store all flavours of user model in $this->user - so marker, control etc will all
                 // go under $this->user, as they all implement the same interface
                 $this->load->model($this->_userModel, 'user');
                 $this->user->setKey($this->input->post('email'));
                 if ($this->user->retrieve()) {
                     $emailData['resetKey'] = $this->user->createPasswordResetKey();
                     $emailData['resetURL'] = $this->_selfURL . '/reset/';
                     $msg = $this->load->view('email/password_reset', $emailData, true);
                     $subject = 'You requested a password reset';
                     $pass = '******';
                     $sender = '*****@*****.**';
                     $this->load->library('swiftwrap');
                     $this->swiftwrap->email($sender, $pass, $this->input->post('email'), $subject, $msg);
                 }
                 $viewData['checkpoints'][] = 'Please check your email: you have been sent an email explaining how to generate a new password.';
             } else {
                 $viewData['errors'][] = 'Your form submission was invalid. Please retry';
             }
         }
     }
     $viewData['token'] = $this->_token();
     $templateData = new TemplateData();
     $templateData->setHead('Reset your password');
     $templateData->setView($viewData);
     $this->_template('forms/password_reset', $templateData);
 }
                    <tfoot>
                        <tr>
                            <th scope="col" id="cb" class="manage-column column-cb  " style="width:20%;text-align:center">S.No</th>
                            
                            <th scope="col" class="manage-column"><?php 
_e("Form", "templatemerge");
?>
</th>
                            
                        </tr>
                    </tfoot>

                    <tbody class="list:user user-list">
                        <?php 
$forms = TemplateData::get_from_entries($paging);
// print_r($forms);
if (is_array($forms) && sizeof($forms) > 0) {
    $i = 0;
    foreach ($forms as $form) {
        ?>
                                <tr class='author-self status-inherit' valign="top">
                                    
                                    <td class="check-column" style="width:20%;text-align:center"><?php 
        echo ++$i;
        ?>
</td>
                                    <td class="column-date" style="font-weight:bold;color:#3D8CFF;font-size:14px">
                                    	<?php 
        $data = RGFormsModel::get_form($form["form_id"]);
        echo $data->title;
);}"><?php 
        _e("Delete", "templatemerge");
        ?>
</a>
                                            </span>
                                        </div>
                                    </td>
                                    <td class="column-date">
                                    	<?php 
        $data = RGFormsModel::get_form($tags[$i]["form_id"]);
        echo $data->title;
        ?>
                                    </td>
                                    <td class="column-date">
                                        <?php 
        $field_name = TemplateData::get_field_name($tags[$i]["form_id"], $tags[$i]["form_field"]);
        echo $field_name;
        ?>
                                    </td>
                                </tr>
                                <?php 
        $i++;
    }
} else {
    ?>
                            <tr>
                                <td colspan="4" style="padding:20px;">
                                    <?php 
    echo sprintf(__("You don't have any Tag mapping configured. Let's go %screate one%s!", "templatemerge"), '<a href="admin.php?page=parsefield&view=edit&id=0">', "</a>");
    ?>
                                </td>
 public static function get_certificates($id)
 {
     $lead = TemplateData::get_entry_by_lead($id);
     $lead = $lead[0];
     $lead = json_decode(json_encode($lead), FALSE);
     $output = "";
     if ($lead->form_id == TemplateData::companyform_id() && $lead->eco_ref != "") {
         //is a company incorporation
         switch ($lead->asic_status) {
             case "Order complete":
                 $output .= '
                       <ul class="dropdown-menu" style="min-width: 107px; margin:0 0 0 14px;padding:0 !important">
                         <li><a class="btn-xs" target="_blank" href="' . site_url() . '/corp/getDocs.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-book fa-fw"></i> Documents</a></li>
                         <li><a class="btn-xs" target="_blank" href="' . site_url() . '/corp/getCert.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-certificate fa-fw"></i> Certificate</a></li>
                         <li><a class="btn-xs" target="_blank" href="' . site_url() . '/corp/getCasFile.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-briefcase fa-fw"></i> CAS File</a></tr></li>
                         
                       </ul>';
                 break;
             case "complete":
                 $output .= '
                       <ul class="dropdown-menu" style="min-width: 107px; margin:0 0 0 14px;padding:0 !important;">
                         <li><a class="btn-xs"  target="_blank" href="' . site_url() . '/corp/getDocs.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-book fa-fw"></i> Documents</a></li>
                         <li><a class="btn-xs"  target="_blank" href="' . site_url() . '/corp/getCert.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-certificate fa-fw"></i> Certificate</a></li>
                         <li><a class="btn-xs"  target="_blank" href="' . site_url() . '/corp/getCasFile.php?orderid=' . $lead->eco_ref . '"><i class="fa fa-briefcase fa-fw"></i> CAS File</a></tr></li>
                       </ul></form>';
                 break;
             case "Submitted to ASIC Temporarily reserved subject to ASIC decision":
                 $output .= '<i class="fa fa-refresh fa-spin"></i> ' . $lead->asic_status . ' Processing';
                 break;
             case "Submitted to ASIC":
                 $output .= '<i class="fa fa-refresh fa-spin"></i> ' . $lead->asic_status . ' Processing';
                 break;
             case "Checks":
                 //$output .= $lead->asic_status;
                 $output .= "Processing";
                 break;
             case "Rejected":
                 $output .= '<button class="btn-danger default btn-xs" style="width: 102px; text-align: left; border:none;" onclick="SetHiddenFormSettingsTPO(' . $lead->id . ', \'update\',\'' . get_action_link($lead->form_id, $lead->id, $wpdb) . '\')"><i class="fa fa-edit"></i> Amend</button>';
                 break;
             case "Failed ASIC validation":
                 $output .= '<button class="btn-danger default btn-xs" style="width: 102px; text-align: left; border:none;" onclick="SetHiddenFormSettingsTPO(' . $lead->id . ', \'update\',\'' . get_action_link($lead->form_id, $lead->id, $wpdb) . '\')"><i class="fa fa-edit"></i> Amend</button>';
                 break;
             default:
                 $output .= $lead->asic_status;
         }
     }
     return $output;
 }
</th>
                            <th scope="col" class="manage-column"><?php 
_e("Download Invoice", "templatemerge");
?>
</th>
                            <th scope="col" class="manage-column"><?php 
_e("Action", "templatemerge");
?>
</th>
                        </tr>
                        </tr>
                    </tfoot>

                    <tbody class="list:user user-list">
                        <?php 
$docs = TemplateData::get_doc_entries($form_id, $name, $email, $file_id, $paging);
if (is_array($docs) && sizeof($docs) > 0) {
    $i = 0;
    foreach ($docs as $doc) {
        ?>
                                <tr class='author-self status-inherit' valign="top">
                                    
                                    <td class="check-column" style="width:5%;text-align:center"><?php 
        echo ++$i;
        ?>
</td>
                                    <td class="column-date" style="font-weight:bold;color:#3D8CFF;font-size:14px">
                                        <?php 
        echo $doc["name"];
        ?>
                                    </td>
                            <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
                            <th scope="col" id="active" class="manage-column check-column"></th>
                            <th scope="col" class="manage-column"><?php 
_e("Form", "invoices");
?>
</th>
                            <th scope="col" class="manage-column"><?php 
_e("TemplateFiles", "invoices");
?>
</th>
                        </tr>
                    </tfoot>

                    <tbody class="list:user user-list">
                        <?php 
$settings = TemplateData::get_invoices_feeds();
if (is_array($settings) && sizeof($settings) > 0) {
    foreach ($settings as $setting) {
        ?>
                                <tr class='author-self status-inherit' valign="top">
                                    <th scope="row" class="check-column"><input type="checkbox" name="feed[]" value="<?php 
        echo $setting["id"];
        ?>
"/></th>
                                    <td><img src="<?php 
        echo self::get_base_url();
        ?>
/images/active<?php 
        echo intval($setting["is_active"]);
        ?>
.png" alt="<?php 
 /**
  * {@inheritdoc}
  */
 public function add_subtemplate($identifier, Template $template)
 {
     $this->data->put($identifier, $template);
     return $this;
 }
                            <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
                            <th scope="col" id="active" class="manage-column check-column"></th>
                            <th scope="col" class="manage-column"><?php 
_e("Form", "templatemerge");
?>
</th>
                            <th scope="col" class="manage-column"><?php 
_e("TemplateFiles", "templatemerge");
?>
</th>
                        </tr>
                    </tfoot>

                    <tbody class="list:user user-list">
                        <?php 
$settings = TemplateData::get_feeds();
if (is_array($settings) && sizeof($settings) > 0) {
    foreach ($settings as $setting) {
        ?>
                                <tr class='author-self status-inherit' valign="top">
                                    <th scope="row" class="check-column"><input type="checkbox" name="feed[]" value="<?php 
        echo $setting["id"];
        ?>
"/></th>
                                    <td><img src="<?php 
        echo self::get_base_url();
        ?>
/images/active<?php 
        echo intval($setting["is_active"]);
        ?>
.png" alt="<?php 
Exemple #24
0
 /**
  * Get the data array.
  * 
  * @return array The data
  * @access public
  * @static
  */
 public static function getData()
 {
     $self = TemplateData::singleton();
     return $self->data;
 }