File indexing completed on 2024-12-29 05:24:49
0001 <?php 0002 /** 0003 * ocs-webserver 0004 * 0005 * Copyright 2016 by pling GmbH. 0006 * 0007 * This file is part of ocs-webserver. 0008 * 0009 * This program is free software: you can redistribute it and/or modify 0010 * it under the terms of the GNU Affero General Public License as 0011 * published by the Free Software Foundation, either version 3 of the 0012 * License, or (at your option) any later version. 0013 * 0014 * This program is distributed in the hope that it will be useful, 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 * GNU Affero General Public License for more details. 0018 * 0019 * You should have received a copy of the GNU Affero General Public License 0020 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0021 **/ 0022 $smodel = new Default_Model_Section(); 0023 $sections = $smodel->fetchAllSections(); 0024 ?> 0025 0026 <style type="text/css"> 0027 0028 0029 div.jtable-main-container table.jtable tbody > tr > td{ 0030 vertical-align: top; 0031 border-left:0px; 0032 border-right:0px; 0033 font-size: small; 0034 } 0035 div.jtable-main-container table.jtable{ 0036 border: 0px; 0037 } 0038 div.jtable-main-container table.jtable th{ 0039 border: 0px; 0040 background: none; 0041 font-weight: bold; 0042 } 0043 0044 #TableContainer 0045 { 0046 padding: 20px; 0047 } 0048 #titleheader{ 0049 padding-left: 20px; 0050 padding-top: 100px; 0051 } 0052 0053 a.btn-xs 0054 { 0055 line-height: 12px; 0056 padding: 3px 5px; 0057 border-radius: 2px; 0058 margin: 2px; 0059 float: right; 0060 } 0061 0062 0063 div.jtable-main-container table.jtable .tooltipuser{ 0064 color: #2673b0; 0065 cursor: pointer; 0066 } 0067 0068 div.jtable-main-container img.avatar{ 0069 width: 50px; 0070 border: 1px solid #dbdbdb; 0071 -webkit-border-radius: 999px; 0072 -moz-border-radius: 999px; 0073 border-radius: 999px; 0074 -webkit-background-clip: padding-box; 0075 -moz-background-clip: padding; 0076 background-clip: padding-box; 0077 display: block; 0078 } 0079 0080 a.removeuser{ 0081 display: block; 0082 } 0083 0084 .aligncenter 0085 { 0086 text-align: center; 0087 } 0088 0089 0090 </style> 0091 0092 <link href="/theme/backend/lib/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet"> 0093 <link href="/theme/backend/lib/jtable/themes/jqueryui/jtable_jqueryui.min.css" rel="stylesheet"> 0094 <script src="/theme/backend/lib/jquery-ui/jquery-ui.min.js"></script> 0095 <script src="/theme/backend/lib/jtable/jquery.jtable.min.js"></script> 0096 0097 <div class="messages"> 0098 0099 </div> 0100 <div class="tooltip_templates" style="display:none"> 0101 <span id="tooltip_content"> 0102 <i class="fa fa-spinner"></i> 0103 </span> 0104 </div> 0105 <div id="titleheader"> <h1>List of new products (published or unpublished) less than 2 months </h1></div> 0106 <div id="filter" style="padding:10px 20px;"> 0107 Section Filter: <select id="filter_section" name="filter_section"> <option></option> 0108 0109 <?php 0110 foreach ($sections as $s) { 0111 echo '<option value='.$s['section_id'].'>'.$s['name'].'</option>'; 0112 } 0113 ?> 0114 </select> 0115 </div> 0116 <div id="TableContainer"></div> 0117 <div id="dialog-form" title="Object Details"></div> 0118 <div id="dialog-confirm" title="Confirm"></div> 0119 <script type="text/javascript"> 0120 $(document).ready(function () { 0121 $('#TableContainer').jtable({ 0122 jqueryuiTheme: true, 0123 paging: true, 0124 sorting: false, 0125 actions: { 0126 listAction: '/spam/newproductlist', 0127 }, 0128 recordsLoaded: function (event, data) { 0129 TooltipUser.setup("tooltipuser","right"); 0130 }, 0131 rowInserted: function (event, data) { 0132 if (data.record.is_wallpaper==1) { 0133 data.row.css("background", "#F7F7E1"); 0134 } 0135 0136 }, 0137 fields: { 0138 section_name: { 0139 title: 'section', 0140 create: false, 0141 edit: false, 0142 list: true 0143 }, 0144 cat_title: { 0145 title: 'category', 0146 create: false, 0147 edit: false, 0148 list: true 0149 }, 0150 project_id: { 0151 title: 'project id', 0152 create: false, 0153 edit: false, 0154 list: true, 0155 display:function(data){ 0156 return '<a style="color:#2673b0" href="/p/'+data.record.project_id+'" target="_blank">'+data.record.project_id+'<a>'; 0157 } 0158 }, 0159 0160 status: { 0161 title: 'status', 0162 width: '5%', 0163 edit: false, 0164 display:function(data){ 0165 if(data.record.status!=100) 0166 { 0167 return '<span style="color:red">unpublished</span>'; 0168 } 0169 return ''; 0170 } 0171 }, 0172 0173 created_at: { 0174 title: 'created', 0175 width: '10%', 0176 create: false, 0177 edit: false 0178 }, 0179 member_id: { 0180 title: 'by', 0181 width: '5%', 0182 edit: false, 0183 display:function(data){ 0184 var html = '<a href="/u/'+data.record.username+'" target="_blank" class="tooltipuser" data-tooltip-content="#tooltip_content" data-user="'+data.record.member_id+'" >'; 0185 0186 if(data.record.is_deleted==1) 0187 { 0188 html += '<span style="color:red">'+data.record.username+'</span></a>'; 0189 }else{ 0190 html=html+data.record.username+'</a>'; 0191 } 0192 0193 0194 return html; 0195 } 0196 }, 0197 earn: { 0198 title: 'last month earn', 0199 width: '10%', 0200 create: false, 0201 edit: false, 0202 display:function(data){ 0203 return data.record.earn; 0204 } 0205 0206 }, 0207 paypal_mail: { 0208 title: 'paypal', 0209 width: '10%', 0210 create: false, 0211 edit: false, 0212 0213 } 0214 0215 } 0216 }); 0217 0218 //$('#TableContainer').jtable('load'); 0219 $('#TableContainer').jtable('load', {},function(){ 0220 //TooltipUser.setup("tooltipuser","right"); 0221 }); 0222 0223 //Re-load records when user click 'load records' button. 0224 $('#filter_section').on('change',function (e) { 0225 e.preventDefault(); 0226 $('#TableContainer').jtable('load', { 0227 filter_section: $('#filter_section').val(), 0228 }); 0229 }); 0230 0231 0232 0233 0234 }); 0235 </script>