?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Settings/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Settings/activitypage.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <script> function add_activity(rwd) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#activitydiv").load("<?= site_url('settings/addactivitypage/') ?>"); } }); } function editevents(rwd,field,pageno,field0,uid,text) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#activitydiv").load("<?= site_url('settings/Get_activity_data/') ?>" +"/" + field + "/" + pageno+"/" + field0 + "/" + uid + "/" + text); } }); } function viewevents(rwd,field,pageno,field0,uid,text) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#activitydiv").load("<?= site_url('settings/Get_viewactivity_data/') ?>" +"/" + field + "/" + pageno+"/" + field0 + "/" + uid + "/" + text); } }); } function delevents(rwd,table,field,pageno) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#activitydiv").load("<?= site_url('settings/deleteevents/') ?>" +"/" +table + "/" + field+ "/" + pageno,function(){ viewactivity(pageno,field,''); }); } }); } function viewactivity(pageno,field,text) { $("#activitydiv").load("<?= site_url('settings/viewactivity/') ?>" +"/" + pageno + "/"+field+"/"+text); } function insert_activity() { var remark=document.getElementById('remark').value ; var eventname=document.getElementById('eventname').value ; var description=document.getElementById('description').value ; var location=document.getElementById('location').value ; var status=document.getElementById('status').value ; var priority=document.getElementById('priority').value ; var startdate1=document.getElementById('startdate').value ; var enddate1=document.getElementById('enddate').value ; var before=document.getElementById('before').value ; var eventhour=document.getElementById('eventhour').value ; var eventmin=document.getElementById('eventmin').value ; var eventhourend=document.getElementById('eventhourend').value ; var eventminend=document.getElementById('eventminend').value ; var start_time=eventhour+':'+eventmin+':00'; var end_time=eventhourend+':'+eventminend+':00'; var startdate=startdate1 + ' ' +start_time; var enddate=enddate1 + ' ' +end_time; if(startdate>enddate) { alert('Event Start Date is greater'); } else { if(validateform('eventname','startdate','enddate')) { $.post("<?php echo site_url('settings/insertevents/'); ?>", { 'eventname':eventname,'description':description,'location':location, 'status':status,'before':before,'priority':priority,'startdate':startdate,'enddate':enddate,'remark':remark }, function(data) { alert(data); showactivity(1,'eventname',''); }); } } } function date_diff(date1,date2) { var oneDay=1000*60*60*24; alert(Math.ceil((date1.getTime()-date2.getTime())/oneDay)); } function searchactivity(pageno,serctext,seloption) { if(seloption=='startdate' || seloption=='enddate' ) { serctext=serctext.replace(/\//gi,'-') } serctext = serctext.replace(/ /g,"~"); serctext = serctext.replace(/\//g,"_"); $("#activitydiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $('#activitydiv').load("<?php echo site_url('settings/viewactivity/'); ?>/"+pageno + "/" + seloption + "/" +serctext ); } </script> <div class="select-bar"> <label> <img src="<?=base_url()?>/assets/images/add-icon.png" title="Add New" class="clickimage" onclick="add_activity(1)" alt="Add New" align = "top" width="25" height="25" /></label> <label> Search For <input type="text" name="search" id="search" style="background-image: none;"> in <select id ="selectsearch" name="selectsearch"> <option value="all">All</option> <option value="eventname">Event Name</option> <option value="description">Description</option> <option value="startdate">Start Date</option> <option value="enddate">End Date</option> </select> </label> <label for="submit"> <button type="submit" class="clickimage" id="submit" onclick="searchactivity(<?=$currpage ?>,document.getElementById('search').value,document.getElementById('selectsearch').value);">Search</button></label> </div> <fieldset><legend>Events</legend> <table class="sort"> <caption>Activities</caption> <tr> <th width="10%">Sl No.</th> <th width="15%">Event Name</th> <th width="20%">Description</th> <th width="15%">Start Date</th> <th width="15%">End Date</th> <th width="10%">Status</th> <th width="10%">Action</th> </tr> <?php $i=(($currpage-1) * 10); foreach ($eventslist as $events) { $i=$i+1; $edate=$events['enddate']; $etim=substr($edate,11,5); $endate=substr($edate,0,10); $dateends = $this->mastermodel->convdatformat($endate); $sdate=$events['startdate']; $stim=substr($sdate,11,5); $stdate=substr($sdate,0,10); $datestarts = $this->mastermodel->convdatformat($stdate); echo "<tr><td>".$i."</td>"; $asi=$events['userid']; ?> <td id="myTd" style=" cursor: pointer;color:#2756c1" onclick="viewevents(0,<?=$events['id']?>,<?php echo $currpage ?>,'<?=$field ?>',<?=$events['userid']?>,'<?= $text ?>');" class="tdlink" ><?=$events['eventname']?> </td> <?php echo " <td>".$events['description']."</td><td>".$datestarts.'<br/>'.$stim."</td><td>".$dateends.'<br/>'.$etim."</td><td>".$events['status']."</td><td>"; ?> <img src="<?=base_url()?>/assets/images/edit-icon.gif" id="editRem" title="Edit" width="20" height="20" alt="Edit" align = "center" onclick="editevents(1,<?=$events['id']?>,<?php echo $currpage ?>,'<?=$field ?>',<?=$events['userid']?>,'<?= $text ?>');" class="clickimage" /> <img src="<?=base_url()?>/assets/images/delete-icon.png" title="Delete" width="20" height="20" alt="Delete" class="clickimage" onclick="return delevents(2,'events',<?=$events['id']?>,<?php echo $currpage ?>)" align = "center"/> <?php echo "</td></tr>"; } ?> </table> </fieldset> <div style="width:75%; height:30px; float:right;"> <ul> <li class="pagsel" onclick="viewactivity('1','<?=$field ?>','<?=$text ?>')"> <img src="<?php echo base_url() ?>/assets/images/first.gif"/> </li> <li class="pagsel" <?php if($currpage>0){ ?> onclick="viewactivity('<?php echo $currpage-1 ?>','<?=$field ?>','<?=$text ?>')" <?php } ?> > <img src="<?php echo base_url() ?>/assets/images/prev.gif"/> </li> <?php $totpage=ceil($totrecord/10); $arr= $this->settingsmodel->getmaxminlist($currpage,$totpage,4); $myarray=$arr['listnos']; for($i=$myarray[0]; $i<=$myarray[1]; $i++) { if($currpage==$i ) { ?> <li class="pagsel"> <?php echo $i ?></li> <?php } else { ?> <li class="pag" onclick="viewactivity('<?php echo $i ?>','<?=$field ?>','<?=$text ?>')"> <?php echo $i ?></li> <?php } } ?> <li class="pagsel" <?php if($currpage<$totpage){ ?> onclick="viewactivity('<?php echo $currpage+1 ?>','<?=$field ?>','<?=$text ?>')"<?php } ?>> <img style="vertical-align:top" src="<?php echo base_url() ?>/assets/images/next.gif"/> </li> <li class="pagsel" onclick="viewactivity('<?php echo $totpage ?>','<?=$field ?>','<?=$text ?>')"><img src="<?php echo base_url() ?>/assets/images/last.gif"/> </li> </ul> </div>