Un mic ajutor

Ai o întrebare legată de PHP? Incercăm să îi găsim soluţie. Sau poate doar vrei să publici un cod interesant.

Moderatori: Zamolxe, Moderatori

ecomeda
New Member
Mesaje: 3
Membru din: Joi Noi 26, 2015 8:54 am

Un mic ajutor

Mesajde ecomeda » Joi Noi 26, 2015 1:14 pm

Buna ziua!sunt incepator in ceea ce priveste php si mysql dar incerc sa fac si eu ce pot si sa lucrez urmand niste exemple de pe marele google.
Am o mica problema....am un sistem de rezervari ....totul este bun si frumos pana cand incerc sa modific o rezervare.Ideea mea a fost simpla si anume extrag din baza de date acea rezervare o afisez si conditionez ca doar 3 campuri sa poti modifica.Pana aici totul a fost ok (mai jos este codul):

Cod: Selectaţi tot

<form name="form1" method="post" action="update_rezervare.php">

<td>
<body>
<p>
<img border="0" src="images/logo.jpg" width="500" height="97"><img border="0" src="images/Untitled.jpg" width="137" height="97"></p>
<table border="1" width="640" bordercolorlight="#000000" bordercolordark="#000000" style="border-collapse:collapse">
<tr>
<td valign="top" width="640" colspan="2">
<p align="center">
<b style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: -webkit-center; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255)">
<font color="#0000FF" size="4">TICHET DE REZERVARE TRANSPORT AEROPORT</font></b></p></td>
      <td valign="middle" width="184" rowspan="6">
      <p align="center"><font face="Times New Roman"><b>KIRVAD TOUR TELEFON DISPECERAT 0768 582 208</b></font></p>
      <p align="center"><b><font size="2" face="Times New Roman">Nume Agent:
      </font>
      </b>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=Nume_Referent value="<?php echo $row['Nume_Referent'];?>"></font></span></p>
      <p align="center"><b><font size="2" face="Times New Roman">Telefon
      Agent :
      </font>
      </b>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=Telefon_Referent value="<?php echo $row['Telefon_Referent'];?>"></font></span></td>
   </tr>
   <tr>
      <td valign="middle" width="220"><font size="2" face="Times New Roman">Nr. Tichet : EMH&nbsp;
      </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=id value="<?php echo $row['id'];?>"></font></span></td>
      <td width="228" valign="middle"><font size="2" face="Times New Roman">Data Emiterii :
      </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=Data_Si_Ora_Rezervarii value="<?php echo date("d-m-Y", strtotime($row['Data_Si_Ora_Rezervarii']));?>"></font></span></td>
   </tr>
   <tr>
      <td width="220" valign="middle">
      <font size="2" face="Times New Roman">Nume Pasager : </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=Nume_Client value="<?php echo $row['Nume_Client'];?>"></font></span></td>
      <td width="228" valign="middle"><font size="2" face="Times New Roman">Telefon :
      </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly name=Telefon_Client value="<?php echo $row['Telefon_Client'];?>"></font></span></td>
   </tr>
   <tr>
      <td width="220" valign="middle">
      <font size="2" face="Times New Roman">Ora Decolare /Aterizare Avion : </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly type="text" name=Ora_Decolare_Aterizare_Avion value="<? echo $row['Ora_Decolare_Aterizare_Avion']; ?>" ></font></span></td>
      <td width="228" valign="middle"><font size="2" face="Times New Roman">De
      Unde Vine Clientul&nbsp; :
      </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21.450000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <span class="Apple-converted-space"><font size="2">&nbsp;</font></span></span><span id="tempvar_value" style="outline: 0px; vertical-align: baseline; font-weight: bold; color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; border: 0px none; margin: 0px; padding: 0px; background: rgb(255, 255, 255)"><font size="2"><input readonly type="text" name=De_Unde_Vine_Clientul value="<? echo $row['De_Unde_Vine_Clientul']; ?>" ></font></span></td>
   </tr>
   <tr>
      <td width="220" valign="middle">
      <font size="2" face="Times New Roman">Loc. Plecare : </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input readonly type="text" name=Locul_Plecarii value="<? echo $row['Locul_Plecarii']; ?>" ></font></span></td>
      <td width="228" valign="middle"><font size="2" face="Times New Roman">Data
      Plecarii :</font><span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)"><font size="2"><input readonly type="text" name=Data_Plecarii value="<? echo $row['Data_Plecarii']; ?>" ></font></span></td>
   </tr>
   <tr>
      <td width="220" valign="middle">
      <font size="2" face="Times New Roman">Loc. Sosire : </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21.450000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <span class="Apple-converted-space"><font size="2">&nbsp;</font></span></span><span id="tempvar_value0" style="outline: 0px; vertical-align: baseline; font-weight: bold; color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; border: 0px none; margin: 0px; padding: 0px; background: rgb(255, 255, 255)"><font size="2"><input readonly type="text" name=Locul_Sosirii value="<? echo $row['Locul_Sosirii']; ?>" ></font></span></td>
      <td width="228" valign="middle"><font size="2" face="Times New Roman">Data
      Sosirii :</font><span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)"><font size="2"><input readonly type="text" name=Data_Sosirii value="<? echo $row['Data_Sosirii']; ?>" ></font></span></td>
   </tr>
   <tr>
      <td width="220" valign="middle">
<font size="2" face="Times New Roman">Tarif Calatorie :
      </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21.450000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <span class="Apple-converted-space"><font size="2">&nbsp;</font></span></span><span id="tempvar_value1" style="outline: 0px; vertical-align: baseline; font-weight: bold; color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; border: 0px none; margin: 0px; padding: 0px; background: rgb(255, 255, 255)"><font size="2"><input readonly type="text" name=Tarif value="<? echo $row['Tarif']; ?>" ></font></span></td>
      <td width="227" valign="middle">
<font face="Times New Roman"color="#FF0000"><b>ACHITAT*:</b></font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input type="text" name=Modalitate_De_Plata value="<? echo $row['Modalitate_De_Plata']; ?>" ></font></span></td>
      <td width="180" valign="middle">
<font face="Times New Roman" size="2"><font color="#FF0000"><b>REST DE PLATA**:</b></font>   </font>
      <span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
      <font size="2"><input type="text" name=Rest_De_Plata value="<? echo $row['Rest_De_Plata']; ?>" ></font></span></td>
   </tr>
   <tr>
      <td width="633" colspan="3" valign="middle">
<font size="2">Observatii:</font>
<span style="color: rgb(34, 34, 34); font-family: Times New Roman; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25.739999771118164px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(255, 255, 255)">
<font size="2"><input readonly type="text" name=Observatii_Client value="<?php echo $row['Observatii_Client'];?>"></font><font color="#FF0000"><b>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;DATORIE***:</b></font>
<span style="color:#222;font-family:Times New Roman;font-style:normal;font-variant:normal;font-weight:bold;letter-spacing:normal;line-height:25.739999771118164px;orphans:auto;text-align:left;text-indent:0;text-transform:none;white-space:normal;widows:auto;word-spacing:0;-webkit-text-stroke-width:0;display:inline!important;float:none;background-color:#ffffff">
<font size="2"><input type=text name=Datorie value="<?php echo $row['Datorie'];?>"></font></span></td>
   </tr>
<tr>
<td width="633" colspan="3" valign="middle">
<font size="2"></font>
<span style="color:#222;font-family:Times New Roman;font-style:normal;font-variant:normal;font-weight:bold;letter-spacing:normal;line-height:25.739999771118164px;orphans:auto;text-align:left;text-indent:0;text-transform:none;white-space:normal;widows:auto;word-spacing:0;-webkit-text-stroke-width:0;display:inline!important;float:none;background-color:#ffffff">
<font size="2"><input readonly type=text name=Cine_A_Modificat style="visibility:hidden" value="<? echo "".$fetch_users_data->utilizator."";?>" ></font></span><font size="2">  </font>
<span style="color:#222;font-family:Times New Roman;font-style:normal;font-variant:normal;font-weight:bold;letter-spacing:normal;line-height:25.739999771118164px;orphans:auto;text-align:left;text-indent:0;text-transform:none;white-space:normal;widows:auto;word-spacing:0;-webkit-text-stroke-width:0;display:inline!important;float:none;background-color:#ffffff">
<font size="2"><input readonly type=text name=Data_Modificarii style="visibility:hidden" value="<? echo date("Y-m-d H:i:s",time());?>"></font></td>
</tr>

</table>
<?php ?>
</body>
</center>
</html>
</div>
<p align="center">


<input type="submit" name="Submit" value="Aplica Modificari">

dar lucrand cu oamenii situatia mereu se complica,cu toate ca am afisat un mesaj exact cum sa faca modificarile si cum sa le modifice.
Ce problema am eu mai exact:
Am 3 campuri ACHITAT , REST DE PLATA SI DATORIE ( in momentul de fata aceste 3 campuri se completeaza automat din baza de date) dar atunci cand incerc sa fac o modificare pe ele operatorul nu mai este atent si face pe romaneste numai balarii, si anume campul ACHITAT ARE DOAR 2 INTRARI si acelea sunt "plata la imbarcare" si integral" . |Ma poate ajuta cineva sa simplific acest lucru?(si anume ...atunci cand aleg plata la imbarcare sau integral celelate 2 campuri |rest de plata si datorie| sa se modifice automat?!
Multumesc Anticipat



takedown
Average Member
Mesaje: 153
Membru din: Joi Feb 07, 2013 8:50 pm
Contact:

Re: Un mic ajutor

Mesajde takedown » Joi Noi 26, 2015 10:47 pm

Salut, daca nu ai reusit pana acum, incerca si pe acest site, sunt persoane capabile care te pot ajuta -> Link, Micul programator!


Înapoi la “Cod PHP”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 41 vizitatori