Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok dito

Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

First explain ko muna mga table ko sa mysql:

table: stock_inventory
fields: stock_id (primary key), inventory_id (FK from supplies table), date_received, date_expired, type, price, stock_received, stock_left, no_days

table: supplies
fields: inventory_id (primary key), supply_name, description

table: dispense_supply
fields: dd_id (primary key), batch_id (FK from stock_inventory as stock_id), inventory_id (FK from supplies), quantity, price, date)

First task:
Paano ko po i-display sa datagridview pagnag-search ako sa textbox ng supplies either stock id or name ng supply sa stock_inventory at supplies na tables, need ko idisplay ang stock_id, inventory_id, supply_name, description, stock_left. (mysql query po)

2nd task: mag-dispense ng supply
bali babawasan ko yung stock left ng na-search ko na supply, may textbox ako kung saan kukunin ang quantity ng i-dispense. so bale ma-uupdate ang stock_inventory na table, yung stock_left nya.... and at the same time mag-iinsert ako ng new record sa table na dispense_supply ng binawas ko na supply sa stock_inventory na table. (process at mysql query)

kung ayaw mo nag rereload pag kasabmit mo gamit ka javascript ajax tpos sabay mo narin dun ung load function ng jquery.
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

kung ayaw mo nag rereload pag kasabmit mo gamit ka javascript ajax tpos sabay mo narin dun ung load function ng jquery.

Sir okay na po thanks!
 

Attachments

  • prntscrn.jpg
    prntscrn.jpg
    244.2 KB · Views: 29
Last edited:
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

<!DOCTYPE html>
<html>
<head>
<title>try</title>
</head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<link rel="stylesheet" href="css/table1css.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
<body>
<div class="wholebody">
<img src="img/loginbg.jpg">


<div class="table-wrapper">
<?php
include('include.php');
?>
<?php
$result = mysqli_query($con,"SELECT * from accounts");
if (!$con) {
die('Could Not Connect:' .mysqli_error());
}
?>

<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Bill</th>
<th>Penalty</th>
<th>Date to pay</th>
<th>Due Date</th>
<th>Total (Bill and Penalty)</th>
</tr>
<?php
while($row = mysqli_fetch_array($result)){?>
<tr>
<td><?php echo "$row[id]"; ?></td>

<td><?php echo "$row[name]"; ?></td>

<td><?php echo "$row[bill]"; ?></td>
<td><?php echo "$row[penalty]"; ?></td>

<td><?php echo "$row[date]"; ?></td>
<td><?php echo "$row[duedate]"; ?></td>
<td>
<?php
$a= $row['bill'] + $row['penalty'];
echo "$a";

?>
</td>

<form method="post" action="addbill.php" enctype="multipart/form-data">
<td><input type="submit" name="" value="Bill" class="bill"></td>
<input type="hidden" name="hidden" value="<?php echo "$row[id]";?>">
</form>
<form method="post" action="addpenalty.php" enctype="multipart/form-data">
<td><input type="submit" name="" value="Penalty" class="penalty"></td>
<input type="hidden" name="hidden" value="<?php echo "$row[id]";?>">

</form>
<td>
<form method="post" action="addduedate.php" enctype="multipart/form-data">
<input type="hidden" name="hidden" value="<?php echo "$row[id]";?>">
<input type="text" name="datepicker" class="dt">
<input type="submit" name="" value="Save" class="save">
</form>
</td>
</tr>

<?php } ?>
</table>


<form action="adminlogout.php" method="post">
<br><br>
<center><input type="submit" class="button" name="submit" value="Logout"></center>


</form>
</div>
</div>

</body>
</html>



//paano po kaya magagamit yung datepicker sa lahat ng instances sa loop? sa unang datepicker lang kasi siya gumagana sa sumusunod na iteration di na siya lumalabas
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

master may tanong po ako about sa importing ng csv file nagawa ko na po yung pag nagimport po ako bibilangin niya kung ilang records yung nainsert niya for example lalabas sa pop up message ko "4 records successfully inserted" tas pag may kaparehas naman lalabas na pop up message "duplicate 4 records" master pano po yun kunware may 8 na records ako then yung 4 bago tas yung 4 may kaparehas na dapat ang lalabas na pop up message is "4 records successfullt inserted and 4 records duplicated" pano gagawin yun ? pahelp po
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Hello po. I am searching to have a free .com domai. ano po bang maiofer niyo? Thanks
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

walang free na .com, lahat yan commercialized, so definitely may fee. Subukan mo .tk nagbibigay pa sila ng free.
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Meron po ba free na api gaya nung REST API. Need po kasi namin gumawa nang website gaya nito
Code:
https://www.onlineocr.net/
na kayang mag OCR sa scanned pdf. TIA!
 
Last edited:
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

error 550 when trying to access the site.

PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/nexuspet/public_html/classes/Database.php on line 134

code below: line 134 highlighed in red font

<?php

class Database{

// Variables

var $connection;
var $db;
var $result;
var $sql;

//*** Constructor: pass connection values, set the db settings and connect **********************


function Connect($server , $user , $password, $db) {

$settings['server'] = $server;
$settings['user'] = $user;
$settings['pass'] = $password;
$settings['db'] = $db;

$this->connection = mysql_connect($settings['server'],$settings['user'],$settings['pass'])

or die("Couldn't connect to the server. Please check your settings.");

$this->db = mysql_select_db($settings['db'],$this->connection)

or die("Couldn't select database. Please make sure it exists.");

}


//*** Function SQL_Select($field , $table , $arg , $order): create mysql select ********************

function SQL_Select($field , $table , $arg , $order=null, $limit=null){

$sql_select = "SELECT ";

if($field){ $sql_select .= $field; } else { $sql_select .= "*"; }

$sql_select .= " FROM $table ";

if($arg){ $sql_select .= $arg; }

if($order){ $sql_select .= " ORDER BY $order"; }

if($limit){ $sql_select .= " LIMIT $limit"; }


$this->Query($sql_select);

}


//*** Function SQL_Select($array): create mysql insert *********************************************


function SQL_Insert( $array , $table ){


$i = 0;

$fields = "";

$values = "";


$arrayCount = count($array);

$arrayCount2 = $arrayCount - 1;


while($i < $arrayCount){

$fields .= $array[$i]["field"];

if($arrayCount > 1 && $i != $arrayCount2) { $fields .= " , "; }

if($array[$i]["value"] == "now()"){

$values .= $array[$i]["value"];

} else {

$values .= "'" . $array[$i]["value"] . "'";

}

if($arrayCount > 1 && $i != $arrayCount2) { $values .= " , "; }


$i++;

}

$sql_insert = "INSERT INTO $table ( $fields ) VALUES ( $values )";

$this->Query($sql_insert);

}


//*** Function SQL_Update(): create mysql update ***************************************************


function SQL_Update( $array , $table , $id , $field ){

$i = 0;

$fields = "";

$values = "";

$arrayCount = count($array);

$arrayCount2 = $arrayCount - 1;

while($i < $arrayCount){

$arg .= $array[$i]["field"] . "= '" . $array[$i]["value"] . "'";

if($arrayCount > 1 && $i != $arrayCount2) { $arg .= " , "; }

$i++;

}

$sql_update = "UPDATE $table SET $arg WHERE $field='$id' LIMIT 1";

$this->Query($sql_update);
}


//*** Function SQL_Delete(): create mysql delete ***************************************************

function SQL_Delete( $id , $table ){

$sql_delete = "DELETE FROM $table WHERE id = '$id' LIMIT 1";
$this->Query($sql_delete);

}


//*** Function Query(): accept the query then run it ***********************************************

function Query( $query ){

//echo $query;
$this->result = mysql_query($query);
return $this->result;
}


//*** Function FetchArrayList(): place the query results into an array ****************************

function FetchArrayList() {

$data = '';
$i = 0;
for ( $i=0; $i < $this->GetRows(); $i++ ) {
$data[$i] = $this->FetchArray();

}

return $data;

}

//*** Function FetchArray(): place the query results into an array *********************************

function FetchArray(){

$array = mysql_fetch_array($this->result);

return $array;
}


//*** Function GetRows(): get the number of result rows from the query ******************************

function GetRows(){

$rows = mysql_num_rows($this->result);
return $rows;
}

function GetAffectedRows(){

$rows = mysql_affected_rows();
return $rows;

}


//*** Function GetLastInsertedID(): get the last inserted ID ******************************

function GetLastInsertedID(){

$last_id = mysql_insert_id( $this->connection );
return $last_id;
}


//*** Function CloseConnection(): close MySQL connection *********************************************

function CloseConnection(){

mysql_close($this->connection);

}


}// ********************************************************************************** End of Class


?>


PHP Warning: Cannot modify header information - headers already sent by (output started at /home/nexuspet/public_html/classes/Database.php:134) in /home/nexuspet/public_html/news-articles.php on line 24

<?php

require_once ('config.php');

require_once (client_root . 'classes/Database.php');

require_once (client_root . 'classes/Utilities.php');


$database = new Database();

$database->Connect(SERVER, USER, PASSWORD, DB);


$utilities = new Utilities();


if(!empty($_GET['id']))

{

$id = $_GET['id'];

$database->Query("SELECT *,DATE_FORMAT(date_published, '%m.%d.%Y') as date FROM tbl_articles WHERE id='$id'");

$article=$database->FetchArray();



if($article)

{

$article=(object)$article;

}

else

{

$return_url = http_dir . 'index.php';

header('Location: '.$return_url);

}

}

else

{

$return_url = http_dir . 'index.php';

header('Location: '.$return_url);

}

$page_title = site_name . ' - News And Articles';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

<title><?php echo $page_title; ?></title>

<!-- add your meta tags here -->



<link href="css/my_layout.css" rel="stylesheet" type="text/css" />

<!--[if lte IE 7]>

<link href="css/patches/patch_my_layout.css" rel="stylesheet" type="text/css" />

<script defer type="text/javascript" src="js/pngfix.js"></script>

<![endif]-->

<script type="text/javascript" src="js/swfobject.js"></script>

</head>

<body>

<div class="page">

<div class="page_margins">

<?php include_once('includes/header.php'); ?>

<div id="banner" class="banner"></div>

<script type="text/javascript">

var so = new SWFObject("nexus-flash-banner4.swf", "mymovie", "945", "324", "8");

so.addParam("quality", "high");

so.addParam("wmode", "opaque");

so.addParam("scale","exactfit");

so.addParam("salign", "t");

so.write("banner");

</script>

<div id="main" class="subpage">

<div class="content">

<h1>Bulletin & Announcement</h1>

<h2><?php echo $article->title; ?>

<div class="article_date"><?php echo $article->date; ?></div>

</h2>

<div class="img-pads">

<?php echo $article->content; ?>

</div>

<div class="clearing"></div>

</div>

</div>

<?php include_once('includes/footer.php'); ?>

</div>

</div>

</body>

</html>

--------------------------------------

tia!
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

thank you sir dun po sa pasword ko cornal po yung password nun..
cge e try ko po sir.. tska ano po ung sefault password ng localhost?



oo nga po nakacomment pla dpt ko po b alisin un :slap: dmi ksi codes nallito n ako hehe

Sir pahingi po ng tutorial about sa mysql replication (master, slave)
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

salamat po
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Meron po akong queries at yung second table which is yung 'students' ay merong foreign key which is on update mula sa first table na 'process'.
The problem po is nakakainsert po ako ng data sa first table pero sa second table wala pong naiinsert na data.

Ito po yung queries ko.

Code:
//query for first table
$query = "INSERT INTO process VALUES (NULL,'".$enrollment_credentials."','".$grade_level."','".$semester."','".$sch_last_attended."',
		'".$sch_year."','".$sch_address."','".$stud_type."','".$transferred_from."')";
//execute query
$result = mysqli_query($dbase,$query);
//foreign key
$process_fk = mysqli_insert_id($dbase);

mysqli_free_result($result);

//query for second table
$query = "INSERT INTO students VALUES (NULL,'".$last_name."','".$first_name."','".$middle_name."','".$age."','".$date."','".$address."',
		'".$lrn."','".$sex."','".$email."','".$bday."','".$bplace."','".$process_fk."')";

//execute query
$result = mysqli_query($dbase,$query);

mysqli_free_result($result);
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Tanong ko lang po yung mga codes po ba sa Wampp server and Xampp Server parehas gumagana?
PHP po yung tinutukoy ko salamat po :D
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Short answer, YES
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2 salamat

salamat :)
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Thank you po sa pag share
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

hi sii possible po bang yung data sa mysql ay idisplay sa map?
mapbox gamit ko po salamat
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

okay to bossing salamat sa pagshare.
 
May isang feature pa po na kulang yung website ko.
Baka po may alam kayong way kung paano maeexport ang isang web page into different formats like ppt and pdf pag niclick ang isang button. Natry ko na po ang ang mga JS libraries like jsPDF and htmltoPDF pero di gumagana.
Salamat po ng marami.
 
Back
Top Bottom