%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<script src="<?= base_url('assets/ckeditor/ckeditor.js') ?>"></script>
<?php // Category Array
$categoryArray = array("Brouchre","Newsletter","Theshardans","Migrationpolicy", "Registrationform","Covid19");
?>
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="<?php echo site_url('admin/home'); ?>">Dashboard</a>
</li>
<li class="breadcrumb-item active">Manage Download center</li>
</ol>
<!-- DataTables Example -->
<div class="card mb-3 fomr-news">
<div class="card-header card-header-new"><h3> <i class="fas fa-table"></i> Download center Details </h3> <a href="javascript:void(0);" data-toggle="modal" data-target="#add_edit_download" class="btn btn-default" style="margin-bottom:10px;"> Add Downloads</a> </div>
</div>
<div class="card-body">
<div class="table-responsive">
<!---- Success Message ---->
<?php if ($this->session->flashdata('success')) { ?>
<p style="color:green; font-size:18px;"><?php echo $this->session->flashdata('success'); ?></p>
</div>
<?php } ?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Category</th>
<th>School</th>
<th>Description</th>
<th>Published on</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Title</th>
<th>Category</th>
<th>School</th>
<th>Description</th>
<th>Published on</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<?php
if(count($overviewDetails)) :
$cnt=1;
foreach ($overviewDetails as $row) :
?>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo $row['title']?></td>
<td><?php echo $row['category']?></td>
<td><?php echo $schools[$row['school_id']]['school_name']?></td>
<td><?php echo $row['description']?></td>
<td><?php echo $row['published_on']?></td>
<td><?php echo $row['status']=='1' ? 'Active' : 'Inactive'?></td>
<td>
<a href="?edit=<?= $row['id'] ?>"><span class="fa fa-edit"></span></a>
<a href="?delete=<?= $row['id'] ?>" class="confirm-delete"><span class="fa fa-trash confirm-delete"></span></a>
</td>
</tr>
<?php
$cnt++;
endforeach;
else : ?>
<tr>
<td colspan="8">No Record found</td>
</tr>
<?php
endif;
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.container-fluid -->
<!-- Sticky Footer -->
<!--Add /Edit menu modal-->
<div class="modal fade" id="add_edit_download" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="" method="POST" enctype="multipart/form-data">
<div class="modal-header">
<button type="button" class="close" <?php if(isset($_GET['edit'])) { ?> onClick="history.go(-1)" <?php } else { ?> data-dismiss="modal" aria-label="Close" <?php } ?>><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Add New Award</h4>
</div>
<?php if (validation_errors()) { ?>
<div class="alert alert-danger"><?= validation_errors() ?></div>
<?php } ?>
<div class="modal-body">
<input type="hidden" name="edit" value="<?= isset($_GET['edit']) ? $_GET['edit'] : '0' ?>">
<div class="form-group">
<label for="email">Title</label>
<input type="text" name="title" placeholder = 'File Title' class="form-control" value="<?= isset($_POST['title']) ? $_POST['title'] : '' ?>" id="title" required>
</div>
<div class="form-group">
<label for="email">Category</label>
<select class="form-control" name="category" id="category" required>
<option value=""> -- Select category -- </option>
<?php foreach($categoryArray as $category) { ?>
<option value="<?=$category?>" <?php if(@$_POST['category']==$category) { echo 'selected = "selected"'; }?>><?=$category?></option>
<?php } ?>
</select>
</div>
<div class="form-group div_school" <?php if($_POST['category']<>'Newsletter') { echo 'style="display:none;"'; } ?>>
<label for="email">School</label>
<select class="form-control" name="school_id" id="school_id">
<option value=""> -- Select School -- </option>
<?php foreach($schools as $key=>$school) { ?>
<option value="<?=$key?>" <?php if(@$_POST['school_id']==$key) { echo 'selected = "selected"'; }?>><?=$school['school_name']?></option>
<?php } ?>
</select>
</div>
<div class="form-group bordered-group">
<?php
if (isset($_POST['download_file_name']) && $_POST['download_file_name'] != null) {
?>
<p>Existing File:</p>
<div>
<?=$_POST['download_file_name'] ?>
</div>
<input type="hidden" name="old_image" value="<?= $_POST['download_file_name'] ?>">
<?php if (isset($_GET['to_lang'])) { ?>
<input type="hidden" name="download_file_name" id="download_file_name" value="<?= $_POST['download_file_name'] ?>">
<?php
}
}
?>
<label for="userfile">File</label>
<input type="file" id="download_file_name" name="download_file_name" />
</div>
<div class="form-group">
<label for="email">Description</label>
<textarea name="description" id="description" rows="5" col ="10" class="form-control" ><?= isset($_POST['description']) ? $_POST['description'] : '' ?></textarea>
<script>
CKEDITOR.replace('description');
CKEDITOR.config.entities = false;
</script>
</div>
<div class="form-group">
<label for="email">Published On</label>
<input type="date" name="published_on" class="form-control" id="published_on" value="<?= isset($_POST['published_on']) ? $_POST['published_on'] : '' ?>" />
</div>
<div class="form-group">
<label for="assign_role">Display Order</label>
<input type="text" name="display_order" class="form-control" value="<?= isset($_POST['display_order']) ? $_POST['display_order'] : '' ?>" id="Display Order">
</div>
<div class="form-group">
<label for="assign_role">Status</label>
<select class="form-control" name="status" id="status">
<option value=""> -- Select Status -- </option>
<option value="1" <?php if(@$_POST['status']=='1') { echo 'selected = "selected"'; }?>>Active</option>
<option value="0" <?php if(@$_POST['status']=='0') { echo 'selected = "selected"'; }?>>Inactive</option>
</select>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="status" id="status" value="1" />
<button type="button" class="btn btn-default" <?php if(isset($_GET['edit'])) { ?> onClick="history.go(-1)" <?php } else { ?> data-dismiss="modal" <?php } ?>>Cancel</button>
<input type="submit" class="btn btn-primary" value="Save">
</div>
</form>
</div>
</div>
</div>
<!--Add /Edit menu modal-->
<script>
<?php if (isset($_GET['edit'])) { ?>
$(document).ready(function () {
$("#add_edit_download").modal('show');
});
<?php } ?>
$('#category').change(function(){
var category_name = $(this).val();
if(category_name=='Newsletter')
{
$('.div_school').show();
return false;
} else {
$('.div_school').hide();
return false;
}
});
</script>