403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/Helpdesk/application/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/Helpdesk/application/models//tonersmodel.php
<?php

class TonersModel
{
    function __construct($db) {
		$this->db = $db;
    }

    public function get($id)
    {
		$id = $this->db->strip($id);
		$result = $this->db->select("* FROM toners WHERE id='$id'", 'firstrow');

		return $result;
    }

    public function getByName($printer, $type, $color)
    {
		$printer = $this->db->strip($printer);
		$type = $this->db->strip($type);
		$color = $this->db->strip($color);

		$result = $this->db->select("* FROM toners WHERE printer='$printer' AND type='$type' AND color='$color'", 'firstrow');

		return $result;
    }
	
    public function getAll()
    {
		$result = $this->db->select("* FROM toners ORDER BY printer ASC");
		
		return $result;
    }

	public function save($record)
	{
		array_walk($record, array($this->db, 'strip_array'));
		$old = $this->get($record['id']);

		if ($old){
			foreach ($record as $field=>$value) {
				if ($field!="id") {
					if ($value=="NULL")
						$set[] = "$field=NULL";
					else
						$set[] = "$field='$value'";
				}
			}
			
			$set = implode(", ", $set);
			
			$result = $this->db->update("toners SET $set WHERE id='".$record['id']."'");
		} else {
			foreach ($record as $field=>$value) {
				$fields[] = $field;
				if ($value=="NULL")
					$values[] = "NULL";
				else
					$values[] = "'$value'";
			}
									
			$fields = implode(", ", $fields);
			$values = implode(", ", $values);
			
			$result = $this->db->insert("INTO toners ($fields) VALUES ($values)");
		}

		return $result;
	}
	
	public function delete($id)
	{
		$id = $this->db->strip($id);
		
		$result = $this->db->delete("FROM toners WHERE id=".$id);
			
		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit