コード例 #1
0
 public function page3()
 {
     //create the model object
     $cal = new Page();
     //send the webclass
     $webClass = __CLASS__;
     $_SESSION['pageConID'] = "";
     //by pass the form
     $cmd = isset($_GET['cmd']) ? addslashes($_GET['cmd']) : 'read';
     if ($cmd == "edit") {
         //Crud::createForm($obj,$webClass);
         //die('edit');
         $id = isset($_GET['id']) ? addslashes($_GET['id']) : 0;
         if ($id) {
             $cal->getByID($id);
         }
         $mps['id'] = $id;
         $mps['obj'] = $cal;
         Mold::plugin("Page", "pageForm", $mps);
         exit;
     }
     //run the crud utility
     Crud::run($cal, $webClass);
     //pr($mps);
 }
コード例 #2
0
 public function page()
 {
     //create the model object
     $cal = new Page();
     //send the webclass
     $webClass = __CLASS__;
     //by pass the form
     $cmd = isset($_GET['cmd']) ? addslashes($_GET['cmd']) : 'read';
     if ($cmd == "edit") {
         //Crud::createForm($obj,$webClass);
         //die('edit');
         $id = isset($_GET['id']) ? addslashes($_GET['id']) : 0;
         if ($id) {
             $cal->getByID($id);
         }
         $mps['id'] = $id;
         $mps['obj'] = $cal;
         Mold::plugin("Page", "pageForm", $mps);
         exit;
     }
     $cid = addslashes($_GET['cid']);
     if ($cid != "") {
         $_SESSION['pageConID'] = $cid;
     } else {
         //unset($_SESSION['pageConID']);
     }
     $cal->read_filter_array = array("post_gallery_id" => $_SESSION['pageConID']);
     //echo $cid;
     //pr($cal);
     //run the crud utility
     Crud::run($cal, $webClass);
     //pr($mps);
 }
コード例 #3
0
 function loginForm()
 {
     //check apakah ada cookie untuk remember
     Auth::indexCheckRemember();
     if (Auth::isLogged()) {
         // kl sukses login pakai cookie
         //load school setting
         //$ss = new Schoolsetting();
         //$ss->loadToSession();
         Hook::processHook($this->login_hook);
         Account::setRedirection();
     }
     //kalau tidak ada keluarkan loginform
     Mold::plugin("AccountLogin", "loginform");
 }
コード例 #4
0
                        $("#walllist<?=$t;?>").html('<?=Lang::t('No more result');?>');
                    } else {

                        $("#walllist<?=$t;?>").html(data);
                    }

                });
        });
    </script>*/
?>
    
    <div id="walllist">
        <?php 
foreach ($arrWall as $m) {
    //pr($m);
    Mold::plugin("Wall", "einzel_post", array("m" => $m, "typ" => $type, "klsid" => $kelas_id, "newFor" => $newFor));
}
?>
    </div>
<?php 
$nmore = isset($_GET['nomoreresults']) ? addslashes($_GET['nomoreresults']) : 'no';
if ($nmore != "yes") {
    ?>
    <div class="loadmore" style="padding:10px; text-align: center;">
    <span style="padding:10px; cursor: pointer; color: #777; background-color: #fff; border-radius: 5px;"
          id="loadmoreb<?php 
    echo $t;
    ?>
">
        <?php 
    echo Lang::t('show more results');
コード例 #5
0
    <script type="text/javascript">
        $("#commmentformv<?php 
echo $t;
?>
").click(function () {
            $('#myModalLabel').empty().append('<?php 
echo Lang::t('Write your reply');
?>
');
            $('#myModalBody').load('<?php 
echo _SPPATH;
?>
WallPortalWeb/viewcomment?cmd=form&typ=kelas&klsid=<?php 
echo $klsid;
?>
&wid=<?php 
echo $wall->wall_id;
?>
');
        });
    </script>
    <div style="padding: 10px;">
<?php 
foreach ($mwc as $c) {
    Mold::plugin("Wall", "einzel_comment", array("c" => $c));
}
//pr($arr);
?>
  <div class="clearfix"></div>
    </div>
    </div>
コード例 #6
0
 public static function read($obj, $webClass)
 {
     if ($obj instanceof Model) {
         $mps = $obj->read();
         $mps['webClass'] = $webClass;
         $mps = $obj->overwriteRead($mps);
         Mold::plugin("Crud", "read", $mps);
     } else {
         die('Crud hanya bisa dipakai dengan object Crud');
     }
 }
コード例 #7
0
 public function viewcomment()
 {
     //$ta = TahunAjaran::ta();
     $wid = isset($_GET['wid']) ? addslashes($_GET['wid']) : '';
     $klsid = isset($_GET['klsid']) ? addslashes($_GET['klsid']) : '';
     $typ = isset($_GET['typ']) ? addslashes($_GET['typ']) : '';
     $cmd = isset($_GET['cmd']) ? addslashes($_GET['cmd']) : 'view';
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     //$return['ta'] = $ta;
     $return["klsid"] = $klsid;
     if ($cmd == "form") {
         $return["typ"] = $typ;
         $return['id'] = $wid;
         $return['mode'] = "viewcomment";
         Mold::plugin("Wall", "compose", $return);
         die;
     }
     if ($cmd == "add") {
         $json['bool'] = 0;
         $json['err'] = '';
         //pr($_POST);
         if (isset($_POST['wall_msg'])) {
             $wall_msg = trim(rtrim($_POST['wall_msg']));
         }
         if ($wall_msg == '') {
             $json['err'] .= Lang::t('Message is empty');
         }
         $id = isset($_GET['id']) ? addslashes($_GET['id']) : '';
         if ($id == '') {
             $json['err'] .= Lang::t('Id is empty');
         }
         if ($json['err'] == '') {
             // am 01.10.2014,insert <embed><iframe> vom Efindi
             //$wall_msg = addslashes(strip_tags(trim(rtrim ($_POST['wall_msg'])),'<p><a><br><b><i><img><hr>'));
             $wall_msg = strip_tags(trim(rtrim($_POST['wall_msg'])), '<p><a><br><b><i><img><hr><embed><iframe>');
             //if ($typ == "kelas") {
             $wall = new WallPortalComment();
             $wall->wid = $id;
             $wall->cid_admin_nama = Account::getMyName();
             $wall->cid_admin_foto = Account::getMyFoto();
             $wall->cid_admin_id = Account::getMyID();
             //create date
             //$tgl = Wall::getDateTime();
             $wall->c_date = leap_mysqldate();
             $wall->c_text = $wall_msg;
             $json['bool'] = $wall->save();
             if ($json['bool']) {
                 $wall2 = new WallPortal();
                 $wall2->getByID($id);
                 $wall2->wall_commentcount++;
                 $wall2->wall_update = $tgl;
                 $wall2->load = 1;
                 //spy update
                 $json['bool'] = $wall2->save();
             }
             // }
         }
         die(json_encode($json));
     }
     if ($cmd == "view") {
         $mwc = new WallPortalComment();
         $whereClause = "wid = '{$wid}' ORDER BY c_date DESC";
         $arrComment = $mwc->getWhere($whereClause);
         $wall = new WallPortal();
         $wall->getByID($wid);
         $acc = new Account();
         $acc->getByID($wall->wall_from);
         $wall->acc = $acc;
         $target = $typ . "___" . $wall->wall_id;
         $foto = new Fotoajax();
         $arrFoto = $foto->getWhere("photo_target_id = '{$target}' ORDER BY photo_date DESC");
         $wall->foto = $arrFoto;
         $return['newFor'] = $this->newFor;
         $return['wall'] = $wall;
         $return['mwc'] = $arrComment;
         Mold::plugin("Wall", "viewcomment", $return);
     }
 }
コード例 #8
0
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
  
<style>
 <?php 
//load custon css
echo ThemeReg::mod("custom_css", "", "text");
?>

</style>
</head>
<body>
<?php 
Mold::plugin("FacebookLogin", "facebookjs");
?>


<?php 
Mold::theme("afterBodyJS");
Mold::theme("ajaxLoader");
?>
<div class="container">

      <!-- Static navbar -->
      <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              <span class="sr-only">Toggle navigation</span>
コード例 #9
0
 public function editProfile()
 {
     //Model
     $acc = new Account();
     //getByID using superclass function
     $acc->getByID(Account::getMyID());
     //get the role
     $role = ucfirst($acc->admin_role);
     //kill the program if roleless
     if ($role == "") {
         die('Role Empty');
     }
     //create dynamic object, all subclass from ModelAccount
     //$murid = new $role();
     //get and fill Object
     // $murid->getByAccountID($acc_id);
     //create Return Object
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     $return['roleObj'] = $acc;
     $return['acc'] = $acc;
     //Molding Design
     Mold::plugin("AccountLogin", "editprofile", $return);
 }
コード例 #10
0
<div id="wallcontainer">

<?php 
/*if (!$muridview) { ?>
    <div class="row" style="margin-bottom: 10px;">
        <div class="col-md-3 col-xs-12">
            <?
            //select on kelas
            $urlOnChange = _SPPATH . $webClass . "/" . $method . "?dummy=1";
            Selection::kelasSelector($kelas, $urlOnChange);
            ?>
        </div>
    </div>
<? } */
Mold::plugin("Wall", "class_wall_einzel", $arr);
?>
</div>
<?php 
//pr($arr);
コード例 #11
0
 public static function loadFBJS()
 {
     Mold::plugin("FacebookLogin", "facebookjs");
 }
コード例 #12
0
    public static function loginAndRegform()
    {
        ?>
<script>
    function showLogin(){
        $('#loginPage').fadeIn('slow');
        $('#regPage').hide();
        $('#content_all').hide();
        console.log('showlogin');
    }
    function showRegister(){
        $('#regPage').fadeIn('slow');
        $('#loginPage').hide();
        $('#content_all').hide();
        console.log('reg');
    }
    function closeLoginAndReg(){
        $('.loginPage').hide();
        $('#content_all').show();
        console.log('closeLoginAndReg');
    }
</script>
<div id="loginPage" class="loginPage" style="display: none; ">
    <div class="donly" style="float: right; width: 20px; cursor:pointer; height: 20px; color: #BBBBBB;" onclick="closeLoginAndReg();">x</div>
    <div class="monly" style="position:absolute; top:20px; right: 10px;z-index: 1000; width: 20px; cursor:pointer; height: 20px; color: #BBBBBB;" onclick="closeLoginAndReg();">x</div>


    <div class="col-md-4 col-md-offset-4" style="padding: 20px; text-align: center;">
        <div class="besar" style="margin-top: 50px;">
            LOG IN
        </div>
        <form class="form-signin" role="form" action="<?php 
        echo _SPPATH;
        ?>
MemberLoginWeb/loginWAnything" method="post" id="loginform" name="loginform">





                    <div id="login_alert" class="alert alert-danger" role="alert" style="margin-bottom: 20px; display: none;">
                    </div>


            <div class="formlabel" >
                Card Nr./Email/Phone
            </div>
            <input id="user_login" type="text" name="cred1" class="form-control" placeholder="Card Nr./Email/Phone" required
                   autofocus>
            <div class="formlabel" >
                Date of Birth
            </div>
            <?php 
        $input = new \Leap\View\InputText("date", "user_pass", "cred2", date("d-m-Y"));
        $input->p();
        ?>
<!--            <input id="user_pass" type="date" name="cred2" class="form-control" placeholder="Date of Birth" required>-->
            <div class="formlabel">
                <input checked="true" type="checkbox" value="1" id="rememberme" name="rememberme"> <span
                    ><?php 
        echo Lang::t('remember me');
        ?>
</span>
            </div>
            <button class="btn btn-lg btn-primary btn-block" type="submit"><?php 
        echo Lang::t("submit");
        ?>
</button>
        </form>

        <br><br>
        I havent got any member card or registration. <a onclick="showRegister();">Register here</a>.

    </div>
    <script>
        $(document).ready(function(){
            // Attach a submit handler to the form
            $( "#loginform" ).submit(function( event ) {

                // Stop form from submitting normally
                event.preventDefault();

                // Get some values from elements on the page:
                var $form = $( this ),
                    url = $form.attr( "action" );

                // Send the data using post
                var posting = $.post( url,  $( "#loginform" ).serialize() ,function(data){

                    console.log(data);
                    if(data.bool){
                        $('#login_alert').hide();
                        closeLoginAndReg();
                        $('#login_menu').hide();
                        $('#logged_menu').html('<a href="<?php 
        echo _SPPATH;
        ?>
myprofile">'+data.results.name+'</a>  | <a href="<?php 
        echo _SPPATH;
        ?>
logout">LOGOUT</a>').show();

                        var htmlMobile = '<a href="<?php 
        echo _SPPATH;
        ?>
myprofile">'+data.results.name+'</a>  | <a href="<?php 
        echo _SPPATH;
        ?>
logout">LOGOUT</a>';


                        $('#logged_menu').html(htmlMobile).show();


                        //untuk mobile
                        $('#logged_menu_mob').html(htmlMobile).show();
                        $('#login_menu_mob').hide();

                    }else{
                        $('#login_alert').html(data.status_message).show();
                    }
                },'json');


            });
        });


    </script>
</div>
<style>
    .formlabel{
        text-align: left;
        padding-bottom: 10px;
        font-weight: bold;
        color: white;
        letter-spacing: 2px;
        padding-top: 10px;
    }
    .btn-primary {
        color: #fff;
        background-color: #878787;
        border-color: #878787;
    }
</style>
<div id="regPage" class="loginPage" style="display: none; ">
    <div class="donly" style="float: right; width: 20px; cursor:pointer; height: 20px; color: #dedede;" onclick="closeLoginAndReg();">x</div>
    <div class="monly" style="position:absolute; top:20px; right: 10px;z-index: 1000; width: 20px; cursor:pointer; height: 20px; color: #BBBBBB;" onclick="closeLoginAndReg();">x</div>


    <div class="besar" style="margin-top: 50px;">
        REGISTER
    </div>
    <div class="col-md-4 col-md-offset-4" style="padding: 20px;">

        <?php 
        Mold::plugin("AccountLogin", "loginform");
        ?>
        <br><br>
        I've got a member card. <a onclick="showLogin();">Login here</a>.
    </div>
</div>
<style>
    .besar{
        color: white;
        font-size: 55px;
        margin-bottom: 30px;

    }
    .loginPage{
        position: fixed;
        z-index: 1030;
        width: 100%;
        height: 100%;
        background-color: white;
        text-align: center;
        padding: 10px;
        background-image: url(<?php 
        echo _SPPATH;
        ?>
images/blur.jpg);
        background-size: cover;
        background-position: center;
        opacity: 0.9;
    }
</style>
<?php 
    }