Changeset 11771
- Timestamp:
- 08/04/11 11:20:53 (13 years ago)
- Location:
- trunk/www/db_po
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/db_po/insert_po.php
r11599 r11771 4 4 ini_set("mysql.trace_mode", "On"); 5 5 6 // init 7 // 8 // values which cannot be empty 6 9 if (empty($_GET["fUpdCase"])) 7 10 { … … 24 27 return; 25 28 } 29 if (empty($_GET["fValue"])) 30 { 31 echo "Please insert a value.<br>"; 32 return; 33 } 34 if (empty($_GET["fDescription"])) 35 { 36 echo "Please insert a description.<br>"; 37 return; 38 } 39 if (empty($_GET["fType"])) 40 { 41 echo "Please select a type.<br>"; 42 return; 43 } 44 // values which may be empty 26 45 if (empty($_GET["fKey2"])) 27 { 28 echo "Please select a key2.<br>"; 29 return; 30 } 31 if (empty($_GET["fValue"])) 32 { 33 echo "Please insert a value.<br>"; 34 return; 35 } 36 if (empty($_GET["fDescription"])) 37 { 38 echo "Please insert a description.<br>"; 39 return; 40 } 41 if (empty($_GET["fType"])) 42 { 43 echo "Please select a type.<br>"; 44 return; 45 } 46 $_GET["fKey2"]=""; 46 47 if (empty($_GET["fOriginalIndex"])) 47 48 $_GET["fOriginalIndex"]=""; … … 97 98 98 99 //check if key alread exists 99 $query2="SELECT Count(*) from ProgramOption WHERE fKey1='".$_GET["fKey1"]."' AND fKey2='.".$_GET["fKey2"]."'"; 100 if (empty($_GET["fKey2"])) 101 $query2="SELECT Count(*) from ProgramOption WHERE fKey1='".$_GET["fKey1"]."' AND ISNULL(fKey2)"; 102 else 103 $query2="SELECT Count(*) from ProgramOption WHERE fKey1='".$_GET["fKey1"]."' AND fKey2='.".$_GET["fKey2"]."'"; 100 104 $query2.=" AND fCounter=(Select Max(fCounter) from History)"; 101 105 if (!$result2=mysqli_query($db_id, $query2)) … … 158 162 $query0.=", fUser='".$_SERVER['PHP_AUTH_USER']."'"; 159 163 $query0.=", fKey1='".$_GET["fKey1"]."'"; 160 $query0.=", fKey2='.".$_GET["fKey2"]."'"; 164 if (!empty($_GET["fKey2"])) 165 $query0.=", fKey2='.".$_GET["fKey2"]."'"; 161 166 $query0.=", fDescription='".$_GET["fDescription"]."'"; 162 167 $query0.=", fType='".$_GET["fType"]."'"; -
trunk/www/db_po/po.js
r11600 r11771 561 561 if (!key1) 562 562 alert("Please insert key1!"); 563 if (!key2)564 alert("Please insert key2!");565 563 if (!val) 566 564 alert("Please insert value!"); 567 if (!val || !descr || !key1 || !key2)565 if (!val || !descr || !key1) 568 566 return; 569 567 if (index==0) … … 650 648 { 651 649 alert("Maximum is not a float."); 650 return; 651 } 652 if (type=='float' && parseFloat(max)<parseFloat(min)) 653 { 654 alert("Maximum cannot be smaller than minimum."); 655 return; 656 } 657 if (type=='int' && parseInt(max)<parseInt(min)) 658 { 659 alert("Maximum cannot be smaller than minimum."); 652 660 return; 653 661 }
Note:
See TracChangeset
for help on using the changeset viewer.