Exemplo n.º 1
2
 public function ZoekTijd()
 {
     require_once "/Classes/databaseHandler.class.php";
     $Database = new Database();
     require_once "/Classes/calculatetime.php";
     $calculatetime = new calculatetime();
     $Database->query('SELECT fileName, name FROM wedstrijden WHERE name=?');
     $Database->bind(1, $_GET['wedstrijd']);
     $resultSet = $Database->single();
     if (isset($_GET['startnummer']) || isset($_GET['naam'])) {
         include 'Classes/PHPExcel/IOFactory.php';
         $inputFileName = 'excel/' . $resultSet['fileName'];
         try {
             $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
             $objReader = PHPExcel_IOFactory::createReader($inputFileType);
             $objPHPExcel = $objReader->load($inputFileName);
         } catch (Exception $e) {
             die('Er is een fout opgetreden met bestand  "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage());
         }
         $sheet = $objPHPExcel->getSheet(0);
         $highestRow = $sheet->getHighestRow();
         $highestColumn = $sheet->getHighestColumn();
         for ($row = 1; $row <= $highestRow; $row++) {
             $rowData[] = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE)[0];
         }
         if (isset($_GET['startnummer']) && $_GET['startnummer'] == !null) {
             $Startnummer = $_GET['startnummer'];
             $key = array_search($Startnummer, array_column($rowData, 0));
         }
         if (isset($_GET['naam']) && $_GET['naam'] == !null) {
             $Naam = $_GET['naam'];
             $key = array_search($Naam, array_column($rowData, 1));
         }
         $this->Startnummer = $rowData[$key][0];
         $this->Naam = $rowData[$key][1];
         $this->Woonplaats = $rowData[$key][2];
         $this->Geboortedatum = $rowData[$key][3];
         $this->Geslacht = $rowData[$key][4];
         $this->Wedstrijdnaam = $resultSet['name'];
         $cell = $sheet->getCellByColumnAndRow(5, $key + 1);
         $cell_value = PHPExcel_Style_NumberFormat::toFormattedString($cell->getCalculatedValue(), 'hh:mm:ss');
         $this->VideoTijd = $calculatetime->GetPlayerTime($cell_value);
         $_GET['startnummer'] = $this->Startnummer;
     }
 }
Exemplo n.º 2
0
 public function ZoekTijd()
 {
     require_once "/Classes/databaseHandler.class.php";
     $Database = new Database();
     require_once "/Classes/calculatetime.php";
     $calculatetime = new calculatetime();
     $Database->query('SELECT wedstrijdID, name FROM wedstrijden WHERE wedstrijdID=?');
     $Database->bind(1, $_GET['eventid']);
     $wedstrijden = $Database->single();
     $Database->query('SELECT camName, videoID  FROM cams WHERE fk_wedstrijdID=?');
     $Database->bind(1, $_GET['eventid']);
     $cams = $Database->single();
     $Database->query('SELECT * FROM tijden WHERE fk_wedstrijdID=? AND Startnummer=?');
     $Database->bind(1, $_GET['eventid']);
     $Database->bind(2, $_GET['startnummer']);
     $tijd = $Database->single();
     if (isset($_GET['video'])) {
         $Database->query('SELECT camName, videoID, tijdName  FROM cams WHERE camID=?');
         $Database->bind(1, $_GET['video']);
         $cams = $Database->single();
         $Database->query('SELECT * FROM tijden WHERE fk_wedstrijdID=? AND Startnummer=?');
         $Database->bind(1, $_GET['eventid']);
         $Database->bind(2, $_GET['startnummer']);
         $tijd = $Database->single();
         if (empty($tijd)) {
             header("Location: ?error&code=1");
             die;
         }
         $this->Startnummer = $tijd['Startnummer'];
         $this->Naam = $tijd['Naam'];
         $this->Woonplaats = $tijd['Woonplaats'];
         $this->Geboortedatum = $tijd['Geboortedatum'];
         $this->Geslacht = $tijd['Geslacht'];
         $this->Wedstrijdnaam = $wedstrijden['name'];
         $this->VideoID = $cams['videoID'];
         $this->CamName = $cams['camName'];
         $this->VideoTijd = $calculatetime->GetPlayerTime($tijd[$cams['tijdName']]);
         $this->RenderPage();
     } else {
         if (empty($tijd)) {
             header("Location: ?error&code=1");
             die;
         }
         $this->Startnummer = $tijd['Startnummer'];
         $this->Naam = $tijd['Naam'];
         $this->Woonplaats = $tijd['Woonplaats'];
         $this->Geboortedatum = $tijd['Geboortedatum'];
         $this->Geslacht = $tijd['Geslacht'];
         $this->Wedstrijdnaam = $wedstrijden['name'];
         $this->VideoID = $cams['videoID'];
         $this->CamName = $cams['camName'];
         $this->VideoTijd = $calculatetime->GetPlayerTime($tijd['Finish']);
         $this->RenderPage();
     }
     //7-11-2015 wijzigen van Excel naar database.
 }
Exemplo n.º 3
0
 public function renderSearch()
 {
     require_once "/Classes/databaseHandler.class.php";
     $Database = new Database();
     $Database->query('SELECT fileName, name, date  FROM wedstrijden');
     $resultSet = $Database->single();
     print '
     </div >
         <div id = "clickTable" class="container" >
         <table id = "myTable" class="table" >
          <thead>
         <tr>
         <th> Startnr <i class="fa fa-sort" ></i></th>
         <th> Wedstrijd <i class="fa fa-sort" ></i></th>
         <th> Naam <i class="fa fa-sort" ></i></th>
         <th> Woonplaats <i class="fa fa-sort" ></i></th>
         <th> Geboortedatum <i class="fa fa-sort" ></i></th>
         <th> Geslacht</th >
         <th> Netto tijd <i class="fa fa-sort" ></i></th>
         <th> Onderdeel <i class="fa fa-sort" ></i> </th>
         <th> Beeld</th>
         </tr></thead ><tbody> ';
     $Database->query('SELECT * FROM tijden WHERE Naam LIKE ?');
     if (!isset($_GET['show'])) {
         $Database->bind(1, "%" . $_POST['naam'] . "%");
         $result = $Database->resultset();
         if (empty($result)) {
             echo "Deelnemer niet gevonden.";
         }
         foreach ($result as $data) {
             $Database->query('SELECT fileName, name, date  FROM wedstrijden WHERE wedstrijdID=?');
             $Database->bind(1, $data['fk_wedstrijdID']);
             $resultSet = $Database->single();
             print ' <tr><td> ' . $data['Startnummer'] . ' </td> ';
             print '<td> ' . $resultSet['name'] . ' </td> ';
             print '<td> ' . $data['Naam'] . ' </td> ';
             print '<td> ' . $data['Woonplaats'] . ' </td> ';
             print '<td> ' . $data['Geboortedatum'] . ' </td> ';
             echo "<td>";
             if ($data['Geslacht'] == "V") {
                 echo ' <i class="fa fa-female" ></i> ';
             } else {
                 echo '<i class="fa fa-male" ></i> ';
             }
             echo "</td>";
             print '<td> ' . $data['NettoTijd'] . ' </td> ';
             print '<td> ' . $data['Onderdeel'] . ' </td> ';
             print "<td><a class='fa fa-line-chart' href='?statistieken&startnummer=" . $data['Startnummer'] . "&eventid=" . $data['fk_wedstrijdID'] . "'></a>";
             print " <a class='fa fa-video-camera' href='?newplayer&wedstrijd=" . $resultSet['name'] . "&naam=& startnummer=" . $data['Startnummer'] . "'></a>";
             print " <a class='fa fa-camera' </a> ";
             print " <a class='fa fa-certificate' target='_blank' href='https://uitslagensoftware.nl/certificaat_3.php?event_id=2015083000294&S= " . $data['Startnummer'] . "'></a></td></tr>";
         }
     }
 }
Exemplo n.º 4
0
 /**
  * User Login
  *
  * @param $username
  * @param $password
  * @return bool
  */
 public function login($username, $password)
 {
     $this->db->query("SELECT * FROM users\n\t\t\t\tWHERE username = :username\n\t\t\t\tAND password = :password");
     //Bind Values
     $this->db->bind(':username', $username);
     $this->db->bind(':password', $password);
     $row = $this->db->single();
     //Check Rows
     if ($this->db->rowCount() > 0) {
         $this->setUserData($row);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 5
0
 public function fetchAllBySeccionId($seccionId)
 {
     $dbh = new Database();
     $data = $dbh->query('SELECT * FROM subsecciones WHERE seccion_id =' . $seccionId);
     $data = $dbh->single();
     return $data;
 }
Exemplo n.º 6
0
 public function CountPhotoOfPlaceProcess($param)
 {
     parent::query('SELECT COUNT(im_id) total FROM dy_image WHERE (im_place_id = :place_id) AND (im_type = "normal")');
     parent::bind(':place_id', $param['place_id']);
     parent::execute();
     return parent::single();
 }
Exemplo n.º 7
0
 public function SearchLogCountProcess()
 {
     parent::query('SELECT COUNT(lo_id) FROM log_search');
     parent::execute();
     $data = parent::single();
     return $data['COUNT(lo_id)'];
 }
Exemplo n.º 8
0
 public function fetchOneById($tiendaId)
 {
     $dbh = new Database();
     $data = $dbh->query('SELECT * FROM tiendas WHERE tienda_id =' . $tiendaId);
     $data = $dbh->single();
     return $data;
 }
Exemplo n.º 9
0
 public function GetCityProcess($param)
 {
     parent::query('SELECT * FROM dy_location_city WHERE (cy_id = :city_id)');
     parent::bind(':city_id', $param['city_id']);
     parent::execute();
     return parent::single();
 }
Exemplo n.º 10
0
    public function RenderPage()
    {
        require_once "/Classes/databaseHandler.class.php";
        $Database = new Database();
        print '
        <title>Run2Day - Bannerbeheer</title>
        <h1>Bannerbeheer</h1>
        <table class="table">
                            <tr>
                                <th>Toegevoegd aan</th>
                                <th>Bestandsnaam</th>
                                <th>Banner tekst</th>
                                <th>Verwijderen</th>
                            </tr> ';
        $Database->query('SELECT ID, fileName, fk_wedstrijdID, text  FROM afbeeldingen');
        $result = $Database->resultset();
        foreach ($result as $key) {
            $Database->query('SELECT name  FROM wedstrijden WHERE wedstrijdID=?');
            $Database->bind(1, $key['fk_wedstrijdID']);
            $wedstrijd = $Database->single();
            print '<tr><td>' . $wedstrijd['name'] . ' </td>';
            print '<td>' . $key['fileName'] . ' </td>';
            print '<td>' . $key['text'] . ' </td>';
            print ' <td><a class="fa fa-trash-o"  href="?dashboard&deletebanner=' . $key['ID'] . '"</td></tr>';
        }
        print '
            </table>


   <div class="col-md-4">
   <h3>Banner afbeelding toevoegen</h3>
   <form action="../Classes/submitWedstrijd.php" method="POST"  enctype="multipart/form-data">

      <label for="usr">Banner toevoegen aan:</label>
      <select class="form-control" name="wedstrijd" id="wedstrijd">';
        $Database->query('SELECT name, wedstrijdID FROM wedstrijden');
        $result = $Database->resultset();
        foreach ($result as $key) {
            print '  <option> ' . $key['name'] . '</option>';
        }
        print '
</select>

    <div class="form-group">
      <label for="usr">Banner tekst:</label>
      <input type="text" class="form-control" id="name" name="name" required>
    </div>

      <div class="form-group">
      <label for="usr">Afbeelding:</label>
        <input type="file" name="file" id="file">
            </div>
           <input type="submit" value="Opslaan">
    <br><br>
  </form>
   </div>
</div>
</div> ';
    }
Exemplo n.º 11
0
 public function CommentAlreadyCheckingProcess($param)
 {
     parent::query('SELECT ac_id FROM dy_activity WHERE (ac_member_id = :member_id) AND (ac_action = "new_comment") AND (ac_to_post_id = :post_id)');
     parent::bind(':member_id', $param['member_id']);
     parent::bind(':post_id', $param['post_id']);
     parent::execute();
     return parent::single();
 }
Exemplo n.º 12
0
 public function getItem($id = 0)
 {
     $db = new Database();
     $db->query("SELECT * FROM menuitem WHERE Id=:id");
     $db->bind(":id", $id);
     $db->execute();
     return $db->single();
 }
Exemplo n.º 13
0
 /**
  * Get Category By ID
  *
  * @param int $id
  * @return mixed
  */
 public function getCategory($id)
 {
     $this->db->query("SELECT * FROM categories\n\t\t\tWHERE id = :id");
     $this->db->bind(':id', $id);
     //Assign Row
     $row = $this->db->single();
     return $row;
 }
Exemplo n.º 14
0
 /**
  * Check that any of the users' groups has the permission bit
  *
  * @param string $action
  * @param int|null $context_id
  * @param int|null $user_id
  * @param bool $ignore_superuser
  * @return bool
  */
 public function checkUsersGroups(string $action = '', int $context_id = null, int $user_id = null, bool $ignore_superuser = false) : bool
 {
     if (!$ignore_superuser) {
         if ($this->isSuperUser($user_id)) {
             return true;
         }
     }
     return 0 < $this->db->single(\Airship\queryStringRoot('security.permissions.check_users_groups', $this->db->getDriver()), ['action' => $action, 'context' => $context_id, 'user' => $user_id]);
 }
Exemplo n.º 15
0
    public function GetCategoryProcess($param)
    {
        parent::query('SELECT ca_id,ca_title,ca_root,ca_parent_first,ca_parent_second,ca_create_time,ca_update_time,ca_type,ca_status,(SELECT COUNT(pl_id) FROM dy_place WHERE pl_category_id = ca_id) total_place 
			FROM dy_category 
			WHERE ca_id = :category_id');
        parent::bind(':category_id', $param['category_id']);
        parent::execute();
        return parent::single();
    }
Exemplo n.º 16
0
 public function mainP()
 {
     $sen = 0;
     $db = new Database();
     foreach ($this->sentences as $sentence) {
         $highest = 0;
         $words = array();
         $words = explode(" ", $sentence);
         foreach ($words as $word) {
             if (!in_array(strtolower($word), $this->stopwords)) {
                 //Fetching the meaning definition of the senses From the WordNet
                 $db->query("SELECT * from words where lemma like :word");
                 $db->bind("word", $word);
                 $wordid = $db->single()->wordid;
                 $db->query("SELECT * from senses where wordid like :wordid");
                 $db->bind("wordid", $wordid);
                 $resulta2 = $db->resultset();
                 foreach ($resulta2 as $row) {
                     $synsetid = $row->synsetid;
                     $sample2[] = $synsetid;
                     $title = $row->wordid . " " . $row->senseid;
                 }
                 $db->query("select * from synsets where synsetid like :sample");
                 $db->bind("sample", $sample2[0]);
                 $resulta3 = $db->resultset();
                 unset($sample2[0]);
                 for ($i = 0; $i < count($sample2) + 1; $i++) {
                     ${result_A . $i} = $sample2[$i];
                     ${lexdomains_var . $i} = $lexdomains[$i];
                     $db->query("select * from synsets where synsetid like :sample");
                     $db->bind("sample", ${result_A . $i});
                     ${result . $i} = $db->resultset();
                     foreach (${result . $i} as $row) {
                         ${pos . $i} = $row->pos;
                         if (${pos . $i} == "s") {
                             ${pos . $i} = "satellite adj";
                         }
                         $def = $row->definition;
                         $def = preg_replace('/[^a-zA-Z0-9_ -]/s', '', $def);
                         $definition = array();
                         $definition = explode(" ", $def);
                         $frequency = $this->frequency($definition);
                         if ($frequency > $highest) {
                             $highest = $frequency;
                         }
                     }
                 }
                 $sample2 = array();
             }
         }
         $this->frequencies[] = $highest;
         $this->sentence_count[] = $sen;
         $sen++;
     }
 }
Exemplo n.º 17
0
    public function GetCommentProcess($param)
    {
        parent::query('SELECT cm_id comment_id,cm_parent_id comment_parent,cm_token comment_token,tk_device comment_poster_device,tk_model comment_poster_model,me_id comment_poster_id,me_name comment_poster_name,cm_post_id comment_post_id,cm_message comment_message,cm_create_time comment_create_time,cm_update_time comment_update_time,cm_ip comment_ip,cm_type comment_type,cm_status comment_status 
			FROM dy_comment,dy_member,dy_token 
			WHERE (cm_id = :comment_id AND cm_member_id = me_id AND cm_status = "active" AND cm_token = tk_token)');
        parent::bind(':comment_id', $param['comment_id']);
        parent::execute();
        $data = parent::single();
        $data['comment_create_time_facebook_format'] = parent::date_facebookformat($data['comment_create_time']);
        $data['comment_update_time_facebook_format'] = parent::date_facebookformat($data['comment_update_time']);
        return $data;
    }
Exemplo n.º 18
0
 public function __construct($patNum)
 {
     //check if patient table already exists
     $database = new Database();
     $database->query('SELECT TableNum, Discharged FROM patients WHERE HosNum = :num');
     $database->bind(':num', $patNum);
     $row = $database->single();
     if ($row) {
     } else {
         add();
     }
 }
Exemplo n.º 19
0
 public function CheckingBankTransferProcess($param)
 {
     parent::query('SELECT mf_id FROM dd_money_transfer WHERE mf_to_bank = :bank_id');
     parent::bind(':bank_id', $param['bank_id']);
     parent::execute();
     $dataset = parent::single();
     if (empty($dataset['mf_id'])) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 20
0
 public function UpdateReadProcess($param)
 {
     parent::query('SELECT pd_read FROM dd_product WHERE pd_id = :product_id');
     parent::bind(':product_id', $param['product_id']);
     parent::execute();
     $data = parent::single();
     $read = $data['pd_read'] + 1;
     parent::query('UPDATE dd_product SET pd_read = :read,pd_visit_time = :visit_time WHERE pd_id = :product_id');
     parent::bind(':product_id', $param['product_id']);
     parent::bind(':read', $read);
     parent::bind(':visit_time', date('Y-m-d H:i:s'));
     parent::execute();
 }
Exemplo n.º 21
0
    public function CountNotificationProcess($param)
    {
        parent::query('SELECT COUNT(ac_id) 
			FROM dy_activity 
			LEFT JOIN dy_post ON ac_to_post_id = po_id 
			LEFT JOIN dy_member ON ac_member_id = me_id 
			LEFT JOIN dy_comment ON ac_to_comment_id = cm_id 
			WHERE (ac_action = "new_comment" OR ac_action = "thanks_post") AND (po_member_id = :member_id) AND (ac_member_id != :member_id) AND (ac_status = "unread")');
        parent::bind(':member_id', $param['member_id']);
        parent::execute();
        $data = parent::single();
        return $data['COUNT(ac_id)'];
    }
Exemplo n.º 22
0
 public function AlreadyMatingProcess($param)
 {
     parent::query('SELECT pt_id FROM dy_place_to_tag WHERE (pt_place_id = :place_id AND pt_tag_id = :tag_id)');
     parent::bind(':place_id', $param['place_id']);
     parent::bind(':tag_id', $param['tag_id']);
     parent::execute();
     $data = parent::single();
     if (empty($data['pt_id'])) {
         return true;
     } else {
         return false;
     }
     // Matching already
 }
Exemplo n.º 23
0
function isLoggedIn()
{
    if (!empty($_SESSION['user_id'])) {
        $db = new Database();
        $db->query("SELECT username,about FROM users WHERE id=:u_id");
        $db->bind("u_id", $_SESSION['user_id']);
        $result = $db->single();
        $_SESSION['username'] = $result->username;
        $_SESSION['details'] = $result->about;
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 24
0
 public function getDetailsByUsername($username)
 {
     $database = new Database();
     $database->query("SELECT * FROM engineers WHERE sAMAccountName = :username");
     $database->bind(":username", $username);
     $row = $database->single();
     // if no results return empty object
     if ($database->rowCount() == 0) {
         return null;
     }
     // else populate opbject with db results
     $userObject = new stdClass();
     $userObject->sAMAccountName = $row['sAMAccountName'];
     $userObject->engineerLevel = $row['engineerLevel'];
     $userObject->idengineers = $row['idengineers'];
     $userObject->superuser = $row['superuser'];
     $userObject->helpdesk = $row['helpdesk'];
     $userObject->localHash = $row['localLoginHash'];
     return $userObject;
 }
Exemplo n.º 25
0
 public function GetPlayerTime($cell_value)
 {
     require_once "databaseHandler.class.php";
     $Database = new Database();
     $Database->query('SELECT videoOffset, first_runner  FROM cams WHERE fk_wedstrijdID=?');
     $Database->bind(1, $_GET['eventid']);
     $result = $Database->single();
     $result['first_runner'] . '<br>';
     $cell_value . '<br>';
     $Offset = $this->ConvertToSeconds($result['videoOffset']);
     //00:00
     $FirstRunner = $this->ConvertToSeconds($result['first_runner']) . '<br>';
     //00:00
     $LoopTijd = $this->ConvertToSeconds($cell_value) . '<br>';
     //00:00
     $tijd = $LoopTijd - $FirstRunner + $Offset;
     //secs
     $tijd . '<br>';
     $this->ConvertTimeToVimeo($tijd) . "<br>";
     return $this->ConvertTimeToVimeo($tijd);
 }
Exemplo n.º 26
0
    public function renderHome()
    {
        require_once "/Classes/databaseHandler.class.php";
        $Database = new Database();
        $Database->query('SELECT video, foto, cert, stats FROM wedstrijden WHERE wedstrijdID=?');
        $Database->bind(1, $_GET['event']);
        $media = $Database->single();
        $url = parse_url($media['foto']);
        $setid = str_replace('setId=', '', $url['query']);
        print '`
        <div class="container">
        <h1>Finishfoto</h1>

<form id="login" target="frame" method="post" action="http://www.ox2data.eu/rpg/processPhotoReq.php">
    <input type="hidden" name="currentSetId" value="' . $setid . '" />
    <input type="hidden" name="currentPhoto" value="1" />
    <input type="hidden" name="startNummer" value="' . $_GET['startnummer'] . '" />
</form>


        <iframe id="frame" name="frame" width="700" height="800" src="' . $media['foto'] . '"></iframe>

        </div>

<script type="text/javascript">
    // submit the form into iframe for login into remote site
    document.getElementById("login").submit();

    // once youre logged in, change the source url (if needed)
    var iframe = document.getElementById("frame");
    iframe.onload = function() {
        if (iframe.src != "' . $media['foto'] . '") {
            iframe.src = "' . $media['foto'] . '";
        }
    }
</script>
        ';
    }
Exemplo n.º 27
0
if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || !strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    header("Location: ../index.php?error=" . urlencode("Direct access not allowed."));
    die;
}
$id = $_GET['id'];
include 'config.php';
// Include database class
include 'database.class.php';
// Instantiate database.
$database = new Database();
// Instantiate database.
$database = new Database();
$database->query('SELECT `name` FROM items WHERE `index` = :id');
$database->bind(':id', $_GET['id']);
$item = $database->single();
?>
<div class="modal-dialog modal-lg">
 	<div class="modal-content">
		<div class="modal-body">
			<div style="padding:10px">
				<h4 style="text-align:center"><?php 
echo $item['name'];
?>
</h4>
				<table id="list" class="table table-bordered table-striped table-condensed" style="cursor:pointer">
					<thead>
						<tr>
							<th>Player</th>
							<th>Auth</th>
							<th>Quality</th>
Exemplo n.º 28
0
<?php

require_once 'templates/top.php';
include 'class/database.class.php';
?>



<?php 
$cats_id = $_GET['id'];
$database = new Database();
$database->query("SELECT * FROM cats WHERE id = '{$cats_id}'");
$one_cat = $database->single();
if ($one_cat['files'] != '') {
    $pic = "<img src = '/media/uploaded/" . $one_cat['usersid'] . "/" . $one_cat['files'] . "' class='pic'/>";
} else {
    $pic = "<img src = '/media/uploaded/no_photo.png' class = 'pic'/>";
}
?>
				
				<table class = 'table table-bordered'>
				 <tr>
				     <th>
					    Фото
						</th>
						<th>Имя кота</th>
						<th>Масть кота</th>
						<th>Характер кота</th>
						<th>Личные особенности</th>
						</tr>
										 
Exemplo n.º 29
0
            $result = $database->execute();
            if ($result) {
                ?>
		<script>
			document.location.href='cobinet.php';
		</script>
		<?php 
            }
        } else {
            print_r($err);
        }
    }
    $database = new Database();
    $query = "SELECT*FROM statias WHERE id = " . $_GET['id'] . "";
    $database->query($query);
    $result = $database->single();
    ?>
	
	<div class="textt"><h2>Форма редактирования новости</h2>
<form method="post" enctype='multipart/form-data'>
<div class="form-group1">
    <label for="exampleInputTitle1">Название новости</label>
    <input type="name_categoria" class="form-control" id="exampleInputTitle1" name="name_categoria" placeholder="name_categoria" value="<?php 
    echo $result['name_categoria'];
    ?>
"/>
  </div><br/>
    <div class="form-group1">
    <label for="exampleInputTextarea1">Текст новости</label>
   <textarea  class="ckeditor" name="editor1" placeholder="text"><?php 
    echo $result['editor1'];
Exemplo n.º 30
0
<?php

require_once 'templates/top.php';
require_once 'class/database.class.php';
?>


<?php 
$database = new Database();
if ($_GET['id']) {
    $id = $_GET['id'];
    $query = "SELECT * FROM cats WHERE id = '{$id}'";
    $database->query($query);
    $val = $database->single();
    // if(file_exists('media/uploaded/'.$val['id'])
    // {
    // @unlink('media/uploaded/'.$val['id']);
    // }
    $query = "DELETE FROM cats WHERE id = '{$id}'";
    $database->query($query);
    $database->execute();
    print_r($query);
    header('location:cabinet.php');
}