Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Problem with my other panel

Asked Modified Viewed 924 times
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
asked
Senior Member

I have one more problem with my other panel.
Can you peek
Administrative file
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: ostrzezenia_admin.php
| Author: Brzanek
+--------------------------------------------------------+
| DF Ostrzeżenia Infusion
| Version: 1.03
| Author: Brzanek
| Developer(s): Brzanek
| Site: http://pogoda-zachodniopomorskie.pl
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+-------------------------------------------------------*/
require_once "../../../maincore.php";
require_once THEMES."templates/admin_header.php";
include INFUSIONS."ostrzezenia_infusion/infusion_db.php";
?>
<!--
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" type="text/css" rel="stylesheet">
<link href="http://pogoda-zachodniopomorskie.pl/infusions/ostrzezenia_infusion/admin/dist/css/tokenfield-typeahead.css" type="text/css" rel="stylesheet">
<link href="http://pogoda-zachodniopomorskie.pl/infusions/ostrzezenia_infusion/admin/dist/css/bootstrap-tokenfield.css" type="text/css" rel="stylesheet">
<link href="http://pogoda-zachodniopomorskie.pl/infusions/ostrzezenia_infusion/admin/docs-assets/css/pygments-manni.css" type="text/css" rel="stylesheet">
<link href="bootstrap-chosen.css" rel="stylesheet">
-->
 <?php
if (!checkrights("OS") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
 $snippetSettings = [
 'required' => TRUE,
 'preview' => TRUE,
 'html' => TRUE,
 'autosize' => TRUE,
 'placeholder' => 'Opis',
 'form_name' => 'inputform',
 'wordcount' => TRUE,
 'rows' => '40',
 ];
 $extendedSettings = [
 'height' => '500px',
 'placeholder' => '',
 ];
 $extendedSettings += $snippetSettings;

 if (fusion_get_settings('tinymce_enabled')) {
 $snippetSettings = [
 'required' => TRUE,
 'height' => '200px',
 'type' => 'tinymce',
 'tinymce' => 'advanced',
 ];

 $extendedSettings = [
 'preview' => TRUE,
 'html' => TRUE,
 'autosize' => TRUE,
 'form_name' => 'inputform',
 'wordcount' => TRUE,
 'rows' => 36,
 ];
 }

echo '<section class="content">';
echo '<div class="p-15" style="background-color: #ffffff;">';
echo '
<br>
<h3 class="heading">Wydawanie ostrzeżeń przed gwałtownymi zjawiskoami (burza, deszcz, wiatr...)</h3>
<br>
<div role="tabpanel">

 <!-- Nav tabs -->
 <ul class="nav nav-tabs" role="tablist">
 <li role="presentation" class="active"><a href="#ost" aria-controls="ost" role="tab" data-toggle="tab">Ostrzeżenie</a></li>
 <li role="presentation"><a href="#arch" aria-controls="arch" role="tab" data-toggle="tab">Arhiwum</a></li>
 </ul>

 <!-- Tab panes -->
 <div class="tab-content">
 <div role="tabpanel" class="tab-pane active" id="ost">
<br>';

$ost_id = (isset($_GET['ost_id']) AND isnum($_GET['ost_id'])) ? $_GET['ost_id'] : "";

if (isset($_GET['status'])) {
 if ($_GET['status'] == "sn") {
 $message = 'Edytuj';
 } elseif ($_GET['status'] == "su") {
 $message = 'Test';
 } elseif ($_GET['status'] == "del") {
 $message = $locale['412'];
 }
 if ($message) { echo "<div id='close-message'><div class='admin-message'>".$message."</div></div>\n"; }
}

if (isset($_GET['action']) && $_GET['action'] == "delete") {
 $result = dbquery("DELETE FROM ".DB_OSTRZEZENIA." WHERE ost_id='".$ost_id."'");
 redirect(FUSION_SELF.$aidlink."&status=del");
}

 if (isset($_POST["zapisz"])) {

$plik_tmp = $_FILES['ost_image']['tmp_name'];
$plik_nazwa = $_FILES['ost_image']['name'];
$plik_rozmiar = $_FILES['ost_image']['size'];

if(is_uploaded_file($plik_tmp)) {
 move_uploaded_file($plik_tmp, "../images/$plik_nazwa");
 echo "ost_image: <strong>$plik_nazwa</strong> o rozmiarze
 <strong>$plik_rozmiar bajtów</strong> został przesłany na serwer!";
}
 if($_POST['ost_name'] != "") {
 $ost_name = stripinput($_POST['ost_name']);
 $ost_kat = stripinput($_POST['ost_kat']);
 $ost_image = file_exists("../images/$plik_nazwa") ? $plik_nazwa : '';
 $ost_powiat = stripinput($_POST['ost_powiat']);
 $ost_keywords = form_sanitizer($_POST['ost_keywords'], '', 'ost_keywords');
 $ost_startdzien = stripinput($_POST['ost_startdzien']);
 $ost_startgodzina = stripinput($_POST['ost_startgodzina']);
 $ost_enddzien = stripinput($_POST['ost_enddzien']);
 $ost_endgodzina = stripinput($_POST['ost_endgodzina']);
 $ost_synoptyczna = stripinput($_POST['ost_synoptyczna']);
 $ost_tresc = stripinput($_POST['ost_tresc']);
 $ost_regiony = stripinput($_POST['ost_regiony']);
 $ost_skutki = stripinput($_POST['ost_skutki']);
 $ost_procent = stripinput($_POST['ost_procent']);
 $ost_stopien = stripinput($_POST['ost_stopien']);
 $ost_visibility = stripinput($_POST['ost_visibility']);

if (isset($_GET['action']) && $_GET['action'] == "edit") {
 
 $result = dbquery("UPDATE ".DB_OSTRZEZENIA." SET ost_name='".$ost_name."', ost_kat='".$ost_kat."', ost_image='".$ost_image."', ost_powiat='".implode(' ',$_POST['ost_powiat'])."', ost_keywords='".$ost_keywords."', ost_startdzien='".$ost_startdzien."', ost_startgodzina='".$ost_startgodzina."', ost_enddzien='".$ost_enddzien."', ost_endgodzina='".$ost_endgodzina."', ost_synoptyczna='".$ost_synoptyczna."', ost_tresc='".$ost_tresc."', ost_regiony='".$ost_regiony."', ost_skutki='".$ost_skutki."', ost_procent='".$ost_procent."', ost_stopien='".$ost_stopien."', ost_visibility='".$ost_visibility."' WHERE ost_id='".$ost_id."'");
 redirect(FUSION_SELF.$aidlink."&status=su&ost_id=".$ost_id);
 } else {
 $result = dbquery("INSERT INTO ".DB_OSTRZEZENIA."(user, ost_name, ost_kat, ost_image, ost_powiat, ost_keywords, ost_startdzien, ost_startgodzina, ost_enddzien, ost_endgodzina, ost_synoptyczna, ost_tresc, ost_regiony, ost_skutki, ost_procent, ost_stopien, ost_visibility) VALUES('".$userdata['user_id']."', '".$ost_name."', '".$ost_kat."', '".$ost_image."', '".implode(' ',$_POST['ost_powiat'])."', '".$ost_keywords."', '".$ost_startdzien."', '".$ost_startgodzina."', '".$ost_enddzien."', '".$ost_endgodzina."', '".$ost_synoptyczna."', '".$ost_tresc."', '".$ost_regiony."', '".$ost_skutki."', '".$ost_procent."', '".$ost_stopien."', '".$ost_visibility."')");
 redirect(FUSION_SELF.$aidlink."&status=sn&ost_id=".$ost_id); }
} else {
 echo "<center><div class='save-error' style='margin-bottom:5px;'>TEST</div></center>\n"; }
}

 if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_POST['ost_id']) && isnum($_POST['ost_id'])) || (isset($_GET['ost_id']) && isnum($_GET['ost_id']))) {

 $result = dbquery("SELECT * FROM ".DB_OSTRZEZENIA." WHERE ost_id='".(isset($_POST['ost_id']) ? $_POST['ost_id'] : $_GET['ost_id'])."'");

 $data = dbarray($result);
 $ost_name = stripinput($data['ost_name']);
 $ost_kat = stripinput($data['ost_kat']);
 $ost_image = stripinput($data['ost_image']);
 $ost_powiat = stripinput($data['ost_powiat']);
 $ost_keywords = stripinput($data['ost_keywords']);
 $ost_startdzien = stripinput($data['ost_startdzien']);
 $ost_startgodzina = stripinput($data['ost_startgodzina']);
 $ost_enddzien = stripinput($data['ost_enddzien']);
 $ost_endgodzina = stripinput($data['ost_endgodzina']);
 $ost_synoptyczna = stripinput($data['ost_synoptyczna']);
 $ost_tresc = stripinput($data['ost_tresc']);
 $ost_regiony = stripinput($data['ost_regiony']);
 $ost_skutki = stripinput($data['ost_skutki']);
 $ost_procent = stripinput($data['ost_procent']);
 $ost_stopien = stripinput($data['ost_stopien']);
 $ost_visibility = stripinput($data['ost_visibility']);
 $ost_action = FUSION_SELF.$aidlink."&amp;action=edit&amp;ost_id=".$ost_id;
} else {
 $ost_name = "";
 $ost_kat = "";
 $ost_image = "";
 $ost_powiat = "";
 $ost_keywords = "";
 $ost_startdzien = "";
 $ost_startgodzina = "";
 $ost_enddzien = "";
 $ost_endgodzina = "";
 $ost_synoptyczna = "";
 $ost_tresc = "";
 $ost_regiony = "";
 $ost_skutki = "";
 $ost_procent = "";
 $ost_stopien = "";
 $ost_visibility = "";
 $ost_action = FUSION_SELF.$aidlink;
}

if (isset($_GET['rowstart']) && isnum($_GET['rowstart'])) {
 $rowstart = $_GET['rowstart'];
} else {
 $rowstart = 0;
}

require_once INCLUDES."bbcode_include.php";
echo '<h4></h4>';
 echo "<div class='spacer-sm'>\n";
 echo form_text('ost_name', 'Nazwa ostrzeżenia', (!empty($data['ost_name'])),
 [
 'required' => TRUE,
 'max_length' => 500,
 'error_text' => 'Podaj nazwę ostrzeżenia ',
 'class' => 'form-group-lg',
 'placeholder' => 'Data oraz nazwa ostrzeżenia',
 ]
 );
 echo "</div>\n";
 echo "<hr/>\n";
echo "<form role='form' enctype='multipart/form-data' name='inputform' method='post' action='".$ost_action."'>";
echo '<div class="row">';
echo '<div class="col-xs-12 col-sm-12 col-md-7 col-lg-8">';

openside();

echo '<h4>Prześlij mapkę</h4>';
$ost_image = array(
 'upload_path' => "../images/",
 'max_width' => 600,
 'max_height' => 600,
 'max_byte' => 1500000000,
 'type' => 'image',
 //'class' => 'm-b-0',
 'required' => 0,
 'delete_original' => 0,
 'thumbnail_folder' => '',
 'thumbnail' => 1,
 'thumbnail_suffix' => '_thumb',
 'thumbnail_w' => 400,
 'thumbnail_h' => 400,
 'error_text' => 'Please select an image',
 'inline' => 1,
 'thumbnail2' => 0
);
echo form_fileinput('ost_image', '', '', $ost_image); // all file types.
closeside();

openside();
echo '<h4>Zaznacz zagrożone powiaty</h4>';
echo form_select('ost_powiat', '', (!empty($data['ost_powiat'])),
 array(
 'tags' => TRUE,
 'multiple' => TRUE,
 'inline' => TRUE,
 'inner_width' => '100%',
 'options' => array(
 'Świnoujście KamieńPomorski Gryfice Kołobrzeg Koszalin Sławno Police Szczecin Goleniów Łobez Świdwin Białogard Gryfino Pyrzyce Stargard DrawskoPomorskie Szczecinek Myślibórz Choszczno Wałcz' => 'Świnoujście KamieńPomorski Gryfice Kołobrzeg Koszalin Sławno Police Szczecin Goleniów Łobez Świdwin Białogard Gryfino Pyrzyce Stargard DrawskoPomorskie Szczecinek Myślibórz Choszczno Wałcz',
 'Świnoujście' => 'Świnoujście',
 'KamieńPomorski' => 'KamieńPomorski',
 'Gryfice' => 'Gryfice',
 'Kołobrzeg' => 'Kołobrzeg',
 'Koszalin' => 'Koszalin',
 'Sławno' => 'Sławno',
 'Police' => 'Police',
 'Szczecin' => 'Szczecin',
 'Goleniów' => 'Goleniów',
 'Łobez' => 'Łobez',
 'Świdwin' => 'Świdwin',
 'Białogard' => 'Białogard',
 'Gryfino' => 'Gryfino',
 'Pyrzyce' => 'Pyrzyce',
 'Stargard' => 'Stargard',
 'DrawskoPomorskie' => 'DrawskoPomorskie',
 'Szczecinek' => 'Szczecinek',
 'Myślibórz' => 'Myślibórz',
 'Choszczno' => 'Choszczno',
 'Wałcz' => 'Wałcz'
 )
 )
);
closeside();


echo '<br>';

 add_to_head("<style>.panel-txtarea {border:0; padding-bottom:0;} .tab-content > .tab > .form-group { margin:0; }</style>");
 echo "<ul class='nav nav-tabs m-b-15 clearfix'>\n";
 echo "<li class='active'><a data-toggle='tab' href='#sytuacja'>Sytuacja Synoptyczna</a></li>";
 echo "<li><a data-toggle='tab' href='#ostrzezenie'>Treść ostrzeżenia</a></li>";
 echo "<li><a data-toggle='tab' href='#regiony'>Zagrożone regiony</a></li>";
 echo "<li><a data-toggle='tab' href='#skutki'>Skutki zagrożenia</a></li>";
 echo "</ul>\n";
 echo "<div class='tab-content p-0'>\n";
 echo "<div id='sytuacja' class='tab tab-pane fade in active p-0'>\n";
 echo form_textarea('ost_synoptyczna', 'Informacja Synoptyczna', (!empty($data['ost_synoptyczna'])), $snippetSettings);
 echo "</div>\n";
 echo "<div id='ostrzezenie' class='tab tab-pane fade p-0'>\n";
 echo form_textarea('ost_tresc', 'Treść ostrzeżenia', (!empty($data['ost_tresc'])), $snippetSettings);
 echo "</div>\n";
 echo "<div id='regiony' class='tab tab-pane fade p-0'>\n";
 echo form_textarea('ost_regiony', 'Zagrożone regiony', (!empty($data['ost_regiony'])), $snippetSettings);
 echo "</div>\n";
 echo "<div id='skutki' class='tab tab-pane fade p-0'>\n";
 echo form_textarea('ost_skutki', 'Możliwe skutki zagrożenia', (!empty($data['ost_skutki'])), $snippetSettings);
 echo "</div>\n";
 echo "</div>\n";

echo '</div>';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
echo '<div class="col-xs-12 col-sm-12 col-md-5 col-lg-4 form-horizontal">';
openside();
echo '<h4>Data i godzina rozpoczęcia</h4>';
echo '<div class="input-group">';
 echo '<label for="inputEmail3" class="col-sm-2 control-label">Dzień: </label>';
 echo '<div class="col-sm-10">';
 echo '<div class="input-group date form_date col-md-12" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">';
 echo "<input class='form-control' id='inputEmail3' type='text' name='ost_startdzien' value='".$ost_startdzien."'>";
 echo '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>';
 echo '</div>';
 echo '</div>';
echo '</div>';
echo '</br>';
echo '<div class="input-group">';
 echo '<label for="inputEmail3" class="col-sm-2 control-label">Godz: </label>';
 echo '<div class="col-sm-10">';
 echo '<div class="input-group date form_time col-md-12" data-date="" data-date-format="hh:ii" data-link-field="dtp_input3" data-link-format="hh:ii">';
 echo "<input class='form-control' type='text' name='ost_startgodzina' value='".$ost_startgodzina."'>";
 echo '<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>';
 echo '</div>';
 echo '</div>';
echo '</div>';

echo '<hr>';
echo '<h4>Data i godzina zakończenia</h4>';
echo '<div class="input-group">';
 echo '<label for="inputEmail3" class="col-sm-2 control-label">Dzień: </label>';
 echo '<div class="col-sm-10">';
 echo '<div class="input-group date form_date col-md-12" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">';
 echo "<input class='form-control' type='text' name='ost_enddzien' value='".$ost_enddzien."'>";
 echo '<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>';
 echo '</div>';
 echo '</div>';
echo '</div>';
echo '</br>';
echo '<div class="input-group">';
 echo '<label for="inputEmail3" class="col-sm-2 control-label">Godz: </label>';
 echo '<div class="col-sm-10">';
 echo '<div class="input-group date form_time col-md-12" data-date="" data-date-format="hh:ii" data-link-field="dtp_input3" data-link-format="hh:ii">';
 echo "<input class='form-control' type='text' name='ost_endgodzina' value='".$ost_endgodzina."'>";
 echo '<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>';
 echo '</div>';
 echo '</div>';
echo '</div>';
closeside();

openside();
echo '<h4>Dodaj tagi</h4>';
echo form_select('ost_keywords', 'Tagi', (!empty($data['ost_keywords'])),
 array(
 'tags' => TRUE,
 'multiple' => TRUE,
 'inline' => TRUE,
 'inner_width' => '100%',
 'options' => array(
 'Wyładowania' => 'Wyładowania',
 'Opady' => 'Opady',
 'Deszcz' => 'Deszcz',
 'Śnieg' => 'Śnieg',
 'Możliwa trąba' => 'Możliwa trąba',
 'Wiatr' => 'Wiatr',
 'Mróz' => 'Mróz',
 'Upał' => 'Upał',
 'Mgła' => 'Mgła',
 'Gołoledź' => 'Gołoledź',
 'Przymrozek' => 'Przymrozek'
 )
 )
);
closeside();

openside();

echo '<h4>Rodzaj, stopień oraz %</h4>';

echo form_select('ost_kat', 'Rodzaj', (!empty($data['ost_kat'])),
 array(
 'inline' => TRUE,
 'inner_width' => '100%',
 'options' => array(
 'Burza' => 'Burza',
 'Opady' => 'Opady',
 'Wiatr' => 'Wiatr',
 'Mróz' => 'Mróz',
 'Upał' => 'Upał',
 'Mgła' => 'Mgła',
 'Gołoledź' => 'Gołoledź',
 'Przymrozek' => 'Przymrozek'
 )
 )
);
echo form_select('ost_procent', '% pra.', (!empty($data['ost_procent'])),
 array(
 'inline' => TRUE,
 'inner_width' => '100%',
 'options' => array(
 10 => 10,
 20 => 20,
 30 => 30,
 40 => 40,
 50 => 50,
 60 => 60,
 70 => 70,
 80 => 80,
 90 => 90,
 100 => 100
 )
 )
);

echo form_select('ost_stopien', 'Stopień', (!empty($data['ost_stopien'])),
 [
 'inline' => TRUE,
 'inner_width' => '100%',
 'options' => [
 0 => 0,
 1 => 1,
 2 => 2,
 3 => 3
 ]
 ]
);
closeside();

openside();
 echo form_select('ost_visibility', 'Widoczne', (!empty($data['ost_visibility'])),
 [
 'options' => fusion_get_groups(),
 'inner_width' => '100%',
 'inline' => TRUE,
 ]
 );

closeside();
echo '</div>';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
echo '</div>';
echo '<br>';
echo "<div class='m-t-20'>\n";
 if (isset($_GET['action']) && $_GET['action'] == "edit")
 echo "<input type='hidden' name='update_datestamp' value='1' checked='checked' />\n";
 if(isset($_GET['action']) && $_GET['action'] == "edit"){
 echo '<button type="submit" class="btn btn-success" name="zapisz">Zapisz</button>';}
 else {
 echo '<button type="submit" class="btn btn-success" name="zapisz">Wyślij</button>';
 }
echo '</div>';
echo '</form>';

echo '</div>';

echo '<div role="tabpanel" class="tab-pane" id="arch">';
echo "<table class='table table-hover'>\n";
echo '<thead>
<tr>
<th>Nazwa</th>
<th>Rodzaj</th>
<th>Od</th>
<th>Do</th>
<th>Autor</th>
<th>Stopień</th>
<th>Akcja</th>
</tr>
</thead>';
echo '<tbody> ';
$result = dbquery(
 "SELECT d.*, u.user_id, u.user_name, u.user_status
 FROM ".DB_OSTRZEZENIA." d
 LEFT JOIN ".DB_USERS." u ON u.user_id=d.user
 ORDER BY ost_startdzien DESC LIMIT 20"
);
 $rows = dbcount("(ost_id)", DB_OSTRZEZENIA);
if ($rows) {
 while($data = dbarray($result)) {
echo '<tr>';
 echo "<td><a href='".INFUSIONS."ostrzezenia_infusion/ostrzezenie.php?ost_id=".$data['ost_id']."'>".$data['ost_name']."</td>\n";
 echo "<td>".$data['ost_kat']."</td>\n";
 echo "<td>".$data['ost_startdzien']."</td>\n";
 echo "<td>".$data['ost_enddzien']."</td>\n";
 echo "<td>".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</td>\n";
 echo "<td>".$data['ost_stopien']."</td>\n";
 echo "<td><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;ost_id=".$data['ost_id']."' title='Edytuj'><img src='".INFUSIONS."df_development_infusion/images/edit.png' alt='Edytuj' /></a>&nbsp;&nbsp;&nbsp;<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;ost_id=".$data['ost_id']."' title='Usuń'><img src='".INFUSIONS."df_development_infusion/images/delete.png' alt='Usuń' /></a></td>\n";
echo '</tr>';
 }
}
echo '</tbody> ';
echo "</table>\n";
 
echo '</div>';
echo '<br>';

echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</section>';

echo '<link href="../bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="../bootstrap/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="../bootstrap/js/locales/bootstrap-datetimepicker.pl.js" charset="UTF-8"></script>
';

?>



 <script>
 $('.chosen-select').chosen();
 </script>

<script type="text/javascript">
 $('.form_datetime').datetimepicker({
 //language: 'fr',
 weekStart: 1,
 todayBtn: 1,
 autoclose: 1,
 todayHighlight: 1,
 startView: 2,
 forceParse: 0,
 showMeridian: 1
 });
 $('.form_date').datetimepicker({
 language: 'pl',
 weekStart: 1,
 todayBtn: 1,
 autoclose: 1,
 todayHighlight: 1,
 startView: 2,
 minView: 2,
 forceParse: 0
 });
 $('.form_time').datetimepicker({
 language: 'pl',
 weekStart: 1,
 todayBtn: 1,
 autoclose: 1,
 todayHighlight: 1,
 startView: 1,
 minView: 0,
 maxView: 1,
 forceParse: 0
 });
</script>
<?php

?>
 

<?php
require_once THEMES."templates/footer.php";
?>


I get an error on line 119
if($_POST['ost_name'] != "") {

Nothing is saved to the database
0 replies

5 posts

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

It requires a larger debug, no time atm. But start using print_p($_POST) and see why the VARs are not taken, use isset(xxx(xx)); to void non submited errors.
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

I will only add that it worked on the previous version.

use isset(xxx(xx)); to void non submited errors ??
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Nothing have changed in POST / GET. Should not be affected. If you had 9.0 or an early version the token init was not strict. So that may explain it. But later versions have required Tokens to be initiated.

However.. your form does not initiate Tokens.
You need to use openform(); closeform(); or for custom token creation.

 // Token data
 $options['form_id'] = "12345678";
 $options['max_tokens'] = "1";
 $options['remote_url'] = fusion_get_settings('site_path').'infusions/myinfusion/post.php';
 $token = \Defender\Token::generate_token($options['form_id'], $options['max_tokens'], $options['remote_url']);

 // Begin Form
 echo "<form id='".$options['form_id']."' name='postform' method='POST' action='".$options['remote_url']."'>\n";
 echo "<input type='hidden' name='fusion_token' value='".$token."' />\n";
 echo "<input type='hidden' name='form_id' value='".$options['form_id']."' />\n";
 
 // Form content as usual, with or without dynamics.
 
 echo "</form>\n";
Edited by Falk on 21-02-2020 14:01,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

May I ask what is the nature of the problem?

You can trace first here:

$sql = "INSERT INTO ".DB_OSTRZEZENIA."(user, ost_name, ost_kat, ost_image, ost_powiat, ost_keywords, ost_startdzien, ost_startgodzina, ost_enddzien, ost_endgodzina, ost_synoptyczna, ost_tresc, ost_regiony, ost_skutki, ost_procent, ost_stopien, ost_visibility) VALUES('".$userdata['user_id']."', '".$ost_name."', '".$ost_kat."', '".$ost_image."', '".implode(' ',$_POST['ost_powiat'])."', '".$ost_keywords."', '".$ost_startdzien."', '".$ost_startgodzina."', '".$ost_enddzien."', '".$ost_endgodzina."', '".$ost_synoptyczna."', '".$ost_tresc."', '".$ost_regiony."', '".$ost_skutki."', '".$ost_procent."', '".$ost_stopien."', '".$ost_visibility."')";

print_p($sql); // see if the values are correct.

$result = dbquery($sql);
0 replies
D
djdandi
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions
answered
Senior Member

Many thanks here was a problem
'".implode(' ',$_POST['ost_powiat'])."'
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
D
D
  • Senior Member, joined since
  • Contributed 298 posts on the community forums.
  • Started 99 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet