# shiftcontroller/4.9.95/sh4/app/html/controller/admin/reinstall.php

ShiftController Employee Shift Scheduling, version 4.9.95. 45 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/code/sh4/app/html/controller/admin/reinstall.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/raw/sh4/app/html/controller/admin/reinstall.php
- Modified: 2024-11-09T11:44:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.95/code/sh4/app/html/controller/admin/reinstall.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
#[AllowDynamicProperties]
class SH4_App_Html_Controller_Admin_Reinstall
{
	public function __construct(
		HC3_Hooks $hooks,
		HC3_Post $post,

		SH4_Shifts_Command $shiftsCommand,
		SH4_App_Command $appCommand
		)
	{
		$this->shiftsCommand = $hooks->wrap( $shiftsCommand );
		$this->appCommand = $hooks->wrap( $appCommand );
	}

	public function execute()
	{
/*
'DELETE FROM ' . $dbPrefix . 'postmeta WHERE post_id IN (SELECT ID FROM ' . $dbPrefix . 'posts WHERE post_type LIKE "sh4_%")';
'DELETE FROM ' . $dbPrefix . 'posts WHERE post_type LIKE "sh4_%"';
'DELETE FROM ' . $dbPrefix . 'options WHERE option_name LIKE "sh4_%"';
*/

		global $wpdb;
		$dbPrefix = $wpdb->prefix;
		$sql = 'DELETE FROM ' . $dbPrefix . 'posts WHERE post_type LIKE "sh4_%"';
		$wpdb->query( $sql );

		$this->appCommand->uninstall();

		$to = 'admin';
		$return = array( $to, '__Reinstalled__' );
		return $return;
	}

	public function executeShifts()
	{
		$this->shiftsCommand->deleteAll();

		$to = '';
		$return = array( $to, '__All Shifts Deleted__' );
		return $return;
	}
}
```
