<?php
/**
 * Marketplace - Component Marketplace 
 * ******************************************************************
 *
 * PHP version 7.0
 *
 * @category   Component
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 * ******************************************************************
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$input = JFactory::getApplication()->input;
jimport('joomla.html.editor');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.framework', true);
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$document = JFactory::getDocument();
$config = JFactory::getConfig();
$global_editor = $config->get('editor');
$editor = JFactory::getEditor();
$style = '
.qcontrols {
    margin-left: 100px !important;
}

.modal-header {
    color: #fff;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    background-color: #428bca;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    margin: 0 4px 10px 0;
}

.toggle-editor {
    display: none;
}

iframe {
    height: 135px !important;
}

#jform_subject-lbl,
#jform_reciepient-lbl,
#jform_description-lbl {
    font-weight: 900;
    display: inline-block;
}

#jform_reciepient,
#jform_subject {
    width: 96.5%;
}

.control-lab {
    font-weight: bold;
    float: left;
}
    ';

?>
<script type="text/javascript">
    jQuery('.wk_reset').on('click',function(){
        
    });
</script>
<?php
$document->addStyleDeclaration($style);
$document->addStyleSheet(
    '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
);
$jinput=JFactory::getApplication()->input;
$valuse=$jinput->getString('emails', '');

if (strlen($valuse)) {
    $emails=unserialize(urldecode($valuse));
} else {
    $email=$jinput->getString('email', '');
}
if (isset($email)) {
    $this->form->setValue('reciepient', '', $email);
} elseif (count($emails)) {
    $this->form->setValue('reciepient', '', implode(',', $emails));
}

if (isset($email)) {
    $total=1;
} else {
    $total=count($emails);
}

?>
<form action="<?php echo 'index.php?option=com_marketplace&tmpl=component&view=suggestedcategory&layout=sendmail_category';?>" method="post" name="adminForm" id="item-form" class="form-validate form-horizontal">
    <div class="queshead">
        <h3 class="modal-header" ><?php
            echo JText::_('COM_MARKETPLACE_SENDMAIL_TITLE');
        ?></h3>
    </div>
    <div class="sendmail">
        <div class="control-group">
            <div class="control-lab" >
                <?php echo $this->form->getLabel('reciepient');
                echo JHtml::tooltip(
                    "(".$total.")".JText::_('NUMBER_RECIEPIENTS'), '',
                    'icon-info', '', '', false
                );
                ?>
            </div>
            <div class="qcontrols" >
                <?php echo $this->form->getInput('reciepient'); ?>
                
            </div>
        </div>
        <div class="control-group">
            <div class="control-lab">
                <?php echo $this->form->getLabel('subject'); ?>
            </div>
            <div class="qcontrols">
                <?php echo $this->form->getInput('subject'); ?>
            </div>
        </div>
        <div class="control-group">
            <div class="control-lab" >
                <?php echo $this->form->getLabel('description'); ?>
            </div>
            <div class="qcontrols" >
                <?php echo $this->form->getInput('description'); ?>
                
            </div>
        </div>
        <div class="control-group">
            <div class="control-lab" >
            </div>
            <div class="qcontrols">
                <div class="bttns-div">
                    <button class="btn wbtn btn-success" ><?php echo JText::_("SEND"); ?></button>
                    <button class="btn wbtn btn-warning" ><?php echo JText::_("RESET"); ?></button>
                </div>
            </div>
        </div>
    </div>
    <input type="hidden" name="task" value="suggestedcategory.sendmail" />
    <input type="hidden" name="option" value="com_marketplace" />
    <?php echo JHtml::_('form.token'); ?>
</form>
