예제 #1
0
function generate_collections_menu()
{
    $collections = get_collections();
    $output = '<select name="collections_menu" id="collections_menu" onclick="var k=document.getElementsByName(\'destination_radio\');k[1].checked=true;" >';
    foreach ($collections as $collection) {
        $output .= "\n\t\t\t\t\t" . '<option value="' . $collection['id'] . '">' . $collection['name'] . '</option>';
    }
    $output .= "\n\t\t\t\t</select>";
    return $output;
}
function generate_collections_menu()
{
    $collections = get_collections();
    $output = '<select class="no-margin-top" tabindex="80" style="width: 80%;" name="collections_menu" id="collections_menu">';
    foreach ($collections as $collection) {
        $output .= "\n\t\t\t\t\t\t" . '<option value="' . $collection['id'] . '">' . SmartStripSlashes($collection['name']) . '</option>';
    }
    $output .= "\n\t\t\t\t\t</select>";
    return $output;
}
예제 #3
0
function generate_collections_menu()
{
    $collections = get_collections();
    $output = "<select name=\"collections_menu\">";
    foreach ($collections as $collection) {
        $output .= "<option value=\"" . $collection['id'] . "\">" . SmartStripSlashes($collection['name']) . "";
        $output .= "</option>";
    }
    $output .= "</select>";
    return $output;
}
function generate_move_menu($level)
{
    if ($level == 'albums') {
        $parent = 'collections';
    }
    if ($level == 'pictures') {
        $parent = 'albums';
    }
    $output = "\n\t\t\t" . '<input class="submit" type="submit" name="move_checked" value="' . plog_tr('Move Checked To') . '" />';
    if ($level == 'pictures') {
        $albums = get_albums();
        $output .= generate_albums_menu($albums);
    } else {
        $output .= "\n\t\t\t" . '<select class="move-del-manage" id="group_id" name="group_id">';
        $collections = get_collections();
        foreach ($collections as $collection) {
            $output .= "\n\t\t\t\t" . '<option value="' . $collection['id'] . '">' . SmartStripSlashes($collection['name']) . '</option>';
        }
        $output .= "\n\t\t\t" . '</select>';
    }
    return $output;
}
예제 #5
0
function generate_move_menu($level)
{
    if ($level == "albums") {
        $parent = "collections";
    }
    if ($level == "pictures") {
        $parent = "albums";
    }
    $output .= '<input class="submit" type="submit" name="move_checked" value="' . plog_tr("Move Checked To") . '"/>';
    if ($level == "pictures") {
        $albums = get_albums();
        $output .= generate_albums_menu($albums);
    } else {
        $output .= '<select name="group_id">';
        $collections = get_collections();
        foreach ($collections as $collection) {
            $output .= '<option value="' . $collection["id"] . '">' . SmartStripSlashes($collection["name"]);
            $output .= '</option>';
        }
        $output .= '</select>';
    }
    return $output;
}
예제 #6
0
            $params = array("photo_id" => $photos[$i]['photo_id'], "favorite_count" => true, "total_comments" => true);
            $indexes = $cbindex->count_index("photos", $params);
            $fields = $cbindex->extract_fields("photos", $params);
            $msg[] = $photos[$i]['photo_id'] . ": Updating <strong><em>" . $photos[$i]['photo_title'] . "</em></strong>";
            $cbindex->update_index("photos", array("fields" => $fields, "values" => $indexes, "photo_id" => $photos[$i]['photo_id']));
        }
        $i++;
    }
    e($start_index + 1 . " - " . $to . "  photos have been reindexed successfully.", "m");
    assign("index_msgs", $msg);
    assign("indexing", "yes");
    assign('mode', 'index_photos');
}
if (isset($_GET['index_collections'])) {
    $collections = get_collections(array("active" => "yes", "limit" => $start_index . "," . $loop_size));
    $total_collections = get_collections(array("count_only" => true, "active" => "yes"));
    $percent = $cbindex->percent(50, $total_collections);
    $i = 0;
    assign('total', $total_collections);
    assign('from', $start_index + 1);
    $to = $start_index + $loop_size;
    if ($to > $total_collections) {
        $to = $total_collections;
        e($total_collections . " collections have been reindexed successfully.", "m");
        assign("stop_loop", "yes");
    }
    assign('to', $to);
    while ($i < $total_collections) {
        if ($collections[$i]['collection_id']) {
            $params = array("collection_id" => $collections[$i]['collection_id'], "total_items" => true, "total_comments" => true);
            $indexes = $cbindex->count_index("collections", $params);
예제 #7
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 "collections":
        case "uploaded":
        default:
            $limit = create_query_limit($page, config('collection_user_collections'));
            assign("the_title", $user['username'] . " " . lang('collections'));
            $collections = get_collections(array("limit" => $limit, "user" => $user['userid']));
            $total_rows = get_collections(array("count_only" => true, "user" => $user['userid']));
            $total_pages = count_pages($total_rows, config('collection_user_collections'));
            break;
        case "favorites":
        case "fav_collections":
        case "favorite":
            $limit = create_query_limit($page, config('collection_user_favorites'));
            assign("the_title", $user['username'] . " " . lang('favorite') . " " . lang('collections'));
            $favC = array("user" => $user['userid'], "limit", $limit);
            $collections = $cbcollection->action->get_favorites($favC);
            $favC['count_only'] = true;
            $total_rows = $cbcollection->action->get_favorites($favC);
            $total_pages = count_pages($total_rows, config('collection_user_favorites'));
            break;
    }
    assign('collections', $collections);
예제 #8
0
                        $limitType = "comments";
                    } else {
                        $limit = 0;
                        $limitType = '';
                    }
                }
            }
        }
    }
}
if (isset($_GET["collections"]) || isset($_GET["albums"]) || isset($_GET["pictures"]) || isset($_GET["comments"]) || isset($_GET["collection_id"]) || isset($_GET["album_id"]) || isset($_GET["picture_id"]) || isset($_GET["comment_id"])) {
    if (isset($_GET["collection_id"])) {
        $collections = array(get_collection_by_id($_GET["collection_id"]));
    } else {
        if (isset($_GET["collections"])) {
            $collections = get_collections("mod", "DESC");
        } else {
            if (isset($_GET["albums"]) || isset($_GET["album_id"]) || isset($_GET["pictures"]) || isset($_GET["picture_id"]) || isset($_GET["comments"]) || isset($_GET["comment_id"])) {
                $collections = get_collection_ids("mod", "DESC");
            } else {
                $collections = array();
            }
        }
    }
    // $total counts the number of items that are being limited that have been returned.
    // When total equals the limit, we're done.
    $total = 0;
    foreach ($collections as $collection) {
        // A collection's tag is only shown if all collections are being shown
        // or if this specific collection was specified by collection_id
        if (isset($_GET["collections"]) && $_GET["collections"] == 1 || isset($_GET["collection_id"]) && $_GET["collection_id"] == $collection["id"]) {
예제 #9
0
파일: ajax.php 프로젝트: yukisky/clipbucket
     }
     break;
 case "groups":
     $groups = get_groups(array("user" => $u['userid'], "order" => " date_added DESC", "limit" => config('photo_channel_page')));
     if ($groups) {
         foreach ($groups as $group) {
             assign('group', $group);
             assign('channelGroup', true);
             $content['html'] .= Fetch("/blocks/group.html");
         }
     } else {
         $content['html'] = '<div align="center"><em>' . lang('User dont have any groups.') . '</em></div>';
     }
     break;
 case "collections":
     $collections = get_collections(array("user" => $u['userid'], "order" => " date_added DESC", "limit" => config('collection_channel_page')));
     if ($collections) {
         foreach ($collections as $collection) {
             assign('collection', $collection);
             assign('channelCollection', true);
             $content['html'] .= Fetch("/blocks/collection.html");
         }
         $content['html'] .= '<div align="right" class="clearfix channelAjaxMoreLink collectionsMoreLink" style="clear:both; display:block;">';
         $content['html'] .= '<a href="' . cblink(array("name" => "user_collections")) . $u['username'] . '">' . lang('more') . '</a> | <a href="' . cblink(array("name" => "user_fav_collections")) . $u['username'] . '">' . lang('Favorites') . '</a>';
         $content['html'] .= '</div>';
     } else {
         $content['html'] = '<div align="center"><em>' . lang('User dont have any collections') . '</em></div>';
     }
     break;
 case "friends":
     $friends = $userquery->get_contacts($u['userid'], '0', 'yes');
예제 #10
0
function cb_get_user_collections()
{
    global $usercontent, $pages, $cbcollection;
    $user = $usercontent->get_current_user();
    $page = mysql_clean(get('page'));
    $limit = create_query_limit($page, config('collection_user_collections'));
    $collections = get_collections(array("limit" => $limit, "user" => $user['userid'], "order" => "last_updated desc"));
    $avatar_collection = cb_user_avatar_collection($user);
    $is_viewable = $cbcollection->is_viewable($avatar_collection['collection_id']);
    if (is_array($collections) && $avatar_collection && $is_viewable) {
        array_unshift($collections, $avatar_collection);
    } else {
        if ($is_viewable) {
            $collections = $avatar_collection;
        }
    }
    $total_rows = get_collections(array("count_only" => true, "user" => $user['userid']));
    $total_pages = count_pages($total_rows, config('collection_user_collections'));
    $pages->paginate($total_pages, $page);
    $params['file'] = 'user_collections.html';
    $params['collections'] = $collections;
    $params['mode'] = 'created';
    $params['total_collections'] = $total_rows;
    $params['the_title'] = $params['heading'] = name($user) . " " . lang('collections');
    return fetch_template_file($params);
}
예제 #11
0
     break;
 case 'deletecollection':
     if (isset($_SESSION['user_name'])) {
         $collections = get_collections($_SESSION['user_id']);
         $collection_id = filter_input(INPUT_POST, 'collection_id', FILTER_VALIDATE_INT);
         if ($collection_id == NULL || $collection_id == false) {
             $message = 'Something went wrong, try again';
             include 'manageCollections.php';
         } else {
             $message = delete_collection($collection_id);
             if ($message == 'error') {
                 $message = 'A database error occurred';
             } elseif ($message == 'success') {
                 $message = 'Collection Deleted';
             }
             $collections = get_collections($_SESSION['user_id']);
             include 'manageCollections.php';
         }
     } else {
         $message = 'Please sign in to manage collections';
         include 'home.php';
     }
     break;
     //this case is for an ajax function - therefore it doesnt include any views
 //this case is for an ajax function - therefore it doesnt include any views
 case 'addcollectionitem':
     if (isset($_SESSION['user_id'])) {
         $collection_id = filter_input(INPUT_GET, 'collection_id', FILTER_VALIDATE_INT);
         $card_id = filter_input(INPUT_GET, 'card_id', FILTER_VALIDATE_INT);
         if ($collection_id == NULL || $collection_id == false || $card_id == NULL || $card_id == false) {
             echo 'Nothing can be empty';
예제 #12
0
                        $limitType = 'comments';
                    } else {
                        $limit = 0;
                        $limitType = '';
                    }
                }
            }
        }
    }
}
if (isset($_GET['collections']) || isset($_GET['albums']) || isset($_GET['pictures']) || isset($_GET['comments']) || isset($_GET['collection_id']) || isset($_GET['album_id']) || isset($_GET['picture_id']) || isset($_GET['comment_id'])) {
    if (isset($_GET['collection_id'])) {
        $collections = array(get_collection_by_id($_GET['collection_id']));
    } else {
        if (isset($_GET['collections'])) {
            $collections = get_collections('mod', 'DESC');
        } else {
            if (isset($_GET['albums']) || isset($_GET['album_id']) || isset($_GET['pictures']) || isset($_GET['picture_id']) || isset($_GET['comments']) || isset($_GET['comment_id'])) {
                $collections = get_collection_ids('mod', 'DESC');
            } else {
                $collections = array();
            }
        }
    }
    // $total counts the number of items that are being limited that have been returned.
    // When total equals the limit, we're done.
    $total = 0;
    foreach ($collections as $collection) {
        // A collection's tag is only shown if all collections are being shown
        // or if this specific collection was specified by collection_id
        if (isset($_GET['collections']) && $_GET['collections'] == 1 || isset($_GET['collection_id']) && $_GET['collection_id'] == $collection['id']) {
    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 
    }