상속: extends Controller
 function dashboard()
 {
     $this->User->recursive = 0;
     $this->set('users', $this->paginate());
     $sprints = $this->Sprint->getCurrentSprint();
     $this->set('sprints', $sprints);
     $tasks = $this->Task->getUserTask($this->Auth->user('id'), false);
     $this->set('tasks', $tasks);
     $this->set('project', $this->Project->read(null, 1));
     $this->set('information', $this->Information->getLatestInformation());
     $this->set('show_link', true);
     $all_sprints = $this->Sprint->getAllSprints();
     $this->Sprint->makeSprintZero($all_sprints);
     $stories = $this->Story->getActiveStory();
     $all_sprints = $this->PmsCommon->getEachStoryPoints($all_sprints, $stories);
     $this->set("all_sprints", $all_sprints);
 }
예제 #2
0
 function approve($id)
 {
     if ($_POST) {
         $rs = new Information($id);
         $rs->from_array($_POST);
         $rs->save();
     }
 }
예제 #3
0
 function delete($id = FALSE)
 {
     if ($id) {
         $information = new Information($id);
         $information->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
예제 #4
0
 private function getItemData(Item $itemInformation)
 {
     $information = new Information();
     $information->set('name', $itemInformation->getName());
     $information->set('agi', $itemInformation->getAgility());
     $information->set('str', $itemInformation->getStrength());
     $information->set('int', $itemInformation->getIntelligence());
     $information->set('minDamage', $itemInformation->getDamage());
     $information->set('maxDamage', $itemInformation->getDamage());
     $information->set('hp', $itemInformation->getHp());
     $information->set('mana', $itemInformation->getMana());
     return $information;
 }
예제 #5
0
 public static function delete()
 {
     $post = Information::load(Request::post("id"));
     if (!$post) {
         return;
     }
     $post->delete();
 }
예제 #6
0
 public function init()
 {
     // Check if system is installed
     if (!Yii::app()->isInstalled()) {
         $this->redirect(array("/install"));
     }
     // TODO: filter by store
     $criteria = new CDbCriteria();
     $criteria->condition = 'bottom=1 AND status=1';
     // only active and bottom informations
     $criteria->order = 'sort_order ASC';
     $this->informations = Information::model()->findAll($criteria);
 }
예제 #7
0
 public static function all()
 {
     if (!file_exists(DATA_DIR)) {
         return array();
     }
     $information = array();
     foreach (scandir(DATA_DIR, 1) as $fname) {
         if (preg_match("/^[0-9]+\$/", $fname)) {
             $information[] = Information::load($fname);
         }
     }
     return $information;
 }
예제 #8
0
파일: Data.php 프로젝트: dudusouza/wowadmin
 /**
  * Gera o array com os dados de todas as tabelas
  * @return array
  */
 private function genArray()
 {
     $arrData = array();
     $arrTables = Information::getAllTables();
     foreach ($arrTables as $arrTable) {
         $table = $arrTable[0];
         $arrFields = Information::getDataTable($table);
         $pkname = $this->getArrFieldsPrimary($arrFields);
         if (!is_null($pkname)) {
             $arrData[$table]['fields'] = $arrFields;
             $arrData[$table]['pk'] = $pkname;
         }
     }
     return $arrData;
 }
 public function get_page()
 {
     $id = Request::segment(3);
     $information = Information::find($id);
     $response_array = array();
     if ($information) {
         $response_array['success'] = true;
         $response_array['title'] = $information->title;
         $response_array['content'] = $information->content;
         $response_array['icon'] = $information->icon;
     } else {
         $response_array['success'] = false;
     }
     $response_code = 200;
     $response = Response::json($response_array, $response_code);
     return $response;
 }
예제 #10
0
 public function __construct($system, $branch, $version)
 {
     parent::__construct('vcs', array('system' => $system, 'branch' => $branch, 'version' => $version));
 }
예제 #11
0
 function unstick_thread($id)
 {
     $data = new Information($id);
     $data->stick = null;
     $data->save();
     set_notify('success', 'ยกเลิกการปักหมุดกระทู้เรียบร้อย');
     redirect($_SERVER['HTTP_REFERER']);
 }
예제 #12
0
 public function update_info_page()
 {
     $id = Input::get('id');
     $title = Input::get('title');
     $description = Input::get('description');
     if ($id == 0) {
         $information = new Information();
     } else {
         $information = Information::find($id);
     }
     if (Input::hasFile('icon')) {
         // Upload File
         $file_name = time();
         $file_name .= rand();
         $ext = Input::file('icon')->getClientOriginalExtension();
         Input::file('icon')->move(public_path() . "/uploads", $file_name . "." . $ext);
         $local_url = $file_name . "." . $ext;
         // Upload to S3
         if (Config::get('app.s3_bucket') != "") {
             $s3 = App::make('aws')->get('s3');
             $pic = $s3->putObject(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'SourceFile' => public_path() . "/uploads/" . $local_url));
             $s3->putObjectAcl(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'ACL' => 'public-read'));
             $s3_url = $s3->getObjectUrl(Config::get('app.s3_bucket'), $file_name);
         } else {
             $s3_url = asset_url() . '/uploads/' . $local_url;
         }
         if (isset($information->icon)) {
             if ($information->icon != "") {
                 $icon = $information->icon;
                 unlink_image($icon);
             }
         }
         $information->icon = $s3_url;
     }
     $information->title = $title;
     $information->content = $description;
     $information->save();
     $title_new = str_replace(' ', '_', $title);
     $file = base_path() . "/app/views/website/" . $title . ".blade.php";
     if (!file_exists($file)) {
         $fp = fopen($file, "w");
         $body = generate_generic_page_layout($description);
         fwrite($fp, $body);
         fclose($fp);
     }
     return Redirect::to("/admin/information/edit/{$information->id}?success=1");
 }
예제 #13
0
						';
            }
            if ($security->hasPermission($permission->getPermission('demote'))) {
                echo '
						<div class="button_93"><a class="console" href="index.php?view=manage_users&cmd=demote">Demote Member</a></div>
						';
            }
            echo '
				</div>
				<div class="green_content_bottom">
				</div>
			</div>
';
        }
        //>>>>>>>>>>>>> INFORMATION MANAGEMENT CONSOLES <<<<<<<<<<<<<<<<<<<//
        $information = new Information();
        if ($user->rank_num >= $information->minToModify()) {
            $information->displayConsole();
        }
        //>>>>>>>>>>>>>>> FILE MANAGEMENT CONSOLE <<<<<<<<<<<<<<<<<<<<//
        $file_management->displayConsole();
        // >>>>>>>>>>>>>>>   GROUP CONSOLES  <<<<<<<<<<<<<<<<<<<//
        $group = new Group();
        echo '
	<div class="green_contentbox">
				<div class="green_content_top">
					<h3 class="content_box_header">Group Consoles</h3>
				</div>
				<div class="green_content">
	<div class="button_153"><a class="console" id="showLink" style="display: true;"
	  onclick="ShowContent(\'consoles\'); return true; HideContent(\'showLink\');"
예제 #14
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Information the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Information::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #15
0
 function vote($id = NULL)
 {
     if (@$_POST['rating'] && $id) {
         $information = new Information($id);
         $information->rating = $information->rating + $_POST['rating'];
         $information->rating_count = $information->rating_count + 1;
         $information->save();
         set_notify('success', 'บันทึกข้อมูลเรียบร้อยค่ะ');
     } else {
         set_notify('error', 'กรุณาให้คะแนนก่อนทำการโหวตค่ะ');
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
예제 #16
0
    function Main($view, $file)
    {
        global $config, $config_file, $user, $group, $db, $security, $statistic, $form, $notification, $group_form, $permission, $games, $file_management;
        if (true) {
            if ($config->getTemplate('use')) {
                include $config->getTemplate('header');
            }
            switch ($view) {
                case 'console':
                    include 'console.php';
                    break;
                case 'members':
                    include 'members.php';
                    break;
                case 'groups':
                    include 'group_list.php';
                    break;
                case 'group':
                    include 'group.php';
                    break;
                case 'group_function':
                    include 'group_function.php';
                    break;
                case 'news':
                    include 'news.php';
                    break;
                case 'logs':
                    include 'logs.php';
                    break;
                case 'profile':
                    include 'profile.php';
                    break;
                case 'statistics':
                    include 'member_statistics.php';
                    break;
                case 'manage_users':
                    include 'user_management.php';
                    break;
                case 'user_personal':
                    include 'user_personal.php';
                    break;
                case 'user_form':
                    include 'user_form_misc.php';
                    break;
                case 'user_administration':
                    include 'user_administration.php';
                    break;
                case 'user_commander':
                    include 'user_commander.php';
                    break;
                case 'message':
                    include 'message.php';
                    break;
                case 'information':
                    $information = new Information();
                    $information->displayFile($file);
                    break;
                case 'edit_information':
                    $information = new Information();
                    $information->editFile($file);
                    break;
                case 'security_error':
                    include 'security_error.php';
                    break;
                case 'fix':
                    include 'fix.php';
                    break;
                case 'file':
                    $file_management->displayFile($file);
                    break;
                case 'project_playlist':
                    include 'information/project_playlist.html';
                    break;
                case 'soon':
                    echo 'The feature that you have requested is not yet available but will be soon.';
                    break;
                default:
                    if ($view) {
                        echo 'You have an error with your URL.  Please check to see that your "View" variable is correct.';
                    } else {
                        $information = new Information();
                        $information->displayFile(1);
                        echo '
				<div class="green_contentbox">
					<div class="green_content_top">
						<h3 class="content_box_header">Online Members</h3>
					</div>
					<div class="green_content">
						<h5>These users have been active on the site in the past ' . $config->getSetting("active_timeout") / 60 . ' minutes.</h5>
						<hr />
						';
                        $online_array = $statistic->getActiveMembers();
                        echo '| ';
                        foreach ($online_array as $username) {
                            echo '<a href="index.php?view=profile&user='******'">' . $db->titleFromUsername($username) . '</a> |
								  ';
                        }
                        echo '
						<hr />
					</div>
					<div class="green_content_bottom">
					</div>
				</div>

				';
                    }
                    break;
            }
            if ($config->getTemplate('use')) {
                include $config->getTemplate('footer');
            }
        } else {
            include 'um/um.html';
        }
    }
예제 #17
0
 public function actionIndex()
 {
     $informations = Information::model()->findAll();
     $this->render('index', array('informations' => $informations));
 }
예제 #18
0
 public function act_delete_information()
 {
     if (!isset($_POST['informations']) || isset($_POST['no'])) {
         set_redirect_header('events', 'src_list');
         return;
     }
     $this->del_confirm = true;
     if (isset($_POST['yes'])) {
         if (isset($_POST['information'])) {
             array_push($_POST['informations'], $_POST['information']);
         }
         //if multiplt events are selected
         if (is_array($_POST['informations'])) {
             foreach ($_POST['informations'] as $information) {
                 $i = new Information();
                 $i->DeleteFromRecordNumber($information);
             }
         }
         set_redirect_header('events', 'src_list');
         return;
     }
     $this->sources = Browse::getSourceListArray($_POST['informations']);
 }
예제 #19
0
<?php

/*
 * @ author: Alexandr Kozyr;
 * @ email: kozyr1av@gmail.com;
 * this file aggregates all moves for parsing and saving data to db
 */
header('Content-Type:aplication/json');
require_once 'class/DbConnect.class.php';
require_once 'class/Information.class.php';
$test = new Information(DbConnect::MySqlConnecton($config));
echo $test->GetInformation();
예제 #20
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request)
 {
     $user = Information::find($request->input('id'));
     $user->delete();
     return "User record successfully deleted #" . $request->input('id');
 }
예제 #21
0
        ?>
</td>
                <td><?php 
        echo $record['connection'];
        ?>
</td>            
            </tr>		
    <?php 
    }
    ?>
 
        </tbody>
    </table>
    <?php 
    $src_form = generate_formarray('information', 'view');
    $src = new Information();
    foreach ($sources as $key => $record) {
        echo '<br /><h3>' . _t('SOURCE') . ++$key . ' : ' . $record['person_name'] . '</h3><br />';
        //print victim details
        $person->LoadFromRecordNumber($record['related_person']);
        $person->LoadRelationships();
        popuate_formArray($person_form, $person);
        shn_form_get_html_labels($person_form, false);
        echo "<br class='page_break' />";
        //print act details
        echo '<h4>' . _t('INFORMATION') . ' : ' . $record['connection'] . '</h4><br />';
        $src->LoadFromRecordNumber($record['information_record_number']);
        $src->LoadRelationships();
        popuate_formArray($src_form, $src);
        shn_form_get_html_labels($src_form, false);
        echo "<br class='page_break' />";
예제 #22
0
 public static function downloadConfig($DEVICE)
 {
     $TIME = time();
     $DESTINATION = "/config/{$DEVICE['id']}.{$TIME}.config";
     $TFTPFILE = "/tftpboot/config/{$DEVICE['id']}.{$TIME}.config";
     $DEVICE['name'] = preg_replace("/\\//", '-', $DEVICE['name']);
     // Replace slashes in device names with hyphens!
     $CONFIGREPO = BASEDIR . "/config/{$DEVICE['name']}";
     // TRY SNMP TFTP config grab FIRST because its FAST(er) than CLI!
     $Config = new CiscoConfig($DEVICE['ip'], SNMP_RW);
     $Config->WriteNetwork($DESTINATION, 'tftp', TFTPIP);
     if ($Config->Error) {
         // If we hit an error, fall back to CLI!
         special_output(' SNMP error, trying Telnet/SSH:');
         $INFOBJECT = Information::retrieve($DEVICE['id']);
         $INFOBJECT->scan();
         $SHOW_RUN = $INFOBJECT->data['run'];
         $DELIMITER = $INFOBJECT->data['pattern'];
         unset($INFOBJECT);
         // Save some memory
     } else {
         $SHOW_RUN = file_get_contents($TFTPFILE);
     }
     $RUNLEN = strlen($SHOW_RUN);
     if ($RUNLEN < 800) {
         // If we cant get the config at all, or length is less than 800 bytes, fuckit and die.
         special_output(" config is {$RUNLEN} bytes, Could not get config!\n");
         return 0;
     } else {
         special_output(" Got {$RUNLEN} bytes!");
     }
     $LINES_IN = preg_split('/\\r\\n|\\r|\\n/', $SHOW_RUN);
     $LINES_OUT = [];
     foreach ($LINES_IN as $LINE) {
         // Ignore a bunch of unimportant often-changing lines that clutter up the config repository
         if (preg_match('/.*show run.*/', $LINE, $REG) || preg_match('/.*show startup.*/', $LINE, $REG) || preg_match('/^Building configur.*/', $LINE, $REG) || preg_match('/^ntp clock-period.*/', $LINE, $REG) || preg_match('/^Current configuration.*/', $LINE, $REG) || preg_match('/.*NVRAM config last up.*/', $LINE, $REG) || preg_match('/.*uncompressed size*/', $LINE, $REG) || preg_match('/^!Time.*/', $LINE, $REG)) {
             continue;
         }
         // If we have UTC and its NOT the configuration last changed line, ignore it.
         if (preg_match('/.* UTC$/', $LINE, $REG) && !preg_match('/^.*onfig.*/', $LINE, $REG)) {
             continue;
         }
         // If we have CST and its NOT the configuration last changed line, ignore it.
         if (preg_match('/.* CST$/', $LINE, $REG) && !preg_match('/^.*onfig.*/', $LINE, $REG)) {
             continue;
         }
         // If we have CDT and its NOT the configuration last changed line, ignore it.
         if (preg_match('/. *CDT$/', $LINE, $REG) && !preg_match('/^.*onfig.*/', $LINE, $REG)) {
             continue;
         }
         // If we find a control code like ^C replace it with ascii ^C
         $LINE = str_replace(chr(3), '^C', $LINE);
         // If we find ": end", break out of this function, end of command output detected
         if (preg_match('/^: end$/', $LINE, $REG)) {
             break;
         }
         // If we find the prompt, break out of this function, end of command output detected
         if (isset($DELIMITER) && preg_match($DELIMITER, $LINE, $REG)) {
             break;
         }
         $LINE = rtrim($LINE);
         // Trim whitespace off the right end!
         array_push($LINES_OUT, $LINE);
     }
     // REMOVE blank lines from the leading part of the array and REINDEX the array
     while ($LINES_OUT[0] == '' && count($LINES_OUT) > 2) {
         array_shift($LINES_OUT);
     }
     // REMOVE blank lines from the end of the array and REINDEX the array
     while (end($LINES_OUT) == '' && count($LINES_OUT) > 2) {
         array_pop($LINES_OUT);
     }
     // Ensure there is one blank line at EOF. Subversion bitches about this for some reason.
     array_push($LINES_OUT, '');
     $SHOW_RUN = implode("\n", $LINES_OUT);
     $FH = fopen($CONFIGREPO, 'w');
     fwrite($FH, $SHOW_RUN);
     fclose($FH);
     return 1;
 }
 /**
  * Get informations for rendering information.
  *
  * @return void
  */
 public function getInformations()
 {
     global $data;
     global $settings;
     $informations = Information::select('*', DB::raw('title_' . $data['language'] . ' AS title'), DB::raw('content_' . $data['language'] . ' AS content'))->orderBy('date', 'DESC')->get()->keyBy('id')->toArray();
     $data['informations'] = $informations;
 }
require '../inc/classes/Helpers.php';
// page vars
$page_title = "";
$id = $_REQUEST['id'];
// id required
if ($id == "") {
    header("Location:mainpage.php");
    exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
    header("Location:information_list.php");
    exit;
}
if ($_POST['commit'] == "Delete Information") {
    $objInformation = new Information();
    $objInformation->Delete($id);
    header("Location:information_list.php");
    exit;
}
$objInformation = new Information($id);
include "includes/pagetemplate.php";
function PageContent()
{
    global $objInformation;
    global $id;
    ?>

            <div class="layout laymidwidth">

                <?php 
예제 #25
0
 public function monthly($res, $id)
 {
     $dt = DateTime::createFromFormat('!m', $id);
     $fpdf = new Fpdf();
     $fpdf->AddPage('L');
     $fpdf->SetFont('Arial', 'B', 16);
     $fpdf->Cell(130);
     $fpdf->Cell(20, 10, Information::where('keyname', '=', 'name')->first()->value, 0, 1, 'C');
     $fpdf->Cell(130);
     $fpdf->SetFont('Arial', '', 14);
     $fpdf->Cell(20, 10, Information::where('keyname', '=', 'address')->first()->value, 0, 1, 'C');
     $header = array('ID', 'Date', 'Pax', 'Status', 'Amount', 'Payment Method', 'Duration');
     $fpdf->SetFont('Arial', 'B', 16);
     $fpdf->Cell(130);
     $fpdf->Cell(20, 10, 'Monthly Report for the Month of: ' . $dt->format('F'), 0, 1, 'C');
     // Colors, line width and bold font
     $fpdf->SetFillColor(255, 0, 0);
     $fpdf->SetTextColor(255);
     $fpdf->SetDrawColor(128, 0, 0);
     $fpdf->SetLineWidth(0.3);
     $fpdf->SetFont('', '');
     // Header
     $fpdf->Ln();
     $fpdf->Cell(10);
     $w = array(35, 25, 25, 45, 23, 50, 55);
     for ($i = 0; $i < count($header); $i++) {
         $fpdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $fpdf->Ln();
     // Color and font restoration
     $fpdf->SetFillColor(224, 235, 255);
     $fpdf->SetTextColor(0);
     $fpdf->SetFont('Arial', '', 12);
     // Data
     $fill = false;
     $total = 0;
     foreach ($res as $row) {
         $fpdf->Cell(10);
         $fpdf->Cell($w[0], 6, $row->id, 'LR', 0, 'L', $fill);
         $fpdf->Cell($w[1], 6, $row->date_request, 'LR', 0, 'L', $fill);
         $fpdf->Cell($w[2], 6, $row->pax, 'LR', 0, 'R', $fill);
         $fpdf->Cell($w[3], 6, $row->status, 'LR', 0, 'R', $fill);
         $fpdf->Cell($w[4], 6, $row->net_total, 'LR', 0, 'R', $fill);
         if ($row->payment_mode != '') {
             $fpdf->Cell($w[5], 6, $row->payment_mode . " (" . $row->payment_method . ")", 'LR', 0, 'L', $fill);
         } else {
             $fpdf->Cell($w[5], 6, 'Payment Method not set', 'LR', 0, 'L', $fill);
         }
         $fpdf->Cell($w[6], 6, $row->reservation_start . ' to ' . $row->reservation_end, 'LR', 0, 'L', $fill);
         $fpdf->Ln();
         $fill = !$fill;
         $total = +$row->net_total;
     }
     // Closing line
     $fpdf->Cell(10);
     $fpdf->Cell(array_sum($w), 0, '', 'T');
     $fpdf->Ln();
     $fpdf->Cell(190);
     $fpdf->SetFont('Arial', 'B', 13);
     $fpdf->Cell(40, 7, 'Total:', '', 0, 'R');
     $fpdf->SetFont('Arial', '', 13);
     $fpdf->Cell(40, 7, "{$total}", 0);
     $fpdf->Output();
     exit;
 }
예제 #26
0
$info = Information::where('type', '=', 'contact')->get();
foreach ($info as $key => $value) {
    echo '<b>' . ucfirst($value['keyname']) . ': </b>';
    echo $value['value'] . '<br/>';
}
?>
	                       </p>
	                </div>

	                <!-- Footer stay connected -->
	                <div class="col-footer col-md-3 col-xs-6">
	                    <h3>Stay Connected</h3>
	                        <ul class="footer-stay-connected no-list-style">

                                <?php 
$info = Information::where('type', '=', 'link')->get();
foreach ($info as $key => $value) {
    echo '<li> <a href="' . $value['value'] . '" class="' . $value['keyname'] . '" ></a></li>';
}
?>
	                        </ul>
	                    </div>
	                </div>

	                <!-- All Rights Reserved -->
	                <div class="row">
	                    <div class="col-md-12">
	                        <div class="footer-copyright">&copy; All rights reserved.</div>
	                    </div>
	                </div>
	            </div>
    header("Location:information_list.php");
    exit;
}
if ($_POST['commit'] == "Save Information") {
    if ($id == 0) {
        // add the listing
        $objInformation = new Information();
        $objInformation->Title = $_REQUEST['title'];
        $objInformation->Create();
        $objInformation->HandleFileUploads();
        $objInformation->HandleDropFileUploads($aDropFields[0], 'PdfFile');
        // redirect to listing list
        header("Location:information_list.php");
        exit;
    } else {
        $objInformation = new Information($_REQUEST["id"]);
        $objInformation->Title = $_REQUEST['title'];
        $objInformation->Update();
        $objInformation->HandleFileUploads();
        $objInformation->HandleDropFileUploads($aDropFields[0], 'PdfFile');
        // redirect to listing list
        header("Location:information_list.php");
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objInformation = new Information($id);
        $title = $objInformation->Title;
        $pdf_file = $objInformation->PdfFile;
    }
예제 #28
0
function PageContent()
{
    ?>
    
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // fix to preserve width of cells
                var fixHelper = function(e, ui) {
                    ui.children().each(function() {
                        $(this).width($(this).width());
                    });
                    return ui;
                };
                var saveIndex = function(e, ui) {
                    //alert("New position: " + ui.item.index());
                    //alert("Image Id: " + ui.item.attr("id"));
                    id = ui.item.attr("id").replace("img_", "");
                    $.ajax({
                        url: 'information_list.php',
                        data: {
                            dragsort: 1,
                            idx: ui.item.index(),
                            id: id
                        },
                        type: 'POST',
                        dataType: 'html',
                        success: function (data) {
                            //alert("done");
                        },
                        error: function (xhr, status) {
                            alert('Sorry, there was a problem!');
                        }
                    });
                }; // end saveIndex
    
                $("#list_table tbody").sortable({
                    helper: fixHelper,
                    stop: saveIndex
                }).disableSelection();
    
            }); // end document.ready
        </script>
        <style>
            .icon-resize-vertical:hover {
                cursor:grab;
            }
        </style>        
    
            <div class="layout center-flex">

                <?php 
    $aLabels = array();
    $aLinks = array();
    $aLabels[0] = 'Home';
    $aLinks[0] = 'mainpage.php';
    $aLabels[1] = 'Information';
    $aLinks[1] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading">Information</p>
                    <a href="information_admin.php" class="button_link"><button class=" ">Add New Information</button></a>
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Title</th>
                            <th>File</th>
                            <th class="mid">Order</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objInformation = new Information();
    $oInformation = $objInformation->GetAllInformation('sort_order');
    foreach ($oInformation as $info) {
        echo '<tr id="img_' . $info->Id . '">' . PHP_EOL;
        echo '<td>' . $info->Id . '</td>' . PHP_EOL;
        echo '<td>' . $info->Title . '</td>' . PHP_EOL;
        echo '<td>/' . $objInformation->GetPath() . $info->PdfFile . '</td>' . PHP_EOL;
        echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="information_admin.php?id=' . $info->Id . '"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="information_delete.php?id=' . $info->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
 public function update_info_page()
 {
     $id = Input::get('id');
     $title = Input::get('title');
     $description = Input::get('description');
     if ($id == 0) {
         $information = new Information();
     } else {
         $information = Information::find($id);
     }
     if (Input::hasFile('icon')) {
         // Upload File
         $file_name = time();
         $file_name .= rand();
         $ext = Input::file('icon')->getClientOriginalExtension();
         Input::file('icon')->move(public_path() . "/uploads", $file_name . "." . $ext);
         $local_url = $file_name . "." . $ext;
         // Upload to S3
         if (Config::get('app.s3_bucket') != "") {
             $s3 = App::make('aws')->get('s3');
             $pic = $s3->putObject(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'SourceFile' => public_path() . "/uploads/" . $local_url));
             $s3->putObjectAcl(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'ACL' => 'public-read'));
             $s3_url = $s3->getObjectUrl(Config::get('app.s3_bucket'), $file_name);
         } else {
             $s3_url = asset_url() . '/uploads/' . $local_url;
         }
         $information->icon = $s3_url;
     }
     $information->title = $title;
     $information->content = $description;
     $information->save();
     return Redirect::to("/admin/information/edit/{$information->id}?success=1");
 }