Jump to content

NotSunfighter

Members
  • Posts

    63
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by NotSunfighter

  1. This is my take on things and it does throw an error is an input is null:

    <?php
    $inm = "Bio Clean green500ml"; 
    $cnm = "INSECTS KILLERS";
    $bnm = "HARPIC ";
    
    echo SKU_gen($inm, $cnm,$bnm,20).'<br>'; 
    function SKU_gen($pname, $cat=null, $brand=null, $id = null, $l = 2){
    	if($pname == null) echo "empty<br><br><br>";
    	
    	$result = "";
    	if($pname == "Bio Clean green500ml"){
    		$result = "BI-";
    	}
    	else{
    		$result = "XX-";
    	}
    	
    	if($cat == "INSECTS KILLERS"){
    		$result = $result."IK";
    	}
    	else{
    		$result = $result."XX";
    	}
    	
    	if($brand == "HARPIC "){
    		$result = $result."HA";
    	}
    	else{
    		$result = $result."XX";
    	}
    	
    	$num = 10000 + $l;
    	$result = $result.substr($num,1);
    	
    	if (strpos($result, "XX") !== false){
    		echo "There is an error: ".$result;
    	}else{
    		echo $result;
    	}
    }
    ?>   

    with a lot of products I'd use switch statements instead of the if then statements.

  2. I have used wamp since to early 2000's. It was hard to install then. I have installed it on every new computer (about once every 2~3 years) and have had no problems, maybe cause I know what I need or where to get the information. I have never figured out how to get xamp up and running.

    You'll need to google the pros and cons. A;; I can tell you is wamp is larger then 4x.

    Code is code so portable.

    • Thanks 1
  3. I have never seen so much code to do a simple drop down menu. It looks like your using bootstrap, ssas, and jquery. Lets start there: learn to code. Learn HTML, CSS, and JavaScript! Then, if your doing a lot of programming and haven't made a personal library you can learn jquery. When studying HTML pay close attention to CSS-Grid and FlexBox. Oh don't forget responsive design.

    Sorry I can't help. Don't know where you originally hide the menu list. That is what I believe is your problem, you don't hide it on page start up.

  4. Dharmeshdhabu, neither of the two code samples you posted relate to the question. The first is totally useless and the second is for installing info into a database. I shall comment on the second, longer code.

    It's a shame SESSIONs are used to just send a message to the user and not protect data. But that may be all you need. So this is just my BS, don't worry about it.

    But here are two things that you should worry about

    You never call the function "test_input" before you insert data. I should be called before the INSERT and both UPDATES. It should be removed from the "if (isset($_POST['admit'])) {" and made to stand along.

    You initialize variables for the first admit of a patient, but not for "$Treatment = $_POST['Treatment'];". Be consistent.

    "$results = mysqli_query($db, "SELECT * FROM IPD ");"  $db is never defined and where does the $results go?

    This might be your problem: PHP is case sensitive. You insert into IPD, but UPDATE ipd. Always use lower case for DB and field names.

     

  5. Here a solution from Stackoverflow

    <!DOCTYPE html>
    <html lang="en">
    <head></head>
    <body>
    
    <script>
    var permArr = [],
      usedChars = [];
    str = [5,3,7,1];
    function permute(input) {
      var i, ch;
      for (i = 0; i < input.length; i++) {
        ch = input.splice(i, 1)[0];
        usedChars.push(ch);
        if (input.length == 0) {
          permArr.push(usedChars.slice());
        }
        permute(input);
        input.splice(i, 0, ch);
        usedChars.pop();
      }
      return permArr
    };
    
    document.write(JSON.stringify(permute(str)));  STACKOVERFLOW
    </script>
    </body>
    </html>

     

  6. @steveb1471, This is way more complicated then it should be. I see a hard time ahead maintaining this with uodates or repairs. IMHO I'd use AJAX to communicate this your PHP and DB.  storedata() works with sessionStorage and has nothing to do with communication and adds extra steps to what your doing.

    The SELECT should be user INPUT, because it needs to be upgraded by a programmer when new weeks appear.

    The worst thing I see is the unneeded use of FORM to talk to PHP. Ajax does this nicely and will open a POP UP BOX and display your information without ruining the HTML page.

    Please consider AJAX.

  7. I don't see anything in your code to cause a problem. I'm sure it lies in your PHP file. Post that code. Also you can save load time by removing the two JS scripts, they are needed.

  8. You really don't need to use a DIV in the HTML code. Your video is at 100% and centering is unresponsive. To center the <B> text use:

     style="text-align:center;display:block;margin: 0 auto;" to the tag

     

    I found a hack for you to try.

    Add an ID to the video (ID="myvideo").

    Then use JAVASCRIPT:

    <script> document.getElementById('myvideo').play(); </script>

    See if that works.

     

  9. The admin panel on my site is not under my control. Are you able to change your admin panel?  If you control it we'd need to see the code.

    How about making two menus OKmenu.php and FullUpMenu.php and change which one you will call from index.php, manually or as stated above?

    Your index.php file may look like this:

    	echo"
    	<table border=\"1\" class=\"tblmare\" width=\"795\" style=\"border-collapse: collapse\" align=center>
    	<tr class=trsus>
    	<td>";
    	include 'routing.php';
    	echo"
    	</td></tr>
    	<tr>
    	<td>
    	<center>";
    	 
    	/* Change the menu here
    	Pick one and then comment the other out */
    	 
    	include 'OKmenu.php';
    	//include 'FullUpMenu.php';
    	
     
    	echo"
    	</center></td>
    	</tr><tr><td>
    	and more....
    	

    Sloppy, but you get the idea - right?

  10. Quote

    it is about the web http://routing-com.roirc.org in the section new applications I would like to introduce to be able to close and reopen that section that is when it is closed to appear a message at the moment we do not accept new applications .... I specify that the web has admin panel and mysql

    The easiest way of doing this is to change the page you send them to when they click on the “New Application” menu. I would use the new page to not only inform them that you can not take new users, but also collect their information to get back to them if an opening occurs.

    Since you have MySQL you can look up a token and add a IF loop to the menu selection area, This way you could program a PHP program to do this automatically and send auto send the email when space is available. Or this can be done manually by staff.

     

    Cel mai simplu mod de a face acest lucru este de a schimba pagina la care le trimiteți atunci când fac clic pe meniul „Aplicație nouă”. Aș folosi noua pagină pentru a-i informa nu numai că nu puteți lua utilizatori noi, ci și să strâng informațiile pentru a vă întoarce la ei dacă are loc o deschidere. Deoarece aveți MySQL, puteți căuta un token și adăugați o buclă IF în zona de selectare a meniului, În acest fel, puteți programa un program PHP pentru a face acest lucru automat și puteți trimite automat e-mailul atunci când spațiul este disponibil. Sau acest lucru poate fi făcut manual de către personal.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.