function testPopUp() { $_SESSION['alreadyPopUp'] = 0; $_SESSION['testPopUp'] = 1; $arrLeft = array(new Portlet("PopUpWeb", "createPopUp")); $arrRight = array(); BootstrapUX::twoColoums($arrLeft, $arrRight, 8, 4); }
function home() { //print_r(PDO::getAvailableDrivers()); //pr($_SESSION); //sebelah kanan $arrLeft = array(new Portlet("CarouselPortalWeb", "createCarousel"), new Portlet("Quotes", "printQuote"), new Portlet("LeapFacebook", "facebookfeed"), new Portlet("LeapTwitter", "twitterFeed"), new Portlet("LeapYoutube", "youtubeFeed"), new Portlet("VideoWeb", "videoFeed"), new Portlet("PopUpWeb", "createPopUp")); $arrRight = array(new Portlet("NewsFeedWeb", "getFeed"), new Portlet("PortalTemplate", "printIcons")); BootstrapUX::twoColoums($arrLeft, $arrRight, 8, 4); }
</div> </div> </div> </div> <?php } ?> <div class="clearfix"></div> <div class="gantihal" style="text-align: center;"> <?php //begin pagination //echo $page; echo $jml; BootstrapUX::pagination($page, $jml, $limit, $link); ?> </div> </div> <style> .product_dalaman { margin: 10px; border-bottom: 1px solid #ccc; } .product_name a { color: #111; font-style: italic; font-family: 'Libre Baskerville', serif; } .prod_price {
public function loadGroupChat() { $gid = isset($_GET['gid']) ? addslashes($_GET['gid']) : die("NO GID"); $m = new ChatMember(); $begin = addslashes($_GET['begin']); $acc = new Account(); //global $db; //$q = "SELECT admin_nama_depan,chat_group_id,chat_member_id,admin_foto FROM {$acc->table_name},{$m->table_name} WHERE chat_group_id = '$gid' AND chat_member_id = admin_id"; $arrMember = $m->getMemberFromGID($gid); //$arrMember = $m->getWhere("chat_group_id = '$gid'"); //cek apakah dia anggota group $ok = 0; $arrUser = array(); $arrUserFoto = array(); foreach ($arrMember as $mm) { if ($mm->chat_member_id == Account::getMyID()) { $ok = 1; } //sortmember spy mudah diambil $arrUser[$mm->chat_member_id] = $mm->admin_nama_depan; $arrUserFoto[$mm->chat_member_id] = $mm->admin_foto; } //ok dia member if ($ok) { //get group $g = new ChatGroup(); $g->getByID($gid); ?> <style> .chatboxfullpage{ // background-color: #fff; // border-radius: 5px; } .memberfoto{ float:right; margin:3px; } </style> <script> latest_entry = 0; </script> <div class="chatboxfullpage col-md-8 col-md-offset-2"> <div class="groupname"> <div class="senderdate" style="width:200px;"> <?php echo ago(strtotime($g->inbox_changedate)); ?> </div> <i class="glyphicon glyphicon-comment"></i> <?php echo stripslashes($g->inbox_judul); ?> <div class="members"> <?php foreach ($arrUserFoto as $id => $foto2) { $foto = Account::getFoto($foto2); ?> <div class="memberfoto"><?php Account::printFoto($foto, 25); ?> </div><?php } ?> </div> <div class="chat_action"> <?php if ($g->inbox_from == Account::getMyID()) { ?> <?php BootstrapUX::createModalButton('Edit Chat Group', _SPPATH . "ChatMsgGroupWeb/inviteNewMember?t=" . time() . "&gid=" . $gid, 'edit chat group', 'btn btn-default btn-xs'); ?> <!--<button onclick="invite_group_chat('<?php echo $gid; ?> ');" class="btn btn-default btn-xs">invite new member</button>--> <button onclick="close_group_chat('<?php echo $gid; ?> ');" class="btn btn-default btn-xs"><?php echo Lang::t('close group'); ?> </button> <?php } else { ?> <button onclick="leave_group_chat('<?php echo $gid; ?> ');" class="btn btn-default btn-xs"><?php echo Lang::t('leave chat'); ?> </button> <?php } ?> <button id="close_chat_<?php echo $gid; ?> " class="btn btn-default btn-xs"><?php echo Lang::t('close chat'); ?> </button> <script> $( "#close_chat_<?php echo $gid; ?> " ).click(function( event ) { event.preventDefault(); lwclose(window.selected_page); deActivateChatMode(); }); </script> </div> <div class="clearfix"></div> </div> <?php $c = new ChatMsg(); $all = 0; $limit = 20; if ($begin == "all") { $all = 1; $arrChat = $c->getWhere("chat_group_id = '{$gid}' ORDER BY inbox_createdate DESC"); } else { $arrChat = $c->getWhere("chat_group_id = '{$gid}' ORDER BY inbox_createdate DESC LIMIT 0,{$limit}"); } //pr($arrChat); $total = $c->getJumlah("chat_group_id = '{$gid}'"); ?> <style type="text/css"> .groupname{ padding:10px; font-weight: bold; //background-color: #efefef; border-bottom: 2px solid #efefef; font-size: 15px; } .baloon { margin: 10px; padding: 10px; } .sender { padding: 10px; padding-top: 0px; } .senderdate { font-size: 0.9em; font-style: italic; color: #999; float: right; width:100px; text-align: right; } .sendername { font-weight: bold; } .msg { background-color: #7fffaf; padding: 10px; } .to .sender { } .to .msg { background-color: #7FDBFF; } .judulinbox { font-size: 16px; padding: 5px; margin: 5px; } .skipbalon0 { margin-top: -20px; } </style> <div id="chatboxcontainer"> <?php $merge = array_reverse($arrChat); if (count($merge) > 0) { //set latest entry ?> <script> latest_entry = '<?php echo $arrChat[0]->inbox_reply_id; ?> '; </script> <?php } if ($total > $limit && !$all) { if ($num == 0) { $prevID = 0; $moreresult = $total - $limit; ?> <div id="overwrite<?php echo $t; ?> "> <div id="showallmsg<?php echo $t; ?> " style="cursor: pointer;text-align: center; background-color: #dedede; padding-top: 10px; padding-bottom: 10px; margin-bottom: 10px; margin-top: 10px;"> <?php echo Lang::t('Show all conversations'); ?> <?php echo "({$moreresult})"; ?> </div> </div> <script type="text/javascript"> $("#showallmsg<?php echo $t; ?> ").click(function () { // $("#chatboxcontainer").load('<?php echo _SPPATH; ?> Inboxweb/see?id=<?php echo $inbox->inbox_id; ?> &begin=all'); openLw('groupchat','<?php echo _SPPATH; ?> ChatMsgWeb/loadGroupChat?gid=<?php echo $gid; ?> &begin=all','scrollBottom'); }); </script> <?php } } foreach ($merge as $num => $obja) { $replyid = isset($obja->inbox_reply_id) ? $obja->inbox_reply_id : $obja->inbox_id; //cek prevID if ($prevID == $obja->inbox_from) { $skipbalon = 0; } else { $skipbalon = 1; $prevID = $obja->inbox_from; } ?> <div class="row <?php echo $class; ?> baloon" id="inbox-<?php echo $replyid; ?> "> <div class="skipbalon<?php echo $skipbalon; ?> "> <div style="float:left; width: 45px; padding-left:10px; padding-right: 10px; padding-top: 10px;"> <?php if ($skipbalon) { $foto = Account::getFoto($arrUserFoto[$obja->inbox_from]); ?> <div class="senderfoto"><?php Account::printFoto($foto, 45); ?> </div> <?php } ?> </div> <div style="margin-left:65px; padding-left: 10px; border:1px dotted #dedede; padding: 10px;"> <div class="senderdate"><?php echo ago(strtotime($obja->inbox_createdate)); ?> </div> <?php if ($skipbalon) { ?> <div class="sendername"><?php echo $arrUser[$obja->inbox_from]; ?> </div> <?php } ?> <div style="padding-top:10px;"> <?php echo stripslashes($obja->inbox_msg); ?> </div> </div> </div> </div> <?php } ?> </div><!-- chatbox container --> </div><!-- chatbox --> <?php //remove notif from this group $g = new ChatGroup(); $g->removeNotifPortal($gid); } }
public function category($args) { list($name, $page) = $args; // $name; $name = urldecode($name); $cat = new ProdCat(); $arr = $cat->getWhere("cat_name LIKE '{$name}'"); // echo $name; ?> <style> .judulcategory { padding-top : 20px; padding-left : 15px; color : #AAA; font-size : 14px; } .judulcategory a { font-size : 14px; color : #AAA; font-family : 'Open Sans', sans-serif; font-weight : normal; } .judulcategory a:hover { text-decoration : underline; } .h1category { padding-top : 20px; padding-bottom : 0px; padding-left : 15px; margin : 0; padding-bottom : 30px; color : #000; font-style : italic; font-family : 'Libre Baskerville', serif; font-size : 28px; } </style> <?php if (count($arr) > 0) { // pr($arr); $arrParent = array(); $arrpp = ProdCat::getAllParents($arr[0]->cat_parent_id, $arrParent); //pr($arrpp); $arrpp2 = array_reverse($arrpp); foreach ($arrpp2 as $bc) { $str[] = "<a href='" . _SPPATH . "pwa/category/" . urlencode($bc->cat_name) . "'>" . $bc->cat_name . "</a>"; } /* * print breadcrumbs if(count($arrpp2)>0) echo "<div class='judulcategory'>".implode(" > ",$str)." > </div>"; */ ?> <h1 class="h1category"><?php echo ucwords($name); ?> </h1> <?php $pc = new ProdModel(); //pagination if ($page < 1 || $page == "") { $page = 1; } $limit = 21; $begin = ($page - 1) * $limit; $link = _SPPATH . "pwa/category/" . urlencode($name) . "/|x|"; $jml = $pc->getJumlah("prod_cat_id = '{$arr[0]->cat_id}'"); //end pagination $arrp = $pc->getWhere("prod_cat_id = '{$arr[0]->cat_id}' LIMIT {$begin},{$limit}"); //pr($arrp); foreach ($arrp as $num => $prod) { $cw = new Cw(); $cw->productPrinter($prod); if ($num % 3 == 2) { ?> <div class="clearfix"></div> <?php } } ?> <div class="clearfix"></div> <div class="gantihal" style="text-align: center;"> <?php //begin pagination BootstrapUX::pagination($page, $jml, $limit, $link); ?> </div> <?php } }
public function loadFolder() { $tid = isset($_GET['tid']) ? addslashes($_GET['tid']) : die('no ID'); $t = isset($_GET['t']) ? addslashes($_GET['t']) : die('no t'); /* * sort */ if (!isset($_SESSION['loadFolderSort'])) { $_SESSION['loadFolderSort'] = "name"; } $sortBy = isset($_GET['sortBy']) ? addslashes($_GET['sortBy']) : $_SESSION['loadFolderSort']; $_SESSION['loadFolderSort'] = $sortBy; $ftext = " ORDER BY folder_name ASC "; $dtext = " ORDER BY file_url ASC "; if ($sortBy == "type") { $dtext = " ORDER BY file_ext ASC,file_url ASC "; } if ($sortBy == "date") { $dtext = " ORDER BY file_date ASC,file_url ASC "; $ftext = " ORDER BY folder_date ASC,folder_name ASC "; } /* * search */ $sdtext = ""; $sftext = ""; $search = isset($_GET['search']) ? addslashes(urldecode($_GET['search'])) : ''; //echo $search; if ($search != '') { $sftext = " folder_name LIKE '%{$search}%'"; $sdtext = " ( file_url LIKE '%{$search}%' OR file_isi LIKE '%{$search}%' )"; } $_SESSION['loadFolderSearch'] = $search; $full = isset($_GET['full']) ? addslashes($_GET['full']) : 0; if ($full && $search != '') { //ambil semua anak2 dari semua folder...dan search accordingly if ($tid < 1) { //folder paling luar langsung saja keluarkan semuanya... $df = new DocumentsPortalFolder(); $arr = $df->getWhere(" {$sftext} {$ftext} "); $ff = new DocumentsPortal(); $arrfiles = $ff->getWhere(" {$sdtext} {$dtext}"); } else { if ($sdtext != "") { $sdtext = " AND " . $sdtext; } if ($sftext != "") { $sftext = " AND " . $sftext; } //get semua child foldernya $df = new DocumentsPortalFolder(); $arrChildFolder = $this->findChildren($tid); //pr($arrChildFolder); $result = array_unique(explode(",", $arrChildFolder)); //pr($result); $arrFtext = array("folder_parent_id = '{$tid}'"); $arrDtext = array("file_folder_id = '{$tid}'"); foreach ($result as $r) { $arrFtext[] = "folder_parent_id = '{$r}'"; $arrDtext[] = "file_folder_id = '{$r}'"; } $ands = implode(" OR ", $arrFtext); $ands = "(" . $ands . ")"; //echo $ands." $sftext $ftextbr <br><br>"; $df = new DocumentsPortalFolder(); $arr = $df->getWhere(" {$ands} {$sftext} {$ftext} "); //pr($arr); $andsf = implode(" OR ", $arrDtext); $andsf = "(" . $andsf . ")"; //echo " $andsf $sdtext $dtext <br>"; $ff = new DocumentsPortal(); $arrfiles = $ff->getWhere(" {$andsf} {$sdtext} {$dtext}"); } } else { if ($sdtext != "") { $sdtext = " AND " . $sdtext; } if ($sftext != "") { $sftext = " AND " . $sftext; } $df = new DocumentsPortalFolder(); $arr = $df->getWhere("folder_parent_id = '{$tid}' {$sftext} {$ftext} "); $ff = new DocumentsPortal(); $arrfiles = $ff->getWhere(" file_folder_id = '{$tid}' {$sdtext} {$dtext}"); } ?> <style> .findet{ background-color:yellow; } </style> <?php foreach ($arr as $f) { ?> <div class="folderdoc-item"> <div class="foldername"> <div title="<?php echo Lang::t('Expand Folder'); ?> " class='foldername-plus' id="foldername_<?php echo $f->folder_id; ?> _<?php echo $t; ?> "> <i class="ficon glyphicon glyphicon-expand"></i> </div> <div title="<?php echo Lang::t('View Folder in a new Page'); ?> " class="foldername-text"> <i style="cursor:pointer;" class="glyphicon glyphicon-folder-close" onclick="winBaru4ByPass('UploadDoc_<?php echo $f->folder_id; ?> ','<?php echo _SPPATH; ?> DMWeb/upload?t=<?php echo $t; ?> &tid=<?php echo $f->folder_id; ?> ','fade');"></i> <span ondblclick="this.contentEditable=true;this.className='inEdit';" onblur="this.contentEditable=false;this.className='';saveFolderName_<?php echo $t; ?> ('<?php echo $f->folder_id; ?> ');" id="foldernameedit_<?php echo $f->folder_id; ?> _<?php echo $t; ?> "> <?php $xx = $f->folder_name; if ($search != '') { $xx = str_ireplace($search, "<i class='findet'>" . $search . "</i>", $f->folder_name); } echo $xx; ?> </span> <?php //if not view only if ($_SESSION['DocumentPortal_view_only'] < 1) { ?> <?php //BootstrapUX::createModal(Lang::t('Choose Destination Folder'), _SPPATH."DMWeb/movefile?t=".$t."&tid=".$f->folder_id, "glyphicon glyphicon-retweet",$f->folder_id."_folder"); ?> <?php BootstrapUX::createModal(Lang::t('Edit Folder [' . $f->folder_name . ']'), _SPPATH . "DMWeb/editfolder?t=" . $t . "&tid=" . $f->folder_id, "glyphicon glyphicon-edit muda", $f->folder_id . "_folderedit"); ?> <?php } ?> <?php if ($search != '') { //search mode ?> <span class="location"> </span> <?php } ?> </div> </div> <div id="folders_<?php echo $f->folder_id; ?> _<?php echo $t; ?> " class="folderPortal" style="display:none;" > </div> </div> <script> $("#foldername_<?php echo $f->folder_id; ?> _<?php echo $t; ?> ").click(function(){ if($("#folders_<?php echo $f->folder_id; ?> _<?php echo $t; ?> ").css("display") == "none"){ $("#folders_<?php echo $f->folder_id; ?> _<?php echo $t; ?> ").show(); activeTID_<?php echo $t; ?> = <?php echo $f->folder_id; ?> ; $("#foldername_<?php echo $f->folder_id; ?> _<?php echo $t; ?> i.ficon").removeClass("glyphicon glyphicon-expand").addClass("glyphicon glyphicon-collapse-down"); if(jQuery.inArray(<?php echo $f->folder_id; ?> , activeHistory_<?php echo $t; ?> )!==-1){ loadfolder_<?php echo $t; ?> ('<?php echo $f->folder_id; ?> '); }else{ console.log(jQuery.inArray('<?php echo $f->folder_id; ?> ', activeHistory_<?php echo $t; ?> )); loadfolder_<?php echo $t; ?> ('<?php echo $f->folder_id; ?> '); activeHistory_<?php echo $t; ?> .push(activeTID_<?php echo $t; ?> ); console.log(activeHistory_<?php echo $t; ?> ); } }else{ $("#folders_<?php echo $f->folder_id; ?> _<?php echo $t; ?> ").hide(); activeTID_<?php echo $t; ?> = <?php echo $f->folder_parent_id; ?> ; $("#foldername_<?php echo $f->folder_id; ?> _<?php echo $t; ?> i.ficon").removeClass("glyphicon glyphicon-collapse-down").addClass("glyphicon glyphicon-expand"); } markActiveFolder_<?php echo $t; ?> (); }); </script> <?php } foreach ($arrfiles as $fil) { $arrParents = $fil->findAllParents(); //pr($arrParents); //pr($p); $arrpar = array(); $arrParents = array_reverse($arrParents); foreach ($arrParents as $par) { $arrpar[] = "<span style='cursor:pointer;text-decoration:underline;' onclick=\"winBaru4ByPass('UploadDoc_" . $par->folder_id . "','" . _SPPATH . "DMWeb/upload?t=" . $t . "&tid=" . $par->folder_id . "','fade');\">" . $par->folder_name . "</span>"; } $strpar = implode(" / ", $arrpar); ?> <div class="filedoc"> <i class="glyphicon glyphicon-list-alt"></i> <!-- benerin file viewer --> <?php $url = "dm"; $link = _SPPATH . "InputFileWeb/show?gurl=" . $url . "&id=" . $fil->file_id; $onclick = "onclick=\"openLw('DocViewer','" . $link . "','fade');\""; if ($_SESSION['DocumentPortal_view_only']) { $link = _SPPATH . "docviewer?gurl=" . $url . "&id=" . $fil->file_id; $onclick = "onclick=\"window.open('" . $link . "','_blank');\""; } ?> <!--<a href="<?php echo _SPPATH; echo $fil->upload_url; echo $fil->file_filename; ?> " target="_blank">--> <a style="cursor:pointer;" <?php echo $onclick; ?> > <?php $xx = $fil->file_url; if ($search != '') { $xx = str_ireplace($search, "<i class='findet'>" . $search . "</i>", $fil->file_url); } echo $xx; ?> </a> <?php //if not view only if ($_SESSION['DocumentPortal_view_only'] < 1) { ?> <i id="deletefile_<?php echo $fil->file_id; ?> _<?php echo $t; ?> " class="glyphicon glyphicon-remove-sign"></i> <?php //BootstrapUX::createModal(Lang::t('Choose Destination Folder'), _SPPATH."DMWeb/movefile?fid=".$fil->file_id."&t=".$t."&tid=".$tid, "glyphicon glyphicon-retweet",$fil->file_id); ?> <?php BootstrapUX::createModal(Lang::t($fil->file_url), _SPPATH . "DMWeb/editfile?fid=" . $fil->file_id . "&t=" . $t . "&tid=" . $tid, "glyphicon glyphicon-edit muda", $fil->file_id . "_fileedit"); ?> <?php } ?> <?php if ($search != '') { //search mode ?> <span class="location" style="font-style: italic;font-size: 12px;"> <?php echo $strpar; ?> </span> <?php } ?> </div> <?php if ($_SESSION['DocumentPortal_view_only'] < 1) { ?> <script> $("#deletefile_<?php echo $fil->file_id; ?> _<?php echo $t; ?> ").click(function(){ if(confirm("<?php echo Lang::t('Are you sure? This action is not undoable'); ?> ")){ $.get("<?php echo _SPPATH; ?> DMWeb/deleteFile?t=<?php echo $t; ?> &fid=<?php echo $fil->file_id; ?> ",function(data){ winBaru4ByPass("UploadDoc_<?php echo $tid; ?> ","<?php echo _SPPATH; ?> DMWeb/upload?tid=<?php echo $tid; ?> &t=<?php echo $t; ?> "); }); } }); </script> <?php } ?> <?php } }