/**
 * Render object reminder information
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 * 12 April 2012 (SA) Ticket #784: check Recurring Reminder email script in AC
 */
function smarty_function_object_reminder($params, &$smarty)
{
    $ticket = array_var($params, 'object');
    if (!instance_of($ticket, 'Ticket')) {
        return 'N/A';
    }
    // if
    require_once SMARTY_PATH . '/plugins/function.select_date.php';
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
    mysql_select_db(DB_NAME);
    $query = "select * from healingcrystals_project_object_misc where object_id='" . (int) $ticket->getId() . "'";
    $result = mysql_query($query, $link);
    if (mysql_num_rows($result)) {
        $info = mysql_fetch_assoc($result);
        $reminder_date = dateval($info['reminder_date']);
        $recurring_period = $info['recurring_period'];
        $recurring_period_type = $info['recurring_period_type'];
    }
    mysql_close($link);
    $resp = '<form name="frmReminder" action="' . $ticket->getEditUrl() . '&mode=reminder_only_update_mode" method=post>' . smarty_function_select_date(array('name' => 'reminder', 'value' => !empty($reminder_date) ? date('m/d/Y', strtotime($reminder_date)) : '', 'id' => 'reminder', 'onchange' => 'this.form.submit();'), $smarty) . '</form>';
    return $resp;
}
 /**
  * Utility method for generating additional controls for add / edit forms
  *
  * @param void
  * @return null
  */
 function partial_generator()
 {
     $select_box = $this->request->get('select_box');
     // remove filter[...] around the value we need
     $select_box = substr($select_box, 7, strlen($select_box) - 8);
     $option_value = $this->request->get('option_value');
     switch ($select_box) {
         case 'user_filter':
             if ($option_value == 'company') {
                 require_once SYSTEM_MODULE_PATH . '/helpers/function.select_company.php';
                 print smarty_function_select_company(array('name' => 'filter[user_filter_data]'), $this->smarty);
             } elseif ($option_value == USER_FILTER_SELECTED) {
                 require_once SYSTEM_MODULE_PATH . '/helpers/function.select_users.php';
                 print smarty_function_select_users(array('name' => 'filter[user_filter_data]'), $this->smarty);
             }
             // if
             break;
         case 'project_filter':
             if ($option_value == 'selected') {
                 require_once SYSTEM_MODULE_PATH . '/helpers/function.select_projects.php';
                 print smarty_function_select_projects(array('name' => 'filter[project_filter_data]', 'user' => $this->logged_user), $this->smarty);
             }
             // if
             break;
         case 'date_filter':
             require_once SMARTY_PATH . '/plugins/function.select_date.php';
             if ($option_value == 'selected_date') {
                 print smarty_function_select_date(array('name' => 'filter[date_from]'), $this->smarty);
             } elseif ($option_value == 'selected_range') {
                 print '<table>
 	        <tr>
 	          <td>' . smarty_function_select_date(array('name' => 'filter[date_from]'), $this->smarty) . '</td>
 	          <td style="width: 10px; text-align: center;">-</td>
 	          <td>' . smarty_function_select_date(array('name' => 'filter[date_to]'), $this->smarty) . '</td>
 	        </tr>
 	      </table>';
             }
             // if
             break;
     }
     // switch
     die;
 }
    function content_56274ec44fe464_44874119($_smarty_tpl)
    {
        if (!is_callable('smarty_function_select_date')) {
            require_once 'D:/tools/xampp/htdocs/test/plugins\\function.select_date.php';
        }
        if (!is_callable('smarty_block_textarea')) {
            require_once 'D:/tools/xampp/htdocs/test/plugins\\block.textarea.php';
        }
        $_smarty_tpl->properties['nocache_hash'] = '620356274ec44b4701_25795753';
        ?>
<!DOCTYPE html PUBLIC
          "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<?php 
        echo smarty_function_select_date(array('name' => "start_time", 'time' => true, 'value' => ''), $_smarty_tpl);
        ?>
 <br>
<?php 
        echo smarty_function_select_date(array('name' => "end_time", 'time' => false, 'value' => "2012-10-10"), $_smarty_tpl);
        ?>
 <br>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('textarea', array('name' => "article1", 'toolbar' => "full", 'color' => "blue", 'height' => "200"));
        $_block_repeat = true;
        echo smarty_block_textarea(array('name' => "article1", 'toolbar' => "full", 'color' => "blue", 'height' => "200"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_textarea(array('name' => "article1", 'toolbar' => "full", 'color' => "blue", 'height' => "200"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
<br>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('textarea', array('name' => "article2", 'toolbar' => "basic", 'color' => "black", 'height' => "200"));
        $_block_repeat = true;
        echo smarty_block_textarea(array('name' => "article2", 'toolbar' => "basic", 'color' => "black", 'height' => "200"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_textarea(array('name' => "article2", 'toolbar' => "basic", 'color' => "black", 'height' => "200"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
<br>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('textarea', array('name' => "article3", 'toolbar' => "full", 'color' => "blue", 'height' => "200"));
        $_block_repeat = true;
        echo smarty_block_textarea(array('name' => "article3", 'toolbar' => "full", 'color' => "blue", 'height' => "200"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_textarea(array('name' => "article3", 'toolbar' => "full", 'color' => "blue", 'height' => "200"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
<br>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('textarea', array('name' => "article4", 'toolbar' => "desc", 'color' => "green", 'height' => "200"));
        $_block_repeat = true;
        echo smarty_block_textarea(array('name' => "article4", 'toolbar' => "desc", 'color' => "green", 'height' => "200"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_textarea(array('name' => "article4", 'toolbar' => "desc", 'color' => "green", 'height' => "200"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>
<br>
<?php 
    }