/**
 * Devuelve el valor del campo pedido de POST en el formato de valor.
 * @param unknown $field
 */
function getValorPost($field)
{
    $post_temp = getPost($field);
    if ($post_temp) {
        return 'value="' . $post_temp . '"';
    }
}
 public function __construct($app)
 {
     $this->app = $app;
     $app->group('/group', function () use($app) {
         $restService = new \Core\Service\RestService($app);
         $groupService = new \Core\Service\GroupService();
         $restService->get('/check', function () use($groupService) {
             return $groupService->check($_GET['name'], isset($_GET['cid']) ? intval($_GET['cid']) : null);
         });
         $restService->get('/validation', function () use($groupService) {
             return $groupService->getForValidation($_GET['cid']);
         });
         $restService->get('/autocomplete', function () use($groupService) {
             return $groupService->getAutocomplete($_GET['s']);
         });
         $restService->get('/list', function () use($groupService) {
             return $groupService->getList($_GET['type'], intval($_GET['page']));
         });
         $restService->get('/:id', function ($id) use($groupService) {
             return $groupService->get($id);
         });
         $restService->post('/', function () use($groupService) {
             $data = getPost();
             return $groupService->save($data);
         });
         $restService->delete('/:id', function ($id) use($groupService) {
             return $groupService->delete($id);
         });
     });
 }
 public function __construct($app)
 {
     $this->app = $app;
     $app->group('/fitting-rule', function () use($app) {
         $restService = new \Core\Service\RestService($app);
         $fittingRuleService = new \Core\Service\FittingRuleService();
         $restService->get('/calculate', function () use($fittingRuleService) {
             return $fittingRuleService->calculateNewItemFilterTypes();
         });
         $restService->get('/check', function () use($fittingRuleService) {
             return $fittingRuleService->check($_GET['name'], isset($_GET['cid']) ? intval($_GET['cid']) : null);
         });
         $restService->get('/autocomplete', function () use($fittingRuleService) {
             return $fittingRuleService->getAutocomplete($_GET['s']);
         });
         $restService->get('/list', function () use($fittingRuleService) {
             return $fittingRuleService->getList($_GET['type'], intval($_GET['page']));
         });
         $restService->get('/:id', function ($id) use($fittingRuleService) {
             return $fittingRuleService->get($id);
         });
         $restService->post('/', function () use($fittingRuleService) {
             $data = getPost();
             return $fittingRuleService->save($data);
         });
         $restService->delete('/:id', function ($id) use($fittingRuleService) {
             return $fittingRuleService->delete($id);
         });
         $restService->post('/fork', function () use($fittingRuleService) {
             $data = getPost();
             return $fittingRuleService->fork($data);
         });
     });
 }
/**
 * Genera un control select para HTML con el nombre dado y el conjunto de opciones dadas en el array valores,
 * siendo valoropcion el índice que indica el valor de cada opción y nombreopcion el índice que tiene el texto a mostrar
 * en cada opción
 * @param unknown $nombre
 * @param unknown $valores
 * @param unknown $valoropcion
 * @param unknown $nombreopcion
 * @return string
 */
function GenerarSelect($nombre, $valores, $valoropcion, $nombreopcion)
{
    $ret = "";
    $ret .= '<select name="' . $nombre . '">' . "\n";
    foreach ($valores as $valor) {
        $ret .= '<option value="' . $valor[$valoropcion] . '"' . (getPost($nombre) == $valor[$valoropcion] ? " selected" : "") . '>' . $valor[$nombreopcion] . '</option>' . "\n";
    }
    $ret .= '</select>' . "\n";
    return $ret;
}
Exemple #5
0
 function buildTile()
 {
     $output = "<div class='BlogTile'>";
     $x = 0;
     while ($x != count($this->feed->posts)) {
         $output .= getPost();
         $x++;
     }
     $output .= "</div>";
     return $output;
 }
function lastPost($board, &$db)
{
    if (boardPosts($board, $db) == 0) {
        return 0;
    } else {
        $query = $db->execute("select `id`, `player`, `name`, `msg`, `time`, `parent` from `forum_posts` where `board`=? order by `time` desc limit 1", array($board));
        $post = $query->fetchrow();
        if (empty($post['name'])) {
            $post2 = getPost($post['parent'], $db);
            $post['name'] = "Re: " . $post2['name'];
        }
        return $post;
    }
}
 public function __construct($app)
 {
     $this->app = $app;
     $app->group('/account-settings', function () use($app) {
         $restService = new \Core\Service\RestService($app);
         $accountSettingsService = new \Core\Service\AccountSettingsService();
         $restService->get('/', function () use($accountSettingsService) {
             return $accountSettingsService->get(0);
         });
         $restService->post('/', function () use($accountSettingsService) {
             $data = getPost();
             return $accountSettingsService->save($data);
         });
     });
 }
Exemple #8
0
/**
 *相关问题
 *返回嵌套数组
 */
function getSimilarQuestions($postid, $num = 3)
{
    $post = getPost($postid);
    $title = $post['title'];
    //文章标题
    $city = $post['city'];
    //城市分类
    $query = qa_db_query_sub("SELECT * from ^posts where (`title` like '%{$title}%' or `areaclass`=\$)\n\t\t\t\t\t\tand postid != \$ order by `updated` desc, `created` DESC limit 0,#", $city, $postid, $num);
    $result = qa_db_read_all_assoc($query);
    if (count($result)) {
        return $result;
    } else {
        return null;
    }
}
Exemple #9
0
function loggin()
{
    $_SESSION['username'] = getPost("pseudo");
    $pass = getPost("password");
    $datas = Bdd::sql_fetch_array_assoc("SELECT *\n                                            FROM LOL_user\n                                            WHERE pseudo=?", array($this->get_pseudo()));
    if ($data[0] == 0) {
        return false;
    }
    $_SESSION['id_user'] = $datas[1]['id'];
    $_SESSION['nom'] = $datas[1]['nom'];
    $_SESSION['prenom'] = $datas[1]['prenom'];
    $_SESSION['pseudo'] = $datas[1]['pseudo'];
    $_SESSION['mail'] = $datas[1]['mail'];
    $_SESSION['pass'] = $datas[1]['password'];
    return true;
}
Exemple #10
0
 public function login()
 {
     $this->show->message = '';
     if (getPost('enter') != '') {
         if (Auth::getInstance()->login($this->post['Login'], $this->post['Password'], true)) {
             if (strlen($this->post['Redirect'])) {
                 //					redirect($this->post['Redirect']);
                 redirect('/admin');
             } else {
                 redirect('/admin');
             }
         } else {
             $this->show->message = 'Неверный логин или пароль';
         }
     }
     $this->template->action = 'index';
 }
Exemple #11
0
function getUser()
{
    $userID = "";
    $userID = getPost('userID');
    if (empty($userID)) {
        $userID = getQString('u');
        if (empty($userID)) {
            $userID = getQString('');
        }
        echo "<p class='debug'>User By Query: {$userID}</p>";
    } else {
        echo "<p class='debug'>User By Post: {$userID}</p>";
    }
    if (strlen($userID) > 3) {
        $userID = null;
    }
    return $userID;
}
 public function RightColumnContent()
 {
     if (in_array($this->Action, array('add', 'view', 'edit'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
         $options = Db_Options::getFulLDetails();
         $product_options = Db_ProductOptions::getOptionsByProductId($this->Id);
         $this->TPL->assign('options', $options);
         $this->TPL->assign('product_options', $product_options);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $product = Db_Products::getDetailsById($this->Id);
         $product_trans = Db_ProductTrans::getDetailsById($this->Id);
         $this->TPL->assign('product', $product);
         $this->TPL->assign('product_trans', $product_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id == 0) {
                 break;
             }
             Db_Products::deleteByField('id', $this->Id);
             Db_ProductTrans::deleteAllByField('pt_product_id', $this->Id);
             Db_ProductOptions::deleteAllByField('po_product_id', $this->Id);
             Upload::rrmdir(BASE_PATH . 'files/' . $this->img_path . $this->Id, true);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl);
             break;
         case 'save':
             $p_model = getPost('p_model');
             $p_url = getPost('p_url');
             $p_published = isset($_POST['p_published']) ? 1 : 0;
             $p_price = getPost('p_price');
             $p_discount = getPost('p_discount');
             $p_discount_status = isset($_POST['p_discount_status']) ? 1 : 0;
             $pt_title = getPost('pt_title');
             $pt_description = getPost('pt_description');
             $options = getPost('options');
             $product = new Db_Products($this->DB, $this->Id, 'id');
             $product->p_model = $p_model;
             $product->p_url = $p_url;
             $product->p_published = $p_published;
             $product->p_price = $p_price;
             $product->p_discount = $p_discount;
             $product->p_discount_status = $p_discount_status;
             $product->p_type = $this->productType;
             $product->save();
             foreach ($pt_title as $lang => $item) {
                 $product_trans = new Db_ProductTrans();
                 $product_trans->findByFields(array('pt_product_id' => $product->id, 'pt_lang_id' => $lang));
                 $product_trans->pt_title = $pt_title[$lang];
                 $product_trans->pt_description = $pt_description[$lang];
                 $product_trans->pt_lang_id = $lang;
                 $product_trans->pt_product_id = $product->id;
                 $product_trans->save();
             }
             if (!empty($_FILES['p_image']) && $_FILES['p_image']['error'] == 0) {
                 $image = Db_Products::getImageById($product->id);
                 $path = BASE_PATH . 'files' . $this->img_path . $product->id . '/';
                 if (is_dir($path)) {
                     Upload::deleteImage($path, $image, $this->img_sizes);
                 }
                 if ($filename = Upload::uploadImage($path, $_FILES['p_image'], 'product', $this->img_sizes, 'crop')) {
                     $product->p_image = $filename;
                     $product->save();
                 }
             }
             if (!empty($options)) {
                 foreach ($options as $option_id => $option_value) {
                     if (empty($option_value) || empty($option_id)) {
                         continue;
                     }
                     $product_option = new Db_ProductOptions();
                     $product_option->findByFields(array('po_option_id' => $option_id, 'po_product_id' => $product->id));
                     $product_option->po_option_id = $option_id;
                     $product_option->po_product_id = $product->id;
                     $product_option->po_value = $option_value;
                     $product_option->save();
                 }
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $product->id);
             break;
         default:
             $Objects = Db_Products::getObjects($this->productType);
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Title'), $this->_T('Url'), $this->_T('Enabled'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'view', $Object['id']));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['title']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['url']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['enabled'] == 1 ? $this->_T('yes') : $this->_T('no'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD(getButton('edit', $this->PageUrl, 'edit', $Object['id']) . getButton('delete', $this->PageUrl, 'delete', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'align-center'));
                     $Grid_TR->Add($Grid_TD);
                     $ListGrid->AddTR($Grid_TR);
                 }
                 $ListGrid->EndBody();
                 $ListGrid = $ListGrid->Html();
             }
             $this->TPL->assign('ListGrid', $ListGrid);
             break;
     }
     $msg = $this->Msg->Html();
     $this->TPL->assign('msg', $msg);
     $this->TPL->assign('Action', $this->Action);
     $result = $this->TPL->display(null, true);
     $this->Msg->Clear();
     return $result;
 }
Exemple #13
0
        <tr>
            <td style='padding:10px;'>
                <textarea style='width:280px;height:60px' id='reasons' name='reason'></textarea>
            </td>
        </tr>
        <tr>
            <td style='padding:10px;text-align:center' id='reject_btn'>
            </td>
        </tr>
    </table>
</div>
<?php 
$status_type = getPost('status', 'Choose');
$requestor_id = getPost('requestor_id', 'Choose');
$date_from = getPost('date_from', '');
$date_to = getPost('date_to', '');
$type = "With PO";
if (!empty($_REQUEST['type'])) {
    $type = $_REQUEST['type'];
}
//echo $type;
$limit = 10;
$start = 0;
$page = 1;
if (!empty($_POST['page'])) {
    $page = $_POST['page'];
    $start = ($_POST['page'] - 1) * $limit;
}
$filter = "where status  in ('Request Release','Ready for pick up','Receive Cash Request' ,'Received')";
$filter = whereMaker($filter, 'status', $status_type);
$filter = whereMaker($filter, 'requestor', $requestor_id);
Exemple #14
0
isset($_GET['postid']) ? $postid = $_GET['postid'] : ($postid = '');
isset($_GET['action']) ? $action = $_GET['action'] : ($action = '');
isset($_GET['type']) ? $type = $_GET['type'] : ($type = 'ques');
//type为bk则为添加或修改百科详情
$ques = null;
$quesuser = qa_get_logged_in_userid();
$update = false;
//是否在更改帖子
if ($postid && $type == 'ques') {
    $ques = qa_post_get_full($postid);
}
if ($ques['userid'] == $quesuser) {
    $update = true;
}
if ($postid && $type == 'baike') {
    $ques = getPost($postid);
    $update = true;
}
// $update=true;
?>
    <?php 
require 'header.php';
?>
   
    <!--side fixed end-->
    <div class="content">
		<script>
			var b=document.getElementsByTagName('body')[0];
			b.className=b.className.replace('qa-body-js-off', 'qa-body-js-on');
		</script>
		
Exemple #15
0
$UseCaseID = $UseCaseTitle = $UseCaseDescription = $PrimaryActor = $AlternateActors = $PreRequisits = $PostConditions = $MainPathSteps = $AlternatePathSteps = $SuccessCriteria = $PotentialFailures = $FrequencyOfUse = $OwnerUserID = $PriorityID = $CaseStatusID = "";
$UseCaseID = getPost('UseCaseID');
$UseCaseTitle = getPost('UseCaseTitle');
$UseCaseDescription = getPost('UseCaseDescription');
$PrimaryActor = getPost('PrimaryActor');
$AlternateActors = getPost('AlternateActors');
$PreRequisits = getPost('PreRequisits');
$PostConditions = getPost('PostConditions');
$MainPathSteps = getPost('MainPathSteps');
$AlternatePathSteps = getPost('AlternatePathSteps');
$SuccessCriteria = getPost('SuccessCriteria');
$PotentialFailures = getPost('PotentialFailures');
$FrequencyOfUse = getPost('FrequencyOfUse');
$OwnerUserID = getPost('OwnerUserID');
$PriorityID = getPost('PriorityID');
$CaseStatusID = getPost('CaseStatusID');
$fields = "UseCaseTitle, UseCaseDescription, PrimaryActor, AlternateActors, PreRequisits, PostConditions, MainPathSteps, AlternatePathSteps, SuccessCriteria, PotentialFailures, FrequencyOfUse, OwnerUserID, PriorityID, CaseStatusID";
$qString = $action = $value = $id = $filterBy = $orderBy = "";
$qString = $_SERVER['QUERY_STRING'];
if ($qString != "") {
    $action = getQString('action');
    //list, select, sort, add, edit, delete, filter, like
    $value = getQString('v');
    $id = getQString('i');
}
if (empty($UseCaseID) and !empty($id)) {
    $UseCaseID = $id;
}
function addUseCaseItem($UseCaseTitle, $UseCaseDescription, $PrimaryActor, $AlternateActors, $PreRequisits, $PostConditions, $MainPathSteps, $AlternatePathSteps, $SuccessCriteria, $PotentialFailures, $FrequencyOfUse, $OwnerUserID, $PriorityID, $CaseStatusID)
{
    try {
Exemple #16
0
<?php

require_once "_main2.php";
$post = getPost($_GET["id_post"]);
header("Content-type: " . $post["type_image"]);
echo $post["post_image"];
Exemple #17
0
    public function RightColumnContent()
    {
        switch ($this->Action) {
            case 'view':
                $this->CheckIdExist();
                $Object = Db_Type::getObjectById($this->Id);
                $this->TPL->assign('Object', $Object);
                $ObjectTrans = Db_TypeTrans::getTransByObjectId($this->Id);
                $this->TPL->assign('ObjectTrans', $ObjectTrans);
                $LanguageModel = Db_Language::getLanguageWithKey();
                $this->TPL->assign('LanguageModel', $LanguageModel);
                break;
            case 'edit':
                $this->CheckIdExist();
                $Object = Db_Type::getObjectById($this->Id);
                $this->TPL->assign('Object', $Object);
                $ObjectTrans = Db_TypeTrans::getTransByObjectId($this->Id);
                $this->TPL->assign('ObjectTrans', $ObjectTrans);
                $LanguageModel = Db_Language::getLanguageWithKey();
                $this->TPL->assign('LanguageModel', $LanguageModel);
                break;
            case 'delete':
                if ($this->Id != 0) {
                    Db_Type::deleteByField('id', $this->Id);
                    Db_TypeTrans::deleteByField('tt_type_id', $this->Id, 0);
                    $this->rrmdir(BASE_PATH . 'files/' . $this->object_path . $this->Id, true);
                    $this->Msg->SetMsg($this->_T('success_item_deleted'));
                    $this->Redirect($this->PageUrl);
                }
                break;
            case 'add':
                $LanguageModel = Db_Language::getLanguageWithKey();
                $this->TPL->assign('LanguageModel', $LanguageModel);
                break;
            case 'save':
                if ($this->Id != 0) {
                    $this->CheckIdExist();
                }
                $tt_title = getPost('tt_title');
                $t_priority = getPost('t_priority');
                $t_url = getPost('t_url');
                $t_published = isset($_POST['t_published']) ? 1 : 0;
                //                Save data into OBJECT
                $Object = new Db_Type($this->DB, $this->Id, 'id');
                $Object->t_priority = $t_priority;
                $Object->t_published = $t_published;
                $Object->t_url = $t_url;
                $Object->save();
                //                Take id of $Object
                $id = $Object->id;
                //                Save trans values into $ObjectTrans
                foreach ($tt_title as $lang => $title) {
                    $ObjectTrans = new Db_TypeTrans();
                    $ObjectTrans->findByFields(array('tt_type_id' => $id, 'tt_lang_id' => $lang));
                    $ObjectTrans->tt_title = $title;
                    $ObjectTrans->tt_type_id = $id;
                    $ObjectTrans->tt_lang_id = $lang;
                    $ObjectTrans->save();
                }
                $this->Msg->SetMsg($this->_T('success_item_saved'));
                $this->Redirect($this->PageUrl . '?action=view&id=' . $id);
                break;
            default:
                $Objects = Db_Type::getObjects();
                $ObjectsTrans = Db_TypeTrans::getTransByLang($this->LangId);
                $ListGrid = false;
                if ($Objects) {
                    $ListGrid = new TGrid();
                    $ListGrid->Spacing = 0;
                    $ListGrid->Width = '100%';
                    $ListGrid->SetClass('table table-bordered table-highlight-head');
                    $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Title'), $this->_T('Url'), $this->_T('Priority'), $this->_T('Published'), $this->_T('actions'));
                    $ListGrid->BeginBody();
                    foreach ($Objects as $Object) {
                        $Grid_TR = new TGrid_TTR();
                        $Grid_TD = new TGrid_TTD($Object['id'] . ' (&nbsp;<a href="' . $this->PageUrl . '?action=view&id=' . $Object['id'] . '">' . $this->_T('see') . '</a>&nbsp;)');
                        $Grid_TR->Add($Grid_TD);
                        $Grid_TD = new TGrid_TTD($ObjectsTrans[$Object['id']]['tt_title']);
                        $Grid_TR->Add($Grid_TD);
                        $Grid_TD = new TGrid_TTD($Object['t_url']);
                        $Grid_TR->Add($Grid_TD);
                        $Grid_TD = new TGrid_TTD($Object['t_priority']);
                        $Grid_TR->Add($Grid_TD);
                        $Grid_TD = new TGrid_TTD($Object['t_published'] == 1 ? $this->_T('yes') : $this->_T('no'));
                        $Grid_TR->Add($Grid_TD);
                        $Grid_TD = new TGrid_TTD('
								<a class="bs-tooltip" title="" href="' . $this->PageUrl . '?action=edit&id=' . $Object['id'] . '" data-original-title="' . $this->_T('edit') . '"><i class="icon-pencil"></i></a>
								<a class="bs-tooltip confirm-dialog" data-text="' . _T('sure_you_want_to_delete') . '" title="" href="' . $this->PageUrl . '?action=delete&id=' . $Object['id'] . '" data-original-title="' . $this->_T('delete') . '"><i class="icon-trash"></i></a>
							');
                        $Grid_TD->AddAttr(new TAttr('class', 'align-center'));
                        $Grid_TR->Add($Grid_TD);
                        $ListGrid->AddTR($Grid_TR);
                    }
                    $ListGrid->EndBody();
                    $ListGrid = $ListGrid->Html();
                }
                $this->TPL->assign('ListGrid', $ListGrid);
                break;
        }
        $msg = $this->Msg->Html();
        $this->TPL->assign('msg', $msg);
        $this->TPL->assign('Action', $this->Action);
        $result = $this->TPL->display(null, true);
        $this->Msg->Clear();
        return $result;
    }
Exemple #18
0
<?php

/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| DB Query Panel                                                                |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("doquery")) {
    $strQuery = getPost("dbquery");
    if (get_magic_quotes_gpc() == 1) {
        $strQuery = stripslashes($strQuery);
    }
    $objDb = class_carrier::getInstance()->getObjDB();
    echo "query to run " . $strQuery . "\n";
    if ($objDb->_query($strQuery)) {
        echo "\n\nquery successfull.\n";
    } else {
        echo "\n\nquery failed.\n";
    }
} else {
    echo "Provide the query to execute.\nPlease be aware of the consequences!\n\n";
    echo "<form method=\"post\">";
    echo "<textarea name=\"dbquery\" cols=\"75\" rows=\"10\">";
    echo "</textarea><br />";
    echo "<input type=\"hidden\" name=\"doquery\" value=\"1\" />";
Exemple #19
0
function printTemplate($data)
{
    global $version;
    ?>
	<html>
		<head>
			<title>FireFile Configuration</title>
			<link rel="shortcut icon" href="http://www.strebitzer.at/projects/firefile/favicon.ico" type="image/x-icon" />
			<style>
				
				body {
					padding: 0px;
					margin: 0px;
					background: #FFFFFF;
					color: #444444;
				}
				
				div.config-pane {
					margin: 2px;
					padding: 2px;
					border: 1px dotted #DDDDDD;
				}
				
				div.success {
					background: #DDEEDD;
				}
				
				div.error {
					background: #EEDDDD;
				}
				
				div.code {
					border: 1px dotted #CCCCCC;
					background: #FFEEEE;
					padding: 2px;
					font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
					font-size: 11px;
					color: #444444;
				}
				
				div.success h1, div.error h1 {
					color: #444444 !IMPORTANT;
					font-size: 12px;
                    font-family: monospace;
                    text-shadow: 0px 1px 1px #999999;
				}

				#login-panel {
					background: #EEEEEE;
					width: 100%;
					height: 32px;
					padding: 4px 0px 4px 0px;
					border-bottom: 2px solid #DDDDDD;
				}
				
				div.login-control {
					float: right;
					padding: 2px 2px 2px 6px;
					margin: 3px 3px 3px 0px;
					border: 1px dotted #CCCCCC;
				}
				
				input {
					border: 1px solid #444444;
					height: 18px;
				}
				
				label {
					color: #444444;
					font-size: 10px;
					line-height: 18px;
				}
				
				div.config-pane label {
					display: block;
					line-height: 13px;
				}
				
				div.config-pane input {
					display: block;

				}
				
				h1 {
					margin: 6px 0px 4px 4px;
					padding: 0px;
					font-size: 12px;
					/*text-transform: uppercase;*/
					color: #AAAAAA;
					font-weight: normal;
				}
				
				input#cmd_submit {
					float: right;
					margin: 3px 3px 3px 0px;
					height: 26px;
					border: 1px dotted #CCCCCC;
					color: #444444;
					font-weight: bold;
				}
				
				input.inner_submit {
					margin: 2px 0px 0px 0px;
					float: none;
					height: 18px;
					border: 1px dotted #CCCCCC;
					color: #444444;
					font-weight: bold;
				}
				
				input.highlight {
					background: #FFCB51;
					border: 1px solid #99882B;
				}
				
				span.firefile-key {
					border: 1px solid #CCCCCC;
					padding: 2px 4px 0px 4px;
					text-transform: uppercase;
					background: #EEEEEE;
				}
				
				span.firefile-install {
					border: 1px solid #CCCCCC;
					padding: 2px 4px 0px 4px;
					text-transform: uppercase;
					background: #EEEEEE;
				}
				
				span.firefile-install a {
					color: #444444;
					font-weight: bold;
					text-decoration: none;
				}
				
				div.logo-float {
					float: left;
					padding: 0px 0px 0px 4px;
					font-size: 40px;
					line-height: 40px;
					font-weight: bold;
				}
				
				div.logo-float img {
				    border: 0 none;
					float: left;
				}
				
				div.logo-float span.logo-fire {
					float: left;
				}
				
				div.logo-float span.logo-file {
					float: left;
					color: #666666;
				}
				
				div.logo-float span.logo-version {
					float: left;
					color: #EAEAEA;
					margin-left: 10px;
				}
				
				div#key-pane {
				    display: none;
				}
				
			</style>
			
			<?php 
    if (file_exists("style1.css") && file_exists("style2.css")) {
        ?>
				<link rel="stylesheet" href="style1.css" type="text/css" />
				<link rel="stylesheet" href="style2.css" type="text/css" />
			<?php 
    }
    ?>
		</head>
		<body>
			<form id="firefile-form" method="POST">
				<div id="login-panel">
					<div class="logo-float">
						<a href="http://firefile.strebitzer.at/?hasversion=<?php 
    echo $version;
    ?>
" target="_blank"><img src="http://www.strebitzer.at/projects/firefile/firefile_update_icon.php?version=<?php 
    echo $version;
    ?>
" width="32" height="32" alt="FireFile" title="FireFile" /></a>
						<span class="logo-fire">Fire</span>
						<span class="logo-file">File</span>
						<span class="logo-version">0.5.0</span>
					</div>
					<?php 
    if ($data["user_set"] || $data["pass_set"]) {
        ?>
						<input id="cmd_submit" type="submit" value="APPLY" />
						<div class="login-control">
							<label for="password">PASS:</label>
							<input type="password" tabindex="2" autocomplete="off" value="<?php 
        echo getPost("password");
        ?>
" id="password" name="password" />
						</div>
						<div class="login-control">
							<label for="username">USER:</label>
							<input type="text" tabindex="1" autocomplete="off" value="<?php 
        echo getPost("username");
        ?>
" id="username" name="username" />
						</div>
					<?php 
    }
    ?>
				</div>
				<?php 
    foreach ($data["success"] as $msg) {
        ?>
					<div class="config-pane success">
						<h1><?php 
        echo $msg;
        ?>
</h1>
					</div>
				<?php 
    }
    ?>
				
				<?php 
    foreach ($data["error"] as $msg) {
        ?>
					<div class="config-pane error">
						<h1><?php 
        echo $msg;
        ?>
</h1>
					</div>
				<?php 
    }
    ?>
				
				<?php 
    if ($data["logged_in"]) {
        ?>
    				<div class="config-pane success">
    					<h1>Please make sure that Firebug ist activated to successfully register FireFile</h1>
    				</div>
    				
					<div class="config-pane">
						<h1>CHANGE USERNAME:</h1>
						<div class="config-pane">
							<label for="username_new">NEW USERNAME:</label>
							<input <?php 
        if (!$data["user_set"]) {
            echo "class='highlight'";
        }
        ?>
 type="text" autocomplete="off" value="" id="username_new" name="username_new" />
							<input class="inner_submit" type="submit" value="APPLY" />
						</div>
						<h1>CHANGE PASSWORD:</h1>
						<div class="config-pane">
							<label for="password_new">NEW PASSWORD:</label>
							<input <?php 
        if (!$data["pass_set"]) {
            echo "class='highlight'";
        }
        ?>
 type="password" autocomplete="off" value="" id="password_new" name="password_new" />
							<label for="password_new_retype">RETYPE:</label>
							<input <?php 
        if (!$data["pass_set"]) {
            echo "class='highlight'";
        }
        ?>
 type="password" autocomplete="off" value="" id="password_new_retype" name="password_new_retype" />
							<input class="inner_submit" type="submit" value="APPLY" />
						</div>
						<?php 
        if ($data["user_set"] && $data["pass_set"]) {
            ?>
							<div id="key-pane" class="config-pane">
								<label for="username">FIREFILE KEY:</label>
								<span id="firefile-key-holder" class="firefile-key"><?php 
            echo $data["code"];
            ?>
</span>
							</div>
						<?php 
        }
        ?>
					</div>
				<?php 
    } else {
        ?>
					<?php 
        if (!isset($data["break"])) {
            ?>
						<div class="config-pane error">
							<h1>YOU ARE NOT LOGGED IN</h1>
						</div>
					<?php 
        }
        ?>
				<?php 
    }
    ?>
				<?php 
    if (file_exists("style1.css") && file_exists("style2.css")) {
        ?>
					<h1>TEST AREA:</h1>
					<div class="config-pane">
						<label>You can edit this test area with firebug to make sure that firefile is working</label>
						<div id="test">
							<div class="outer_div">
								<div class="inner_div">
									<div class="header_div">HEADER</div>
									<div class="content_div">CONTENT</div>
									<div class="footer_div">FOOTER</div>
								</div>
							</div>
						</div>
						<input class="inner_submit" type="submit" value="RELOAD PAGE" />
					</div>
				<?php 
    }
    ?>
			</form>
		</body>
	</html>
<?php 
}
$login_pass = '';
// エラー保持用配列
$errors = array();
// DBコネクトオブジェクト取得
try {
    $db = get_db_connect();
} catch (PDOException $e) {
    $errors[] = entity_str($e->getMessage());
}
if (!isPost()) {
    include_once '../include/view/login.php';
} else {
    if (getPost('action_id') === 'login') {
        // ユーザIDとパスワードの組み合わせでチェック
        $login_id = entity_str(getPost('login_id'));
        $login_pass = entity_str(getPost('login_pass'));
        //  todo ユーザID入力チェック
        if (!isExist($login_id)) {
            $errors[] = 'ユーザIDを入力してください';
        }
        // todo パスワード入力チェック
        if (!isExist($login_pass)) {
            $errors[] = 'パスワードを入力してください';
        }
        // 入力エラーがない場合DB認証チェック
        if (count($errors) === 0) {
            $login = new user_login_model();
            if ($login->loginCheck($db, $login_id, $login_pass)) {
                // ログインIDを記録
                $_SESSION['login_id'] = $login_id;
                setcookie('login_id', $login_id, time() + 60 * 60 * 24 * 30);
Exemple #21
0
		<?php 
include "cabecalho.php";
include "conf.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $where = array();
    $idProduto = getPost('idProduto');
    $idCliente = getPost('idCliente');
    if ($idProduto) {
        $where[] = " `id_produto` like '%" . $idProduto . "%'";
    }
    if ($idCliente) {
        $where[] = " `id_cliente` like '%" . $idCliente . "%'";
    }
    $query = "SELECT * FROM pedido ";
    if (sizeof($where)) {
        $query .= ' WHERE ' . implode(' AND ', $where);
    }
} else {
    $query = "select * from pedido";
}
function filter($str)
{
    return addslashes($str);
}
function getPost($key)
{
    return isset($_POST[$key]) ? filter($_POST[$key]) : null;
}
$dados = mysql_query($query, $conn) or die(mysql_error());
$linha = mysql_fetch_assoc($dados);
$total = mysql_num_rows($dados);
<?php

/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| Delete all tables                                                             |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("dodelete")) {
    $strUsername = getPost("username");
    $strPassword = getPost("password");
    $objUsersource = new class_module_user_sourcefactory();
    $objUser = $objUsersource->getUserByUsername($strUsername);
    echo "Authenticating user...\n";
    if ($objUsersource->authenticateUser($strUsername, $strPassword)) {
        echo " ... authenticated.\n";
        $arrGroupIds = $objUser->getArrGroupIds();
        if (in_array(class_module_system_setting::getConfigValue("_admins_group_id_"), $arrGroupIds)) {
            echo "User is member of admin-group.\n";
            $arrTables = class_carrier::getInstance()->getObjDB()->getTables();
            foreach ($arrTables as $strOneTable) {
                $strQuery = "DROP TABLE " . $strOneTable;
                echo " executing " . $strQuery . "\n";
                class_carrier::getInstance()->getObjDB()->_pQuery($strQuery, array());
            }
        } else {
Exemple #23
0
<?php

$model = new Model();
$username = stringOr(getPost("username"));
?>
<div class="scene login i:login">
	<h1>Log ind</h1>

<?	if(defined("SITE_SIGNUP") && SITE_SIGNUP): ?>
	<p>Ikke registreret endnu? <a href="<?php 
echo SITE_SIGNUP;
?>
">Opret din konto nu</a>.</p>
<?	endif; ?>

	<?php 
echo $model->formStart("?login=true", array("class" => "labelstyle:inject"));
?>

<?	if(message()->hasMessages(array("type" => "error"))): ?>
		<p class="errormessage">
<?		$messages = message()->getMessages(array("type" => "error"));
		message()->resetMessages();
		foreach($messages as $message): ?>
			<?php 
echo $message;
?>
<br>
<?		endforeach;?>
		</p>
<?	endif; ?>
<?php

include_once 'functions.inc';
## Form
if (isset($_POST['submit'])) {
    # Get request properties
    $form['firstname'] = getPost('firstname');
    $form['lastname'] = getPOST('lastname');
    $form['email'] = getPOST('email');
    $form['password'] = getPOST('password');
    $form['confirmPassword'] = getPOST('confPassword');
    $form['subject'] = getPOST('subject');
    $form['message'] = getPOST('message');
    $form['captchaValue'] = getPOST('captchaValue');
    $form['captchaId'] = getPOST('captchaId');
    // Add datetime
    date_default_timezone_set('Europe/Berlin');
    $form['date'] = date("F j, Y, g:i a");
    // Check for empty fields
    foreach ($form as $key => $value) {
        if (!$value) {
            $errorMsg .= 'The field "' . $key . '" may not be empty.<br>';
        }
    }
    if (!validateEmail($form['email'])) {
        $errorMsg .= "Please check your email address entered.<br>";
    }
    if (!validatePassword($form['password'], $form['confirmPassword'])) {
        $errorMsg .= "Passwords does not match.<br>";
    }
    if (!validateCaptcha($form['captchaValue'], $form['captchaId'])) {
Exemple #25
0
<?php

include 'functions.php';
$postId = $_GET['postId'];
$post = getPost($postId);
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>View Post</title>
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="css/styles.css">
</head>
<body>

<!-- Nav bar -->
<?php 
include 'nav.php';
?>

<div class="container">
		<?php 
include 'errors.php';
?>
		<h1><?php 
echo $post['title'];
?>
<br><img class="avatar-post" src="<?php 
echo $post['profile_picture'];
Exemple #26
0
 public function RightColumnContent()
 {
     if (in_array($this->Action, array('add', 'additem', 'edit', 'edititem', 'viewitem'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $slider = Db_Sliders::getDetailsById($this->Id);
         $this->TPL->assign('slider', $slider);
     }
     if (in_array($this->Action, array('edititem', 'viewitem'))) {
         $slide = Db_SliderItems::getDetailsById($this->Id);
         $slide_trans = Db_SliderItemTrans::getTransById($this->Id);
         $this->TPL->assign('slide', $slide);
         $this->TPL->assign('slide_trans', $slide_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id == 0) {
                 return false;
             }
             $ids = Db_SliderItems::getIdsBySliderId($this->Id);
             Db_Sliders::deleteByField('id', $this->Id);
             Db_SliderItems::deleteAllByField('si_slider_id', $this->Id);
             Db_SliderItemTrans::deleteBySliderItemIds($ids);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl);
             break;
         case 'deleteitem':
             Db_SliderItems::deleteByField('id', $this->Id);
             Db_SliderItemTrans::deleteAllByField('sit_slider_item_id', $this->Id);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl . '?action=viewitems&id=' . $this->Id);
             break;
         case 'saveitem':
             if ($this->sId == 0) {
                 return '';
             }
             $si_url = getPost('si_url');
             $si_priority = getPost('si_priority');
             $sit_h1 = getPost('sit_h1');
             $sit_h2 = getPost('sit_h2');
             $sit_h3 = getPost('sit_h3');
             $sit_title_link = getPost('sit_title_link');
             $slide = new Db_SliderItems($this->DB, $this->Id, 'id');
             $slide->si_url = $si_url;
             $slide->si_priority = $si_priority;
             $slide->si_slider_id = $this->sId;
             $slide->save();
             foreach ($sit_h1 as $lang => $item) {
                 $slide_trans = new Db_SliderItemTrans();
                 $slide_trans->findByFields(array('sit_slider_item_id' => $slide->id, 'sit_lang_id' => $lang));
                 $slide_trans->sit_h1 = $sit_h1[$lang];
                 $slide_trans->sit_h2 = $sit_h2[$lang];
                 $slide_trans->sit_h3 = $sit_h3[$lang];
                 $slide_trans->sit_title_link = $sit_title_link[$lang];
                 $slide_trans->sit_slider_item_id = $slide->id;
                 $slide_trans->sit_lang_id = $lang;
                 $slide_trans->save();
             }
             if (!empty($_FILES['si_image']) && $_FILES['si_image']['error'] == 0) {
                 $image = Db_SliderItems::getImageById($this->sId);
                 $path = BASE_PATH . 'files' . $this->img_path . $this->sId . DS;
                 if (is_dir($path)) {
                     Upload::deleteImage($path, $image, $this->img_sizes);
                 }
                 if ($image = Upload::uploadImage($path, $_FILES['si_image'], 'slider', $this->img_sizes, 'crop')) {
                     $slide->si_image = $image;
                     $slide->save();
                 }
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=viewitem&id=' . $slide->id . '&sid=' . $this->sId);
             break;
         case 'save':
             $s_key = getPost('s_key');
             $s_enabled = isset($_POST['s_enabled']) ? 1 : 0;
             $slider = new Db_Sliders($this->DB, $this->Id, 'id');
             $slider->s_key = $s_key;
             $slider->s_enabled = $s_enabled;
             $slider->save();
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $slider->id);
             break;
         case 'viewitems':
             $Objects = Db_SliderItems::getFulLDetailsBySliderId($this->Id);
             $this->TPL->assign('slider_id', $this->Id);
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Image'), $this->_T('H1'), $this->_T('H2'), $this->_T('H3'), $this->_T('Link title'), $this->_T('Url'), $this->_T('Priority'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'viewitem', $Object['id'], $this->Id));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['image']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['h1']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['h2']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['h3']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['title_link']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['url']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['priority']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD(getButton('edit', $this->PageUrl, 'edititem', $Object['id'], $this->Id) . getButton('delete', $this->PageUrl, 'deleteitem', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'align-center col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $ListGrid->AddTR($Grid_TR);
                 }
                 $ListGrid->EndBody();
                 $ListGrid = $ListGrid->Html();
             }
             $this->TPL->assign('ListGrid', $ListGrid);
             break;
         default:
             $Objects = Db_Sliders::getObjects();
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Key'), $this->_T('Enabled'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'viewitems', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['s_key']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-9'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['s_enabled'] == 1 ? $this->_T('yes') : $this->_T('no'));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD(getButton('edit', $this->PageUrl, 'edit', $Object['id']) . getButton('delete', $this->PageUrl, 'delete', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'align-center col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $ListGrid->AddTR($Grid_TR);
                 }
                 $ListGrid->EndBody();
                 $ListGrid = $ListGrid->Html();
             }
             $this->TPL->assign('ListGrid', $ListGrid);
             break;
     }
     $msg = $this->Msg->Html();
     $this->TPL->assign('msg', $msg);
     $this->TPL->assign('Action', $this->Action);
     $result = $this->TPL->display(null, true);
     $this->Msg->Clear();
     return $result;
 }
Exemple #27
0
function outMP3Info()
{
    $info = getPost("access2008_mp3_info");
    if (strlen($info) > 0) {
        $arr = explode("|", $info);
        if (count($arr) == 8) {
            echo "<br />MP3文件信息:<br/>";
            echo "版本:{$arr['0']}<br/>";
            echo "层:{$arr['1']}<br/>";
            if ($arr[2] == 0) {
                echo "CRC校验:校验<br/>";
            } else {
                echo "CRC校验:不校验<br/>";
            }
            echo "位率:{$arr['3']}Kbps<br/>";
            echo "采样频率:{$arr['4']}Hz<br/>";
            if ($arr[5] == 0) {
                echo "声道模式:立体声Stereo<br/>";
            } else {
                if ($arr[5] == 1) {
                    echo "声道模式:Joint Stereo<br/>";
                } else {
                    if ($arr[5] == 2) {
                        echo "声道模式:双声道<br/>";
                    } else {
                        echo "声道模式:单声道<br/>";
                    }
                }
            }
            if ($arr[6] == 0) {
                echo "版权:不合法<br/>";
            } else {
                echo "版权:合法<br/>";
            }
            if ($arr[7] == 0) {
                echo "原版标志:非原版<br/>";
            } else {
                echo "原版标志:原版<br/>";
            }
        }
    }
}
Exemple #28
0
function getPostsByTag($tagID)
{
    $posts = array();
    $query = mysql_query("SELECT post_id FROM posts_to_tags WHERE tag_id='{$tagID}';") or die(mysql_error());
    while ($mapping = mysql_fetch_array($query)) {
        array_push($posts, getPost($mapping['post_id']));
    }
    return $posts;
}
Exemple #29
0
<?php

require_once 'core.php';
$name = getPost('NAME', '');
$location = getPost('LOCATION', '');
$summary = getPost('SUMMARY', '');
// See if the team already exists
$exists = getTeam($name);
if ($name != '' && $location != '' && $summary != '' && !$exists) {
    addTeam(new Team($name, $location, $summary));
}
header("Location: team.php?name={$name}");
Exemple #30
0
function getPostRequest($strKey, $varDefault)
{
    return getPost($strKey, getRequest($strKey, $varDefault));
}