Exemplo n.º 1
0
 public function get_issue_photos($part_id)
 {
     $part = $this->get($part_id);
     if (!empty($part->diagnostic_issue_id)) {
         return get_photos('diagnostic_issue', null, $part->diagnostic_issue_id, 'miniant');
     }
     return array();
 }
Exemplo n.º 2
0
        break;
    case "most_commented":
        $cond['order'] = $table_name . ".total_comments DESC";
        break;
    case "top_rated":
        $cond['order'] = $table_name . ".rating DESC, " . $table_name . ".rated_by DESC";
        break;
}
//Getting Photo List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, MAINPLIST);
$clist = $cond;
$clist['limit'] = $get_limit;
$photos = get_photos($clist);
Assign('photos', $photos);
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
//Collecting Data for Pagination
$ccount = $cond;
$ccount['count_only'] = true;
$total_rows = get_photos($ccount);
$total_pages = count_pages($total_rows, MAINPLIST);
//Pagination
$link == NULL;
$extra_params = NULL;
$tag = '<li><a #params#>#page#</a><li>';
$pages->paginate($total_pages, $page, $link, $extra_params, $tag);
subtitle(lang('photos'));
//Displaying The Template
template_files('photos.html');
display_it();
Exemplo n.º 3
0
function cb_get_user_uploaded_photos($content, $key)
{
    global $usercontent, $pages;
    $user = $usercontent->get_current_user();
    $page = mysql_clean(get('page'));
    $limit = create_query_limit($page, config('photo_user_photos'));
    $photos = get_photos(array("limit" => $limit, "user" => $user['userid']));
    $total_rows = get_photos(array("count_only" => true, "user" => $user['userid']));
    $total_pages = count_pages($total_rows, config('photo_user_photos'));
    $pages->paginate($total_pages, $page);
    $params['file'] = 'user_photos.html';
    $params['the_title'] = name($user) . " " . lang('photos');
    $params['photos'] = $photos;
    $params['total_photos'] = $total_rows;
    $params['mode'] = 'uploaded';
    return fetch_template_file($params);
}
Exemplo n.º 4
0
    } else {
        update_record($_GET['id'], $_POST);
    }
}
if (!isset($_GET['id'])) {
    header('Location: /');
    exit;
}
$person = load_record($_GET['id']);
if (empty($person)) {
    header('Location: /');
    exit;
}
$updates = get_updates($_GET['id']);
$comments = get_comments($_GET['id']);
$photos = get_photos($_GET['id']);
$searcher = get_searcher($_GET['id']);
$title = $person['fullname'];
//$title = msg('People');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
include 'header.php';
?>
	<?php 
include_once "sidebar.php";
?>
	<div id="content">
Exemplo n.º 5
0
            $params = array("group_id" => $groups[$i]['group_id'], "group_videos" => true, "group_topics" => true, "group_members" => true);
            $indexes = $cbindex->count_index("group", $params);
            $fields = $cbindex->extract_fields("group", $params);
            $msg[] = $groups[$i]['group_id'] . ": Updating <strong><em>" . $groups[$i]['group_name'] . "</em></strong>";
            $cbindex->update_index("group", array("fields" => $fields, "values" => $indexes, "group_id" => $groups[$i]['group_id']));
        }
        $i++;
    }
    e($start_index + 1 . " - " . $to . "  groups have been reindexed successfully.", "m");
    assign("index_msgs", $msg);
    assign("indexing", "yes");
    assign('mode', 'index_gps');
}
if (isset($_GET['index_photos'])) {
    $photos = get_photos(array("active" => "yes", "limit" => $start_index . "," . $loop_size));
    $total_photos = get_photos(array("count_only" => true, "active" => "yes"));
    $percent = $cbindex->percent(50, $total_photos);
    $i = 0;
    assign('total', $total_photos);
    assign('from', $start_index + 1);
    $to = $start_index + $loop_size;
    if ($to > $total_photos) {
        $to = $total_photos;
        e($total_photos . " photos have been reindexed successfully.", "m");
        assign("stop_loop", "yes");
    }
    assign('to', $to);
    while ($i < $total_photos) {
        if ($photos[$i]['photo_id']) {
            $params = array("photo_id" => $photos[$i]['photo_id'], "favorite_count" => true, "total_comments" => true);
            $indexes = $cbindex->count_index("photos", $params);
Exemplo n.º 6
0
                coauthors_posts_links();
                ?>
</span>
						<?php 
            }
            ?>
					<?php 
        }
        ?>
				</div>
				
				<section class="post-body"> <!-- article text and images -->
				
					<!-- Grab all of the photos associated with article. -->
					<?php 
        $attachments = get_photos(get_the_ID());
        ?>
					
					<?php 
        if (isset($attachments['photos'][0]['src']['medium'])) {
            ?>
					<meta itemprop="thumbnailUrl" content="<?php 
            echo $attachments['photos'][0]['src']['medium'];
            ?>
" />
					<?php 
        }
        ?>
					
					<!--
					// Check if a feature photo exists. If there is a feature photo,
Exemplo n.º 7
0
        if ($uid != 'x') {
            $photos = get_photos(array('limit' => $sqlLimit, 'user' => $uid, 'order' => 'date_added DESC'));
            $total_photos = $u['total_photos'];
            $title = "Photos uploaded by " . $user;
        }
        break;
    case "views":
        $photos = get_photos(array('limit' => $sqlLimit, 'order' => 'views DESC'));
        $title = lang('Most Viewed Photos');
        break;
    case "rating":
        $photos = get_photos(array('limit' => $sqlLimit, 'order' => 'rating DESC, rated_by DESC'));
        $title = lang('Top Rated Photos');
        break;
    case "watching":
        $photos = get_photos(array('limit' => $sqlLimit, 'order' => 'last_viewed DESC'));
        $title = lang('Photos Being Viewed');
        break;
}
subtitle($title);
?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><?php 
echo cbtitle();
?>
</title>
        <link><?php 
echo BASEURL;
?>
</link>
Exemplo n.º 8
0
<?php

// On recherche la bille correspondant au NUM passé en paramètre
include_once 'MODELE/BILLES/get_bille.php';
include_once 'MODELE/BILLES/get_billes.php';
if (!isset($login)) {
    $login = '';
}
$bille = get_bille($sql_detail_bille, $id);
$photos = get_photos_sac($sql_photos_sac, $id);
$autres_photos = get_photos($sql_list_autres_photos, $id);
$mbc_existants = get_liste_inventaire_pour_bille($sql_liste_marque_bille_conditionnement_pour_bille, $login, $id);
//$return = ecrireLog('APP','INFO',$login);
foreach ($bille as $cle => $mabille) {
    $bille['ID_BILLES'] = htmlspecialchars($bille['ID_BILLES']);
    $bille['NOM'] = htmlspecialchars($bille['NOM']);
}
// On affiche la page (vue)
include_once 'VUE/BILLES/v_update_sac.php';
Exemplo n.º 9
0
function pd_get_category_posts($category_id)
{
    // num posts allowed to show up alongside
    // featured. depends on the current category.
    $max_secondary = 0;
    // initialize arrays
    $featured = $secondary = array();
    // if featured post on homepage is in the current category,
    // then set that one as featured.
    foreach (get_the_category(z_get_posts_in_zone('feature-feature')[0]->ID) as $category) {
        if ($category->term_id === $category_id) {
            $featured = objectToArray(z_get_posts_in_zone('feature-feature'));
        }
    }
    // loop through the featured secondary posts and see if
    // any match the current category. if they do, set them as
    // the in the secondary part of the category page.
    foreach (z_get_posts_in_zone('feature-list') as $article) {
        foreach (get_the_category($article->ID) as $category) {
            if ($category->term_id === $category_id) {
                $secondary[] = objectToArray($article);
            }
        }
    }
    // whitelisted categories that support the zoninator layout
    $whitelist = array('news', 'sports', 'opinion', 'release');
    if (!in_array(get_category($category_id)->slug, $whitelist)) {
        return false;
    }
    // if category page is news
    if (get_category_by_slug('news')->term_id === $category_id) {
        // news
        if (!$featured) {
            // if featured on homepage is not from category
            // the use the category's featured image.
            $featured = objectToArray(z_get_posts_in_zone('zone-news-feature'));
        }
        $secondary = array_merge($secondary, objectToArray(z_get_posts_in_zone('zone-news-secondary')), objectToArray(z_get_posts_in_zone('zone-news-list')));
        $max_secondary = 2;
    }
    // if category page is sports
    if (get_category_by_slug('sports')->term_id === $category_id) {
        // sports
        if (!$featured) {
            // if featured on homepage is not from category
            // the use the category's featured image.
            $featured = objectToArray(z_get_posts_in_zone('zone-sports-feature'));
        }
        $secondary = array_merge($secondary, objectToArray(z_get_posts_in_zone('zone-sports-list')));
        $max_secondary = 2;
    }
    // if category page is opinion
    if (get_category_by_slug('opinion')->term_id === $category_id) {
        // opinion
        $featured = wp_get_recent_posts(array('numberposts' => 1, 'category' => 10));
        $secondary = objectToArray(z_get_posts_in_zone('zone-opinion-list'));
        $max_secondary = 3;
    }
    // if category page is release
    if (get_category_by_slug('release')->term_id === $category_id) {
        // opinion
        if (!$featured) {
            // if featured on homepage is not from category
            // the use the category's featured image.
            $featured = objectToArray(z_get_posts_in_zone('zone-release-feature'));
        }
        $secondary = array_merge($secondary, objectToArray(z_get_posts_in_zone('zone-release-list')));
        $max_secondary = 2;
    }
    // determine the featured post in category
    $posts['feature'] = get_post($featured[0]['ID'], 'ARRAY_A');
    $posts['feature']['photos'] = get_photos($posts['feature']['ID'], 1);
    // if the featured article doesn't have a photo,
    // return false so category.php will display the
    // simple article-list layout.
    if (!$posts['feature']['photos']) {
        return false;
    }
    // since there is a photo, we'll display the featured
    // post in the dominant position. therefore, we should
    // exclude it from the article list.
    $posts['exclude'][0] = $posts['feature']['ID'];
    $posts['secondary'] = array();
    foreach ($secondary as $article) {
        // sidebar posts
        if (count($posts['secondary']) < $max_secondary) {
            $posts['secondary'][] = get_post($article['ID'], 'ARRAY_A');
            $posts['secondary'][count($posts['secondary']) - 1]['photos'] = get_photos($article['ID'], 1);
            $posts['exclude'][] = $article['ID'];
        }
    }
    return $posts;
}
Exemplo n.º 10
0
            $id = mysql_clean($_GET['delete_orphan_photo']);
            $cbphoto->delete_photo($id);
        }
        if (isset($_POST['delete_orphan_photos'])) {
            $total = count($_POST['check_photo']);
            for ($i = 0; $i < $total; $i++) {
                $cbphoto->delete_photo($_POST['check_photo'][$i], TRUE);
            }
            $eh->flush();
            e(sprintf(lang("total_photos_deleted"), $total), "m");
        }
        $photo_arr = array("user" => userid(), "limit" => $get_limit, 'order' => ' date_added DESC', "get_orphans" => TRUE);
        $collection = $cbphoto->collection->get_collections(array("user" => userid(), "type" => "photos"));
        if (get('query') != '') {
            $photo_arr['title'] = mysql_clean(get('query'));
            $photo_arr['tags'] = mysql_clean(get('query'));
        }
        $photos = get_photos($photo_arr);
        //echo $db->db_query;
        assign('photos', $photos);
        assign('c', $collection[0]);
        $photo_arr['count_only'] = true;
        $total_rows = get_photos($photo_arr);
        $total_pages = count_pages($total_rows, MAINPLIST);
        //Pagination
        $pages->paginate($total_pages, $page);
        subtitle(lang("manage_orphan_photos"));
        break;
}
template_files('manage_photos.html');
display_it();
Exemplo n.º 11
0
					</div>
					<p class="byline" itemprop="author" itemscope itemtype="http://schema.org/Person">
						<a href="<?php 
        echo get_author_posts_url(get_the_author_meta('ID'));
        ?>
" itemprop="url">More photos by <span itemprop="name"><?php 
        the_author();
        ?>
</span></a>
					</p>
				</div>
				<section itemprop="articleBody">
				
					<?php 
        // grab all of the photos to display in the right place.
        $photos = get_photos(get_the_ID(), 1);
        ?>
					
					<?php 
        $width = wp_get_attachment_image_src($post->ID, 'medium');
        $width = $width[1];
        ?>
					
					<figure id="attachment" style="width: <?php 
        echo $width;
        ?>
px;">
						<a href="<?php 
        echo wp_get_attachment_url($post->ID);
        ?>
"><?php 
Exemplo n.º 12
0
 public function get_common_variables($servicequote_id, $review_only = false)
 {
     $servicequote = $this->servicequote_model->get($servicequote_id);
     $order = $this->order_model->get_values($servicequote->order_id);
     $assignment = $this->assignment_model->get(array('diagnostic_id' => $servicequote->diagnostic_id), true);
     $assignment = $this->assignment_model->get_values($assignment->id);
     $technician = $this->user_model->get($assignment->technician_id);
     $technician_name = 'No longer on record';
     if (!empty($technician->id)) {
         $technician_name = $this->user_model->get_name($technician->id);
     }
     $unit = $this->unit_model->get_values($assignment->unit_id);
     $unit['photos'] = get_photos('assignment', null, $unit['id']);
     $diagnostic_issues = $this->diagnostic_issue_model->get(array('diagnostic_id' => $servicequote->diagnostic_id, 'can_be_fixed_now' => 0));
     $issues = array();
     foreach ($diagnostic_issues as $di) {
         $issues[] = "{$di->issue_type_name} {$di->part_type_name}";
     }
     $statuses = $this->servicequote_model->get_statuses($servicequote_id);
     $dropdowns = $this->get_dropdowns($servicequote_id);
     $feature_type = 'Custom Feature';
     $stages = array();
     $raw_stages = array_reverse($this->stages);
     array_pop($raw_stages);
     foreach ($raw_stages as $stage) {
         $page_name = str_replace('_', ' ', ucfirst($stage['url']));
         if ($this->uri->segment(4) == $stage['url']) {
             $stages[] = $page_name;
         } else {
             $stages[] = anchor(base_url() . "miniant/servicequotes/servicequote/{$stage['url']}/{$servicequote_id}/{$review_only}", $page_name);
         }
     }
     return compact('servicequote', 'order', 'assignment', 'technician', 'technician_name', 'issues', 'statuses', 'unit', 'dropdowns', 'servicequote_id', 'feature_type', 'stages');
 }
Exemplo n.º 13
0
    if ($photo && !$photo['error']) {
        $name = $photo['name'];
        $type = $photo['type'];
        $path = $photo['tmp_name'];
        $bytes = file_get_contents($path);
        add_photo($name, $type, $bytes);
        $msg = "<div class = 'alert alert-success' style = 'width: 265px;'>New photo has been uploaded.</div>";
        echo "<script>";
        //go back to viewPhotos page after 3 seconds.
        echo "setTimeout(function(){ document.location = '?p=viewAdmin'; }, 2000);";
        echo "</script>";
    } else {
        $msg = "<div class = 'alert alert-warning' style = 'width: 265px;'>Invalid File!</div>";
    }
}
$photos = get_photos();
?>

<html>
<body>
	<div class="container">
	  <div class="row col-md-4">
	   <div class="box">
			<form method="post" enctype="multipart/form-data">
				<div class="form-group">
					<input type="file" name="photo" />
				</div>
				<div class="form-group">
					<button class="btn" name="upload">Upload</button>
				</div>
			</form>
    function content_56afd77ab2a977_56293857($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/html/includes/smartyv3/plugins/modifier.truncate.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/var/www/html/includes/smartyv3/plugins/modifier.date_format.php';
        }
        ?>
<div class="heading">
    <h2>ClipBucket V2.7 Dashboard</h2>
</div>
<div class="row">
    <div class="col-md-6">
        <div class="tabbable">
            <ul class="nav nav-tabs" id="myTab">
                <li class="active">
                    <a data-toggle="tab" href="#statistics">
                        <h5>Statistics</h5>
                    </a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#nusers">
                        <h5>New Users</h5>
                    </a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#mvideos">
                        <h5>Most Viewed Videos</h5>
                    </a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#fobjects">
                        <h5>Flagged Objects</h5>
                    </a>
                </li>
            </ul>
            <div class="tab-content">
                <div id="statistics" class="tab-pane active">
                    <div class="tabbable tabs-left">
                        <ul class="nav nav-tabs" id="myTab1">
                            <li class="active">
                                <a data-toggle="tab" href="#sweek">
                                    This Week
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#smonth">
                                    This Month
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#soday">
                                    Today
                                </a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div id="sweek" class="tab-pane active">
                                <div id="weekly_stats" class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="smonth" class="tab-pane">
                                <div id="monthly_stats"  class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="soday" class="tab-pane">
                                <div id="daily_stats" class="flot_chart1">
                                    <img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="nusers" class="tab-pane">
                    <div class="tabbable tabs-left">
                        <ul class="nav nav-tabs" id="myTab1">
                            <li class="active">
                                <a data-toggle="tab" href="#uweek">
                                    This Week
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#umonth">
                                    This Month
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#utoday">
                                    Today
                                </a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div id="uweek" class="tab-pane active">
                                <div id="weekly_users" class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="umonth" class="tab-pane">
                                <div id="monthly_users"  class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="utoday" class="tab-pane">
                                <div id="daily_users" class="flot_chart1">
                                    <img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>


                        </div>
                        <div class="users marginTopLarge">
                            <?php 
        if ($_smarty_tpl->tpl_vars['users']->value) {
            ?>
                                <?php 
            $_smarty_tpl->tpl_vars['u'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['u']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['users']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['u']->key => $_smarty_tpl->tpl_vars['u']->value) {
                $_smarty_tpl->tpl_vars['u']->_loop = true;
                ?>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="row marginBottom">
                                            <div class="col-md-2">
                                                <a href="view_user.php?uid=<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                ?>
"> <img src="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb($_smarty_tpl->tpl_vars['u']->value, 'small');
                ?>
" class="img-thumbnail oneUserImage" />
                                                </a>
                                            </div>
                                            <div class="col-md-10">
                                                <a href="view_user.php?uid=<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                ?>
" target="_blank"><?php 
                echo $_smarty_tpl->tpl_vars['u']->value['username'];
                ?>
        </a>(<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['email'];
                ?>
)
                                                <button id="dropdownMenu1" class="btn btn-primary btn-xs dropdown-toggle pull-right" data-toggle="dropdown">
                                                    <i class="glyphicon glyphicon-cog"></i><i class="icon-angle-down icon-on-right"></i>
                                                </button>
                                                <ul class="dropdown-menu pull-right" aria-labelledby="dropdownMenu1" role="menu">
                                                    <?php 
                if ($_smarty_tpl->tpl_vars['u']->value['ban_status'] == 'yes') {
                    ?>
                                                    <li><a role="menuitem" tabindex="-1" href="?unban=<?php 
                    echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                    ?>
">Unban Member</a></li>
                                                    <?php 
                }
                ?>
                                                    <?php 
                if ($_smarty_tpl->tpl_vars['u']->value['ban_status'] == 'no') {
                    ?>
                                                    <li><a role="menuitem" tabindex="-1" href="?ban=<?php 
                    echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                    ?>
">Ban Member</a></li>
                                                    <?php 
                }
                ?>
                                                    <li><a role="menuitem" tabindex="-1" href="view_user.php?uid=<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                ?>
">Edit</a></li>
                                                    <li><a role="menuitem" tabindex="-1" href="members.php?deleteuser=<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                ?>
">Delete</a></li>
                                                </ul>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php 
            }
            ?>
                                <?php 
        }
        ?>
                        </div>
                    </div>
                </div>
                <div id="mvideos" class="tab-pane">
                    <div class="tabbable tabs-left">
                        <ul class="nav nav-tabs" id="myTab1">
                            <li class="active">
                                <a data-toggle="tab" href="#vweek">
                                    This Week
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#vmonth">
                                    This Month
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#vtoday">
                                    Today
                                </a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div id="vweek" class="tab-pane active">
                                <div id="weekly_users" class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="vmonth" class="tab-pane">
                                <div id="monthly_users"  class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="vtoday" class="tab-pane">
                                <div id="daily_users" class="flot_chart1">
                                    <img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                        </div>
                    </div>
                    <div class="vids marginTopLarge">
                        <?php 
        if ($_smarty_tpl->tpl_vars['videos']->value) {
            ?>
                        <?php 
            $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
                $_smarty_tpl->tpl_vars['video']->_loop = true;
                ?>
                        <div class="row">
                            <div class="col-md-3">
                                <img src="<?php 
                echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video']->value), $_smarty_tpl);
                ?>
" height="80" class="img-thumbnail" id="thumbs_<?php 
                echo $_smarty_tpl->tpl_vars['video']->value['videoid'];
                ?>
" title="<?php 
                echo $_smarty_tpl->tpl_vars['video']->value['title'];
                ?>
"/>
                            </div>
                            <div class="col-md-9">
                                <a href="<?php 
                echo $_smarty_tpl->tpl_vars['baseurl']->value;
                ?>
/watch_video.php?v=<?php 
                echo $_smarty_tpl->tpl_vars['video']->value['videokey'];
                ?>
"target="_blank">
                                    <?php 
                echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video']->value['title'], 45);
                ?>
 </a>
                                <strong class="btn btn-primary btn-xs pull-right"> <?php 
                echo smarty_lang(array('code' => 'views'), $_smarty_tpl);
                ?>
 : <?php 
                echo format_number($_smarty_tpl->tpl_vars['video']->value['views']);
                ?>
</strong>
                            </div>
                        </div>
                        <hr>
                        <?php 
            }
            ?>
                        <?php 
        }
        ?>
                    </div>
                </div>
                <div id="fobjects" class="tab-pane">
                    <div class="tabbable tabs-left">
                        <ul class="nav nav-tabs" id="myTab1">
                            <li class="active">
                                <a data-toggle="tab" href="#fweek">
                                    This Week
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#fmonth">
                                    This Month
                                </a>
                            </li>
                            <li class="">
                                <a data-toggle="tab" href="#ftoday">
                                    Today
                                </a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div id="fweek" class="tab-pane active">
                                <div id="weekly_users" class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="fmonth" class="tab-pane">
                                <div id="monthly_users"  class="flot_chart1"><img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                            <div id="ftoday" class="tab-pane">
                                <div id="daily_users" class="flot_chart1">
                                    <img class="loading-image" src="./styles/cb_2014/images/ajax-loader.gif"/></div>
                            </div>
                        </div>
                    </div>
                    <div class="flaggedUser marginTopLarge">
                        <?php 
        if ($_smarty_tpl->tpl_vars['flaggedUsers']->value) {
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars['u'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['u']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['flaggedUsers']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['u']->key => $_smarty_tpl->tpl_vars['u']->value) {
                $_smarty_tpl->tpl_vars['u']->_loop = true;
                ?>
                            <div class="row">
                                <div class="col-md-3">
                                    <a href="view_user.php?uid=<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['userid'];
                ?>
"> <img src="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb($_smarty_tpl->tpl_vars['u']->value, 'small');
                ?>
" class="oneUserImage" width="85" />
                                    </a>
                                </div>
                                <div class="col-md-6">
                                    (<?php 
                echo $_smarty_tpl->tpl_vars['u']->value['email'];
                ?>
) <?php 
                echo $_smarty_tpl->tpl_vars['u']->value['username'];
                ?>

                                </div>

                                <div class="col-md-7">
                                    <label class="label label-danger">Last Active  <?php 
                echo niceTime($_smarty_tpl->tpl_vars['u']->value['last_active']);
                ?>
</label>
                                    <label class="label label-primary"> <?php 
                echo smarty_lang(array('code' => 'Flags'), $_smarty_tpl);
                ?>
 : <?php 
                echo $_smarty_tpl->tpl_vars['u']->value['flag_type'];
                ?>
</label>

                                </div>
                            </div>
                            <?php 
            }
            ?>
                        <?php 
        }
        ?>
                    </div>
                </div>
           
                <div class="widget-main">
                    <hr>
                    <table class="table table-stripped table-bordered">
                        <tr>
                            <td>
                                <div class="stats_subitem_d">Total Videos : <strong><?php 
        ob_start();
        echo get_videos(array('count_only' => 'yes'), $_smarty_tpl);
        echo number_format(ob_get_clean());
        ?>
</strong> </div>
                            </td>
                            <td>
                                <div class="stats_subitem_d">Total Groups : <strong><?php 
        echo get_groups(array('count_only' => 'yes'), $_smarty_tpl);
        ?>
</strong> </div>
                            </td>
                            <td>
                                <div class="stats_subitem_d">Total Collection : <strong><?php 
        echo get_collections(array('count_only' => 'yes'), $_smarty_tpl);
        ?>
</strong> </div>
                            </td>
                            <td>
                                <div class="stats_subitem_d">Total Users : <strong><?php 
        echo get_users(array('count_only' => 'yes'), $_smarty_tpl);
        ?>
</strong> </div>
                            </td>
                            <td>
                                <div class="stats_subitem_d">Total Photos: <strong><?php 
        echo get_photos(array('count_only' => 'yes'), $_smarty_tpl);
        ?>
</strong> </div>
                            </td>
                    </table>
                </div>

            </div>
        </div>
    </div>

    <div class="col-md-6">
        <div class="widget-box">
            <div class="widget-header header-color-red">
                <h5><i class="glyphicon glyphicon-book"></i>ClipBucket News</h5>
                <div class="widget-toolbar">
                    <a href="#" data-action="collapse">
                        <i class="icon-chevron-down"></i>
                    </a>
                    <a href="#" data-action="close">
                        <i class="icon-remove"></i>
                    </a>
                </div>
            </div>
            <div class="widget-body">
                <div id="clipbucket_news" class="widget-main" style="height:419px;overflow:auto">
                    
                </div>
            </div>
        </div>
    </div>

    <hr>
   <!--  <div class="tabbable tabs-left" > -->
    <div class=" col-md-8 todotab" >
   
        <ul class="nav nav-tabs" id="myTab" >
            <li class="active">
                <a data-toggle="tab" href="#todolist">
                    <h5><i class="glyphicon glyphicon-list-alt"></i> ToDo List</h5>
                </a>
            </li>
            <li class="">
                <a data-toggle="tab" href="#pnotes">
                    <h5><i class="glyphicon glyphicon-pencil"></i> Personal Notes</h5>
                </a>
            </li>
            <li class="">
                <a data-toggle="tab" href="#rcomments">
                    <h5><i class="glyphicon glyphicon-comment"></i> Recent Comments</h5>
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div id="todolist" class="tab-pane active">
                <div class="widgetBox">
                    <div class="addTodo paddingRightSmall paddingLeftLarge marginBottomLarge">
                        <div class="row">
                            <div class="from-group col-md-10">
                                <input type="text" name="addTodo" class="form-control">
                            </div>
                            <div class="from-group  relative">
                                <div class="addTodoButton">
                                    <button id="addTodo" class="btn btn-primary btn-sm">Add</button>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <?php 
        if (isset($_smarty_tpl->tpl_vars['todos'])) {
            $_smarty_tpl->tpl_vars['todos'] = clone $_smarty_tpl->tpl_vars['todos'];
            $_smarty_tpl->tpl_vars['todos']->value = $_smarty_tpl->tpl_vars['myquery']->value->get_todos();
            $_smarty_tpl->tpl_vars['todos']->nocache = null;
            $_smarty_tpl->tpl_vars['todos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['todos'] = new Smarty_variable($_smarty_tpl->tpl_vars['myquery']->value->get_todos(), null, 0);
        }
        ?>
                    <ul class="row todosList" id="note-<?php 
        echo $_smarty_tpl->tpl_vars['the_note']->value['note_id'];
        ?>
" >
                        <?php 
        $_smarty_tpl->tpl_vars['note'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['note']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['todos']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['note']->key => $_smarty_tpl->tpl_vars['note']->value) {
            $_smarty_tpl->tpl_vars['note']->_loop = true;
            ?>
                            <li class="col-md-12">
                                <div class="col-md-12">
                                    <p class="oneTodo paddingLeftSmall col-md-10" id="<?php 
            echo $_smarty_tpl->tpl_vars['note']->value['todo_id'];
            ?>
">
                                        <?php 
            echo $_smarty_tpl->tpl_vars['note']->value['todo'];
            ?>

                                    </p>
                                    <a href="#" class="btn btn-danger btn-xs delete">Delete</a>
                                </div>
                            </li>
                        <?php 
        }
        ?>
                        </ul>
                </div>
            </div>
            <div id="pnotes" class="tab-pane">
                    <div class="widgetBox">
                        <div class="addNote form-group paddingRightSmall">
                            <textarea class="form-control" name="ntoe" id="note"></textarea>
                            <div class="alignRight marginTopSmall">
                                <a href="#" id="add_new_note" class="btn btn-primary btn-xs">Add a note</a>
                            </div>
                        </div>
                        <?php 
        if (isset($_smarty_tpl->tpl_vars['notes'])) {
            $_smarty_tpl->tpl_vars['notes'] = clone $_smarty_tpl->tpl_vars['notes'];
            $_smarty_tpl->tpl_vars['notes']->value = $_smarty_tpl->tpl_vars['myquery']->value->get_notes();
            $_smarty_tpl->tpl_vars['notes']->nocache = null;
            $_smarty_tpl->tpl_vars['notes']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['notes'] = new Smarty_variable($_smarty_tpl->tpl_vars['myquery']->value->get_notes(), null, 0);
        }
        ?>
                        <ul class="notesList row paddingRightSmall" id="note-<?php 
        echo $_smarty_tpl->tpl_vars['the_note']->value['note_id'];
        ?>
" >
                            <?php 
        $_smarty_tpl->tpl_vars['note'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['note']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['notes']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['note']->key => $_smarty_tpl->tpl_vars['note']->value) {
            $_smarty_tpl->tpl_vars['note']->_loop = true;
            ?>
                                <li class="col-md-4">
                                    <div class="">
                                        <p class="oneNote" id="<?php 
            echo $_smarty_tpl->tpl_vars['note']->value['note_id'];
            ?>
">
                                        <?php 
            echo $_smarty_tpl->tpl_vars['note']->value['note'];
            ?>

                                        <a href="#" class="delete">×</a>
                                    </p>
                                    </div>
                                </li>
                            <?php 
        }
        ?>
                        </ul>
                    </div>

            </div>
            <div id="rcomments" class="tab-pane">
                <div class="widget-box">
                    <div class="widget-header header-color-blue">
                        <h5>Recent Comments</h5>
                        <div class="widget-toolbar">
                            <a href="#" data-action="collapse">
                                <i class="icon-chevron-down"></i>
                            </a>
                            <a href="#" data-action="close">
                                <i class="icon-remove"></i>
                            </a>
                        </div>
                    </div>
                    <div class="widget-body">
                        <div class="widget-main">
                            <div class="widget-box transparent">
                                <div class="widget-header widget-header-small">
                                </div>
                                <div class="widget-body">
                                    <div class="widget-body">
                                        <div class="widget-main no-padding">
                                            <div class="slimScrollDiv">
                                                <?php 
        if ($_smarty_tpl->tpl_vars['comments']->value) {
            ?>
                                                <?php 
            $_smarty_tpl->tpl_vars['comment'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['comment']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['comments']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['comment']->key => $_smarty_tpl->tpl_vars['comment']->value) {
                $_smarty_tpl->tpl_vars['comment']->_loop = true;
                ?>
                                                <div class="itemdiv dialogdiv">
                                                    <?php 
                $_smarty_tpl->tpl_vars['u'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['u']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['users']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['u']->key => $_smarty_tpl->tpl_vars['u']->value) {
                    $_smarty_tpl->tpl_vars['u']->_loop = true;
                    ?>
                                                    <div class="user">
                                                        <img alt="Alexa's Avatar" src="<?php 
                    echo $_smarty_tpl->tpl_vars['userquery']->value->getUserThumb($_smarty_tpl->tpl_vars['u']->value, 'small');
                    ?>
">
                                                    </div>
                                                    <?php 
                }
                ?>
                                                    <div class="body">
                                                        <div class="time">
                                                            <i class="icon-time"></i>
                                                            <span class="green"><?php 
                echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['comment']->value['date_added']);
                ?>
</span>
                                                        </div>
                                                        <div class="name">
                                                            <a href="#"><?php 
                echo $_smarty_tpl->tpl_vars['comment']->value['anonym_name'];
                ?>
</a>
                                                        </div>
                                                        <div class="text"><?php 
                echo $_smarty_tpl->tpl_vars['comment']->value['comment'];
                ?>
</div>
                                                        <div class="tools">
                                                            <a href="#" class="btn btn-minier btn-info">
                                                                <i class="icon-only icon-share-alt"></i>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>
                                                <?php 
            }
            ?>
                                                <?php 
        }
        ?>
                                            </div>
                                        </div>/widget-main
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>







<div class="well" style="margin-top: 14px;background:;border:1px solid rgba(128, 213, 255, 1);" >
    <h3>WHO WE ARE</h3>
    <p style="text-align:left;"><strong><a href="http://clip-bucket.com/" target="self">ClipBucket</a></strong> would not been possible without its team hardwork and determination for the betterment of the products quality and its services. We are proud that over _____ users are using worlds most popular open source video,audio and photo sharing script named
    <strong>ClipBucket</strong>. We are team who is  determined to deliver the best  features to the open source community.
    </p>


    <p style="text-align:left;margin-top:20px; "><strong>Clipbucket</strong> was made in the year 2006 with the idea to bring a better platform for organizations and companies interested in launching their own video,audio or photo sharing website. In every version our mission and goal is to simplify the technology by adopting new technological methods and techniques to cut down several frontend and backend issues faced. The idea is to give the user a chance to explore more with the flexibility of our product.



     We never compromise on our product interactivity. We always try to create a simple yet interactive and elegant design so that the user can have the best experience of the functions. With the improved social networking options like channels and groups. With ClipBucket’s unmatched quantifiability, users will stretch their applications from family videos to photo-albums. We started off as a paid product and later realized there is more power in going open-source and here we stand today <strong>#1</strong> video sharing and media management script in the industry.</p>

    <h3>OUR TEAM</h3>

    <p style="text-align:left;padding-bottom:20px;">However the team behind ClipBucket always kept their heads and nerves, though they faced many difficulties and problems in meeting the requirements. But team’s coordination and their creative techniques of solving issues and overcoming them with the best possible solution helped us in presenting  Pakistan on international platform in the field of technology by bringing “Clip Bucket” A complete open source multimedia management script.
    </p>

    <div class="to_display">
        <p>Founders <strong><a href="http://www.linkedin.com/profile/view?id=273050157" target="blank">Jahanzeb Hassan</a></strong> and <strong><a href="http://www.linkedin.com/profile/view?id=37419812" target="blank">Arslan Hassan</a></strong></p>

         <strong><a href="http://www.linkedin.com/profile/view?id=324544384" target="self">Fawaz Tahir</a></strong> - Web Application Team Lead<br>
         <strong><a href="http://www.linkedin.com/profile/view?id=78646794" target="self">Ruman Malik</a></strong> - Project Manager<br>
         <strong><a href="http://www.linkedin.com/profile/view?id=325944697" target="self">Muneeb</a></strong> - Mobile Application Team Lead<br>
         <strong><a href="http://www.linkedin.com/profile/view?id=324542682" target="self">Zomail</a></strong> - Sales and Support<br>
         <strong><a href="http://www.linkedin.com/profile/view?id=324542554" target="self">Shahzaib</a></strong> - Network Engineer<br>
         <strong><a href="http://www.linkedin.com/profile/view?id=324542025" target="self">Zunair</a></strong> - SEO and Publishing Manager<br>
        <br>

        <h5><strong>Kick-ass development team of <strong>ClipBucket</strong></strong></h5>
        <strong><a href="https://github.com/fahad-cb" target="self">Fahad Abbas</a></strong> - Project Head (Developer)<br>
         <strong><a href="https://github.com/imranhassan009" target="self">Imran Hassan</a></strong> - Web Developer<br>
         <strong><a href="https://github.com/shoaib-dev" target="self">Muhammad Shoaib</a></strong> - Web Services provider (Developer)<br>
         <strong><a href="https://github.com/awaistariq123" target="self">Awais Tariq</a></strong> - Video Converison Handler<br>
         <strong><a href="https://pk.linkedin.com/in/saqirzzq" target="self">Saaqib Razzaq</a></strong> - Web Developer<br>
         <strong><a href="https://github.com/jamilrehman" target="self">Jamil Rehman</a></strong> - Front end  Developer (Head)<br>
         <strong><a href="https://github.com/rameez-anees" target="self">Rameez Anees</a></strong> - Front end  Developer<br>
         <strong><a href="https://github.com/usman-des" target="self">Usman Afzal</a></strong> - Front end  Developer<br>
         <strong><a href="https://github.com/epicPenguin" target="self">Muhammad Rizwan</a></strong> - Quality Assurance department<br><br><br>


         <h5><strong>We are from Pakistan with high heads and soft hearts</strong></h5>

        <p style="padding-bottom:20px;">Pakistan is always been in the news for the bad reasons and has been criticized by the rest of the world,even then the people of Pakistan are patriotic and stand united for the goodwill of their country.no matter how worst the situation gets the youth is eager enough to bring out the best in all the fields like media,communication, IT and science. IT industry is fast growing with a large potential and is regarded as a successful sector even in country’s worst financial crisis. as the IT industry in Pakistan is growing like wise the demand for the softwares and programmes has taken up a rapid growth. ClipBucket is one of the fastest and the most used media sharing script with all the latest features and enhancements in the social media. We as Pakistani feel proud on creating this product which will lead our country to the highest levels in the international market.</p>
    </div>

    <p><button id="addTodo" class="btn btn-primary btn-sm clip_read clip_hide" style="float:right;margin-right:10px;margin-top:-30px;">Read More</button></p>
</div>




<style type="text/css">

.to_display{

   display: none; 
}
    .flot_chart1{
        height: 200px;
        width: 400px;
    }
    .vids{
        height: 250px;
        overflow-y: scroll;
        overflow-x: hidden;
        padding: 5px;
    }
</style>






<script type="text/javascript">
$( document ).ready(function() {

    $(".clip_read").click(function() {

        $(this).toggleClass('clip_hide');


        if(!$(this).hasClass('clip_hide')) 
           
           {
            $('.to_display').show();
            $(".clip_read").text("Hide");
           }
        
        else
           {
            $('.to_display').hide();
            $(".clip_read").text("Read More");
           }     
    });

var baseurl="<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
";

$.ajax({
                   // url: baseurl+'/ajax.php',

                   url:baseurl+'/ajax.php',
                    type: "POST",
                    dataType : 'text',
                    data: { mode: "get_news"},
                    success : function(news){ $('#clipbucket_news').html(news) },
                    timeout : 5000,
                    error  :  function(err) { $('#clipbucket_news').html(' <div align="center"><em><strong>Connect with Internet to get News</strong></em></div>')},


                });

 
});





  $(function() {


        var options = {

            series: {
                bars: {
                    show: true,
                    steps: true,
                    barWidth: 0.5,
                    align: "center",
                },
                points: { show: true },
                lines: { show: true }
            },
            xaxis: {
                mode: "categories",
                tickLength: 0
            },
            yaxis: {
                alignTicksWithAxis: false
            },
            grid: {
                hoverable: true, 
                clickable: true,
                labelMargin: 30,
                borderWidth: 0
            }
        };


        var ChartsWorker = function(options){
            this.options = options;

       


            this.getUsersStatistics = function(callback){
                var self = this;
                var ajaxCall = $.ajax({
                    url: "charts/reports/dashboard/get_users_data.php",
                    type: "POST",
                    data:"videos=videos",
                    dataType: "json",
                    success: function(data){
                        callback.call(self, data);
                    },
                    error: function() {
                        //alert('error');
                    },
                });
            };

            this.getVideosStatistics = function(callback){
                var self = this;
                var ajaxCall = $.ajax({
                    url: "charts/reports/dashboard/get_videos_data.php",
                    type: "POST",
                    data:"videos=videos",
                    dataType: "json",
                    success: function(data){
                        callback.call(self, data);
                    },
                    error: function() {
                        //alert('error');
                    },
                });
            };

            this.getFlaggedStatistics = function(callback){
                var self = this;
                var ajaxCall = $.ajax({
                    url: "charts/reports/dashboard/get_flagged_objects_data.php",
                    type: "POST",
                    data:"videos=videos",
                    dataType: "json",
                    success: function(data){
                        callback.call(self, data);
                    },
                    error: function() {
                        //alert('error');
                    },
                });
            };

            this.getOverallStatistics = function(callback){
                var self = this;
                var ajaxCall = $.ajax({
                    url: "charts/reports/dashboard/get_total_status_data.php",
                    type: "POST",
                    data:"videos=videos",
                    dataType: "json",
                    success: function(data){
                        callback.call(self, data);
                    },
                    error: function() {
                        //alert('error');
                    },
                });
            };

        };


        var chartsWorker = new ChartsWorker(options);

        chartsWorker.getUsersStatistics(function(data){
            var today = data.today;
            var week = data.this_week;
            var month = data.this_month;
            $.plot("#nusers #weekly_users", [week] , this.options);
            $.plot("#nusers #monthly_users", [month] , this.options);
            $.plot("#nusers #daily_users", [today], this.options);
        });

        chartsWorker.getVideosStatistics(function(data){
            var today = data.today;
            var week = data.this_week;
            var month = data.this_month;
            $.plot("#mvideos #weekly_users", [week] , this.options);
            $.plot("#mvideos #monthly_users", [month] , this.options);
            $.plot("#mvideos #daily_users", [today], this.options);
        });

        chartsWorker.getFlaggedStatistics(function(data){
            var today = data.today;
            var week = data.this_week;
            var month = data.this_month;
            $.plot("#fobjects #weekly_users", [week] , this.options);
            $.plot("#fobjects #monthly_users", [month] , this.options);
            $.plot("#fobjects #daily_users", [today], this.options);
        });

        chartsWorker.getOverallStatistics(function(data){
            var today = data.today;
            var week = data.this_week;
            var month = data.this_month;
            $.plot("#statistics #weekly_stats", [week] , this.options);
            $.plot("#statistics #monthly_stats", [month] , this.options);
            $.plot("#statistics #daily_stats", [today], this.options);
        });

        // $.plot("#placeholder", data, options);

        var iteration = 0;

        function showTooltip(x, y, contents) {
            $('<div id="tooltip">' + contents + '</div>').css( {
                position: 'absolute',
                display: 'none',
                top: y + 5,
                left: x + 5,
                border: '1px solid #fdd',
                padding: '2px',
                'background-color': '#fee',
                opacity: 0.80
            }).appendTo("body").fadeIn(200);
        }

        var previousPoint = null;
        function tooltip(chart_id,tooltip_id){

            $(chart_id).bind("plothover", function (event, pos, item) {
                $("#x").text(pos.x.toFixed(2));
                $("#y").text(pos.y.toFixed(2));

                if ($(tooltip_id).is(':checked')) {
                    if (item) {
                        if (previousPoint != item.dataIndex) {
                            previousPoint = item.dataIndex;

                            $("#tooltip").remove();
                            var x = item.datapoint[0].toFixed(2),
                                    y = item.datapoint[1].toFixed(2);

                            showTooltip(item.pageX, item.pageY,
                                    item.series.label + " = " + y);
                        }
                    }
                    else {
                        $("#tooltip").remove();
                        previousPoint = null;
                    }
                }
            });
        }

        var page = '<?php 
        echo $_smarty_tpl->tpl_vars['baseurl']->value;
        ?>
/admin_area/index.php';

        $(".oneNote .delete").on({
            click: function(e){
                e.preventDefault();
                var noteId = $(this).parent().attr("id");
                delete_note(noteId);
                $(this).parents("li").remove();
            }
        });

        $("#add_new_note").on({
            click: function(e){
                e.preventDefault();
                var self = this;
                var note = $(this).parents(".widgetBox").find("textarea").val();
                if(!note){
                    alert("Please enter something");
                }
                else{
                    $(this).parents(".widgetBox").find("textarea").val("");
                    $.post(page, {   
                        mode : 'add_note',
                        note : note,
                    },function(data) {
                        console.log(data);
                        var li = document.createElement("li");
                        li.className = "col-md-4";
                        var a = document.createElement("a");
                        a.className = "delete";
                        a.href = "#";
                        a.innerHTML = "x";
                        var p = document.createElement("p");
                        p.id = data.id;
                        p.innerHTML = note;
                        p.className = "oneNote";
                        $(p).append(a);
                        $(li).append(p);
                        $(a).on({
                            click: function(e){
                                e.preventDefault();
                                var noteId = $(this).parent().attr("id");
                                delete_note(noteId);
                                $(this).parents("li").remove();
                            }
                        });
                        $(self).parents(".widgetBox").find("ul").prepend(li);
                    },'json');
                }
            }
        });

        $("#addTodo").on({
            click: function(e){
                e.preventDefault();
                var self = this;
                var newVal = $(this).parents(".addTodo").find("input").val();
                if(newVal.length){
                $(this).parents(".addTodo").find("input").val("");
                var ajaxCall = $.ajax({
                    url: page,
                    type: "post",
                    data: {
                        val: newVal,
                        mode: "add_todo",
                    },
                });
                ajaxCall.success(function(data){
                    data = $.parseJSON(data);
                    var li = document.createElement("li");
                    li.className = "col-md-12";
                    var p = document.createElement("p");
                    p.className = "oneTodo paddingLeftSmall col-md-10";
                    p.id = data.id;
                    p.innerHTML = data.todo;
                    var a = document.createElement("a");
                    a.href = "#";
                    a.className = "col-md-2 btn btn-danger btn-xs delete";
                    a.innerHTML = "Delete";
                    $(a).on("click", function(e){
                        e.preventDefault();
                        var self = this;
                        var id = $(this).prev().attr("id");
                        var ajaxCall = $.ajax({
                            url: page,
                            type: "post",
                            data: {
                                id: id,
                                mode: "delete_todo",
                            },
                        });
                        ajaxCall.success(function(data){
                            $(self).parents("li").remove();
                        });

                    });
                    var div = document.createElement("div");
                    div.className = "col-md-12";

                    $(li).append(div).find("div").append(p).append(a);
                    $(self).parents(".widgetBox").find("ul").prepend(li);
                });
                }else{
                alert("Please enter a valid value");
                }
            }
        });
        
        $("#todolist .delete").on("click", function(e){
            e.preventDefault();
            var self = this;
            var id = $(this).prev().attr("id");
            var ajaxCall = $.ajax({
                url: page,
                type: "post",
                data: {
                    id: id,
                    mode: "delete_todo",
                },
            });
            ajaxCall.success(function(data){
                $(self).parents("li").remove();
            });

        });
    });

</script>



<?php 
    }
Exemplo n.º 15
0
    $Cbucket->show_page = false;
}
//Getting Collection Lists
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, COLLPP);
$clist = $cond;
$clist['active'] = "yes";
$clist['limit'] = $get_limit;
$collections = $cbcollection->get_collections($clist);
Assign('collections', $collections);
//Getting Photo List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, MAINPLIST);
$clist = $cond;
$clist['limit'] = $get_limit;
$clist['order'] = " last_viewed DESC";
$photos = get_photos($clist);
Assign('photos', $photos);
/* CREATING LIMIT1 */
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, RESULTS);
$carray['limit'] = $get_limit;
if (!empty($carray['order'])) {
    $carray['order'] = $carray['order'] . " DESC";
} else {
    $carray['order'] = "DESC";
}
$collections = $cbcollection->get_collections($carray);
assign('c', $collections);
template_files('view_item.html');
display_it();
Exemplo n.º 16
0
             $cond['order'] = " total_favorites DESC";
             break;
         case "most_commented":
             $cond['order'] = " total_comments DESC";
             break;
         case "highest_rated":
             $cond['order'] = " rating DESC, rated_by DESC";
             break;
         case "most_viewed":
             $cond['order'] = " views DESC";
             break;
         case "most_downloaded":
             $cond['order'] = " downloaded DESC";
             break;
     }
     $photos = get_photos($cond);
     if ($photos) {
         foreach ($photos as $photo) {
             assign("photo", $photo);
             $cond['photoBlocks'] .= Fetch("/blocks/photo.html");
         }
         $cond['completed'] = "successfull";
     } else {
         $cond['failed'] = "successfully";
     }
     echo json_encode($cond);
     break;
     /**
      * Getting comments along with template
      */
 /**
Exemplo n.º 17
0
            if ($delete) {
                header('Location: ?section=photos&action=album_list&del=ok');
            }
        }
    } else {
        log_write('Не удалось удалить альбом: не достаточно прав', '0', '1');
        print_error('Не достаточно прав для выполнения действия.');
    }
}
if ($_GET['del'] == 'ok') {
    $message = "Альбом удален";
}
// выводим список фотографий
if ($_GET['action'] == 'list') {
    $limit = "12";
    $photo_list = get_photos($limit);
    $tpl = "photos_list_tpl.php";
}
// просмотр содержимого альбома (фотографий)
if ($_GET['action'] == 'album_view' && isset($_GET['id']) && empty($error)) {
    $limit = "12";
    $photo_list = get_album_photos($_GET['id'], $limit);
    $tpl = "photos_album_view_tpl.php";
}
// Просмотр фотографии
if ($_GET['action'] == 'view' && empty($error)) {
    $view_photo = get_photo($_GET['id']);
    $tpl = "photos_view_tpl.php";
}
// добавление или изменение фотографии
if (($_GET['action'] == 'add' || $_GET['action'] == 'edit') && empty($error)) {
Exemplo n.º 18
0
<?php 
} elseif (is_page()) {
    ?>
	<meta property="og:url" content="<?php 
    echo get_permalink();
    ?>
" />
	<meta property="og:type" content="article" />
	<?php 
    $description = htmlspecialchars(strip_tags(get_the_excerpt()));
    if (!$description) {
        $description = htmlspecialchars(get_custom_excerpt($post->post_content, '25'));
    }
    ?>
	<?php 
    $photos = get_photos(get_the_ID());
    if ($photos) {
        ?>
		<?php 
        foreach ($photos['photos'] as $photo) {
            ?>
			<meta property="og:image" content="<?php 
            echo $photo['src']['large'];
            ?>
" />
		<?php 
        }
        ?>
	<?php 
    } else {
        ?>
Exemplo n.º 19
0
$u = $u ? $u : $_GET['uid'];
$u = $u ? $u : $_GET['u'];
$user = $userquery->get_user_details($u);
$page = mysql_clean($_GET['page']);
if ($user) {
    assign('u', $user);
    assign('p', $userquery->get_user_profile($udetails['userid']));
    $mode = $_GET['mode'];
    switch ($mode) {
        case "photos":
        case "uploaded":
        default:
            $limit = create_query_limit($page, config('photo_user_photos'));
            assign("the_title", $user['username'] . " " . lang('photos'));
            $photos = get_photos(array("limit" => $limit, "user" => $user['userid']));
            $total_rows = get_photos(array("count_only" => true, "user" => $user['userid']));
            $total_pages = count_pages($total_rows, config('photo_user_photos'));
            break;
        case "favorites":
        case "fav_photos":
        case "favorite":
            $limit = create_query_limit($page, config('photo_user_favorites'));
            assign("the_title", $user['username'] . " " . lang('Favorite') . " " . lang('photos'));
            $favP = array("user" => $user['userid'], "limit", $limit);
            $photos = $cbphoto->action->get_favorites($favP);
            $favP['count_only'] = true;
            $total_rows = $cbphoto->action->get_favorites($favP);
            $total_pages = count_pages($total_rows, config('photo_user_favorites'));
            break;
    }
    assign('photos', $photos);
Exemplo n.º 20
0
 public function export_documents($format = 'pdf', $invoice_tenancy_id, $order_id)
 {
     ob_end_clean();
     $this->load->model('signature_model');
     $this->load->model('miniant/abbreviation_model');
     $this->load->model('miniant/invoice_tenancy_abbreviation_model');
     $invoice_tenancy = $this->invoice_tenancy_model->get($invoice_tenancy_id);
     $signature = $this->signature_model->get($invoice_tenancy->signature_id);
     $signature_image = $this->signature_model->get_image($invoice_tenancy->signature_id);
     $invoice = $this->invoice_model->get($invoice_tenancy->invoice_id);
     $order = (object) $this->order_model->get_values($invoice->order_id);
     $tenancy = $this->tenancy_model->get($invoice_tenancy->tenancy_id);
     $order->job_site_address = $this->address_model->get_formatted_address($order->site_address_id);
     $abbreviations = $this->abbreviation_model->get_dropdown('description', false);
     $invoice_tenancy_abbreviations = $this->invoice_tenancy_abbreviation_model->get(array('invoice_tenancy_id' => $invoice_tenancy_id));
     foreach ($invoice_tenancy_abbreviations as $key => $invoice_tenancy_abbreviation) {
         $invoice_tenancy_abbreviations[$key]->text = $abbreviations[$invoice_tenancy_abbreviation->abbreviation_id];
     }
     $this->db->where('tenancy_id', $invoice_tenancy->tenancy_id);
     $units = $this->unit_model->get_from_order_id($order_id);
     foreach ($units as $key => $unit) {
         $units[$key]->assignment = (object) $this->assignment_model->get_values($units[$key]->assignment_id);
         $unit_photos = get_photos('assignment', $unit->assignment_id, $unit->id, 'miniant');
         $photos = array();
         $photos['Equipment photos'] = array();
         if (!empty($unit_photos)) {
             foreach ($unit_photos as $photo) {
                 $photos['Equipment photos'][] = $photo;
             }
         }
         if (!empty($units[$key]->assignment->diagnostic_id)) {
             $units[$key]->diagnostic = (object) $this->diagnostic_model->get_values($units[$key]->assignment->diagnostic_id);
             $units[$key]->issues = $this->diagnostic_issue_model->get(array('diagnostic_id' => $units[$key]->diagnostic->id));
             if (!$units[$key]->diagnostic->bypassed) {
                 $has_required_diagnostics = true;
             }
         }
         if (!empty($units[$key]->issues) && !$units[$key]->assignment->hide_issue_photos) {
             foreach ($units[$key]->issues as $diagnostic_issue) {
                 if ($issue_photos = get_photos('diagnostic_issue', null, $diagnostic_issue->id, 'miniant')) {
                     foreach ($issue_photos as $issue_photo) {
                         if (empty($photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"])) {
                             $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"] = array();
                         }
                         $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"][] = $issue_photo;
                     }
                 }
             }
         }
         $units[$key]->photos = $photos;
         $parts_used = $this->part_model->get(array('assignment_id' => $unit->assignment_id));
         foreach ($parts_used as $key2 => $part_used) {
             if (empty($part_used->part_name)) {
                 $parts_used[$key2]->part_name = $this->part_type_model->get($part_used->part_type_id)->name;
             }
             if (empty($part_used->quantity)) {
                 $part_used->quantity = $part_used->description;
             }
             if (!empty($part_used->servicequote_id) || empty($part_used->quantity)) {
                 unset($parts_used[$key2]);
             }
         }
         $units[$key]->parts_used = $parts_used;
     }
     $invoice_tenancy_parts = $this->invoice_tenancy_part_model->get(array('invoice_tenancy_id' => $invoice_tenancy_id));
     $parts = array();
     foreach ($invoice_tenancy_parts as $invoice_tenancy_part) {
         $parts[] = $this->part_model->get($invoice_tenancy_part->part_id);
     }
     $this->load->library('miniant_pdf', array('header_title' => "Invoice for {$tenancy->name}", 'header_font_size' => 14));
     $this->miniant_pdf->_config['page_orientation'] = 'portrait';
     $this->miniant_pdf->addpage();
     $this->miniant_pdf->setCellPadding(55);
     $this->miniant_pdf->_config['encoding'] = 'UTF-8';
     $this->miniant_pdf->SetSubject("Invoice for {$tenancy->name}");
     $view_params = array('order' => $order, 'order_dowd' => $this->dowd_model->get_formatted_order_dowd($order->dowd_id, $order->id), 'invoice_tenancy' => $invoice_tenancy, 'abbreviations' => $invoice_tenancy_abbreviations, 'parts' => $parts, 'tenancy' => $tenancy, 'units' => $units, 'signature_image' => $signature_image, 'signature' => $signature);
     $this->miniant_pdf->SetFont($this->miniant_pdf->_config['page_font'], 'B', $this->miniant_pdf->_config['page_font_size']);
     $output = $this->load->view('orders/pdf/invoice_tenancy_template', $view_params, true);
     $this->miniant_pdf->writeHTML($output, false, false, false, false, '');
     $filename = 'tenancy_invoice_' . $invoice_tenancy->id . '.pdf';
     $this->miniant_pdf->output($filename, 'D');
 }
    function content_55e44443075054_87310853($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/includes/smartyv3/plugins/modifier.truncate.php';
        }
        ?>
<div class="container">
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
	    var js, fjs = d.getElementsByTagName(s)[0];
	    if (d.getElementById(id)) return;
	    js = d.createElement(s); js.id = id;
	    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=120542078043680";
	    fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));
	</script>
	<div class="row cb-box marginBottom">

		<?php 
        if (isset($_smarty_tpl->tpl_vars['row'])) {
            $_smarty_tpl->tpl_vars['row'] = clone $_smarty_tpl->tpl_vars['row'];
            $_smarty_tpl->tpl_vars['row']->value = $_smarty_tpl->tpl_vars['myquery']->value->Get_Website_Details();
            $_smarty_tpl->tpl_vars['row']->nocache = null;
            $_smarty_tpl->tpl_vars['row']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['row'] = new Smarty_variable($_smarty_tpl->tpl_vars['myquery']->value->Get_Website_Details(), null, 0);
        }
        ?>

	    <!--<div class="alert alert-info margin-bottom-10 ">-->
	    <?php 
        echo ANCHOR(array('place' => 'global'), $_smarty_tpl);
        ?>
 
	    <!--	</div> -->
	    <div class="clearfix"></div>
	       
		<?php 
        if (is_installed('editorspick')) {
            ?>
		<?php 
            if ($_smarty_tpl->tpl_vars['editor_picks']->value) {
                ?>
		<div class="row">
	        <div class="col-md-8">
				<!-- Editor Pick Video Main Container START //-->
				<div id="ep_video_container">
					<?php 
                if (is_installed('editorspick')) {
                    ?>
					<?php 
                    if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list'])) {
                        unset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']);
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['name'] = 'e_list';
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['editor_picks']->value) ? count($_loop) : max(0, (int) $_loop);
                    unset($_loop);
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = (int) 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = true;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] < 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] = 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - 1;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = min(ceil(($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] + 1) / abs($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'])), $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max']);
                        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] == 0) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = false;
                        }
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = 0;
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                        for ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration']++) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == 1;
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'];
                            ?>
					<?php 
                            echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/editor_pick/video_block.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('video' => $_smarty_tpl->tpl_vars['editor_picks']->value[$_smarty_tpl->getVariable('smarty')->value['section']['e_list']['index']]), 0);
                            ?>

					<?php 
                        }
                    } else {
                        ?>
					There is no video in editor's pick, Please Add Videos In Editor's Pick<br />Videos Manager > Add to editor's pick
					<?php 
                    }
                    ?>
					<?php 
                }
                ?>
				</div>
				
				<!-- Editor Pick Video Main Container END //-->

	        </div>

			<!-- Editor Pick Videos Slider Container START //-->
	        <div class="col-md-4 col-sm-12 col-xs-12 editorpick-holder pull-right custom-elements">
	            <div id="slide" class="scrollable-area">
					<?php 
                if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list'])) {
                    unset($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']);
                }
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['name'] = 'e_list';
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['editor_picks']->value) ? count($_loop) : max(0, (int) $_loop);
                unset($_loop);
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = true;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] = 1;
                $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'] - 1;
                if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['loop'];
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] == 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show'] = false;
                    }
                } else {
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'] = 0;
                }
                if ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['show']) {
                    for ($_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration']++) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['step'];
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == 1;
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['e_list']['total'];
                        ?>
	            	<?php 
                        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/editor_pick/index_featured_video.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('video' => $_smarty_tpl->tpl_vars['editor_picks']->value[$_smarty_tpl->getVariable('smarty')->value['section']['e_list']['index']]), 0);
                        ?>

					<?php 
                    }
                }
                ?>
	        	</div>
				<div class="next_pre_hold">
					<a href="#" class="col-md-6 btn btn-primary" id="slide_prev">
					<span class="glyphicon glyphicon-chevron-up"></span>
					</a>
					<a href="#" class="col-md-6 btn btn-primary" id="slide_next">
					<span class="glyphicon glyphicon-chevron-down"></span>
					</a>
				</div>
			</div>
	        <!-- Editor Pick Videos Slider Container END //-->
		</div>
		<?php 
            }
            ?>
		<?php 
        }
        ?>
	    <!-- ******************************************* //-->
		<!-- ************ EDITORS BLOCK END ************ //-->
	    <!-- ******************************************* //-->
	       
	    
	         
	   <!-- <div align="center" class="margin-bottom-10">
	    	<a href="http://www.arvixe.com/clipbucket_hosting">
	    		<img class="banner" src="<?php 
        echo $_smarty_tpl->tpl_vars['theme']->value;
        ?>
/assets/images/ad-box-728x90.jpg" >

			</a>
		</div>-->
		<div class="ad"><?php 
        echo getAd(array('place' => 'ad_728x90'), $_smarty_tpl);
        ?>
</div>
		<!-- ******************************************* //-->
		<!-- *********** LATEST VIDEOS START *********** //-->
		<!-- ******************************************* //-->
		<div class="row">
			<div class="col-md-12 clearfix">
				<div class="col-md-8 nopadding padding-right-10 featuredvideos-wrapper">
					<h2 class="myHeading theme_color"><?php 
        echo smarty_lang(array('code' => "Featured Videos"), $_smarty_tpl);
        ?>
</h2>
					<?php 
        if (isset($_smarty_tpl->tpl_vars['featured_videos'])) {
            $_smarty_tpl->tpl_vars['featured_videos'] = clone $_smarty_tpl->tpl_vars['featured_videos'];
            $_smarty_tpl->tpl_vars['featured_videos']->value = get_videos(array('featured' => 'yes', 'limit' => 6));
            $_smarty_tpl->tpl_vars['featured_videos']->nocache = null;
            $_smarty_tpl->tpl_vars['featured_videos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['featured_videos'] = new Smarty_variable(get_videos(array('featured' => 'yes', 'limit' => 6)), null, 0);
        }
        ?>
					<?php 
        if ($_smarty_tpl->tpl_vars['featured_videos']->value) {
            ?>
					<div class="col-md-12 featured-videos nopadding">
						<div class="col-md-12 text-center nopadding ">
							<div class="col-md-8 text-center nopadding mouse_hover featured-imglg">
							
								<?php 
            if (isset($_smarty_tpl->tpl_vars['video_01'])) {
                $_smarty_tpl->tpl_vars['video_01'] = clone $_smarty_tpl->tpl_vars['video_01'];
                $_smarty_tpl->tpl_vars['video_01']->value = $_smarty_tpl->tpl_vars['featured_videos']->value[0];
                $_smarty_tpl->tpl_vars['video_01']->nocache = null;
                $_smarty_tpl->tpl_vars['video_01']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['video_01'] = new Smarty_variable($_smarty_tpl->tpl_vars['featured_videos']->value[0], null, 0);
            }
            ?>
								<div class="col-md-12 text-center nopadding video_thumb_lg">
									<a href="<?php 
            echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_01']->value), $_smarty_tpl);
            ?>
" title="<?php 
            echo $_smarty_tpl->tpl_vars['video_01']->value['title'];
            ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
            echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_01']->value, 'num' => '4', 'size' => 'big'), $_smarty_tpl);
            ?>
" width="500" height="285" border="0" <?php 
            echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_01']->value), $_smarty_tpl);
            ?>
 />
									</a>
									<div class="cbHomeVidTitle cbHomeVidTitle_Big mouse_hover_on"><?php 
            echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_01']->value['title'], 30);
            ?>
</div>
								</div>
					            <div class="cbHomeVidDuration mouse_hover_on">
					            <?php 
            if ($_smarty_tpl->tpl_vars['video_01']->value['duration'] > 1) {
                echo SetTime($_smarty_tpl->tpl_vars['video_01']->value['duration']);
            } else {
                ?>
00:00ewwew<?php 
            }
            ?>
					            </div>
					            <div class="cbHomeVidDuration_left mouse_hover_on">
					            	<?php 
            echo $_smarty_tpl->tpl_vars['video_01']->value['username'];
            ?>

					            </div>
							</div>
							<div class="col-md-4 col-sm-6 hidden-xs text-center nopadding-right pull-right tumb-sm">
							<?php 
            $_smarty_tpl->tpl_vars['video_02'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video_02']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['featured_videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['video_02']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['video_02']->key => $_smarty_tpl->tpl_vars['video_02']->value) {
                $_smarty_tpl->tpl_vars['video_02']->_loop = true;
                $_smarty_tpl->tpl_vars['video_02']->iteration++;
                ?>
								<?php 
                if ($_smarty_tpl->tpl_vars['video_02']->iteration > 1 && $_smarty_tpl->tpl_vars['video_02']->iteration < 4) {
                    ?>
								<div class="col-md-12 text-center nopadding mouse_hover1 featured-video video_thumb" style="<?php 
                    if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['foo']['last']) {
                        ?>
 <?php 
                    }
                    ?>
 " >
									<a href="<?php 
                    echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
" title="<?php 
                    echo $_smarty_tpl->tpl_vars['video_02']->value['title'];
                    ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
                    echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value, 'size' => '240x133'), $_smarty_tpl);
                    ?>
" width="240" height="133" <?php 
                    echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
 />
										<div class="cbHomeVidTitle mouse_hover_on1"><?php 
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_02']->value['title'], 10);
                    ?>
</div>
										<div class="cbHomeVidDuration mouse_hover_on1">
						            		<?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->value['duration'] > 1) {
                        echo SetTime($_smarty_tpl->tpl_vars['video_02']->value['duration']);
                    } else {
                        ?>
00:00<?php 
                    }
                    ?>
						            	</div>
									</a>
								</div>
								<?php 
                }
                ?>

							<?php 
            }
            ?>
							</div>
							<div class="col-lg-12 col-md-12 text-center nopadding">
							<?php 
            $_smarty_tpl->tpl_vars['video_02'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['video_02']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['featured_videos']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['video_02']->iteration = 0;
            foreach ($_from as $_smarty_tpl->tpl_vars['video_02']->key => $_smarty_tpl->tpl_vars['video_02']->value) {
                $_smarty_tpl->tpl_vars['video_02']->_loop = true;
                $_smarty_tpl->tpl_vars['video_02']->iteration++;
                ?>
							<?php 
                if ($_smarty_tpl->tpl_vars['video_02']->iteration > 3) {
                    ?>
								<div class="col-lg-4 col-md-4 col-sm-6 hidden-xs video_thumb text-center nopadding-right mouse_hover featured-video <?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->iteration == 4) {
                        ?>
nopadding<?php 
                    }
                    ?>
 ">
									<a href="<?php 
                    echo videoSmartyLink(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
" title="<?php 
                    echo $_smarty_tpl->tpl_vars['video_02']->value['title'];
                    ?>
">
										<span class="play-icon fa fa-play"></span>
										<img class="cb_img_thum" src="<?php 
                    echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['video_02']->value, 'size' => '240x133'), $_smarty_tpl);
                    ?>
" width="240" height="133" <?php 
                    echo ANCHOR(array('place' => "video_thumb", 'data' => $_smarty_tpl->tpl_vars['video_02']->value), $_smarty_tpl);
                    ?>
 />
									
										<div class="cbHomeVidTitle mouse_hover_on"><?php 
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['video_02']->value['title'], 10);
                    ?>
</div>

										<div class="cbHomeVidDuration mouse_hover_on">
							            <?php 
                    if ($_smarty_tpl->tpl_vars['video_02']->value['duration'] > 1) {
                        echo SetTime($_smarty_tpl->tpl_vars['video_02']->value['duration']);
                    } else {
                        ?>
00:00<?php 
                    }
                    ?>
							            </div>
									</a>
								</div>
							<?php 
                }
                ?>
							<?php 
            }
            ?>
							</div>
			                
			            </div>
					
		        		<div class="clearfix"></div>    
					</div>
					<?php 
        } else {
            ?>
					<div class="col-md-12 nopadding">No featured Video</div>
					<?php 
        }
        ?>
			        <div class="clearfix"></div>
			        <div class="row nopadding">
			        	<h3 class="myHeading theme_color"><?php 
        echo lang('Recent videos');
        ?>
</h3>
			        	<?php 
        if (isset($_smarty_tpl->tpl_vars['videos'])) {
            $_smarty_tpl->tpl_vars['videos'] = clone $_smarty_tpl->tpl_vars['videos'];
            $_smarty_tpl->tpl_vars['videos']->value = get_videos(array("order" => "date_added DESC", "limit" => 12));
            $_smarty_tpl->tpl_vars['videos']->nocache = null;
            $_smarty_tpl->tpl_vars['videos']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['videos'] = new Smarty_variable(get_videos(array("order" => "date_added DESC", "limit" => 12)), null, 0);
        }
        ?>
						<div class="clearfix recent-videos row">
				        	<?php 
        $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['video']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['videos']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
            $_smarty_tpl->tpl_vars['video']->_loop = true;
            ?>

				        	<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 mbm cb-video-fixed-block">
				        		<!-- <div class="marginBottom grid_view recent-col list_view nopadding-right"> -->
								<?php 
            echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['style_dir']->value . "/blocks/videos/video.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>

								<!-- </div> -->
							</div>
				        	<?php 
        }
        ?>
			        	</div>
			        </div>
					
	              	<div class="ad"><?php 
        echo getAd(array('place' => 'ad_468x60'), $_smarty_tpl);
        ?>
</div>
			    	<div class="row nopadding">
			    		<?php 
        if ($_smarty_tpl->tpl_vars['row']->value['photosSection'] == 'yes') {
            ?>
						<div class="col-md-12 clearfix nopadding ">
			        		<h2 class="myHeading theme_color"><?php 
            echo smarty_lang(array('code' => "Photos"), $_smarty_tpl);
            ?>
</h2>
							<?php 
            if (isset($_smarty_tpl->tpl_vars['result_photos1_01'])) {
                $_smarty_tpl->tpl_vars['result_photos1_01'] = clone $_smarty_tpl->tpl_vars['result_photos1_01'];
                $_smarty_tpl->tpl_vars['result_photos1_01']->value = get_photos(array('order' => ' RAND() LIMIT 15 '));
                $_smarty_tpl->tpl_vars['result_photos1_01']->nocache = null;
                $_smarty_tpl->tpl_vars['result_photos1_01']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['result_photos1_01'] = new Smarty_variable(get_photos(array('order' => ' RAND() LIMIT 15 ')), null, 0);
            }
            ?>
		
			        		<?php 
            if ($_smarty_tpl->tpl_vars['result_photos1_01']->value) {
                ?>
	        				<!-- *********** FIRST PHOTOS START ************ //-->
	        				<!-- <div class="row clearfix fill-background lg-img"> -->
							<div class="clearfix featured-images">
								<div class="clearfix">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo1_01'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo1_01']->_loop = false;
                $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['result_photos1_01']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo1_01']->key => $_smarty_tpl->tpl_vars['result_photo1_01']->value) {
                    $_smarty_tpl->tpl_vars['result_photo1_01']->_loop = true;
                    $_smarty_tpl->tpl_vars['i']->value = $_smarty_tpl->tpl_vars['result_photo1_01']->key;
                    ?>
									
								<?php 
                    if ($_smarty_tpl->tpl_vars['i']->value == 0) {
                        ?>
			

									<div class="ft-img col-md-7">
									

						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						          
						            </div>
						        <?php 
                    } elseif ($_smarty_tpl->tpl_vars['i']->value < 3) {
                        ?>
    

						           
						            
									
									<div class="ft-img col-md-5">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						           
						       	    </div>
						           
								<?php 
                    } elseif ($_smarty_tpl->tpl_vars['i']->value < 7) {
                        ?>
						           
									<div class="ft-img col-md-6">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						            
						       	    </div>
						            
								<?php 
                    } else {
                        ?>
			
						           
									<div class="ft-img col-md-3" style="height:140px;">
						            	<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_08']->value, 'view_item');
                        ?>
">
						            	<?php 
                        echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo1_01']->value, 'output' => 'html', 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                        ?>

						            	</a>
						            	<div class="hover">
						            		<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo1_01']->value, 'view_item');
                        ?>
">
						            			<span class="photo-title"><?php 
                        echo $_smarty_tpl->tpl_vars['result_photo1_01']->value['photo_title'];
                        ?>
</span>
						            			<span class="plus">plus</span>
						            		</a>
						            	</div>
						            
						       	    </div>
						         <?php 
                    }
                    ?>
   
						        
						        <?php 
                }
                ?>
						        </div>
								<!-- </div> -->
							</div>
					        <!-- *********** FIRST PHOTOS END ************ //-->
				     		<?php 
            }
            ?>

							<?php 
            if (isset($_smarty_tpl->tpl_vars['result_photos2_08'])) {
                $_smarty_tpl->tpl_vars['result_photos2_08'] = clone $_smarty_tpl->tpl_vars['result_photos2_08'];
                $_smarty_tpl->tpl_vars['result_photos2_08']->value = get_photos(array('order' => '  photo_id ASC LIMIT 4 '));
                $_smarty_tpl->tpl_vars['result_photos2_08']->nocache = null;
                $_smarty_tpl->tpl_vars['result_photos2_08']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['result_photos2_08'] = new Smarty_variable(get_photos(array('order' => '  photo_id ASC LIMIT 4 ')), null, 0);
            }
            ?>
						    
						    <?php 
            if ($_smarty_tpl->tpl_vars['result_photos2_08']->value) {
                ?>
 		
					        <!-- *********** SECOND PHOTOS START ************ //-->
							<!-- <div class="col-md-12 fill-background clearfix lg-img">
						        <div class="col-md-5 nopadding sm-imgs clearfix left-aligned">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo2_08'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo2_08']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['result_photos2_08']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo2_08']->key => $_smarty_tpl->tpl_vars['result_photo2_08']->value) {
                    $_smarty_tpl->tpl_vars['result_photo2_08']->_loop = true;
                    ?>
									<div class="col-md-6 col-sm-6">
						        	<a href="<?php 
                    echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo2_08']->value, 'view_item');
                    ?>
">
						        	<?php 
                    echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo2_08']->value, 'output' => 'html', 'width' => "128", 'height' => "118", 'size' => "l", 'class' => 'photoThumbBox moveL cb_img_thum'), $_smarty_tpl);
                    ?>

						        	</a>
						        <?php 
                    if ($_smarty_tpl->tpl_vars['photos']->iteration > 1) {
                        break 1;
                    }
                    ?>
						   	    </div>
						        <?php 
                }
                ?>
								</div>
								<?php 
                if (isset($_smarty_tpl->tpl_vars['result_photos2_01'])) {
                    $_smarty_tpl->tpl_vars['result_photos2_01'] = clone $_smarty_tpl->tpl_vars['result_photos2_01'];
                    $_smarty_tpl->tpl_vars['result_photos2_01']->value = get_photos(array('order' => '  RAND() LIMIT 1 '));
                    $_smarty_tpl->tpl_vars['result_photos2_01']->nocache = null;
                    $_smarty_tpl->tpl_vars['result_photos2_01']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['result_photos2_01'] = new Smarty_variable(get_photos(array('order' => '  RAND() LIMIT 1 ')), null, 0);
                }
                ?>
								<div class="col-md-7 big_img">
								<?php 
                $_smarty_tpl->tpl_vars['result_photo2_01'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['result_photo2_01']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['result_photos2_01']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['result_photo2_01']->key => $_smarty_tpl->tpl_vars['result_photo2_01']->value) {
                    $_smarty_tpl->tpl_vars['result_photo2_01']->_loop = true;
                    ?>
						        	<a href="<?php 
                    echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['result_photo2_01']->value, 'view_item');
                    ?>
">
						        	<?php 
                    echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['result_photo2_01']->value, 'output' => 'html', 'width' => "420", 'height' => "235", 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                    ?>

						        	</a>
						        <?php 
                }
                ?>
						        </div>
							</div> -->
							<!-- *********** SECOND PHOTOS END ************ //-->
							<?php 
            }
            ?>
						</div>
						<?php 
        } else {
            ?>
						<div class="col-md-12 nopadding">No featured Photo</div>
						<?php 
        }
        ?>
	
					</div>

			        <!-- ******************************************* //-->
			        <!-- *********** PHOTOS END ************ //-->
			        <!-- ******************************************* //-->

				</div>
				<!-- ******************************************* //-->
		        <!-- ******** ADVERTISEMENT BLOCK START ******** //-->
		        <!-- ******************************************* //-->
				<!--<div class="col-md-4" style="background-color:#F2F2F2; padding-top:10px; padding-bottom:10px; margin-bottom:10px;">
				<h2 class="myHeadingBLK" style="margin-top:0;">Advertisement</h2>
					<div class="col-md-12 text-center nopadding" style="font-size:18px; border:1px solid #CCC; background:#FFF; display:block; height: 250px; width: 300px; line-height: 200px; text-align:center; left:7%;">
					Ad Box 300 x 250
					</div>
				</div>-->
				<!-- ******************************************* //-->
		        <!-- ******** ADVERTISEMENT BLOCK END ******** //-->
		        <!-- ******************************************* //-->


				<!-- ******************************************* //-->
		        <!-- ************* USER BLOCK START ************ //-->
		        <!-- ******************************************* //-->
				<?php 
        if (isset($_smarty_tpl->tpl_vars['feature_users'])) {
            $_smarty_tpl->tpl_vars['feature_users'] = clone $_smarty_tpl->tpl_vars['feature_users'];
            $_smarty_tpl->tpl_vars['feature_users']->value = get_users(array('featured' => 'yes', 'limit' => 5));
            $_smarty_tpl->tpl_vars['feature_users']->nocache = null;
            $_smarty_tpl->tpl_vars['feature_users']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['feature_users'] = new Smarty_variable(get_users(array('featured' => 'yes', 'limit' => 5)), null, 0);
        }
        ?>
				<?php 
        if ($_smarty_tpl->tpl_vars['feature_users']->value) {
            ?>
	     		<div class="col-md-4 side_user_home">
					<h2 class="myHeading theme_color"><?php 
            echo smarty_lang(array('code' => "Featured Users"), $_smarty_tpl);
            ?>
</h2>
	               
	               <?php 
            $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['user']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['feature_users']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value) {
                $_smarty_tpl->tpl_vars['user']->_loop = true;
                ?>
					
	                <div class="col-md-12 nopadding clearfix user-view-home">
						<div class="col-md-3 nopadding">
							<img src="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->getuserthumb($_smarty_tpl->tpl_vars['user']->value, 'small');
                ?>
" width="56" height="56" class="img-circle" />
						</div>
						<div class="col-md-9 nopadding">
							<h4 class="nopadding "><a href="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['user']->value);
                ?>
"><?php 
                echo $_smarty_tpl->tpl_vars['user']->value['username'];
                ?>
</a></h4>

							<div class=" nopadding col-md-6 min-height-20">
								<div class="pull-left small"><span class="bg-eye"></span>&nbsp;<span><?php 
                echo number_format($_smarty_tpl->tpl_vars['user']->value['profile_hits']);
                ?>
 <?php 
                echo smarty_lang(array('code' => 'views'), $_smarty_tpl);
                ?>
</span></div>
								<div class="pull-right small"><span class="bg-videocam"></span>&nbsp;<span><?php 
                echo number_format($_smarty_tpl->tpl_vars['user']->value['total_videos']);
                ?>
 <?php 
                echo smarty_lang(array('code' => 'Videos'), $_smarty_tpl);
                ?>
</span></div>
							</div>
		                    <br>
		                    <div class="row pull-left" style="margin-left: 0px; width: 99%;">
			                    <div class="progres">
			                        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
			                            <span class="sr-only">40% Complete (success)</span>
			                        </div>
			                    </div>
		                    </div>
							<!--<div class="col-md-12 nopadding progress no-border-radius">
			      				<div style="width: 40%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" role="progressbar" class="progress-bar progress-bar-success">
			        			<span class="sr-only">40% Complete (success)</span>
			  					</div>
			    			</div>-->
						</div>
						<div class="user_icon">
							<a href="<?php 
                echo $_smarty_tpl->tpl_vars['userquery']->value->profile_link($_smarty_tpl->tpl_vars['user']->value);
                ?>
">
							<img class="" src="<?php 
                echo $_smarty_tpl->tpl_vars['imageurl']->value;
                ?>
/user_next_icon.png" width="25" height="25" />
							</a>
						</div>
					</div>
					<?php 
            }
            ?>
				</div>
				<?php 
        }
        ?>
				<!-- ******************************************* //-->
		        <!-- ************* USER BLOCK END ************ //-->
		        <!-- ******************************************* //-->
		        <?php 
        if ($_smarty_tpl->tpl_vars['row']->value['collectionsSection'] == 'yes') {
            ?>
				<?php 
            if (isset($_smarty_tpl->tpl_vars['collections'])) {
                $_smarty_tpl->tpl_vars['collections'] = clone $_smarty_tpl->tpl_vars['collections'];
                $_smarty_tpl->tpl_vars['collections']->value = $_smarty_tpl->tpl_vars['cbcollection']->value->get_collections(array('limit' => 5, 'active' => 'yes'));
                $_smarty_tpl->tpl_vars['collections']->nocache = null;
                $_smarty_tpl->tpl_vars['collections']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['collections'] = new Smarty_variable($_smarty_tpl->tpl_vars['cbcollection']->value->get_collections(array('limit' => 5, 'active' => 'yes')), null, 0);
            }
            ?>
				<div class="col-md-4 comment_home side_user_home" >
					<h2 class="myHeading"><?php 
            echo smarty_lang(array('code' => "Top Collections"), $_smarty_tpl);
            ?>
</h2>
					<?php 
            if (isset($_smarty_tpl->tpl_vars['limit'])) {
                $_smarty_tpl->tpl_vars['limit'] = clone $_smarty_tpl->tpl_vars['limit'];
                $_smarty_tpl->tpl_vars['limit']->value = 10;
                $_smarty_tpl->tpl_vars['limit']->nocache = null;
                $_smarty_tpl->tpl_vars['limit']->scope = 0;
            } else {
                $_smarty_tpl->tpl_vars['limit'] = new Smarty_variable(10, null, 0);
            }
            ?>
		        	<?php 
            if ($_smarty_tpl->tpl_vars['collections']->value) {
                ?>
        
					<?php 
                $_smarty_tpl->tpl_vars['collection'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['collection']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['collections']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['collection']->key => $_smarty_tpl->tpl_vars['collection']->value) {
                    $_smarty_tpl->tpl_vars['collection']->_loop = true;
                    ?>
					<div class="clearfix collection-section">
						<div class="category-header row clearfix">
							<div class="col-sm-6 clearfix"><?php 
                    echo $_smarty_tpl->tpl_vars['collection']->value['collection_name'];
                    ?>
</div>
							<div class="col-sm-6 clearfix"><span class="total-obj"><?php 
                    echo $_smarty_tpl->tpl_vars['collection']->value['total_objects'];
                    ?>
</span></div>

							<!--  -->
							<!-- <div class="col-sm-6 clearfix"><span class="total-obj"><?php 
                    echo $_smarty_tpl->tpl_vars['limit']->value;
                    ?>
</span></div> -->
						</div>
						<div class="collection-grid clearfix"> 
						<?php 
                    if ($_smarty_tpl->tpl_vars['collection']->value['type'] == 'photos') {
                        ?>
							<?php 
                        if (isset($_smarty_tpl->tpl_vars['items'])) {
                            $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                            $_smarty_tpl->tpl_vars['items']->value = $_smarty_tpl->tpl_vars['cbphoto']->value->collection->get_collection_items_with_details($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false);
                            $_smarty_tpl->tpl_vars['items']->nocache = null;
                            $_smarty_tpl->tpl_vars['items']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['items'] = new Smarty_variable($_smarty_tpl->tpl_vars['cbphoto']->value->collection->get_collection_items_with_details($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false), null, 0);
                        }
                        ?>
						<?php 
                    } else {
                        ?>
							<?php 
                        if (isset($_smarty_tpl->tpl_vars['items'])) {
                            $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                            $_smarty_tpl->tpl_vars['items']->value = get_videos_of_collection($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false);
                            $_smarty_tpl->tpl_vars['items']->nocache = null;
                            $_smarty_tpl->tpl_vars['items']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['items'] = new Smarty_variable(get_videos_of_collection($_smarty_tpl->tpl_vars['collection']->value['collection_id'], 0, $_smarty_tpl->tpl_vars['limit']->value, false), null, 0);
                        }
                        ?>
						<?php 
                    }
                    ?>
	



						<?php 
                    if ($_smarty_tpl->tpl_vars['items']->value) {
                        ?>
							<?php 
                        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['item']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['items']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                            $_smarty_tpl->tpl_vars['item']->_loop = true;
                            ?>
								<div class="collection-item">
									<a href="<?php 
                            echo $_smarty_tpl->tpl_vars['cbphoto']->value->photo_links($_smarty_tpl->tpl_vars['item']->value, 'view_item');
                            ?>
">
										<?php 
                            if ($_smarty_tpl->tpl_vars['collection']->value['type'] == 'photos') {
                                ?>
											<?php 
                                echo get_image_file(array('details' => $_smarty_tpl->tpl_vars['item']->value, 'output' => 'html', 'size' => "l", 'class' => "cb_img_thum"), $_smarty_tpl);
                                ?>

										<?php 
                            } else {
                                ?>
											<img alt="<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['title'];
                                ?>
" title="<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['title'];
                                ?>
" class="cb_img_thum" id="photo_<?php 
                                echo $_smarty_tpl->tpl_vars['item']->value['ci_id'];
                                ?>
" src="<?php 
                                echo getSmartyThumb(array('vdetails' => $_smarty_tpl->tpl_vars['item']->value), $_smarty_tpl);
                                ?>
">
										<?php 
                            }
                            ?>
									</a>
								</div>
							<?php 
                        }
                        ?>
						<?php 
                    }
                    ?>
						</div>
					</div>

					<?php 
                }
                ?>
					<?php 
            } else {
                ?>
					<div class="col-md-12 nopadding">No Collection</div>
					<?php 
            }
            ?>
		    	</div>
		    	<?php 
        }
        ?>
				
				<?php 
        if (isset($_smarty_tpl->tpl_vars['playlists'])) {
            $_smarty_tpl->tpl_vars['playlists'] = clone $_smarty_tpl->tpl_vars['playlists'];
            $_smarty_tpl->tpl_vars['playlists']->value = get_playlists(array('limit' => 5, 'order' => 'total_items DESC'));
            $_smarty_tpl->tpl_vars['playlists']->nocache = null;
            $_smarty_tpl->tpl_vars['playlists']->scope = 0;
        } else {
            $_smarty_tpl->tpl_vars['playlists'] = new Smarty_variable(get_playlists(array('limit' => 5, 'order' => 'total_items DESC')), null, 0);
        }
        ?>
                <div class="col-md-4 comment_home side_user_home " >
                	<h2 class="myHeading"><?php 
        echo smarty_lang(array('code' => "Top Playlists"), $_smarty_tpl);
        ?>
</h2>
                	<?php 
        if ($_smarty_tpl->tpl_vars['playlists']->value) {
            ?>
					<?php 
            $_smarty_tpl->tpl_vars['playlist'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['playlist']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['playlists']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['playlist']->key => $_smarty_tpl->tpl_vars['playlist']->value) {
                $_smarty_tpl->tpl_vars['playlist']->_loop = true;
                ?>

						<div class="clearfix collection-section">
							<div class="category-header row clearfix">
								<div class="col-sm-6 clearfix"><span class=""><?php 
                echo $_smarty_tpl->tpl_vars['playlist']->value['playlist_name'];
                ?>
</span></div>
								<div class="col-sm-6 clearfix">
									<span class="total-obj">
										<?php 
                echo number_format($_smarty_tpl->tpl_vars['cbvid']->value->action->count_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']));
                ?>

									</span>
								</div>
                            </div>

							<div class="collection-grid clearfix"> 
							<?php 
                if (isset($_smarty_tpl->tpl_vars['items'])) {
                    $_smarty_tpl->tpl_vars['items'] = clone $_smarty_tpl->tpl_vars['items'];
                    $_smarty_tpl->tpl_vars['items']->value = get_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']);
                    $_smarty_tpl->tpl_vars['items']->nocache = null;
                    $_smarty_tpl->tpl_vars['items']->scope = 0;
                } else {
                    $_smarty_tpl->tpl_vars['items'] = new Smarty_variable(get_playlist_items($_smarty_tpl->tpl_vars['playlist']->value['playlist_id']), null, 0);
                }
                ?>
								<?php 
                $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['item']->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['items']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                    $_smarty_tpl->tpl_vars['item']->_loop = true;
                    ?>
								    <div class="collection-item">
										    <?php 
                    if (isset($_smarty_tpl->tpl_vars['videoid'])) {
                        $_smarty_tpl->tpl_vars['videoid'] = clone $_smarty_tpl->tpl_vars['videoid'];
                        $_smarty_tpl->tpl_vars['videoid']->value = $_smarty_tpl->tpl_vars['item']->value['videoid'];
                        $_smarty_tpl->tpl_vars['videoid']->nocache = null;
                        $_smarty_tpl->tpl_vars['videoid']->scope = 0;
                    } else {
                        $_smarty_tpl->tpl_vars['videoid'] = new Smarty_variable($_smarty_tpl->tpl_vars['item']->value['videoid'], null, 0);
                    }
                    ?>
										    <?php 
                    if ($_smarty_tpl->tpl_vars['videoid']->value) {
                        ?>
		                                    <?php 
                        if (isset($_smarty_tpl->tpl_vars['videos'])) {
                            $_smarty_tpl->tpl_vars['videos'] = clone $_smarty_tpl->tpl_vars['videos'];
                            $_smarty_tpl->tpl_vars['videos']->value = get_videos(array('videoid' => $_smarty_tpl->tpl_vars['videoid']->value, 'limit' => '4'));
                            $_smarty_tpl->tpl_vars['videos']->nocache = null;
                            $_smarty_tpl->tpl_vars['videos']->scope = 0;
                        } else {
                            $_smarty_tpl->tpl_vars['videos'] = new Smarty_variable(get_videos(array('videoid' => $_smarty_tpl->tpl_vars['videoid']->value, 'limit' => '4')), null, 0);
                        }
                        ?>
											    <?php 
                        $_smarty_tpl->tpl_vars['video'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['video']->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['videos']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['video']->key => $_smarty_tpl->tpl_vars['video']->value) {
                            $_smarty_tpl->tpl_vars['video']->_loop = true;
                            ?>
				                                    <a href="<?php 
                            echo videoLink($_smarty_tpl->tpl_vars['video']->value);
                            ?>
">
														<?php 
                            if (isset($_smarty_tpl->tpl_vars['thumb'])) {
                                $_smarty_tpl->tpl_vars['thumb'] = clone $_smarty_tpl->tpl_vars['thumb'];
                                $_smarty_tpl->tpl_vars['thumb']->value = get_thumb($_smarty_tpl->tpl_vars['video']->value);
                                $_smarty_tpl->tpl_vars['thumb']->nocache = null;
                                $_smarty_tpl->tpl_vars['thumb']->scope = 0;
                            } else {
                                $_smarty_tpl->tpl_vars['thumb'] = new Smarty_variable(get_thumb($_smarty_tpl->tpl_vars['video']->value), null, 0);
                            }
                            ?>
				                                        <img src="<?php 
                            echo $_smarty_tpl->tpl_vars['thumb']->value;
                            ?>
" />
						                            </a>
												<?php 
                        }
                        ?>
											<?php 
                    } else {
                        ?>
											<span class="label label-default">no items</span>
											<?php 
                    }
                    ?>
                                    </div>
								<?php 
                }
                ?>
							</div>
						</div>	

                    <?php 
            }
            ?>
                    <?php 
        } else {
            ?>
						<div class="col-md-12 nopadding">No Playlists</div>
					<?php 
        }
        ?>
				</div>

			</div>
		</div>
	</div>
	
</div>

<div style="height:20px;"></div>
<script type="text/javascript">
	$(function() {
				
	    $('#slide').ulslide({
	        width: 350,
	        height: 88,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'y',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next',
	        prevButton: '#slide_prev',
	        duration: 800,
	        /*autoslide: 2000*/
			easing: 'easeOutBounce'
	    });
	    $('#slide1').ulslide({
	        width: 150,
	        height: 80,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'x',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next1',
	        prevButton: '#slide_prev1',
	        duration: 800,
	        autoslide: 2000
			/*easing: 'easeOutBounce'*/
	    });
	    $('#slide3').ulslide({
	        width: 150,
	        height: 80,
			effect: {
				type: 'carousel', // slide or fade
	            axis: 'x',        // x, y
				showCount: 5
			},
	        nextButton: '#slide_next3',
	        prevButton: '#slide_prev3',
	        duration: 800,
	        autoslide: 2000,
			easing: 'easeOutBounce'
	    });
	});
</script>

<!--<style>

.ad{
    background: none repeat scroll 0 0 #F3F3F3;
    border: 1px solid #CCCCCC;
    font-size: 15px;
    height: 90px;
    margin: 0 auto 25px;
    padding: 0;
    text-align: center;
    width: 728px;
}
</style>--><?php 
    }
Exemplo n.º 22
0
 public function index($assignment_id)
 {
     require_capability('orders:editunitdetails');
     if (!($this->assignment = $this->assignment_model->get($assignment_id))) {
         die("The assignment ID {$assignment_id} could not be found!");
     }
     $order = (object) $this->order_model->get_values($this->assignment->order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $technician_id = parent::get_technician_id($assignment_id);
     $is_technician = user_has_role($this->session->userdata('user_id'), 'Technician');
     $order_technician = $this->order_technician_model->get(array('order_id' => $order->id, 'technician_id' => $technician_id), true);
     $units = $this->get_units($assignment_id, $technician_id, $order->senior_technician_id);
     parent::update_time($order->id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'signature', 'param' => $assignment_id, 'module' => 'miniant'));
     $has_required_diagnostics = false;
     $tenancies = array();
     foreach ($units as $key => $unit) {
         $units[$key]->assignment = (object) $this->assignment_model->get_values($units[$key]->assignment_id);
         $unit_photos = get_photos('assignment', $unit->assignment_id, $unit->id, 'miniant');
         $photos = array();
         $photos['Equipment photos'] = array();
         if (!empty($unit_photos)) {
             foreach ($unit_photos as $photo) {
                 $photos['Equipment photos'][] = $photo;
             }
         }
         if ($order_type != 'Installation') {
             if (!empty($units[$key]->assignment->diagnostic_id)) {
                 $units[$key]->diagnostic = (object) $this->diagnostic_model->get_values($units[$key]->assignment->diagnostic_id);
                 $units[$key]->issues = $this->diagnostic_issue_model->get(array('diagnostic_id' => $units[$key]->diagnostic->id));
                 if (!$units[$key]->diagnostic->bypassed) {
                     $has_required_diagnostics = true;
                 }
             }
             if (!empty($units[$key]->issues) && !$units[$key]->assignment->hide_issue_photos) {
                 foreach ($units[$key]->issues as $diagnostic_issue) {
                     if ($issue_photos = get_photos('diagnostic_issue', null, $diagnostic_issue->id, 'miniant')) {
                         foreach ($issue_photos as $issue_photo) {
                             if (empty($photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"])) {
                                 $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"] = array();
                             }
                             $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"][] = $issue_photo;
                         }
                     }
                 }
             }
         }
         $units[$key]->photos = $photos;
         $parts_used = $this->part_model->get(array('assignment_id' => $unit->assignment_id));
         foreach ($parts_used as $key2 => $part_used) {
             if (empty($part_used->part_name)) {
                 $parts_used[$key2]->part_name = $this->part_type_model->get($part_used->part_type_id)->name;
             }
             if (empty($part_used->quantity)) {
                 $part_used->quantity = $part_used->description;
             }
             if (!empty($part_used->servicequote_id) || empty($part_used->quantity)) {
                 unset($parts_used[$key2]);
             }
         }
         $units[$key]->parts_used = $parts_used;
         if (empty($tenancies[$unit->tenancy_id])) {
             $tenancy = $this->tenancy_model->get($unit->tenancy_id);
             $tenancies[$unit->tenancy_id] = array('units' => array(), 'tenancy' => $tenancy, 'signature' => $this->tenancy_model->get_signature_for_order($tenancy->id, $order->id));
         }
         $tenancies[$unit->tenancy_id]['units'][] = $unit;
     }
     $site_photos = array('pre-job' => get_photos('order', 'site-pre-job', $order->id, 'miniant'), 'post-job' => get_photos('order', 'site-post-job', $order->id, 'miniant'));
     $this->load_stage_view(array('units' => $units, 'jstoload' => array('jquery.signaturepad', 'signaturepad/flashcanvas', 'signaturepad/json2'), 'module' => 'miniant', 'csstoload' => array('jquery.signaturepad'), 'tenancies' => $tenancies, 'site_photos' => $site_photos, 'terms' => $this->setting_model->get(array('name' => 'terms'), true)->value, 'is_maintenance' => $order->order_type_id == $this->order_model->get_type_id('Maintenance'), 'is_service' => $order->order_type_id == $this->order_model->get_type_id('Service'), 'is_repair' => $order->order_type_id == $this->order_model->get_type_id('Repair'), 'order_dowd' => $this->dowd_model->get_formatted_order_dowd($order->dowd_id, $order->id), 'time_started' => @$this->order_technician_model->get_status_change_log($order_technician->id, 'STARTED')->creation_date));
 }
Exemplo n.º 23
0
        foreach ($photos['response'] as $value) {
            echo '<a href="/albums.php?id=' . $id . '&aid=' . $value['aid'] . '&pid=' . $value['pid'] . '" ><img src="' . $value['src'] . '"></a>';
        }
    }
}
function get_photo($id, $aid, $pid)
{
    $vk = new VK\VK(APP_ID, ACCES_CODE);
    $photo = $vk->api('photos.get', array('owner_id' => $id, 'album_id' => $aid, 'photo_ids' => $pid));
    echo '<a href="/albums.php?id=' . $id . '&aid=' . $aid . '"><<< НАЗАД</a><br />';
    if (isset($photo['response']['0']['src_big'])) {
        echo '<img src="' . $photo['response']['0']['src_big'] . '">';
    } else {
        echo "<p>Нет доступа к фотографии...<br> Фотография скрыта настройками приватности :(";
    }
    if (isset($photo['response']['0']['text'])) {
        echo '<p>' . $photo['response']['0']['text'] . '</p>';
    }
}
if (isset($id)) {
    get_albums($id);
} else {
    exit;
}
if ($pid !== '') {
    get_photo($id, $aid, $pid);
    exit;
} elseif (isset($aid)) {
    get_photos($id, $aid);
    exit;
}
Exemplo n.º 24
0
			</section>
						
			<section class="archive-list">
				<h2 class="archive-list-heading"><?php 
echo $post_count . ' Article' . ($post_count !== 1 ? 's' : '');
?>
</h2>
				<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

					<article class="clearfix">
						<?php 
        $photos = get_photos(get_the_ID(), 1, array('alt-thumbnail'));
        if ($photos) {
            ?>
						
							<figure class="figure-right figure-border">
								<a href="<?php 
            the_permalink();
            ?>
">
									<img src="<?php 
            echo $photos['src']['alt-thumbnail'] ? $photos['src']['alt-thumbnail'] : $photos['src']['single-inline'];
            ?>
" />
								</a>
							</figure>
Exemplo n.º 25
0
 public function index($assignment_id)
 {
     // If this stage is completed, redirect to the next uncompleted unit, if any
     if ($assignment = $this->stage_conditions_model->get_next_uncompleted_assignment_for_stage($assignment_id, 'unit_details')) {
         $this->assignment = (object) $this->assignment_model->get_values($assignment->id);
     } else {
         $this->assignment = (object) $this->assignment_model->get_values($assignment_id);
     }
     if (empty($this->assignment)) {
         add_message('This job is no longer on record.', 'warning');
         redirect(base_url());
     }
     $order = (object) $this->order_model->get_values($this->assignment->order_id);
     $order_type = $this->order_model->get_type_string($order->order_type_id);
     $technician_id = parent::get_technician_id($assignment_id);
     $is_technician = user_has_role($this->session->userdata('user_id'), 'Technician');
     parent::update_time($order->id);
     $this->load->library('Miniant_Workflow_manager', array(), 'workflow_manager');
     $this->workflow_manager->initialise(array('workflow' => $order_type, 'stage' => 'unit_details', 'param' => $assignment_id, 'module' => 'miniant'));
     require_capability('orders:editunitdetails');
     $this->order_time_model->finish_time($order->id, $technician_id);
     $this->order_time_model->add(array('time_start' => time(), 'technician_id' => $technician_id, 'order_id' => $order->id));
     $units = $this->get_units($assignment_id, $technician_id, $order->senior_technician_id);
     if (empty($units)) {
         add_message('There are no units associated with this job!', 'danger');
         redirect(base_url('miniant/stages/assignment_details/index/' . $assignment_id));
     }
     $notes = $this->message_model->get_with_author_names(array('document_type' => 'order', 'document_id' => $order->id));
     foreach ($units as $key => $unit) {
         $unit_data = (array) $unit;
         foreach ($unit_data as $var => $val) {
             if (!is_array($val)) {
                 form_element::$default_data[$var . '_' . $unit->assignment_id] = $val;
             }
         }
         if ($unit->unit_type_id == $this->unit_model->get_type_id('Evaporative A/C')) {
             form_element::$default_data['brand_id_evap_' . $unit->assignment_id] = $unit->brand_id;
         }
         if ($unit->unit_type_id == $this->unit_model->get_type_id('Refrigerated A/C')) {
             form_element::$default_data['brand_id_ref_' . $unit->assignment_id] = $unit->brand_id;
         }
         // Get assignment of parent order
         $units[$key]->diagnostic_assignment = $this->assignment_model->get_diagnostic_assignment($unit->assignment_id);
         $units[$key]->assignment = (object) $this->assignment_model->get_values($units[$key]->assignment_id);
         $units[$key]->notes = $this->message_model->get_with_author_names(array('document_type' => 'assignment', 'document_id' => $unit->assignment_id));
         $units[$key]->details_recorded = $this->unit_model->has_statuses($unit->id, array('UNIT DETAILS RECORDED'));
         if ($order_type == 'Repair') {
             $photos = array();
             if (!empty($units[$key]->diagnostic_assignment->diagnostic_id)) {
                 $units[$key]->parent_diagnostic = (object) $this->diagnostic_model->get_values($units[$key]->diagnostic_assignment->diagnostic_id);
                 $units[$key]->issues = $this->diagnostic_issue_model->get(array('diagnostic_id' => $units[$key]->parent_diagnostic->id));
                 if (!$units[$key]->parent_diagnostic->bypassed) {
                     $has_required_diagnostics = true;
                 }
             }
             if (!empty($units[$key]->issues) && !$units[$key]->diagnostic_assignment->hide_issue_photos) {
                 foreach ($units[$key]->issues as $diagnostic_issue) {
                     if ($issue_photos = get_photos('diagnostic_issue', null, $diagnostic_issue->id, 'miniant')) {
                         foreach ($issue_photos as $issue_photo) {
                             if (empty($photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"])) {
                                 $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"] = array();
                             }
                             $photos["{$diagnostic_issue->issue_type_name} {$diagnostic_issue->part_type_name}"][] = $issue_photo;
                         }
                     }
                 }
             }
             $units[$key]->photos = $photos;
         }
         /*
          * I don't think we need this dialog at all
          *
         $this->load->library('Dialog');
         $this->dialog->initialise(array());
         
         $this->dialog->add_question(array(
             'id' => 'unit_details_recorded',
             'shown' => !$this->unit_model->has_statuses($unit->id, array('UNIT DETAILS RECORDED')),
             'text' => 'Have the details of this unit been recorded by the senior technician ('.$order->senior_technician_first_name.')?',
             'answers' => array(
                 array(
                     'text' => 'Yes',
                     'ids_to_show' => array('start_diagnostic'),
                 ))
             ));
         
             // $next_page_url = ($order->order_type == 'Installation') ? base_url() . 'orders/technician/installation_checklist/'.$unit->assignment_id : base_url() . 'orders/technician/diagnostic_report/'.$unit->assignment_id;
             $this->dialog->add_question(array(
                 'id' => 'start_diagnostic',
                 'shown' => $this->unit_model->has_statuses($unit->id, array('UNIT DETAILS RECORDED')),
                 'text' => 'Details have been recorded for this unit',
                 'answers' => array(
                     array(
                         'text' => 'Continue',
                         'url' => $this->workflow_manager->get_next_url(),
                     ))
                 ));
         $units[$key]->junior_technician_dialog = $this->dialog->output();
         */
     }
     if ($this->input->post()) {
         foreach ($this->input->post() as $key => $val) {
             form_element::$default_data[$key] = $val;
         }
     }
     $this->load_stage_view(array('units' => $units, 'jstoload' => array('signature_pad'), 'is_senior_technician' => $technician_id == $order->senior_technician_id, 'is_maintenance' => $order_type == 'Maintenance', 'is_technician' => user_has_role($this->session->userdata('user_id'), 'Technician'), 'is_service' => $order_type == 'Service', 'is_repair' => $order_type == 'Repair', 'notes' => $notes));
 }