Example #1
0
<?php

require_once '../../includes/initialize.php';
$session->confirmation_protected_page();
if (User::is_employee() || !User::is_kamy()) {
    redirect_to('index.php');
}
?>

<?php 
$class_name = "MyCigarette";
$class_name1 = "MyCigaretteDay";
$new_item = new MyCigarette();
$new_item->number_cig = 1;
$myDate = strftime("%Y-%m-%d", time());
$new_item->cig_date = $myDate;
$myDate = strftime("%Y-%m-%d %H:%M:%S", time());
$new_item->cig_date_time = $myDate;
$new_item->comment = "Added automatically!";
$new_item->save();
$session->message("Added 1 cig");
$session->ok(true);
redirect_to($class_name1::$page_manage);
Example #2
0
function admin_button()
{
    $output = "<div class=\"col-lg-2 col-md-2 col-md-offset-4\">\n            <div class=\"text-center m-t-lg\">\n        <div class=\"btn-group\" role=\"group\" aria-label=\"...\">\n<!--            <button type=\"button\" class=\"btn btn-default\">1</button>-->\n<!--            <button type=\"button\" class=\"btn btn-default\">2</button>-->\n\n            <div class=\"btn-group\" role=\"group\">\n                <button type=\"button\" class=\"btn btn-primary dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n                    <b>Admin</b>\n                    <span class=\"caret\"></span>\n                </button>\n                <ul class=\"dropdown-menu\">\n                    <li><a href=\"index.php\"><b>Admin</b></a></li>";
    if (User::is_kamy()) {
        $output .= "<li><a href=\"expense_loan.php\">Loan and House</a></li>";
    }
    $output .= "                 <li><a href=\"minor.php\">Minor</a></li>\n                    <li><a href=\"01_test.php\">test 01</a></li>\n\n                </ul>\n            </div>\n        </div>\n            </div>\n        </div>";
    return $output;
}
Example #3
0
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->

<!--<div id="page-wrapper">-->
<?php 
echo admin_button();
?>

    <?php 
include "admin_content.php";
?>

    <?php 
if (User::is_kamy()) {
    ?>

<div class="row">
        <?php 
    echo Table::ibox_table(MyExpense::by_person(), "Expense by Person", 4, 0);
    ?>
        <?php 
    echo Table::ibox_table(MyExpense::by_type(), "Expense by Type", 4, 0);
    ?>
        <?php 
    echo Table::ibox_table(MyExpense::by_ccy(), "Expense by Currency", 4, 0);
    ?>
</div>
    <div class="row">
        <?php 
Example #4
0
 public static function output_links($name_category = null, $category_1 = false, $category_2 = false)
 {
     ////global $database;
     if (!$name_category or empty($name_category)) {
         //  $link_set=find_all_links();
         if ($category_1) {
             $link_set = self::find_all_get(true);
         } elseif ($category_2) {
             $link_set = self::find_all_get(false, true);
         } else {
             $link_set = self::find_all_get();
         }
         if (isset($_GET['category'])) {
             $category = $_GET['category'];
         } else {
             $category = "All";
         }
     } else {
         if ($category_1) {
             $link_set = self::find_name_category_1_links($name_category);
         } elseif ($category_2) {
             $link_set = self::find_name_category_2_links($name_category);
         } else {
             $link_set = self::find_name_category_links($name_category);
         }
         $category = $name_category;
     }
     $output = "";
     $output .= "<div class='table-responsive'>";
     $output .= "<table class='table table-striped table-bordered table-hover table-condensed'>";
     $output .= "<tr>";
     $output .= "<th class='text-center' style='vertical-align:middle;'>{$category}</th>";
     $output .= "</tr>";
     foreach ($link_set as $link) {
         //   while($link = mysqli_fetch_assoc($link_set)) {
         $link_id = $link->id;
         $web = $link->web_address;
         $name = htmlentities($link->name, ENT_COMPAT, 'utf-8');
         $href = "<a target='_blank' href='{$web}'>{$name}</a>";
         if (User::is_kamy()) {
             $modal = "<small>" . self::get_modal_link($link_id) . "</small>";
         } else {
             $modal = "";
         }
         $output .= "<tr>";
         //  $output.= "<td class='text-center'>" . "" . "</td>";
         //todo chk $moodal
         //            $modal="";
         if (!$name_category) {
             $output .= "<td class='text-center'>" . $href . "&nbsp;&nbsp; " . $modal . "</td>";
         } else {
             $output .= "<td class='text-center'>" . $href . "&nbsp;&nbsp; " . "</td>";
         }
         // $output.="<td class='text-center'>".htmlentities($link['category'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['description'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['sub_category_1'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['sub_category_2'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['privacy'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['rank'], ENT_COMPAT, 'utf-8')."</td>";
         //        $output.="<td class='text-center'>".htmlentities($link['username'], ENT_COMPAT, 'utf-8')."</td>";
         $output .= "</tr>";
     }
     $output .= "</table>";
     //    mysqli_free_result($link_set);
     $output .= "</div>";
     return $output;
 }