Commit e787b611 by Tobin

daily commit

parent 9b7ed860
......@@ -150,16 +150,21 @@ class Event extends CI_Controller {
$evtMediaData = array();
if(!empty($files = $_FILES)){
$images = array();
$this->load->library('upload',set_upload_service("assets/uploads/services"));
$media_type = 0;
for ($typ = 0; $typ < count($files); $typ++) {
$images = array();
$this->load->library('upload');
$config = set_upload_service("assets/uploads/services");
for ($typ = 0; $typ < count($files['event_image']['name']); $typ++) {
$_FILES['file']['name'] = $files['event_image']['name'][$typ];
$_FILES['file']['type'] = $files['event_image']['type'][$typ];
$_FILES['file']['size'] = $files['event_image']['size'][$typ];
$_FILES['file']['error'] = $files['event_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['event_image']['tmp_name'][$typ];
$config['file_name'] = time()."_".$_FILES['file']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('file')){
$imgData = $this->upload->data();
$evtMediaData[] = array(
......@@ -304,14 +309,19 @@ class Event extends CI_Controller {
}
$status = $this->Event_model->updateTags($event_id,$insertTag);
$existingImages = (isset($_POST['existingImages']) && !empty($_POST['existingImages']))?
$_POST['existingImages']:'';
$evtMediaData = array();
if(isset($_FILES) && isset($_FILES['event_image']) && isset($_FILES['event_image']['name']) &&
count($_FILES['event_image']['name']) > 1){
$files = $_FILES;
$media_type = (!empty($existingImages))?1:0;
$images = array();
$media_type = '0';
$this->load->library('upload',set_upload_service("assets/uploads/services"));
$this->load->library('upload');
$config = set_upload_service("assets/uploads/services");
for ($typ = 0; $typ < count($files['event_image']['name']); $typ++) {
$_FILES['file']['name'] = $files['event_image']['name'][$typ];
$_FILES['file']['type'] = $files['event_image']['type'][$typ];
......@@ -319,6 +329,9 @@ class Event extends CI_Controller {
$_FILES['file']['error'] = $files['event_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['event_image']['tmp_name'][$typ];
$config['file_name'] = time()."_".$_FILES['file']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('file')){
$imgData = $this->upload->data();
$evtMediaData[] = array(
......@@ -330,8 +343,6 @@ class Event extends CI_Controller {
}
}
$existingImages = (isset($_POST['existingImages']) && !empty($_POST['existingImages']))?
$_POST['existingImages']:'';
$status = $this->Event_model->updateEventMedia($event_id,$evtMediaData,$existingImages);
$flashMsg['class'] = 'success';
......
......@@ -175,7 +175,6 @@ class Event_model extends CI_Model {
if(empty($event_id)){
return 0;
}
if(!empty($existingImages)){
$this->db->query("DELETE FROM event_gallery
WHERE id NOT IN (".implode(",",$existingImages).") AND event_id=$event_id");
......
......@@ -217,7 +217,7 @@
<div class="col-sm-6">
<div class="form-group">
<label>Event Description</label>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom required" placeholder="Venue Description" name="event_discription" required
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Venue Description" name="event_discription"
style="height:108px;" data-parsley-trigger="change" data-parsley-minlength="2"><?= $event_data->event_discription ?></textarea>
</div>
</div>
......@@ -227,6 +227,22 @@
<div id="multipleImageInputCntr">
<?php
$count = 1;
if(isset($event_data->eventMedia[0]) && !empty($event_data->eventMedia[0])){
foreach($event_data->eventMedia[0] AS $photos){ ?>
<div class="dropZoneContainer" id="multiImageCntr_<?= $count ?>">
<input type="hidden" name="existingImages[]" value="<?= $photos['id'] ?>">
<div id="multiImageClose_<?= $count ?>" class="close_custom cpoint"
onclick="removeImage('<?= $count ?>');">&times;</div>
<input disabled type="file" name="event_image[]" class="multiFileUpload"
accept="image/*" onchange="setMultiImg(this,jQuery(this));"
count="<?= $count ?>" />
<img class="multiDropZoneOverlay" id="multiImageImg_<?= $count ?>"
src="<?= base_url($photos['media_url']) ?>" onerror="this.src='<?=base_url("assets/images/add-image.png")?>';" />
</div>
<?php
$count += 1;
}
}
if(isset($event_data->eventMedia[1]) && !empty($event_data->eventMedia[1])){
foreach($event_data->eventMedia[1] AS $photos){ ?>
<div class="dropZoneContainer" id="multiImageCntr_<?= $count ?>">
......@@ -242,7 +258,7 @@
<?php
$count += 1;
}
}
}
?>
<div class="dropZoneContainer" id="multiImageCntr_<?= $count ?>">
<div id="multiImageClose_<?= $count ?>" class="close_custom cpoint hide"
......
......@@ -182,4 +182,4 @@
</div>
</div>
<?php } ?>
</div>
\ No newline at end of file
</div>
......@@ -40,9 +40,10 @@
<tr>
<th class="hidden">ID</th>
<th>Event Name</th>
<th>Venue</th>
<th>Category</th>
<th>Region</th>
<th>Location</th>
<th>Venue</th>
<!-- <th>Location</th> -->
<th>Status</th>
<th width="300px">Action</th>
</tr>
......@@ -54,9 +55,9 @@
<tr>
<td class="hidden"><?= $event->event_id ?></td>
<td><?= $event->event_name ?></td>
<td><?= $event->venue_name ?></td>
<td><?= $event->category ?></td>
<td><?= $event->region_name ?></td>
<td><?= $event->location ?></td>
<td><?= $event->venue_name ?></td>
<td>
<?php
switch($event->event_status){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment