コード例 #1
0
ファイル: function.url.php プロジェクト: tzmg/BitWasp
/**
 * Smarty {url} function plugin
 *
 * Type:     function
 * Name:     url
 * @author:  Trimo
 * @mail:     trimo.1992[at]gmail[dot]com
 */
function smarty_function_url($params, &$smarty)
{
    if (!function_exists('current_url')) {
        if (!function_exists('get_instance')) {
            $smarty->trigger_error("url: Cannot load CodeIgniter");
            return;
        }
        $CI =& get_instance();
        $CI->load->helper('url');
    }
    if ($params['type'] == 'string') {
        return uri_string();
    } elseif ($params['type'] == 'anchor' && isset($params['url'])) {
        return anchor($params['url'], $params['text'], $params['attr']);
    } elseif ($params['type'] == 'safemail' && isset($params['url'])) {
        return safe_mailto($params['url'], $params['text'], $params['attr']);
    } elseif ($params['type'] == 'mail' && isset($params['url'])) {
        return mailto($params['url'], $params['text'], $params['attr']);
    } elseif ($params['type'] == 'autolink' && isset($params['url'])) {
        return auto_link($params['url'], isset($params['mode']) ? $params['mode'] : 'both', $params['new'] == 1 ? TRUE : FALSE);
    } elseif ($params['type'] == 'urltitle' && isset($params['title'])) {
        return url_title($params['title'], isset($params['mode']) ? $params['mode'] : 'dash', $params['lower'] == 1 ? TRUE : FALSE);
    } elseif ($params['type'] == 'prep' && isset($params['url'])) {
        return prep_url($params['url']);
    } elseif ($params['type'] == 'current') {
        return current_url();
    } elseif ($params['type'] == 'site') {
        return site_url($params['url']);
    } else {
        return base_url();
    }
}
コード例 #2
0
function showProvider($clsRpt, $provider, $lProviderID)
{
    //--------------------------------------------------
    // provider section
    //--------------------------------------------------
    openBlock('Funding Provider', strLinkEdit_GrantProvider($lProviderID, 'Edit Provider Record', true) . '     ' . strLinkRem_Provider($lProviderID, 'Remove Provider', true, true));
    echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Funder/Provider ID:') . $clsRpt->writeCell(str_pad($lProviderID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell(htmlspecialchars($provider->strGrantOrg)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($provider->strAddress) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars($provider->strPhone)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Cell:') . $clsRpt->writeCell(htmlspecialchars($provider->strCell)) . $clsRpt->closeRow());
    if ($provider->strEmail == '') {
        $strOut = ' ';
    } else {
        $strOut = mailto($provider->strEmail, htmlspecialchars($provider->strEmail));
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell($strOut) . $clsRpt->closeRow());
    if ($provider->strWebSite == '') {
        $strOut = ' ';
    } else {
        if (!strtoupper(substr($provider->strWebSite, 0, 4)) == 'HTTP') {
            $provider->strWebSite = 'http://' . $provider->strWebSite;
        }
        $strOut = '<a target="_blank" href="' . prep_url($provider->strWebSite) . '">' . htmlspecialchars($provider->strWebSite) . '</a>';
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Web:') . $clsRpt->writeCell($strOut) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($provider->strNotes))) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed to:') . $clsRpt->writeCell(htmlspecialchars($provider->strAttributedTo)) . $clsRpt->closeRow());
    echoT($clsRpt->closeReport());
    closeBlock();
}
コード例 #3
0
 public function __construct()
 {
     parent::__construct();
     $this->data['title'] = 'mully-ci-jqwidgets';
     $this->data['footer'] = 'ci-jqwidgets by ' . mailto('*****@*****.**', 'mully') . ' &copy; 2013';
     //load model
     $this->load->model('orders');
 }
コード例 #4
0
ファイル: field.email.php プロジェクト: blekedeg/lbhpers
 /**
  * Process before outputting for the plugin
  *
  * This creates an array of data to be merged with the
  * tag array so relationship data can be called with
  * a {field.column} syntax
  *
  * @access	public
  * @param	string
  * @param	string
  * @param	array
  * @return	array
  */
 public function pre_output_plugin($input, $params)
 {
     $choices = array();
     get_instance()->load->helper('url');
     $choices['email_address'] = $input;
     $choices['mailto_link'] = mailto($input, $input);
     $choices['safe_mailto_link'] = safe_mailto($input, $input);
     return $choices;
 }
コード例 #5
0
function strPhoneWebEmail($provider)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $strOut = '<table cellpadding="0" cellspacing="0" border="0" style="margin: 0px; padding: 0px; width: 100%">';
    // phone
    $strOut .= '<tr>
             <td style="padding-left: 0px; margin-left: 0px; width: 50pt;">
                phone:
             </td>
             <td>' . htmlspecialchars($provider->strPhone) . '
             </td>
          </tr>';
    // cell
    $strOut .= '<tr>
             <td style="padding-left: 0px; margin-left: 0px;">
                cell:
             </td>
             <td>' . htmlspecialchars($provider->strCell) . '
             </td>
          </tr>';
    // email
    $strOut .= '<tr>
             <td style="padding-left: 0px; margin-left: 0px;">
                email:
             </td>
             <td>';
    if ($provider->strEmail == '') {
        $strOut .= '&nbsp;';
    } else {
        $strOut .= mailto($provider->strEmail, htmlspecialchars($provider->strEmail));
    }
    $strOut .= '
                </td>
             </tr>';
    // web
    $strOut .= '<tr>
             <td style="padding-left: 0px; margin-left: 0px;">
                web:
             </td>
             <td>';
    if ($provider->strWebSite == '') {
        $strOut .= '&nbsp;';
    } else {
        if (!strtoupper(substr($provider->strWebSite, 0, 4)) == 'HTTP') {
            $provider->strWebSite = 'http://' . $provider->strWebSite;
        }
        $strOut .= '<a target="_blank" href="' . prep_url($provider->strWebSite) . '">' . htmlspecialchars($provider->strWebSite) . '</a>';
    }
    $strOut .= '
                </td>
             </tr>';
    $strOut .= '</table>';
    return $strOut;
}
コード例 #6
0
ファイル: backup.php プロジェクト: brucewu16899/artica
function listemails()
{
    $page = CurrentPageName();
    $and = "AND filesize>0";
    $head = "\n\t<table>\n\t<td valign='middle' width=99%>\n\t\t<H3>{user_backup_emails_query_text}</H3>\n\t</td>\n\t<td>" . imgtootltip("question-48.png", '{search}', "Loadjs('{$page}?search-js=yes')") . "</td>\n\t<td>" . imgtootltip("48-infos.png", '{infos}', "Loadjs('user.messaging.php?email-infos-js=quarantine')") . "</td>\n\t</tr>\n\t</table>\n\t";
    //filter-body
    //$sql="SELECT storage.MessageID,storage.mailfrom$recipient_to_find_fields,storage.zDate,storage.subject,storage.MessageBody,MATCH (storage.MessageBody)
    //		AGAINST (\"$stringtofind\") AS pertinence
    //		FROM storage,storage_recipients WHERE storage.MessageID=storage_recipients.MessageID$recipient_to_find$sender_to_find ORDER BY pertinence DESC LIMIT 0,90";
    $order = "ORDER BY zDate DESC";
    if (isset($_GET["filter-sender"])) {
        if ($_GET["filter-sender"] != null) {
            if (strpos($_GET["filter-sender"], '*') > 0 or $_GET["filter-sender"][0] == '*') {
                $and = $and . " AND mailfrom LIKE '" . str_replace("*", "%", "{$_GET["filter-sender"]}") . "'";
            } else {
                $and = $and . " AND mailfrom='{$_GET["filter-sender"]}'";
            }
            $back = true;
        }
    }
    if ($_GET["body"] != null) {
        $pertinance = ",MATCH (MessageBody) AGAINST (\"{$_GET["filter-body"]}\") AS pertinence ";
        $order = "ORDER BY pertinence DESC";
    }
    $delivery_users = mailto($and);
    $q = new mysql();
    $sql = "select MessageID,mailfrom,mailto,DATE_FORMAT(zDate,'%Y-%m-%d %H:%i') as tdate ,filesize,subject{$pertinance} FROM storage WHERE ({$delivery_users}) {$order} LIMIT 0,150";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if ($back) {
        $html = $html . "<table style='width:90%'>\n\t\t<tr>\n\t\t\t<td><a href='backup.php'><H3>&laquo;&nbsp;{back}</H3></td>\n\t\t</tr>\n\t\t</table>";
    }
    $html = $html . "<table style='width:95%' class=table_form>\n\t\n\t\t<tr>\n\t\t<th>{date}</span></th>\n\t\t<th>{size}</span></th>\n\t\t<th>{subject}</span></th>\n\t\t<th>{senderm}</span></th>\t\t\n\t\t<th>{recipient}</span></th>\n\n\t\t</tr>\n\t\t\n\t\t";
    $date_hier = strftime("%y-%m-%d", mktime(0, 0, 0, date('m'), date('d') - 1, date('y')));
    $date = date('Y-m-d');
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $filesize = $ligne["filesize"] / 1024;
        if ($class == "row1") {
            $class = "row2";
        } else {
            $class = "row1";
        }
        $filesize = FormatBytes($filesize);
        if (strlen($ligne["subject"]) > 40) {
            $ligne["subject"] = substr($ligne["subject"], 0, 37) . "...";
        }
        $ligne["tdate"] = str_replace($date, '{today}', $ligne["tdate"]);
        $ligne["tdate"] = str_replace($date_hier, '{yesterday}', $ligne["tdate"]);
        $html = $html . "\n\t\t<tr class={$class}>\n\t\t<td valign='top' nowrap width=1%>&nbsp;{$ligne["tdate"]}&nbsp;</td>\n\t\t<td valign='top' >&nbsp;{$filesize}&nbsp;</td>\n\t\t\t<td valign='top' class={$class}>" . divlien("Loadjs('{$page}?ShowID={$ligne["MessageID"]}')", $ligne["subject"]) . "</td>\n\t\t<td valign='top' >{$ligne["mailfrom"]}</td>\n\t\t<td valign='top' >{$ligne["mailto"]}</td>\n\t\t</tr>";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body("<div style='width:100%;height:500px;overflow:auto'>{$head}{$html}</div>");
}
コード例 #7
0
function get_person_data_row($person, $controller)
{
    $CI =& get_instance();
    $controller_name = $CI->uri->segment(1);
    $width = $controller->get_form_width();
    $table_data_row = '<tr>';
    $table_data_row .= "<td width='5%'><input type='checkbox' id='person_{$person->person_id}' value='" . $person->person_id . "'/></td>";
    $table_data_row .= '<td width="20%">' . character_limiter($person->last_name, 13) . '</td>';
    $table_data_row .= '<td width="20%">' . character_limiter($person->first_name, 13) . '</td>';
    $table_data_row .= '<td width="30%">' . mailto($person->email, character_limiter($person->email, 22)) . '</td>';
    $table_data_row .= '<td width="20%">' . character_limiter($person->phone_number, 13) . '</td>';
    $table_data_row .= '<td width="5%">' . anchor($controller_name . "/view/{$person->person_id}/width:{$width}", $CI->lang->line('common_edit'), array('class' => 'thickbox', 'title' => $CI->lang->line($controller_name . '_update'))) . '</td>';
    $table_data_row .= '</tr>';
    return $table_data_row;
}
コード例 #8
0
ファイル: quarantine.php プロジェクト: brucewu16899/artica
function listemails()
{
    $order = "ORDER BY zDate DESC";
    $page = CurrentPageName();
    if (isset($_GET["filter-sender"])) {
        if ($_GET["filter-sender"] != null) {
            $_SESSION["QUARANTINE"]["SENDER"] = $_GET["filter-sender"];
            if (strpos($_GET["filter-sender"], '*') > 0 or $_GET["filter-sender"][0] == '*') {
                $and = " AND mailfrom LIKE '" . str_replace("*", "%", "{$_GET["filter-sender"]}") . "'";
            } else {
                $and = " AND mailfrom='{$_GET["filter-sender"]}'";
            }
            $back = true;
        }
    }
    if ($_GET["body"] != null) {
        $_SESSION["QUARANTINE"]["body"] = $_GET["body"];
        $pertinance = ",MATCH (MessageBody) AGAINST (\"{$_GET["body"]}\") AS pertinence ";
        $order = "ORDER BY pertinence DESC";
    }
    $mailto = mailto($and);
    $q = new mysql();
    $sql = "select MessageID,mailfrom,mailto,zDate,subject{$pertinance} FROM quarantine WHERE ({$mailto})  {$order} LIMIT 0,150";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $head = "\n\t<table>\n\t<td valign='middle' width=99%>\n\t\t<H3>{quarantine_mails}</H3>\n\t</td>\n\t<td>" . imgtootltip("48-logs.png", '{quarantine_email_report}', "Loadjs('quarantine.report.php')") . "</td>\n\t<td>" . imgtootltip("question-48.png", '{search}', "Loadjs('{$page}?search-js=yes')") . "</td>\n\t<td>" . imgtootltip("48-infos.png", '{infos}', "Loadjs('user.messaging.php?email-infos-js=quarantine')") . "</td>\n\t</tr>\n\t</table>\n\t";
    $table = "<table style='width:95%' class=table_form>\n\t\t<tr>\n\t\t<th><span style='color:white'>{date}</span></th>\n\t\t<th><span style='color:white'>{subject}</span></th>\n\t\t<th><span style='color:white'>{senderm}</span></th>\t\t\n\t\t<th><span style='color:white'>{recipient}</span></th>\n\t\t</tr>\n\t\t\n\t\t";
    $date_hier = strftime("%Y-%m-%d", mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')));
    $date = date('Y-m-d');
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ligne["zDate"] = str_replace($date, '{today}', $ligne["zDate"]);
        $ligne["zDate"] = str_replace($date_hier, '{yesterday}', $ligne["zDate"]);
        if ($class == "row1") {
            $class = "row2";
        } else {
            $class = "row1";
        }
        if (strlen($ligne["subject"]) > 40) {
            $ligne["subject"] = substr($ligne["subject"], 0, 37) . "...";
        }
        $table = $table . "<tr class={$class}>\n\t\t<td valign='top' nowrap class={$class} width=1%>{$ligne["zDate"]}</td>\n\t\t<td valign='top' class={$class}>" . divlien("Loadjs('{$page}?ShowID={$ligne["MessageID"]}')", $ligne["subject"]) . "</td>\n\t\t<td valign='top' class={$class}>{$ligne["mailfrom"]}</a></td>\n\t\t<td valign='top' class={$class}>{$ligne["mailto"]}</td>\n\t\t\n\t\t</tr>";
    }
    $table = $table . "</table>";
    if ($back) {
        return "{$head}{$table}";
    }
    return "<div style='width:100%;height:500px;overflow:auto' id='rtmm-panel'>{$head}{$table}</div>\n\t\n\t\n\t";
}
コード例 #9
0
 /**
  * My Account main page
  *
  * @access	public
  * @return	void
  */
 function index()
 {
     $vars['cp_page_title'] = lang('my_account');
     $vars = array_merge($this->_account_menu_setup(), $vars);
     $query = $this->member_model->get_member_data($this->id, array('email', 'ip_address', 'join_date', 'last_visit', 'total_entries', 'total_comments', 'last_entry_date', 'last_comment_date', 'last_forum_post_date', 'total_forum_topics', 'total_forum_posts'));
     if ($query->num_rows() > 0) {
         $vars['username'] = $this->username;
         $vars['fields'] = array('email' => mailto($query->row('email'), $query->row('email')), 'join_date' => $this->localize->human_time($query->row('join_date')), 'last_visit' => ($query->row('last_visit') == 0 or $query->row('last_visit') == '') ? '--' : $this->localize->human_time($query->row('last_visit')), 'total_entries' => $query->row('total_entries'), 'total_comments' => $query->row('total_comments'), 'last_entry_date' => ($query->row('last_entry_date') == 0 or $query->row('last_entry_date') == '') ? '--' : $this->localize->human_time($query->row('last_entry_date')), 'last_comment_date' => ($query->row('last_comment_date') == 0 or $query->row('last_comment_date') == '') ? '--' : $this->localize->human_time($query->row('last_comment_date')), 'user_ip_address' => $query->row('ip_address'));
         if ($this->config->item('forum_is_installed') == "y") {
             $fields['last_forum_post_date'] = $query->row('last_forum_post_date') == 0 ? '--' : $this->localize->human_time($query->row('last_forum_post_date'));
             $fields['total_forum_topics'] = $query->row('total_forum_topics');
             $fields['total_forum_replies'] = $query->row('total_forum_posts');
             $fields['total_forum_posts'] = $query->row('total_forum_posts') + $query->row('total_forum_topics');
         }
     }
     $this->cp->render('account/index', $vars);
 }
コード例 #10
0
 public function __construct()
 {
     parent::__construct();
     if (!$this->session->userdata('idUsuario')) {
         $this->session->sess_destroy();
         redirect(url_site() . 'administracao');
     } else {
         $this->template->set_diretorio('admin');
         //$this->template->set_title("Fábrica Pinheiro");
         $this->template->set_title("Pinheiro Shop");
         $this->template->set_css("admin.css");
         $this->template->set_css("select2.css");
         $this->template->set_js("geral.js");
         $this->template->set_js("select2.min.js");
         $this->template->set_js("admin.js");
         $this->template->set_css(FCPATH . "template/admin/js/redactor/css/redactor.css");
         $this->template->set_js("redactor/redactor.js");
         $rodape = '<div>Todos os direitos reservados 2011-' . date('Y') . '</div>';
         $rodape .= '<div>Designer: ' . mailto('*****@*****.**', 'Lucas Pinheiro') . '</div>';
         $this->template->set_rodape($rodape);
     }
 }
コード例 #11
0
ファイル: myaccount.php プロジェクト: rmdort/adiee
 /**
  * My Account main page
  *
  * @access	public
  * @return	void
  */
 function index()
 {
     $vars['cp_page_title'] = $this->lang->line('my_account');
     $this->javascript->output('');
     $this->javascript->compile();
     $vars = array_merge($this->_account_menu_setup(), $vars);
     $query = $this->member_model->get_member_data($this->id, array('email', 'ip_address', 'join_date', 'last_visit', 'total_entries', 'total_comments', 'last_entry_date', 'last_comment_date', 'last_forum_post_date', 'total_forum_topics', 'total_forum_posts'));
     if ($query->num_rows() > 0) {
         foreach ($query->row_array() as $key => $val) {
             ${$key} = $val;
         }
         $vars['username'] = $this->username;
         $vars['fields'] = array('email' => mailto($email, $email), 'join_date' => $this->localize->set_human_time($join_date), 'last_visit' => ($last_visit == 0 or $last_visit == '') ? '--' : $this->localize->set_human_time($last_visit), 'total_entries' => $total_entries, 'total_comments' => $total_comments, 'last_entry_date' => ($last_entry_date == 0 or $last_entry_date == '') ? '--' : $this->localize->set_human_time($last_entry_date), 'last_comment_date' => ($last_comment_date == 0 or $last_comment_date == '') ? '--' : $this->localize->set_human_time($last_comment_date), 'user_ip_address' => $ip_address);
         if ($this->config->item('forum_is_installed') == "y") {
             $fields['last_forum_post_date'] = $last_forum_post_date == 0 ? '--' : $this->localize->set_human_time($last_forum_post_date);
             $fields['total_forum_topics'] = $total_forum_topics;
             $fields['total_forum_replies'] = $total_forum_posts;
             $fields['total_forum_posts'] = $total_forum_posts + $total_forum_topics;
         }
     }
     $this->load->view('account/index', $vars);
 }
コード例 #12
0
function display_email_data_for_person($person, $persontype)
{
    $CI =& get_instance();
    $controller_name = strtolower($persontype) . 's';
    switch ($persontype) {
        case 'Customer':
            $width = 350;
            break;
        case 'Supplier':
            $width = 360;
            break;
        case 'Employee':
            $width = 650;
            break;
    }
    $table_data_row = '<tr id="person-' . $person->person_id . '">';
    $table_data_row .= '<td width="13%">' . character_limiter($person->last_name, 13) . '</td>';
    $table_data_row .= '<td width="13%">' . character_limiter($person->first_name, 13) . '</td>';
    $table_data_row .= '<td width="24%" class="email">' . mailto($person->email, character_limiter($person->email, 22)) . '</td>';
    $table_data_row .= '<td width="50%" class="action">' . anchor($controller_name . "/view/{$person->person_id}/width:{$width}", $CI->lang->line($controller_name . '_update'), array('class' => 'thickbox button pill left', 'title' => $CI->lang->line($controller_name . '_update'), 'onClick' => 'thickit(this); return false;')) . '<a class="negative button remove pill right"' . ' onClick="listremove(this)">' . 'Remove</a>' . '</td>';
    $table_data_row .= '</tr>';
    return $table_data_row;
}
コード例 #13
0
					<p style="text-align: center;">
						<span style="display:inline-block;padding:8px 12px;background-color:#95c033;color:#fff;font-size:20px;font-weight:bold;text-decoration:none;box-shadow:0 1px 0 #b7db81 inset, 0 -1px 0 #b7db81 inset;text-shadow:0 1px 0 #6b8e4a">
							<?php 
echo $new_password;
?>
						</span>
					</p>
					<p>&nbsp;</p>
				</td>
				<td width="10px"></td>
			</tr>
			<tr>
				<td width="10px"></td>
				<td>
					<p>If you have not asked for your password to be reset, please <?php 
echo mailto('*****@*****.**', 'Contact Us');
?>
. </p>
				</td>
				<td width="10px"></td>
			</tr>
			<tr>
				<td width="10px"></td>
				<td>
					<p>&nbsp;</p>
					<p>
						Cheers,
						<br />
						Lunchsparks Support
					</p>
				</td>
コード例 #14
0
ファイル: index.php プロジェクト: 8496tar/pyrocms
			</tfoot>  
			<tbody>
				<?php 
    foreach ($users as $member) {
        ?>
					<tr>
						<td align="center"><?php 
        echo form_checkbox('action_to[]', $member->id);
        ?>
</td>
						<td><?php 
        echo anchor('admin/users/edit/' . $member->id, $member->full_name);
        ?>
</td>
						<td><?php 
        echo mailto($member->email);
        ?>
</td>
						<td><?php 
        echo $member->role_title;
        ?>
</td>
						<td><?php 
        echo date('M d, Y', $member->created_on);
        ?>
</td>
						<td><?php 
        echo $member->last_login > 0 ? date('M d, Y', $member->last_login) : lang('user_never_label');
        ?>
</td>
						<td>
コード例 #15
0
ファイル: index.php プロジェクト: reith2004/pyrocms
								<?php if( strlen($comment->comment) > 30 ): ?>
									<?php echo character_limiter($comment->comment, 30); ?>
								<?php else: ?>
									<?php echo $comment->comment; ?>
								<?php endif; ?>
							</a>
						</td>
						<td><?php echo isset($comment->item) ? $comment->item : '???'; ?></td>
						<td>
							<?php if($comment->user_id > 0): ?>
								<?php echo anchor('admin/users/edit/' . $comment->user_id, $comment->name); ?>
							<?php else: ?>
								<?php echo $comment->name;?>
							<?php endif; ?>
						</td>
						<td><?php echo mailto($comment->email);?></td>
						<td><?php echo format_date($comment->created_on);?></td>
						<td class="align-center buttons buttons-small">
							<?php if ($this->settings->moderate_comments): ?>
							<?php if($comment->is_active): ?>
								<?php echo anchor('admin/comments/unapprove/' . $comment->id, lang('comments.deactivate_label'), 'class="button deactivate"'); ?>
							<?php else: ?>
								<?php echo anchor('admin/comments/approve/' . $comment->id, lang('comments.activate_label'), 'class="button activate"'); ?>
							<?php endif; ?>
							<?php endif; ?>
							<?php echo anchor('admin/comments/edit/' . $comment->id, lang('comments.edit_label'), 'class="button edit"'); ?>
							<?php echo anchor('admin/comments/delete/' . $comment->id, lang('comments.delete_label'), array('class'=>'confirm button delete')); ?>
						</td>
					</tr>
				<?php endforeach; ?>
			</tbody>
コード例 #16
0
			</thead>
			<tbody>	
	<?php 
    foreach ($usuarios as $usuario) {
        ?>
			<tr>
				<td><?php 
        echo $usuario['usuario'];
        ?>
</td>
				<td><?php 
        echo $usuario['nome'] . " " . $usuario['sobrenome'];
        ?>
</td>
				<td><?php 
        echo mailto($usuario['email'], $usuario['email']);
        ?>
</td>
				<td><?php 
        echo $usuario['status'] == 1 ? "Ativo" : "Inativo";
        ?>
</td>
				<td>
					<button type="button" class="btn btn-success registro" id="<?php 
        echo $usuario['id_usuario'];
        ?>
"><span class="glyphicon glyphicon glyphicon-edit"></span> Editar</button>
					<button type="button" class="btn btn-danger remove" id="<?php 
        echo $usuario['id_usuario'];
        ?>
"><span class="glyphicon glyphicon-ban-circle"></span> Remover</button>
コード例 #17
0
?>
</li>
      <li><?php 
echo anchor('admin/article', 'News Articles');
?>
</li>
      </li>
    </ul>
              <ul class="nav navbar-nav navbar-right">
              <?php 
$email = $this->session->userdata('email');
$name = $this->session->userdata('name');
$id = $this->session->userdata('id');
?>
            <li class="active"><?php 
echo mailto($email, '<i class="glyphicon glyphicon-user"></i>' . '&nbsp;' . $name . ' !');
?>
</li>
            <li><?php 
echo anchor('admin/user/logout', '<i class="glyphicon glyphicon-log-out"></i> Logout');
?>
</li>
          </ul>
  </div>
  </div>
</div>

<div class="container container-fluid container-main" role="dialog" style="margin-top:50px;">
      <div class="row">
      <div class="col-xs-12 col-sm-3 col-md-3 col-lg-2">
        <?php 
コード例 #18
0
ファイル: index.php プロジェクト: reith2004/pyrocms
					<th width="200" class="align-center"><?php echo lang('user_actions_label');?></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="8">
						<div class="inner"><?php $this->load->view('admin/partials/pagination'); ?></div>
					</td>
				</tr>
			</tfoot>  
			<tbody>
				<?php foreach ($users as $member): ?>
					<tr>
						<td class="align-center"><?php echo form_checkbox('action_to[]', $member->id); ?></td>
						<td><?php echo anchor('admin/users/edit/' . $member->id, $member->full_name); ?></td>
						<td><?php echo mailto($member->email); ?></td>
						<td><?php echo $member->group_name; ?></td>
						<td><?php echo $member->active ? lang('dialog.yes') : lang('dialog.no') ; ?></td>
						<td><?php echo format_date($member->created_on); ?></td>
						<td><?php echo ($member->last_login > 0 ? format_date($member->last_login) : lang('user_never_label')); ?></td>
						<td class="align-center buttons buttons-small">
							<?php echo anchor('admin/users/edit/' . $member->id, lang('user_edit_label'), array('class'=>'button edit')); ?>
							<?php echo anchor('admin/users/delete/' . $member->id, lang('user_delete_label'), array('class'=>'confirm button delete')); ?>
						</td>
						</tr>
				<?php endforeach; ?>
			</tbody>	
		</table>
	
	<div class="buttons float-right padding-top">
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete') )); ?>
コード例 #19
0
ファイル: mcp.comment.php プロジェクト: ayuinc/laboratoria-v2
 /**
  * Merge Comment Data
  *
  * This is a...productive method.
  *
  * This method loops through the array of 50 comment db objects and
  * adds in a few more vars that will be used in the view. Additionally,
  * we alter some values such as status to make it human readable to get
  * that logic out of the views where it has no bidness.
  *
  * @param 	array 	array of comment objects
  * @param 	object 	db result from channel query
  * @param 	object 	db result from authors query
  * @return 	array 	array of altered comment objects
  */
 protected function _merge_comment_data($comments, $channels, $authors)
 {
     ee()->load->library('typography');
     $config = array('parse_images' => FALSE, 'allow_headings' => FALSE, 'word_censor' => ee()->config->item('comment_word_censoring') == 'y' ? TRUE : FALSE);
     ee()->typography->initialize($config);
     // There a result for authors here, or are they all anon?
     $authors = !$authors->num_rows() ? array() : $authors->result();
     foreach ($comments as &$comment) {
         // Drop the entry title into the comment object
         foreach ($channels->result() as $row) {
             if ($comment->entry_id == $row->entry_id) {
                 $comment->entry_title = $row->title;
                 break;
             }
         }
         // Get member info as well.
         foreach ($authors as $row) {
             if ($comment->author_id == $row->member_id) {
                 $comment->author_screen_name = $row->screen_name;
                 break;
             }
         }
         if (!isset($comment->author_screen_name)) {
             $comment->author_screen_name = '';
         }
         // Convert stati to human readable form
         switch ($comment->status) {
             case 'o':
                 $comment->status = lang('open');
                 break;
             case 'c':
                 $comment->status = lang('closed');
                 break;
             default:
                 $comment->status = lang("pending");
         }
         // Add the expand arrow
         $comment->_expand = array('data' => '<img src="' . ee()->cp->cp_theme_url . 'images/field_collapse.png" alt="' . lang('expand') . '" />', 'class' => 'expand');
         // Add the toggle checkbox
         $comment->_check = form_checkbox('toggle[]', $comment->comment_id, FALSE, 'class="comment_toggle"');
         // Alter the email var
         $comment->email = mailto($comment->email, '', 'class="less_important_link"');
         $comment->comment_date = ee()->localize->human_time($comment->comment_date);
         // Create comment_edit_link
         $comment->comment_edit_link = sprintf("<a class=\"less_important_link\" href=\"%s\" title=\"%s\">%s</a>", $this->base_url . AMP . 'method=edit_comment_form' . AMP . 'comment_id=' . $comment->comment_id, 'edit', ellipsize($comment->comment, 50));
         $comment->comment = array('data' => '<div>' . ee()->typography->parse_type($comment->comment) . '</div>', 'colspan' => 7);
         $comment->details_link = array('data' => anchor(BASE . AMP . 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=comment' . AMP . 'method=edit_comment_form' . AMP . 'comment_id=' . $comment->comment_id, 'EDIT', 'class="submit"'), 'colspan' => 2);
     }
     return $comments;
 }
コード例 #20
0
ファイル: viewer.php プロジェクト: vinik/hplt
				<h3><?php 
echo $aluno->get_nome();
?>
</h3>
				<p><?php 
echo $aluno->get_profissao();
?>
</p>
				<p><?php 
echo $aluno->get_data_nascimento();
?>
</p>
			</div>
			<div id="abaContato">
				<p>Email: <?php 
echo mailto($aluno->get_email(), $aluno->get_email());
?>
</p>
				<p>Endereço: <?php 
echo $aluno->get_endereco();
?>
</p>
				<p>Telefone: <?php 
echo $aluno->get_telefone();
?>
</p>
			</div>
			<div id="abaObj">
				<p><?php 
echo $aluno->get_objetivo();
?>
コード例 #21
0
		<!-- CONTACT DETAILS -->
		<div class="charter-main-info" style="background-color:#59b4dc;padding:16px;"> <!-- col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 -->
			<div class="contact-details" > 
				<div class="charter-phone ">
					<h3>
		                <i class="fa fa-phone" style="padding:16px;"></i> <?php 
echo '  ' . $charter[0]->phone;
?>
		               </h3>
		           </div>
		           
		 
				<div class="charter-phone">
					<h3>
		                   <i class="fa fa-envelope-o" style="padding:16px;"></i> <?php 
echo '  ' . mailto($charter[0]->email);
?>
		            </h3>
		           </div>
		            

				<div class="charter-phone">
					<h3>
		                   <i class="fa fa-globe" style="padding:16px;"></i> <a href="http://<?php 
echo $charter[0]->website;
?>
" class="anchor"> <?php 
echo '  ' . $charter[0]->website;
?>
</a>
		            </h3>
コード例 #22
0
ファイル: _layout.php プロジェクト: sk8sta13/Clients
                </nav>
                <h3 class="text-muted">Clients</h3>
            </div>

            <!-- Body -->
            <div class="row marketing">

                {body}

            </div>

            <footer class="footer">
                <p>
                    <a href="/language/en" title="English"><img src="/images/en.jpeg" /></a>
                    <a href="/language/pt-BR" title="Português Brasil"><img src="/images/pt-br.jpeg" /></a>
                    <span class="pull-right">© <?php 
echo mailto('*****@*****.**', 'Marcelo') . ' ' . date('Y');
?>
</span>
                </p>
            </footer>

        </div>

        <?php 
include_once '_modals.php';
?>

    </body>

</html>
コード例 #23
0
ファイル: index.php プロジェクト: brkrishna/freelance
</td>
				<td><?php 
        echo anchor(site_url(SITE_AREA . '/settings/users/edit/' . $user->id), $user->username);
        if ($user->banned) {
            ?>
					<span class="label label-warning">Banned</span>
					<?php 
        }
        ?>
				</td>
				<td><?php 
        echo $user->display_name;
        ?>
</td>
				<td><?php 
        echo $user->email ? mailto($user->email) : '';
        ?>
</td>
				<td><?php 
        echo $roles[$user->role_id]->role_name;
        ?>
</td>
				<td class='last-login'><?php 
        echo $user->last_login != '0000-00-00 00:00:00' ? date('M j, y g:i A', strtotime($user->last_login)) : '---';
        ?>
</td>
				<td class='status'>
					<?php 
        if ($user->active) {
            ?>
					<span class="label label-success"><?php 
コード例 #24
0
function get_supplier_data_row($supplier, $controller)
{
    $CI =& get_instance();
    $controller_name = strtolower(get_class($CI));
    $width = $controller->get_form_width();
    $table_data_row = '<tr>';
    $table_data_row .= "<td width='5%'><input type='checkbox' id='person_{$supplier->person_id}' value='" . $supplier->person_id . "'/></td>";
    $table_data_row .= '<td width="17%">' . character_limiter($supplier->company_name, 13) . '</td>';
    $table_data_row .= '<td width="17%">' . character_limiter($supplier->agency_name, 13) . '</td>';
    $table_data_row .= '<td width="17%">' . character_limiter($supplier->last_name, 13) . '</td>';
    $table_data_row .= '<td width="17%">' . character_limiter($supplier->first_name, 13) . '</td>';
    $table_data_row .= '<td width="22%">' . mailto($supplier->email, character_limiter($supplier->email, 22)) . '</td>';
    $table_data_row .= '<td width="17%">' . character_limiter($supplier->phone_number, 13) . '</td>';
    $table_data_row .= '<td width="5%">' . character_limiter($supplier->person_id, 5) . '</td>';
    $table_data_row .= '<td width="5%">' . anchor($controller_name . "/view/{$supplier->person_id}/width:{$width}", $CI->lang->line('common_edit'), array('class' => 'thickbox', 'title' => $CI->lang->line($controller_name . '_update'))) . '</td>';
    $table_data_row .= '</tr>';
    return $table_data_row;
}
コード例 #25
0
ファイル: mcp.comment.php プロジェクト: rmdort/adiee
 function comments_ajax_filter()
 {
     $this->EE->output->enable_profiler(FALSE);
     $this->EE->load->helper('text');
     //$this->EE->load->model('search_model');
     $this->EE->load->model('comment_model');
     $ids = array();
     $col_map = array('comment', 'comment', 'title', 'channel_title', 'name', 'email', 'comment_date', 'ip_address', 'status');
     // Note- we pipeline the js, so pull more data than are displayed on the page
     $perpage = $this->EE->input->get_post('iDisplayLength');
     $offset = $this->EE->input->get_post('iDisplayStart') ? $this->EE->input->get_post('iDisplayStart') : 0;
     // Display start point
     $sEcho = $this->EE->input->get_post('sEcho');
     /* Ordering */
     $order = array();
     if ($this->EE->input->get('iSortCol_0') !== FALSE) {
         for ($i = 0; $i < $this->EE->input->get('iSortingCols'); $i++) {
             if (isset($col_map[$this->EE->input->get('iSortCol_' . $i)])) {
                 $order[$col_map[$this->EE->input->get('iSortCol_' . $i)]] = $this->EE->input->get('sSortDir_' . $i) == 'asc' ? 'asc' : 'desc';
             }
         }
     }
     $filter = $this->filter_settings($ajax = TRUE);
     //  Get comment ids
     $comment_id_query = $this->EE->comment_model->get_comment_ids($filter, '', $order);
     $comment_ids = array_slice($comment_id_query->result_array(), $offset, $perpage);
     foreach ($comment_ids as $id) {
         $ids[] = $id['comment_id'];
     }
     $this->EE->db->where('site_id', $this->EE->config->item('site_id'));
     $total = $this->EE->db->count_all_results('comments');
     $j_response['sEcho'] = $sEcho;
     $j_response['iTotalRecords'] = $total;
     $j_response['iTotalDisplayRecords'] = $comment_id_query->num_rows();
     $tdata = array();
     $i = 0;
     $comment_results = $this->EE->comment_model->fetch_comment_data($ids, $order);
     // Note- empty string added because otherwise it will throw a js error
     if ($comment_results != FALSE) {
         $config = $this->EE->config->item('comment_word_censoring') == 'y' ? array('word_censor' => TRUE) : array();
         $this->EE->load->library('typography');
         $this->EE->typography->initialize($config);
         $this->EE->typography->parse_images = FALSE;
         $this->EE->typography->allow_headings = FALSE;
         foreach ($comment_results->result_array() as $comment) {
             $can_edit_comment = TRUE;
             if ($comment['entry_author_id'] != $this->EE->session->userdata('member_id') && !$this->EE->cp->allowed_group('can_edit_all_comments')) {
                 $can_edit_comment = FALSE;
             }
             if ($comment['status'] == 'o') {
                 $status_label = $this->EE->lang->line('open');
             } elseif ($comment['status'] == 'c') {
                 $status_label = $this->EE->lang->line('closed');
             } else {
                 $status_label = $this->EE->lang->line('pending');
             }
             if ($this->comment_leave_breaks == 'y') {
                 $display_comment = str_replace(array("\n", "\r"), '<br />', strip_tags($comment['comment']));
             } else {
                 $display_comment = strip_tags(str_replace(array("\t", "\n", "\r"), ' ', $comment['comment']));
             }
             if ($this->comment_chars != 0) {
                 $display_comment = $this->EE->functions->char_limiter(trim($display_comment), $this->comment_chars);
             }
             $full_comment = $this->EE->typography->parse_type($comment['comment'], array('text_format' => $comment['comment_text_formatting'], 'html_format' => $comment['comment_html_formatting'], 'auto_links' => $comment['comment_auto_link_urls'], 'allow_img_url' => $comment['comment_allow_img_urls']));
             $edit_url = $this->base_url . AMP . 'method=edit_comment_form' . AMP . 'comment_id=' . $comment['comment_id'];
             $status_search_url = $this->base_url . AMP . 'status=' . $comment['status'];
             $ip_search_url = $this->base_url . AMP . 'ip_address=' . base64_encode($comment['ip_address']);
             $channel_search_url = $this->base_url . AMP . 'channel_id=' . $comment['channel_id'];
             $email_search_url = $this->base_url . AMP . 'email=' . base64_encode($comment['email']);
             $mail_to = $comment['email'] != '' ? mailto($comment['email']) : FALSE;
             $name_search_url = $this->base_url . AMP . 'name=' . base64_encode($comment['name']);
             $date = $this->EE->localize->set_human_time($comment['comment_date']);
             $entry_search_url = $this->base_url . AMP . 'entry_id=' . $comment['entry_id'];
             $entry_title = $this->EE->functions->char_limiter(trim(strip_tags($comment['title'])), 26);
             $expand_img = '<img src="' . $this->EE->cp->cp_theme_url . 'images/field_collapse.png" alt="expand" />';
             $m[] = $expand_img;
             $m[] = "<a class='less_important_link' href='{$edit_url}'>{$display_comment}</a>";
             $m[] = "<a class='less_important_link' href='{$entry_search_url}'>{$entry_title}</a>";
             $m[] = "<a class='less_important_link' href='{$channel_search_url}'>{$comment['channel_title']}</a>";
             $m[] = "<a class='less_important_link'  href='{$name_search_url}'>{$comment['name']}</a>";
             $m[] = "<a class='less_important_link'  href='{$email_search_url}'>{$comment['email']}</a>";
             $m[] = !is_null($date) ? $date : '';
             $m[] = "<a class='less_important_link' href='{$ip_search_url}'>{$comment['ip_address']}</a>";
             $m[] = "<a class='less_important_link' href='{$status_search_url}'>{$status_label}</a>";
             $m[] = !is_null($full_comment) ? $full_comment : '';
             $m[] = '<input class="comment_toggle" type="checkbox" name="toggle[]" value="' . $comment['comment_id'] . '" />';
             $tdata[$i] = $m;
             $i++;
             unset($m);
         }
     }
     // end false check
     $j_response['aaData'] = $tdata;
     $sOutput = $this->EE->javascript->generate_json($j_response, TRUE);
     die($sOutput);
 }
コード例 #26
0
ファイル: view_order.php プロジェクト: billaldev/halogy
echo $order['address3'] ? $order['address3'] . '<br />' : '';
?>
				<?php 
echo $order['city'] ? $order['city'] . '<br />' : '';
?>
				<?php 
echo $order['country'] ? lookup_country($order['country']) . '<br />' : '';
?>
				<?php 
echo $order['postcode'] ? $order['postcode'] . '<br />' : '';
?>
				<?php 
echo $order['phone'] ? $order['phone'] : '';
?>
				<?php 
echo $order['email'] ? mailto($order['email']) : '';
?>
			</p>
			
		</div>

		<div class="col3">
		
			<h3 class="underline">Billing Address</h3>
		
			<p>
				<?php 
if ($order['billingAddress1'] || $order['billingAddress2'] || $order['billingCity'] || $order['billingPostcode']) {
    ?>
					<?php 
    echo $order['firstName'] ? $order['firstName'] : '(no firstname)';
コード例 #27
0
 public function test1()
 {
     $this->load->helper('url');
     //site_url()参数为字符串
     echo '1:site_url()参数为字符串<br/> ' . site_url('helpers_test/Helper_url_test/test');
     echo '<br/>';
     //site_url()参数为数组
     $segments = array('helpers_test', 'Helper_url_test', 'test');
     echo '2:site_url()参数为数组<br/> ' . site_url($segments);
     echo '<br/>';
     //base_url()和site_url()相同,只是不会加上index.php
     echo '3:base_url()和site_url()相同,只是不会加上index.php<br/> ' . base_url("helpers_test/Helper_url_test/test");
     echo '<br/>';
     echo '4:base_url()和site_url()相同,只是不会加上index.php<br/> ' . base_url($segments);
     echo '<br/>';
     //current_url()返回当前正在浏览的页面的完整 URL (包括分段)
     echo '5:current_url()返回当前正在浏览的页面的完整 URL (包括分段)<br/> ' . current_url();
     echo '<br/>';
     //uri_string()
     echo '6:uri_string返回包含该函数的页面的 URI 分段<br/>' . uri_string() . '<br/>';
     //返回你在配置文件中配置的 index_page 参数
     echo '7:返回你在配置文件中配置的 index_page 参数<br/>' . index_page() . '<br/>';
     //anchor()根据你提供的 URL 生成一个标准的 HTML 链接
     echo '8:根据你提供的 URL 生成一个标准的 HTML 链接<br/>' . anchor('news/local/123', 'My News', 'title="News title"');
     echo '<br/>';
     echo anchor('news/local/123', 'My News', array('title' => 'The best news!'));
     echo '<br/>';
     echo anchor('', 'Click here');
     echo '<br/>';
     //anchor_popup()它生成的 URL 将会在新窗口被打开
     $atts = array('width' => 800, 'height' => 600, 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => 0, 'screeny' => 0, 'window_name' => '_blank');
     //anchor_popup()它生成的 URL 将会在新窗口被打开
     echo '9:anchor_popup()它生成的 URL 将会在新窗口被打开<br/>' . anchor_popup('news/local/123', 'Click Me!', $atts);
     echo '<br/>';
     echo anchor_popup('news/local/123', 'Click Me!', array());
     echo '<br/>';
     //mailto()创建一个标准的 HTML e-mail 链接(发邮件)
     echo '10.mailto()创建一个标准的 HTML e-mail 链接<br/>' . mailto('*****@*****.**', 'Click Here to Contact Me');
     echo '<br/>';
     $attributes = array('title' => 'Mail me');
     echo mailto('*****@*****.**', 'Contact Me', $attributes);
     echo '<br/>';
     //和mailto函数一样safe_mailto()它的 mailto 标签使用了一个混淆的写法, 可以防止你的 e-mail 地址被垃圾邮件机器人爬到
     echo '11.和mailto函数一样safe_mailto()它的 mailto 标签使用了一个混淆的写法,可以防止你的 e-mail 地址被垃圾邮件机器人爬到<br/>' . mailto('*****@*****.**', 'Click Here to Contact Me');
     echo '<br/>';
     //auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接
     //$string = auto_link($string, 'url');
     //$string = auto_link($string, 'email');
     //$string = auto_link($string, 'both', TRUE);
     //auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接
     echo '12:auto_link()将一个字符串中的 URL 和 e-mail 地址自动转换为链接<br/>' . auto_link('http://cyy.com/ci_chm/helpers/url_helper.html#id2', 'url');
     echo '<br/>';
     //url_title()将字符串转换为对人类友好的 URL 字符串格式
     $title = "What's wrong with CSS?";
     echo '13:url_title()将字符串转换为对人类友好的 URL 字符串格式<br/>' . url_title($title);
     echo '<br/>';
     echo url_title($title, 'underscore');
     echo '<br/>';
     //$url = prep_url('example.com');
     $url = prep_url('example.com');
     echo '14:prep_url(\'example.com\'):<br/>' . $url;
 }
コード例 #28
0
ファイル: list.php プロジェクト: sitesbyjoe/cmsbyjoe
    foreach ($users->result() as $row) {
        ?>
						<tr id="<?php 
        echo $row->id;
        ?>
">
							<td class="link"><?php 
        echo anchor('admin_users/edit/' . $row->id, $row->first_name . ' ' . $row->last_name);
        ?>
</td>
							<td class="category"><?php 
        echo $row->username;
        ?>
</td>
							<td class="link"><?php 
        echo mailto($row->email, $row->email);
        ?>
</td>
							<td class="actions">
								<?php 
        echo anchor('admin_users/edit/' . $row->id, '<i class="fa fa-pencil"></i>', array('title' => 'Edit', 'class' => 'text-success'));
        ?>
								<?php 
        echo anchor('admin_users/delete/' . $row->id, '<i class="fa fa-minus-circle"></i>', array('title' => 'Delete', 'class' => 'text-danger', 'onclick' => "return confirm('Are you SURE you want to delete this user?');"));
        ?>
							</td>
						</tr>
						<?php 
    }
}
?>
コード例 #29
0
    function add_items($channel_id = '', $message = '', $extra_sql = '', $search_url = '', $form_url = '', $action = '', $extra_fields_search = '', $extra_fields_entries = '', $heading = '')
    {
        ee()->lang->loadfile('content');
        ee()->load->helper('url');
        $channel_id = '';
        $extra_sql = array();
        ee()->db->select('entry_id');
        $query = ee()->db->get('simple_commerce_items');
        if ($query->num_rows() > 0) {
            $extra_sql['where'] = " AND exp_channel_titles.entry_id NOT IN ('";
            foreach ($query->result_array() as $row) {
                $extra_sql['where'] .= $row['entry_id'] . "','";
            }
            $extra_sql['where'] = substr($extra_sql['where'], 0, -2) . ') ';
        }
        ee()->load->library('api');
        // $action, $extra_fields_*, and $heading are used by move_comments
        $vars['message'] = $message;
        $action = $action ? $action : ee()->input->get_post('action');
        // Security check
        if (!ee()->cp->allowed_group('can_access_edit')) {
            show_error(lang('unauthorized_access'));
        }
        ee()->load->library('pagination');
        ee()->load->library('table');
        ee()->load->helper(array('form', 'text', 'url', 'snippets'));
        ee()->api->instantiate('channel_categories');
        ee()->load->model('channel_model');
        ee()->load->model('channel_entries_model');
        ee()->load->model('category_model');
        ee()->load->model('status_model');
        // Load the search helper so we can filter the keywords
        ee()->load->helper('search');
        ee()->view->cp_page_title = lang('edit');
        ee()->cp->add_js_script('ui', 'datepicker');
        ee()->javascript->output(array(ee()->javascript->hide(".paginationLinks .first"), ee()->javascript->hide(".paginationLinks .previous")));
        ee()->javascript->output('
			$(".toggle_all").toggle(
				function(){
					$("input.toggle").each(function() {
						this.checked = true;
					});
				}, function (){
					var checked_status = this.checked;
					$("input.toggle").each(function() {
						this.checked = false;
					});
				}
			);
		');
        ee()->jquery->tablesorter('.mainTable', '{
			headers: {
			2: {sorter: false},
			3: {
				// BLARG!!! This should be human readable sorted...
			},
			5: {dateFormat: "mm/dd/yy"},
			8: {sorter: false}
		},
			widgets: ["zebra"]
		}');
        ee()->javascript->output('
			$("#custom_date_start_span").datepicker({
				dateFormat: "yy-mm-dd",
				prevText: "<<",
				nextText: ">>",
				onSelect: function(date) {
					$("#custom_date_start").val(date);
					dates_picked();
				}
			});
			$("#custom_date_end_span").datepicker({
				dateFormat: "yy-mm-dd",
				prevText: "<<",
				nextText: ">>",
				onSelect: function(date) {
					$("#custom_date_end").val(date);
					dates_picked();
				}
			});

			$("#custom_date_start, #custom_date_end").focus(function(){
				if ($(this).val() == "yyyy-mm-dd")
				{
					$(this).val("");
				}
			});

			$("#custom_date_start, #custom_date_end").keypress(function(){
				if ($(this).val().length >= 9)
				{
					dates_picked();
				}
			});

			function dates_picked()
			{
				if ($("#custom_date_start").val() != "yyyy-mm-dd" && $("#custom_date_end").val() != "yyyy-mm-dd")
				{
					// populate dropdown box
					focus_number = $("#date_range").children().length;
					$("#date_range").append("<option id=\\"custom_date_option\\">" + $("#custom_date_start").val() + " to " + $("#custom_date_end").val() + "</option>");
					document.getElementById("date_range").options[focus_number].selected=true;

					// hide custom date picker again
					$("#custom_date_picker").slideUp("fast");
				}
			}
		');
        ee()->javascript->change("#date_range", "\n\t\t\tif (\$('#date_range').val() == 'custom_date')\n\t\t\t{\n\t\t\t\t// clear any current dates, remove any custom options\n\t\t\t\t\$('#custom_date_start').val('yyyy-mm-dd');\n\t\t\t\t\$('#custom_date_end').val('yyyy-mm-dd');\n\t\t\t\t\$('#custom_date_option').remove();\n\n\t\t\t\t// drop it down\n\t\t\t\t\$('#custom_date_picker').slideDown('fast');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$('#custom_date_picker').hide();\n\t\t\t}\n\t\t");
        ee()->javascript->output('
		$(".paginationLinks a.page").click(function() {
			current_rownum = $("#perpage").val()*$(this).text()-$("#perpage").val();
			current_perpage = $("#perpage").val();

			$.getJSON("' . BASE . '&C=javascript&M=json&perpage="+$("#perpage").val()+"&rownum="+($("#perpage").val()*$(this).text()-$("#perpage").val())' . ', {ajax: "true"}, doPagination);
			return false;
		});

		var current_rownum = 0;
		var current_perpage = 20;
		var total_entries = 60; // needs to be set via PHP
		var next_page = current_perpage;

		function doPagination(e){
			var entries = "";
			for (var i = 0; i < e.length; i++) {
				entries += "<tr>";
				entries += "<td>" + e[i].id + "</td>";
				entries += "<td><a href=\\"#\\">" + e[i].title + "</a></td>";
				entries += "<td><a href=\\"#\\">Live Look</a></td>";
				entries += "<td>(" + e[i].comment_count + ")&nbsp;&nbsp;&nbsp;<a href=\\"#\\">View</a></td>";
				entries += "<td><div class=\'smallLinks\'><a href=\\"mailto:" + e[i].author_email + "\\">" + e[i].author + "</a></div></td>";
				entries += "<td>" + e[i].entry_date + "</td>";
				entries += "<td>" + e[i].channel_name + "</td>";

				if (e[i].status == "Open")
				{
					entries += "<td><span style=\\"color:#339900;\\">" + e[i].status + "</span></td>";
				}
				else
				{
					entries += "<td><span style=\\"color:#cc0000;\\">" + e[i].status + "</span></td>";
				}

				entries += "<td><input class=\'checkbox\' type=\'checkbox\' name=\'toggle[]\' value=\'" + e[i].id + "\' /></td>";
				entries += "</tr>";
			}

			$(".mainTable tbody").html(entries);
			$(".mainTable").trigger("update");
			var current_sort = $(".mainTable").get(0).config.sortList;
			$(".mainTable").trigger("sorton", [current_sort]);

			// add or remove first and last links
			(current_rownum >= current_perpage) ? $(".paginationLinks .first").show() : $(".paginationLinks .first").hide() ;
			(current_rownum >= current_perpage) ? $(".paginationLinks .previous").show() : $(".paginationLinks .previous").hide() ;
			(current_rownum >= (total_entries - current_perpage)) ? $(".paginationLinks .last").hide() : $(".paginationLinks .last").show() ;
			(current_rownum >= (total_entries - current_perpage)) ? $(".paginationLinks .next").hide() : $(".paginationLinks .next").show() ;
			// readjust page numbers for links
		}

		$(".paginationLinks .first").click(function() {
			current_perpage = $("#perpage").val();
			current_rownum = 0;
			$.getJSON("' . BASE . '&C=javascript&M=json&per_page="+current_perpage+"&rownum="+current_rownum, {ajax: "true"}, doPagination);
			return false;
		});

		$(".paginationLinks .previous").click(function() {
			current_perpage = $("#perpage").val();
			current_rownum = Number(current_rownum) - Number($("#perpage").val());
			$.getJSON("' . BASE . '&C=javascript&M=json&per_page="+current_perpage+"&rownum="+current_rownum, {ajax: "true"}, doPagination);
			return false;
		});

		$(".paginationLinks .next").click(function() {
			current_perpage = $("#perpage").val();
			current_rownum = Number(current_rownum) + Number($("#perpage").val());
			$.getJSON("' . BASE . '&C=javascript&M=json&per_page="+current_perpage+"&rownum="+current_rownum, {ajax: "true"}, doPagination);
			return false;
		});

		$(".paginationLinks .last").click(function() {
			current_perpage = $("#perpage").val();
			current_rownum = total_entries;
			$.getJSON("' . BASE . '&C=edit&M=json_entries&per_page="+current_perpage+"&rownum="+current_rownum, {ajax: "true"}, doPagination);
			return false;
		});

	');
        $cp_theme = !ee()->session->userdata('cp_theme') ? ee()->config->item('cp_theme') : ee()->session->userdata('cp_theme');
        $turn_on_robot = FALSE;
        // Fetch channel ID numbers assigned to the current user
        $allowed_channels = ee()->functions->fetch_assigned_channels();
        if (empty($allowed_channels)) {
            show_error(lang('no_channels'));
        }
        //  Fetch Color Library - We use this to assist with our status colors
        if (file_exists(APPPATH . 'config/colors.php')) {
            include APPPATH . 'config/colors.php';
        } else {
            $colors = '';
        }
        // We need to determine which channel to show entries from
        // if the channel_id combined
        if ($channel_id == '') {
            $channel_id = ee()->input->get_post('channel_id');
        }
        if ($channel_id == 'null' or $channel_id === FALSE or !is_numeric($channel_id)) {
            $channel_id = '';
        }
        $cat_group = '';
        $cat_id = ee()->input->get_post('cat_id');
        $status = ee()->input->get_post('status');
        $order = ee()->input->get_post('order');
        $date_range = ee()->input->get_post('date_range');
        $total_channels = count($allowed_channels);
        // If we have more than one channel we'll write the JavaScript menu switching code
        if ($total_channels > 1) {
            ee()->javascript->output($this->filtering_menus());
        }
        // Do we have a message to show?
        // Note: a message is displayed on this page after editing or submitting a new entry
        if (ee()->input->get_post("U") == 'mu') {
            $vars['message'] = lang('multi_entries_updated');
        }
        // Declare the "filtering" form
        $vars['search_form'] = $search_url != '' ? $search_url : 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=simple_commerce' . AMP . 'method=add_items';
        // If we have more than one channel we'll add the "onchange" method to
        // the form so that it'll automatically switch categories and statuses
        if ($total_channels > 1) {
            $vars['channel_select']['onchange'] = 'changemenu(this.selectedIndex);';
        }
        // Design note:	 Because the JavaScript code dynamically switches the information inside the
        // pull-down menus we can't show any particular menu in a "selected" state unless there is only
        // one channel.	 Each channel is fully independent, so it can have its own categories, statuses, etc.
        // Channel selection pull-down menu
        // Fetch the names of all channels and write each one in an <option> field
        $fields = array('channel_title', 'channel_id', 'cat_group');
        $where = array();
        // If the user is restricted to specific channels, add that to the query
        if (ee()->session->userdata['group_id'] != 1) {
            $where[] = array('channel_id' => $allowed_channels);
        }
        $query = ee()->channel_model->get_channels(ee()->config->item('site_id'), $fields, $where);
        if ($query->num_rows() == 1) {
            $channel_id = $query->row('channel_id');
            $cat_group = $query->row('cat_group');
        } elseif ($channel_id != '') {
            foreach ($query->result_array() as $row) {
                if ($row['channel_id'] == $channel_id) {
                    $channel_id = $row['channel_id'];
                    $cat_group = $row['cat_group'];
                }
            }
        }
        $vars['channel_selected'] = ee()->input->get_post('channel_id');
        $vars['channel_select_options'] = array('null' => lang('filter_by_channel'));
        if ($query->num_rows() > 1) {
            $vars['channel_select_options']['all'] = lang('all');
        }
        foreach ($query->result_array() as $row) {
            $vars['channel_select_options'][$row['channel_id']] = $row['channel_title'];
        }
        // Category pull-down menu
        $vars['category_selected'] = $cat_id;
        $vars['category_select_options'][''] = lang('filter_by_category');
        if ($total_channels > 1) {
            $vars['category_select_options']['all'] = lang('all');
        }
        $vars['category_select_options']['none'] = lang('none');
        if ($cat_group != '') {
            foreach (ee()->api_channel_categories->cat_array as $key => $val) {
                if (!in_array($val['0'], explode('|', $cat_group))) {
                    unset(ee()->api_channel_categories->cat_array[$key]);
                }
            }
            $i = 1;
            $new_array = array();
            foreach (ee()->api_channel_categories->cat_array as $ckey => $cat) {
                if ($ckey - 1 < 0 or !isset(ee()->api_channel_categories->cat_array[$ckey - 1])) {
                    $vars['category_select_options']['NULL_' . $i] = '-------';
                }
                $vars['category_select_options'][$cat['1']] = str_replace("!-!", "&nbsp;", $cat['2']);
                if (isset(ee()->api_channel_categories->cat_array[$ckey + 1]) && ee()->api_channel_categories->cat_array[$ckey + 1]['0'] != $cat['0']) {
                    $vars['category_select_options']['NULL_' . $i] = '-------';
                }
                $i++;
            }
        }
        // Authors list
        $vars['author_selected'] = ee()->input->get_post('author_id');
        $query = ee()->member_model->get_authors();
        $vars['author_select_options'][''] = lang('filter_by_author');
        foreach ($query->result_array() as $row) {
            $vars['author_select_options'][$row['member_id']] = $row['screen_name'] == '' ? $row['username'] : $row['screen_name'];
        }
        // Status pull-down menu
        $vars['status_selected'] = $status;
        $vars['status_select_options'][''] = lang('filter_by_status');
        $vars['status_select_options']['all'] = lang('all');
        $sel_1 = '';
        $sel_2 = '';
        if ($cat_group != '') {
            $sel_1 = $status == 'open' ? 1 : '';
            $sel_2 = $status == 'closed' ? 1 : '';
        }
        if ($cat_group != '') {
            $rez = ee()->db->query("SELECT status_group FROM exp_channels WHERE channel_id = '{$channel_id}'");
            $query = ee()->db->query("SELECT status FROM exp_statuses WHERE group_id = '" . ee()->db->escape_str($rez->row('status_group')) . "' ORDER BY status_order");
            if ($query->num_rows() > 0) {
                foreach ($query->result_array() as $row) {
                    $status_name = ($row['status'] == 'closed' or $row['status'] == 'open') ? lang($row['status']) : $row['status'];
                    $vars['status_select_options'][$row['status']] = $status_name;
                }
            }
        } else {
            $vars['status_select_options']['open'] = lang('open');
            $vars['status_select_options']['closed'] = lang('closed');
        }
        // Date range pull-down menu
        $vars['date_selected'] = $date_range;
        $vars['date_select_options'][''] = lang('date_range');
        $vars['date_select_options']['1'] = lang('today');
        $vars['date_select_options']['7'] = lang('past_week');
        $vars['date_select_options']['31'] = lang('past_month');
        $vars['date_select_options']['182'] = lang('past_six_months');
        $vars['date_select_options']['365'] = lang('past_year');
        $vars['date_select_options']['custom_date'] = lang('any_date');
        // Display order pull-down menu
        $vars['order_selected'] = $order;
        $vars['order_select_options'][''] = lang('order');
        $vars['order_select_options']['asc'] = lang('ascending');
        $vars['order_select_options']['desc'] = lang('descending');
        $vars['order_select_options']['alpha'] = lang('alpha');
        // Results per page pull-down menu
        if (!($perpage = ee()->input->get_post('perpage'))) {
            $perpage = ee()->input->cookie('perpage');
        }
        if ($perpage == '') {
            $perpage = 50;
        }
        ee()->functions->set_cookie('perpage', $perpage, 60 * 60 * 24 * 182);
        $vars['perpage_selected'] = $perpage;
        $vars['perpage_select_options']['10'] = '10 ' . lang('results');
        $vars['perpage_select_options']['25'] = '25 ' . lang('results');
        $vars['perpage_select_options']['50'] = '50 ' . lang('results');
        $vars['perpage_select_options']['75'] = '75 ' . lang('results');
        $vars['perpage_select_options']['100'] = '100 ' . lang('results');
        $vars['perpage_select_options']['150'] = '150 ' . lang('results');
        if (isset($_POST['keywords'])) {
            $keywords = sanitize_search_terms($_POST['keywords']);
        } elseif (isset($_GET['keywords'])) {
            $keywords = sanitize_search_terms(base64_decode($_GET['keywords']));
        } else {
            $keywords = '';
        }
        if (substr(strtolower($keywords), 0, 3) == 'ip:') {
            $keywords = str_replace('_', '.', $keywords);
        }
        // Because of the auto convert we prepare a specific variable with the converted ascii
        // characters while leaving the $keywords variable intact for display and URL purposes
        $search_keywords = ee()->config->item('auto_convert_high_ascii') == 'y' ? ascii_to_entities($keywords) : $keywords;
        $vars['exact_match'] = ee()->input->get_post('exact_match');
        $vars['keywords'] = array('name' => 'keywords', 'value' => stripslashes($keywords), 'id' => 'keywords', 'maxlength' => 200);
        $search_in = ee()->input->get_post('search_in') != '' ? ee()->input->get_post('search_in') : 'title';
        $vars['search_in_selected'] = $search_in;
        $vars['search_in_options']['title'] = lang('title_only');
        $vars['search_in_options']['body'] = lang('title_and_body');
        if (isset(ee()->installed_modules['comment'])) {
            $vars['search_in_options']['everywhere'] = lang('title_body_comments');
            $vars['search_in_options']['comments'] = $this->lang->line('comments');
        }
        //	 Build the main query
        if ($search_url != '') {
            $pageurl = BASE . AMP . $search_url;
        } else {
            $pageurl = BASE . AMP . 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=simple_commerce' . AMP . 'method=add_items';
        }
        $sql_a = "SELECT ";
        if ($search_in == 'comments') {
            $sql_b = "DISTINCT(exp_comments.comment_id) ";
        } else {
            $sql_b = ($cat_id == 'none' or $cat_id != "") ? "DISTINCT(exp_channel_titles.entry_id) " : "exp_channel_titles.entry_id ";
        }
        $sql = "FROM exp_channel_titles\n\t\t\t\tLEFT JOIN exp_channels ON exp_channel_titles.channel_id = exp_channels.channel_id ";
        if ($keywords != '') {
            if ($search_in != 'title') {
                $sql .= "LEFT JOIN exp_channel_data ON exp_channel_titles.entry_id = exp_channel_data.entry_id ";
            }
            if ($search_in == 'everywhere' or $search_in == 'comments') {
                $sql .= "LEFT JOIN exp_comments ON exp_channel_titles.entry_id = exp_comments.entry_id ";
            }
        } elseif ($search_in == 'comments') {
            $sql .= "LEFT JOIN exp_comments ON exp_channel_titles.entry_id = exp_comments.entry_id ";
        }
        $sql .= "LEFT JOIN exp_members ON exp_members.member_id = exp_channel_titles.author_id ";
        if ($cat_id == 'none' or $cat_id != "") {
            $sql .= "LEFT JOIN exp_category_posts ON exp_channel_titles.entry_id = exp_category_posts.entry_id\n\t\t\t\t\t LEFT JOIN exp_categories ON exp_category_posts.cat_id = exp_categories.cat_id ";
        }
        if (is_array($extra_sql) && isset($extra_sql['tables'])) {
            $sql .= ' ' . $extra_sql['tables'] . ' ';
        }
        // Limit to channels assigned to user
        $sql .= " WHERE exp_channels.site_id = '" . ee()->db->escape_str(ee()->config->item('site_id')) . "' AND exp_channel_titles.channel_id IN (";
        foreach ($allowed_channels as $val) {
            $sql .= "'" . $val . "',";
        }
        $sql = substr($sql, 0, -1) . ')';
        if (!ee()->cp->allowed_group('can_edit_other_entries') and !ee()->cp->allowed_group('can_view_other_entries')) {
            $sql .= " AND exp_channel_titles.author_id = " . ee()->session->userdata('member_id');
        }
        if (is_array($extra_sql) && isset($extra_sql['where'])) {
            $sql .= ' ' . $extra_sql['where'] . ' ';
        }
        if ($keywords != '') {
            $pageurl .= AMP . 'keywords=' . base64_encode($keywords);
            if ($search_in == 'comments') {
                // When searching in comments we do not want to search the entry title.
                // However, by removing this we would have to make the rest of the query creation code
                // below really messy so we simply check for an empty title, which should never happen.
                // That makes this check pointless and allows us some cleaner code. -Paul
                $sql .= " AND (exp_channel_titles.title = '' ";
            } else {
                if ($vars['exact_match'] != 'yes') {
                    $sql .= " AND (exp_channel_titles.title LIKE '%" . ee()->db->escape_like_str($search_keywords) . "%' ";
                } else {
                    $pageurl .= AMP . 'exact_match=yes';
                    $sql .= " AND (exp_channel_titles.title = '" . ee()->db->escape_str($search_keywords) . "' OR exp_channel_titles.title LIKE '" . ee()->db->escape_like_str($search_keywords) . " %' OR exp_channel_titles.title LIKE '% " . ee()->db->escape_like_str($search_keywords) . " %' ";
                }
            }
            $pageurl .= AMP . 'search_in=' . $search_in;
            if ($search_in == 'body' or $search_in == 'everywhere') {
                // ---------------------------------------
                //	 Fetch the searchable field names
                // ---------------------------------------
                $fields = array();
                $xql = "SELECT DISTINCT(field_group) FROM exp_channels";
                if ($channel_id != '') {
                    $xql .= " WHERE channel_id = '" . ee()->db->escape_str($channel_id) . "' ";
                }
                $query = ee()->db->query($xql);
                if ($query->num_rows() > 0) {
                    $fql = "SELECT field_id FROM exp_channel_fields WHERE group_id IN (";
                    foreach ($query->result_array() as $row) {
                        $fql .= "'" . $row['field_group'] . "',";
                    }
                    $fql = substr($fql, 0, -1) . ')';
                    $query = ee()->db->query($fql);
                    if ($query->num_rows() > 0) {
                        foreach ($query->result_array() as $row) {
                            $fields[] = $row['field_id'];
                        }
                    }
                }
                foreach ($fields as $val) {
                    if ($exact_match != 'yes') {
                        $sql .= " OR exp_channel_data.field_id_" . $val . " LIKE '%" . ee()->db->escape_like_str($search_keywords) . "%' ";
                    } else {
                        $sql .= "  OR (exp_channel_data.field_id_" . $val . " LIKE '" . ee()->db->escape_like_str($search_keywords) . " %' OR exp_channel_data.field_id_" . $val . " LIKE '% " . ee()->db->escape_like_str($search_keywords) . " %' OR exp_channel_data.field_id_" . $val . " = '" . ee()->db->escape_str($search_keywords) . "') ";
                    }
                }
            }
            if ($search_in == 'everywhere' or $search_in == 'comments') {
                if ($search_in == 'comments' && (substr(strtolower($search_keywords), 0, 3) == 'ip:' or substr(strtolower($search_keywords), 0, 4) == 'mid:')) {
                    if (substr(strtolower($search_keywords), 0, 3) == 'ip:') {
                        $sql .= " OR (exp_comments.ip_address = '" . ee()->db->escape_str(str_replace('_', '.', substr($search_keywords, 3))) . "') ";
                    } elseif (substr(strtolower($search_keywords), 0, 4) == 'mid:') {
                        $sql .= " OR (exp_comments.author_id = '" . ee()->db->escape_str(substr($search_keywords, 4)) . "') ";
                    }
                } else {
                    $sql .= " OR (exp_comments.comment LIKE '%" . ee()->db->escape_like_str($keywords) . "%') ";
                    // No ASCII conversion here!
                }
            }
            $sql .= ")";
        }
        if ($channel_id) {
            $pageurl .= AMP . 'channel_id=' . $channel_id;
            $sql .= " AND exp_channel_titles.channel_id = {$channel_id}";
        }
        if ($date_range) {
            $pageurl .= AMP . 'date_range=' . $date_range;
            $date_range = time() - $date_range * 60 * 60 * 24;
            $sql .= " AND exp_channel_titles.entry_date > {$date_range}";
        }
        if (is_numeric($cat_id)) {
            $pageurl .= AMP . 'cat_id=' . $cat_id;
            $sql .= " AND exp_category_posts.cat_id = '{$cat_id}'\n\t\t\t\t\t  AND exp_category_posts.entry_id = exp_channel_titles.entry_id ";
        }
        if ($cat_id == 'none') {
            $pageurl .= AMP . 'cat_id=' . $cat_id;
            $sql .= " AND exp_category_posts.entry_id IS NULL ";
        }
        if ($status && $status != 'all') {
            $pageurl .= AMP . 'status=' . $status;
            $sql .= " AND exp_channel_titles.status = '{$status}'";
        }
        $end = " ORDER BY ";
        if ($order) {
            $pageurl .= AMP . 'order=' . $order;
            switch ($order) {
                case 'asc':
                    $end .= "entry_date asc";
                    break;
                case 'desc':
                    $end .= "entry_date desc";
                    break;
                case 'alpha':
                    $end .= "title asc";
                    break;
                default:
                    $end .= "entry_date desc";
            }
        } else {
            $end .= "entry_date desc";
        }
        // ------------------------------
        //	 Are there results?
        // ------------------------------
        $query = ee()->db->query($sql_a . $sql_b . $sql);
        // No result?  Show the "no results" message
        $vars['total_count'] = $query->num_rows();
        if ($vars['total_count'] == 0) {
            ee()->javascript->compile();
            $vars['heading'] = 'edit_channel_entries';
            $vars['search_form_hidden'] = array();
            ee()->load->view('edit_rip', $vars, TRUE);
            return;
        }
        // Get the current row number and add the LIMIT clause to the SQL query
        if (!($rownum = ee()->input->get_post('rownum'))) {
            $rownum = 0;
        }
        // --------------------------------------------
        //	 Run the query again, fetching ID numbers
        // --------------------------------------------
        if ($search_in == 'comments') {
            $rownum = ee()->input->get('current_page') ? ee()->input->get('current_page') : 0;
        } else {
            $pageurl .= AMP . 'perpage=' . $perpage;
            $vars['form_hidden']['pageurl'] = base64_encode($pageurl);
            // for pagination
        }
        $query = ee()->db->query($sql_a . $sql_b . $sql . $end . " LIMIT " . $rownum . ", " . $perpage);
        // Filter comments
        if ($search_in == 'comments') {
            $comment_array = array();
            foreach ($query->result_array() as $row) {
                $comment_array[] = $row['comment_id'];
            }
            if ($keywords == '') {
                $pageurl .= AMP . 'keywords=' . base64_encode($keywords) . AMP . 'search_in=' . $search_in;
            }
            return ee()->view_comments('', '', '', FALSE, array_unique($comment_array), $vars['total_count'], $pageurl);
        }
        // --------------------------------------------
        //	 Fetch the channel information we need later
        // --------------------------------------------
        $sql = "SELECT channel_id, channel_name FROM exp_channels ";
        $sql .= "WHERE site_id = '" . ee()->db->escape_str(ee()->config->item('site_id')) . "' ";
        $w_array = array();
        $result = ee()->db->query($sql);
        if ($result->num_rows() > 0) {
            foreach ($result->result_array() as $rez) {
                $w_array[$rez['channel_id']] = $rez['channel_name'];
            }
        }
        // --------------------------------------------
        //	 Fetch the status highlight colors
        // --------------------------------------------
        $cql = "SELECT exp_channels.channel_id, exp_channels.channel_name, exp_statuses.status, exp_statuses.highlight\n\t\t\t\t FROM  exp_channels, exp_statuses, exp_status_groups\n\t\t\t\t WHERE exp_status_groups.group_id = exp_channels.status_group\n\t\t\t\t AND   exp_status_groups.group_id = exp_statuses.group_id\n\t\t\t\t AND\texp_statuses.highlight != ''\n\t\t\t\t AND\texp_status_groups.site_id = '" . ee()->db->escape_str(ee()->config->item('site_id')) . "' ";
        // Limit to channels assigned to user
        $sql .= " AND exp_channels.channel_id IN (";
        foreach ($allowed_channels as $val) {
            $sql .= "'" . $val . "',";
        }
        $sql = substr($sql, 0, -1) . ')';
        $result = ee()->db->query($cql);
        $c_array = array();
        if ($result->num_rows() > 0) {
            foreach ($result->result_array() as $rez) {
                $c_array[$rez['channel_id'] . '_' . $rez['status']] = str_replace('#', '', $rez['highlight']);
            }
        }
        // information for entries table
        $vars['entries_form'] = $form_url != '' ? $form_url : 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=simple_commerce' . AMP . 'method=add_item';
        $vars['form_hidden'] = $extra_fields_entries;
        $vars['search_form_hidden'] = $extra_fields_search ? $extra_fields_search : array();
        // table headings
        $table_headings = array('#', lang('title'), lang('view'));
        // comments module installed?  If so, add it to the list of headings.
        if (isset(ee()->installed_modules['comment'])) {
            $table_headings[] .= lang('comments');
        }
        $table_headings = array_merge($table_headings, array(lang('author'), lang('date'), lang('channel'), lang('status'), form_checkbox('select_all', 'true', FALSE, 'class="toggle_all"')));
        $vars['table_headings'] = $table_headings;
        // Build and run the full SQL query
        $sql = "SELECT ";
        $sql .= ($cat_id == 'none' or $cat_id != "") ? "DISTINCT(exp_channel_titles.entry_id), " : "exp_channel_titles.entry_id, ";
        $sql .= "exp_channel_titles.channel_id,\n\t\t\t\texp_channel_titles.title,\n\t\t\t\texp_channel_titles.author_id,\n\t\t\t\texp_channel_titles.status,\n\t\t\t\texp_channel_titles.entry_date,\n\t\t\t\texp_channel_titles.comment_total,\n\t\t\t\texp_channels.live_look_template,\n\t\t\t\texp_members.username,\n\t\t\t\texp_members.email,\n\t\t\t\texp_members.screen_name";
        $sql .= " FROM exp_channel_titles\n\t\t\t\t  LEFT JOIN exp_channels ON exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t  LEFT JOIN exp_members ON exp_members.member_id = exp_channel_titles.author_id ";
        if ($cat_id != 'none' and $cat_id != "") {
            $sql .= "INNER JOIN exp_category_posts ON exp_channel_titles.entry_id = exp_category_posts.entry_id\n\t\t\t\t\t INNER JOIN exp_categories ON exp_category_posts.cat_id = exp_categories.cat_id ";
        }
        $sql .= "WHERE exp_channel_titles.entry_id IN (";
        foreach ($query->result_array() as $row) {
            $sql .= $row['entry_id'] . ',';
        }
        $sql = substr($sql, 0, -1) . ') ' . $end;
        $query = ee()->db->query($sql);
        // load the site's templates
        $templates = array();
        $tquery = ee()->db->query("SELECT exp_template_groups.group_name, exp_templates.template_name, exp_templates.template_id\n\t\t\t\t\t\t\tFROM exp_template_groups, exp_templates\n\t\t\t\t\t\t\tWHERE exp_template_groups.group_id = exp_templates.group_id\n\t\t\t\t\t\t\tAND exp_templates.site_id = '" . ee()->db->escape_str(ee()->config->item('site_id')) . "'");
        if ($tquery->num_rows() > 0) {
            foreach ($tquery->result_array() as $row) {
                $templates[$row['template_id']] = $row['group_name'] . '/' . $row['template_name'];
            }
        }
        // Grab all autosaved entries
        // Removed for here
        $vars['autosave_show'] = FALSE;
        // Loop through the main query result and set up data structure for table
        $vars['entries'] = array();
        foreach ($query->result_array() as $row) {
            // Entry ID number
            $vars['entries'][$row['entry_id']][] = $row['entry_id'];
            // Channel entry title (view entry)
            $output = '<a href="' . BASE . AMP . 'C=content_publish' . AMP . 'M=entry_form' . AMP . 'channel_id=' . $row['channel_id'] . AMP . 'entry_id=' . $row['entry_id'] . '">' . $row['title'] . '</a>';
            $vars['entries'][$row['entry_id']][] = $output;
            // "View"
            if ($row['live_look_template'] != 0 && isset($templates[$row['live_look_template']])) {
                $qm = ee()->config->item('force_query_string') == 'y' ? '' : '?';
                $view_link = anchor(ee()->functions->fetch_site_index() . $qm . 'URL=' . ee()->functions->create_url($templates[$row['live_look_template']] . '/' . $row['entry_id']), lang('view'), '', TRUE);
            } else {
                $view_link = '--';
            }
            $vars['entries'][$row['entry_id']][] = $view_link;
            // Comment count
            $show_link = TRUE;
            if ($row['author_id'] == ee()->session->userdata('member_id')) {
                if (!ee()->cp->allowed_group('can_edit_own_comments') and !ee()->cp->allowed_group('can_delete_own_comments') and !ee()->cp->allowed_group('can_moderate_comments')) {
                    $show_link = FALSE;
                }
            } else {
                if (!ee()->cp->allowed_group('can_edit_all_comments') and !ee()->cp->allowed_group('can_delete_all_comments') and !ee()->cp->allowed_group('can_moderate_comments')) {
                    $show_link = FALSE;
                }
            }
            if (isset(ee()->installed_modules['comment'])) {
                //	Comment Link
                if ($show_link !== FALSE) {
                    $res = ee()->db->query("SELECT COUNT(*) AS count FROM exp_comments WHERE entry_id = '" . $row['entry_id'] . "'");
                    ee()->db->query_count--;
                    $view_url = BASE . AMP . 'C=content_edit' . AMP . 'M=view_comments' . AMP . 'channel_id=' . $row['channel_id'] . AMP . 'entry_id=' . $row['entry_id'];
                }
                $view_link = $show_link == FALSE ? '<div class="lightLinks">--</div>' : '<div class="lightLinks">(' . $res->row('count') . ')' . NBS . anchor($view_url, lang('view')) . '</div>';
                $vars['entries'][$row['entry_id']][] = $view_link;
            }
            // Username
            $name = $row['screen_name'] != '' ? $row['screen_name'] : $row['username'];
            $vars['entries'][$row['entry_id']][] = mailto($row['email'], $name);
            // Date
            $date_fmt = ee()->session->userdata('time_format') != '' ? ee()->session->userdata('time_format') : ee()->config->item('time_format');
            if ($date_fmt == 'us') {
                $datestr = '%m/%d/%y %h:%i %a';
            } else {
                $datestr = '%Y-%m-%d %H:%i';
            }
            $vars['entries'][$row['entry_id']][] = ee()->localize->format_date($datestr, $row['entry_date']);
            // Channel
            $vars['entries'][$row['entry_id']][] = isset($w_array[$row['channel_id']]) ? '<div class="smallNoWrap">' . $w_array[$row['channel_id']] . '</div>' : '';
            // Status
            $status_name = ($row['status'] == 'open' or $row['status'] == 'closed') ? lang($row['status']) : $row['status'];
            $color_info = '';
            if (isset($c_array[$row['channel_id'] . '_' . $row['status']]) and $c_array[$row['channel_id'] . '_' . $row['status']] != '') {
                $color = $c_array[$row['channel_id'] . '_' . $row['status']];
                $prefix = (is_array($colors) and !array_key_exists(strtolower($color), $colors)) ? '#' : '';
                // There are custom colours, override the class above
                $color_info = 'style="color:' . $prefix . $color . ';"';
            }
            $vars['entries'][$row['entry_id']][] = '<span class="status_' . $row['status'] . '"' . $color_info . '>' . $status_name . '</span>';
            // Delete checkbox
            $vars['entries'][$row['entry_id']][] = form_checkbox('toggle[]', $row['entry_id'], '', ' class="toggle" id="delete_box_' . $row['entry_id'] . '"');
        }
        // End foreach
        // Pass the relevant data to the paginate class
        $config['base_url'] = $pageurl;
        $config['total_rows'] = $vars['total_count'];
        $config['per_page'] = $perpage;
        $config['page_query_string'] = TRUE;
        $config['query_string_segment'] = 'rownum';
        $config['full_tag_open'] = '<p id="paginationLinks">';
        $config['full_tag_close'] = '</p>';
        $config['prev_link'] = '<img src="' . ee()->cp->cp_theme_url . 'images/pagination_prev_button.gif" width="13" height="13" alt="&lt;" />';
        $config['next_link'] = '<img src="' . ee()->cp->cp_theme_url . 'images/pagination_next_button.gif" width="13" height="13" alt="&gt;" />';
        $config['first_link'] = '<img src="' . ee()->cp->cp_theme_url . 'images/pagination_first_button.gif" width="13" height="13" alt="&lt; &lt;" />';
        $config['last_link'] = '<img src="' . ee()->cp->cp_theme_url . 'images/pagination_last_button.gif" width="13" height="13" alt="&gt; &gt;" />';
        ee()->pagination->initialize($config);
        $vars['pagination'] = ee()->pagination->create_links();
        $vars['heading'] = $heading ? $heading : 'edit_channel_entries';
        $vars['action_options'] = '';
        if ($action == '') {
            $vars['action_options'] = array('add' => lang('add_items'));
        } elseif (is_array($action)) {
            $vars['action_options'] = $action;
        }
        ee()->javascript->compile();
        return ee()->load->view('edit_rip', $vars, TRUE);
    }
コード例 #30
0
ファイル: index.php プロジェクト: travis-south/co_share
    ?>
					<tr>
						<td class="id-col"><?php 
    echo $user->id;
    ?>
</td>
						<td class="firstnam-col"><?php 
    echo $user->first_name;
    ?>
</td>
						<td class="lastname-col"><?php 
    echo $user->last_name;
    ?>
</td>
						<td class="email-col"><?php 
    echo mailto($user->email, $user->email);
    ?>
</td>
						<td class="groups-col">
							<?php 
    $i = 1;
    foreach ($user->groups as $group) {
        ?>
								<?php 
        $sep = $i++ != count($user->groups) ? ',' : '';
        echo anchor("auth/edit_group/" . $group->id, $group->name) . $sep;
        ?>
			                <?php 
    }
    ?>
						</td>