| | 54 | |
|---|
| | 55 | function backup_list_files($dir='', $display='', $file='') { |
|---|
| | 56 | global $type,$asterisk_conf,$amp_conf; |
|---|
| | 57 | $html=''; |
|---|
| | 58 | if(is_dir($dir)){ |
|---|
| | 59 | if(($file!=".") && ($file!="..") && ($file!="")){ |
|---|
| | 60 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to delete this File Set?")."','config.php?type=$type&display=$display&action=deletedataset&dir=$dir')\">"; |
|---|
| | 61 | $html.=_("DELETE ALL THE DATA IN THIS SET").'<span>'._("Delete this backup set and all data associated with this backup set..").'</span></a><br></li><br>'; |
|---|
| | 62 | } |
|---|
| | 63 | if($dh = opendir($dir)){ |
|---|
| | 64 | while(($file = readdir($dh))!== false){ |
|---|
| | 65 | $file_arr[]=$file; |
|---|
| | 66 | } |
|---|
| | 67 | rsort($file_arr); |
|---|
| | 68 | $count=25; |
|---|
| | 69 | foreach($file_arr as $file){ |
|---|
| | 70 | if(($file!=".") && ($file!="..") && ($dir==$amp_conf['ASTVARLIBDIR']."/backups/")){ |
|---|
| | 71 | $html.="<li><a href=\"config.php?type=$type&display=$display&action=restore&dir=$dir/$file\">$file</a><br></li>"; |
|---|
| | 72 | $count--; |
|---|
| | 73 | }elseif(($file!=".") && ($file!="..")){ |
|---|
| | 74 | $html.="<li><a href=\"config.php?type=$type&display=$display&action=restore&dir=$dir/$file&file=$file\">$file</a><br></li>"; |
|---|
| | 75 | $count--; |
|---|
| | 76 | } |
|---|
| | 77 | } |
|---|
| | 78 | closedir($dh); |
|---|
| | 79 | for ($i = $count; $i > 0; $i--){ |
|---|
| | 80 | $html.='<br />'; |
|---|
| | 81 | } |
|---|
| | 82 | } |
|---|
| | 83 | }elseif(substr($dir, -6)=="tar.gz" ){ |
|---|
| | 84 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to delete this File Set?")."','config.php?type=$type&display=$display&action=deletefileset&dir=$dir&file=$file')\">"; |
|---|
| | 85 | $html.=_("Delete File Set").'<span>'._("Delete this backup set.").'</span></a><br></li><br>'; |
|---|
| | 86 | $tar_string="tar tfz \"$dir\" | cut -d'/' -f4"; |
|---|
| | 87 | exec($tar_string,$restore_files,$error); |
|---|
| | 88 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to restore this COMPLETE file set?\\nDoing so will permanently over-write all FreePBX and Asterisk files\\nYou will lose all Your Call Detail Records and any Voicemail that was recorded between the BACKUP DATE and NOW!")."','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=ALL&file=$file')\">"; |
|---|
| | 89 | $html.=_("Restore Entire Backup Set").'<span>'; |
|---|
| | 90 | $html.=_("Restore your Complete Backup set overwriting all files.").'</span></a><br></li><br>'; |
|---|
| | 91 | if(array_search('voicemail.tar.gz',$restore_files)){ |
|---|
| | 92 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to Restore this file set?\\nDoing so will permanently delete any new voicemail you have in your mailbox\\nsince this backup on")." $file!','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=VoiceMail&file=$file')\">"; |
|---|
| | 93 | $html.=_('Restore VoiceMail Files').'<span>'; |
|---|
| | 94 | $html.=_('Restore your Voicemail files from this backup set. NOTE! This will delete any voicemail currently in the voicemail boxes.'); |
|---|
| | 95 | $html.='</span></a><br></li><br>'; |
|---|
| | 96 | } |
|---|
| | 97 | if(array_search('recordings.tar.gz',$restore_files)){ |
|---|
| | 98 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to Restore this file set?\\nNOTE! This will OVERWRITE any voicerecordings currently on the system. It will NOT delete new files not currently in the backup set")."','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=Recordings&file=$file')\">"; |
|---|
| | 99 | $html.=_('Restore System Recordings Files').'<span>'; |
|---|
| | 100 | $html.=_("Restore your system Voice Recordings including AutoAttendent files from this backup set. NOTE! This will OVERWRITE any voicerecordings currently on the system. It will NOT delete new files not currently in the backup set").'</span></a><br></li><br>'; |
|---|
| | 101 | } |
|---|
| | 102 | if(array_search('configurations.tar.gz',$restore_files)){ |
|---|
| | 103 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to Restore this File Set?\\nDoing so will Permanently Over-Write all FreePBX and Asterisk Files!")."','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=Configurations&file=$file')\">"; |
|---|
| | 104 | $html.=_("Restore System Configuration").'<span>'._("Restore your system configuration from this backup set. NOTE! This will OVERWRITE any System changes you have made since this backup... ALL Itemes will be reset to what they were at the time of this backup set..").'</span></a><br></li><br>'; |
|---|
| | 105 | } |
|---|
| | 106 | if(array_search('fop.tar.gz',$restore_files)){ |
|---|
| | 107 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to Restore the Operator Panel Files?\\nDoing so will Permanently Over-Write all Operator Panel Files!")."','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=FOP&file=$file')\">"; |
|---|
| | 108 | $html.=_("Restore Operator Panel").'<span>'; |
|---|
| | 109 | $html.=_('Restore the Operator Panel from this backup set. NOTE! This will OVERWRITE any Operator Panel Changes you have made since this backup... ALL Itemes will be reset to what they were at the time of this backup set..').'</span></a><br></li><br>'; |
|---|
| | 110 | } |
|---|
| | 111 | if(array_search('cdr.tar.gz',$restore_files)){ |
|---|
| | 112 | $html.="<li><a class=\"info\" href=\"javascript:decision('"._("Are you sure you want to Restore the CALL DETAIL FILES?\\nDoing so will Permanently DELETE all CALL RECORDS!")."','config.php?type=$type&display=$display&action=restored&dir=$dir&filetype=CDR&file=$file')\">"; |
|---|
| | 113 | $html.=_("Restore Call Detail Report").'<span>'; |
|---|
| | 114 | $html.=_("Restore the Call Detail Records from this backup set. NOTE! This will DELETE ALL CALL RECORDS that have been saved since this backup set.."); |
|---|
| | 115 | $html.='</span></a><br></li><br>'; |
|---|
| | 116 | } |
|---|
| | 117 | }else{ |
|---|
| | 118 | $html.='<h2>'._("ERROR its not a BACKUP SET file").'</h2>'; |
|---|
| | 119 | } |
|---|
| | 120 | echo $html; |
|---|
| | 121 | } |
|---|
| | 122 | |
|---|
| | 123 | function backup_restore_tar($dir="", $file="",$filetype="", $display="") { |
|---|
| | 124 | global $asterisk_conf,$amp_conf; |
|---|
| | 125 | $error = false; |
|---|
| | 126 | $tar='/bin/tar'; |
|---|
| | 127 | if($amp_conf['AMPBACKUPSUDO']==true){$sudo='/usr/bin/sudo';}else{$sudo='';}//use sudo if requested - DANGEROUS!!! |
|---|
| | 128 | switch($filetype){ |
|---|
| | 129 | case 'ALL': |
|---|
| | 130 | $fileholder=substr($file, 0,-7); |
|---|
| | 131 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 132 | $error = ($error || ($ret != 0)); |
|---|
| | 133 | |
|---|
| | 134 | // First restore voicemial (for some reason if you do it all at once these don't get restored |
|---|
| | 135 | exec('/bin/rm -rf '.$amp_conf['ASTSPOOLDIR'].'/voicemail 2>&1',$out_arr,$ret); |
|---|
| | 136 | $error = ($error || ($ret != 0)); |
|---|
| | 137 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/voicemail.tar.gz | $tar -Pxvz"; |
|---|
| | 138 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 139 | $error = ($error || ($ret != 0)); |
|---|
| | 140 | |
|---|
| | 141 | // Next, recordings cause same issue as above |
|---|
| | 142 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/recordings.tar.gz | $tar -Pxvz"; |
|---|
| | 143 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 144 | $error = ($error || ($ret != 0)); |
|---|
| | 145 | |
|---|
| | 146 | // Now the rest and then we'll get on with the databases |
|---|
| | 147 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/configurations.tar.gz | $tar -Pxvz"; |
|---|
| | 148 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 149 | $error = ($error || ($ret != 0)); |
|---|
| | 150 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/fop.tar.gz /tmp/ampbackups.$fileholder/cdr.tar.gz | $tar -Pxvz"; |
|---|
| | 151 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 152 | $error = ($error || ($ret != 0)); |
|---|
| | 153 | $tar_cmd="$tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asterisk.sql /tmp/ampbackups.$fileholder/asteriskcdr.sql /tmp/ampbackups.$fileholder/astdb.dump"; |
|---|
| | 154 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 155 | $error = ($error || ($ret != 0)); |
|---|
| | 156 | |
|---|
| | 157 | $sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql 2>&1"; |
|---|
| | 158 | exec($sql_cmd,$out_arr,$ret); |
|---|
| | 159 | $error = ($error || ($ret != 0)); |
|---|
| | 160 | $sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql 2>&1"; |
|---|
| | 161 | exec($sql_cmd,$out_arr,$ret); |
|---|
| | 162 | $error = ($error || ($ret != 0)); |
|---|
| | 163 | exec($amp_conf['AMPBIN']."/restoreastdb.php $fileholder 2>&1",$out_arr,$ret); |
|---|
| | 164 | $error = ($error || ($ret != 0)); |
|---|
| | 165 | |
|---|
| | 166 | //restore additional file (aka AMPPROVROOT), using sudo if requested |
|---|
| | 167 | $tar_cmd="$sudo $tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/phoneconfig.tar.gz |$sudo $tar -Pxvz"; |
|---|
| | 168 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 169 | $error = ($error || ($ret != 0)); |
|---|
| | 170 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder",$out_arr,$ret); |
|---|
| | 171 | $error = ($error || ($ret != 0)); |
|---|
| | 172 | if(!error){$message=_("Restored All Files in BackupSet");} |
|---|
| | 173 | break; |
|---|
| | 174 | case 'VoiceMail': |
|---|
| | 175 | $fileholder=substr($file, 0,-7); |
|---|
| | 176 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 177 | $error = ($error || ($ret != 0)); |
|---|
| | 178 | exec('/bin/rm -rf '.$amp_conf['ASTSPOOLDIR'].'/voicemail 2>&1',$out_arr,$ret); |
|---|
| | 179 | $error = ($error || ($ret != 0)); |
|---|
| | 180 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/voicemail.tar.gz | $tar -Pxvz"; |
|---|
| | 181 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 182 | $error = ($error || ($ret != 0)); |
|---|
| | 183 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 184 | $error = ($error || ($ret != 0)); |
|---|
| | 185 | if(!error){$message=_("Restored VoiceMail");} |
|---|
| | 186 | break; |
|---|
| | 187 | case 'Recordings': |
|---|
| | 188 | $fileholder=substr($file, 0,-7); |
|---|
| | 189 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 190 | $error = ($error || ($ret != 0)); |
|---|
| | 191 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/recordings.tar.gz | $tar -Pxvz"; |
|---|
| | 192 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 193 | $error = ($error || ($ret != 0)); |
|---|
| | 194 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 195 | $error = ($error || ($ret != 0)); |
|---|
| | 196 | if(!error){$message=_("Restored System Recordings");} |
|---|
| | 197 | break; |
|---|
| | 198 | case 'Configurations': |
|---|
| | 199 | $fileholder=substr($file, 0,-7); |
|---|
| | 200 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 201 | $error = ($error || ($ret != 0)); |
|---|
| | 202 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/configurations.tar.gz | $tar -Pxvz"; |
|---|
| | 203 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 204 | $error = ($error || ($ret != 0)); |
|---|
| | 205 | $tar_cmd="$$tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asterisk.sql /tmp/ampbackups.$fileholder/astdb.dump"; |
|---|
| | 206 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 207 | $error = ($error || ($ret != 0)); |
|---|
| | 208 | $sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asterisk.sql"; |
|---|
| | 209 | exec($sql_cmd,$out_arr,$ret); |
|---|
| | 210 | $error = ($error || ($ret != 0)); |
|---|
| | 211 | exec($amp_conf['AMPBIN']."/restoreastdb.php $fileholder 2>&1",$out_arr,$ret); |
|---|
| | 212 | $error = ($error || ($ret != 0)); |
|---|
| | 213 | //restore additional file (aka AMPPROVROOT), using sudo if requested |
|---|
| | 214 | $tar_cmd="$sudo $tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/phoneconfig.tar.gz |$sudo $tar -Pxvz"; |
|---|
| | 215 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 216 | |
|---|
| | 217 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 218 | $error = ($error || ($ret != 0)); |
|---|
| | 219 | if(!error){$message=_("Restored System Configuration");} |
|---|
| | 220 | break; |
|---|
| | 221 | case 'FOP': |
|---|
| | 222 | $fileholder=substr($file, 0,-7); |
|---|
| | 223 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 224 | $error = ($error || ($ret != 0)); |
|---|
| | 225 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/fop.tar.gz | $tar -Pxvz"; |
|---|
| | 226 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 227 | $error = ($error || ($ret != 0)); |
|---|
| | 228 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 229 | $error = ($error || ($ret != 0)); |
|---|
| | 230 | if(!error){$message=_("Restored Operator Panel");} |
|---|
| | 231 | break; |
|---|
| | 232 | case 'CDR': |
|---|
| | 233 | $fileholder=substr($file, 0,-7); |
|---|
| | 234 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 235 | $error = ($error || ($ret != 0)); |
|---|
| | 236 | $tar_cmd="$tar -PxvOz -f \"$dir\" /tmp/ampbackups.$fileholder/cdr.tar.gz | $tar -Pxvz"; |
|---|
| | 237 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 238 | $error = ($error || ($ret != 0)); |
|---|
| | 239 | $tar_cmd="$tar -Pxvz -f \"$dir\" /tmp/ampbackups.$fileholder/asteriskcdr.sql"; |
|---|
| | 240 | exec($tar_cmd,$out_arr,$ret); |
|---|
| | 241 | $error = ($error || ($ret != 0)); |
|---|
| | 242 | $sql_cmd="mysql -u ".$amp_conf['AMPDBUSER']." -p".$amp_conf['AMPDBPASS']." < /tmp/ampbackups.$fileholder/asteriskcdr.sql 2>&1"; |
|---|
| | 243 | exec($sql_cmd,$out_arr,$ret); |
|---|
| | 244 | $error = ($error || ($ret != 0)); |
|---|
| | 245 | exec("/bin/rm -rf /tmp/ampbackups.$fileholder 2>&1",$out_arr,$ret); |
|---|
| | 246 | $error = ($error || ($ret != 0)); |
|---|
| | 247 | if(!error){$message=_("Restored CDR logs");} |
|---|
| | 248 | break; |
|---|
| | 249 | } |
|---|
| | 250 | return ($error)?$message:_('Restore Failed, see System Status Notification for details'); |
|---|
| | 251 | } |
|---|
| | 252 | |
|---|
| | 253 | function backup_get(){ |
|---|
| | 254 | global $db; |
|---|
| | 255 | $sql = "SELECT * FROM backup ORDER BY name ASC"; |
|---|
| | 256 | $results = $db->getAll($sql); |
|---|
| | 257 | if(DB::IsError($results)) { |
|---|
| | 258 | $results = null; |
|---|
| | 259 | } |
|---|
| | 260 | return $results; |
|---|
| | 261 | } |
|---|
| | 262 | |
|---|
| | 263 | function backup_delete_set($id=''){ |
|---|
| | 264 | global $db,$asterisk_conf,$amp_conf; |
|---|
| | 265 | $sql = "DELETE FROM backup WHERE id =?"; |
|---|
| | 266 | $result = $db->query($sql,array($id)); |
|---|
| | 267 | if(DB::IsError($result)) { |
|---|
| | 268 | die_freepbx($result->getMessage()); |
|---|
| | 269 | } |
|---|
| | 270 | backup_retrieve_backup_cron(); |
|---|
| | 271 | } |
|---|
| | 272 | |
|---|
| | 273 | function backup_save_schedule($parms){ |
|---|
| | 274 | global $db,$asterisk_conf,$amp_conf; |
|---|
| | 275 | //build query based on the following keys |
|---|
| | 276 | $parms_num=array('admin','cdr','command','configurations','days','emailaddr', |
|---|
| | 277 | 'emailmaxsize','emailmaxtype','exclude','fop','ftpdir','ftphost', |
|---|
| | 278 | 'ftppass','ftpuser','hours','id','include','method','minutes', |
|---|
| | 279 | 'months','name','recordings','sshdir','sshhost','sshkey','sshuser', |
|---|
| | 280 | 'sudo','voicemail','weekdays'); |
|---|
| | 281 | foreach($parms_num as $dprm){$db_parms[$dprm]=isset($parms[$dprm])?$parms[$dprm]:'';} |
|---|
| | 282 | $keys=$vals=''; |
|---|
| | 283 | //dont include empty values in the query |
|---|
| | 284 | foreach(array_keys($db_parms) as $key){ |
|---|
| | 285 | if($db_parms[$key]!=''){ |
|---|
| | 286 | $keys.=$key.','; |
|---|
| | 287 | } |
|---|
| | 288 | } |
|---|
| | 289 | foreach(array_values($db_parms) as $val){ |
|---|
| | 290 | if($val!=''){ |
|---|
| | 291 | $vals.='"'.$db->escapeSimple($val).'",'; |
|---|
| | 292 | } |
|---|
| | 293 | } |
|---|
| | 294 | $keys=substr($keys,0,-1);$vals=substr($vals,0,-1); |
|---|
| | 295 | $sql='INSERT INTO backup ('.$keys.') VALUES ('.$vals.')'; |
|---|
| | 296 | $result = $db->query($sql); |
|---|
| | 297 | if(DB::IsError($result)) { |
|---|
| | 298 | die_freepbx($result->getMessage().'<hr>'.$sql); |
|---|
| | 299 | } |
|---|
| | 300 | |
|---|
| | 301 | if($parms['method']=='now' && $result){ |
|---|
| | 302 | $latest=$db->getOne('select last_insert_id()'); |
|---|
| | 303 | $backup_script=$asterisk_conf['astvarlibdir'].'/bin/ampbackup.php '.$latest; |
|---|
| | 304 | exec($backup_script,$res); |
|---|
| | 305 | } |
|---|
| | 306 | backup_retrieve_backup_cron(); |
|---|
| | 307 | |
|---|
| | 308 | } |
|---|
| | 309 | function backup_get_string($parms){ |
|---|
| | 310 | global $asterisk_conf; |
|---|
| | 311 | switch($parms['backup_schedule']){ |
|---|
| | 312 | case 'hourly': |
|---|
| | 313 | $cron_string='0 * * * * '; |
|---|
| | 314 | break; |
|---|
| | 315 | case 'daily': |
|---|
| | 316 | $cron_string='0 0 * * * '; |
|---|
| | 317 | break; |
|---|
| | 318 | case 'weekly': |
|---|
| | 319 | $cron_string='0 0 * * 0 '; |
|---|
| | 320 | break; |
|---|
| | 321 | case 'monthly': |
|---|
| | 322 | $cron_string='0 0 1 * * '; |
|---|
| | 323 | break; |
|---|
| | 324 | case 'yearly': |
|---|
| | 325 | $cron_string='0 0 1 1 * '; |
|---|
| | 326 | break; |
|---|
| | 327 | case 'now': |
|---|
| | 328 | $cron_string='0 0 0 0 0 '; |
|---|
| | 329 | break; |
|---|
| | 330 | case 'follow_schedule': |
|---|
| | 331 | $mins_string=$hours_string=$days_string=$months_string=$weekdays_string=''; |
|---|
| | 332 | if(is_array($parms['mins'])){ |
|---|
| | 333 | foreach($parms['mins'] as $value){ |
|---|
| | 334 | $mins_string.=":$value:"; |
|---|
| | 335 | } |
|---|
| | 336 | }else{ |
|---|
| | 337 | $mins_string=":0:"; |
|---|
| | 338 | } |
|---|
| | 339 | if(is_array($parms['hours'])){ |
|---|
| | 340 | foreach($parms['hours'] as $value){ |
|---|
| | 341 | $hours_string.=":$value:"; |
|---|
| | 342 | } |
|---|
| | 343 | }else{ |
|---|
| | 344 | $hours_string=":0:"; |
|---|
| | 345 | } |
|---|
| | 346 | if(isset($parms['all_days']) && $parms['all_days']=='0'){ |
|---|
| | 347 | foreach($parms['days'] as $value){ |
|---|
| | 348 | $days_string.=":$value:"; |
|---|
| | 349 | } |
|---|
| | 350 | }else{ |
|---|
| | 351 | $days_string="*"; |
|---|
| | 352 | } |
|---|
| | 353 | if(isset($parms['all_months']) && $parms['all_months']=='0'){ |
|---|
| | 354 | foreach($parms['months'] as $value){ |
|---|
| | 355 | $months_string.=":$value:"; |
|---|
| | 356 | } |
|---|
| | 357 | }else{ |
|---|
| | 358 | $months_string="*"; |
|---|
| | 359 | } |
|---|
| | 360 | if(isset($parms['all_weekdays']) && $parms['all_weekdays']=='0'){ |
|---|
| | 361 | foreach($parms['weekdays'] as $value){ |
|---|
| | 362 | $weekdays_string.=":$value:"; |
|---|
| | 363 | } |
|---|
| | 364 | }else{ |
|---|
| | 365 | $weekdays_string="*"; |
|---|
| | 366 | } |
|---|
| | 367 | $cron_mins_string=trim($mins_string,":"); |
|---|
| | 368 | $cron_hours_string=trim($hours_string,":"); |
|---|
| | 369 | $cron_days_string=trim($days_string,":"); |
|---|
| | 370 | $cron_months_string=trim($months_string,":"); |
|---|
| | 371 | $cron_weekdays_string=trim($weekdays_string,":"); |
|---|
| | 372 | $cron_string=str_replace("::", ",", "$cron_mins_string $cron_hours_string $cron_days_string $cron_months_string $cron_weekdays_string"); |
|---|
| | 373 | break; |
|---|
| | 374 | } |
|---|
| | 375 | $backup_string['name']=$parms['name']; |
|---|
| | 376 | $backup_string['method']=$parms['backup_schedule']; |
|---|
| | 377 | $backup_string['minutes']=isset($mins_string)?$mins_string:''; |
|---|
| | 378 | $backup_string['hours']=isset($hours_string)?$hours_string:''; |
|---|
| | 379 | $backup_string['days']=isset($days_string)?$days_string:''; |
|---|
| | 380 | $backup_string['months']=isset($months_string)?$months_string:''; |
|---|
| | 381 | $backup_string['weekdays']=isset($weekdays_string)?$weekdays_string:''; |
|---|
| | 382 | $backup_string['command']=$cron_string.' '.$asterisk_conf['astvarlibdir'].'/bin/ampbackup.php'; |
|---|
| | 383 | $ret=array_merge($parms,$backup_string); |
|---|
| | 384 | return ($ret); |
|---|
| | 385 | } |
|---|
| | 386 | function Get_Backup_Times($id){ |
|---|
| | 387 | global $db; |
|---|
| | 388 | $sql = "SELECT minutes, hours, days, months, weekdays, method From backup where id=?"; |
|---|
| | 389 | $results = $db->getAll($sql,array($id)); |
|---|
| | 390 | if(DB::IsError($results)) { |
|---|
| | 391 | $results = Array(null, null, null, null, null, null); |
|---|
| | 392 | } |
|---|
| | 393 | return $results; |
|---|
| | 394 | } |
|---|
| | 395 | function Get_Backup_Options($id){ |
|---|
| | 396 | global $db; |
|---|
| | 397 | $sql = "SELECT * FROM backup WHERE id=?"; |
|---|
| | 398 | $results = $db->getAll($sql,array($id),DB_FETCHMODE_ASSOC); |
|---|
| | 399 | if(DB::IsError($results)) { |
|---|
| | 400 | $results = Array(null, null, null, null, null, null); |
|---|
| | 401 | } |
|---|
| | 402 | return $results[0]; |
|---|
| | 403 | } |
|---|
| | 404 | function backup_showopts($id=''){ |
|---|
| | 405 | $tabindex=0; |
|---|
| | 406 | if ($id==''){ |
|---|
| | 407 | $opts=array('name','voicemail','recordings','configurations','cdr','fop'); |
|---|
| | 408 | foreach($opts as $o){$opts[$o]='';}//set defaults to '' |
|---|
| | 409 | }else{ |
|---|
| | 410 | $opts=Get_Backup_Options($id); |
|---|
| | 411 | } |
|---|
| | 412 | ?> |
|---|
| | 413 | <table> |
|---|
| | 414 | <tr><td colspan="2"><h5><?php echo _("Basic Settings")?><hr></h5></td></tr> |
|---|
| | 415 | <tr> |
|---|
| | 416 | <td><a href="#" class="info"><?php echo _("Schedule Name:")?><span><?php echo _("Give this Backup Schedule a brief name to help you identify it.");?></span></a></td> |
|---|
| | 417 | <td><input type="text" name="name" value="<?php echo (isset($opts['name'])?$opts['name']:''); ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| | 418 | </tr> |
|---|
| | 419 | <tr> |
|---|
| | 420 | <td><a href="#" class="info"><?php echo _("VoiceMail");?><span><?php echo _("Backup the System VoiceMail Boxes... CAUTION: Could result in large file");?></span></a>: </td> |
|---|
| | 421 | <td><input type="checkbox" name="voicemail" tabindex="<?php echo ++$tabindex;?>" value="yes" <?php echo ($opts['voicemail']=='yes')?'checked':''; ?> /></td> |
|---|
| | 422 | </tr> |
|---|
| | 423 | <tr> |
|---|
| | 424 | <td><a href="#" class="info"><?php echo _("System Recordings");?><span><?php echo _("Backup the System Recordings (AutoAttendent, Music On Hold, System Recordings)");?></span></a>: </td> |
|---|
| | 425 | <td><input type="checkbox" name="recordings" value="yes" <?php echo ($opts['recordings']=='yes')?'checked':''; ?> /></td> |
|---|
| | 426 | </tr> |
|---|
| | 427 | <tr> |
|---|
| | 428 | <td><a href="#" class="info"><?php echo _("System Configuration");?><span><?php echo _("Backup the System Configurations (Database, etc files, SQL Database, astdb)");?></span></a>: </td> |
|---|
| | 429 | <td><input type="checkbox" name="configurations" value="yes" <?php echo ($opts['configurations']=='yes')?'checked':''; ?>/></td> |
|---|
| | 430 | </tr> |
|---|
| | 431 | <tr> |
|---|
| | 432 | <td><a href="#" class="info"><?php echo _("Admin Web Directory");?><span><?php echo _("Backup the admin web directory (i.e. the static FreePBX web files). This is usefull to have durring a restore to prevent a version mismatch, but can baloon the backup size.");?></span></a>: </td> |
|---|
| | 433 | <td><input type="checkbox" name="admin" value="yes" <?php echo ($opts['admin']=='yes')?'checked':''; ?>/></td> |
|---|
| | 434 | </tr> |
|---|
| | 435 | <tr> |
|---|
| | 436 | <td><a href="#" class="info"><?php echo _("CDR");?><span><?php echo _("Backup the System Call Detail Reporting (HTML and Database)");?></span></a>: </td> |
|---|
| | 437 | <td><input type="checkbox" name="cdr" value="yes" <?php echo ($opts['cdr']=='yes')?'checked':''; ?>/></td> |
|---|
| | 438 | </tr> |
|---|
| | 439 | <tr> |
|---|
| | 440 | <td><a href="#" class="info"><?php echo _("Operator Panel");?><span><?php echo _("Backup the Operator Panel (HTML and Database)");?></span></a>: </td> |
|---|
| | 441 | <td><input type="checkbox" name="fop" value="yes" <?php echo ($opts['fop']=='yes')?'checked':''; ?>/></td> |
|---|
| | 442 | </tr> |
|---|
| | 443 | |
|---|
| | 444 | <tr><td colspan="2"><h5><span class="tog files">+</span><?php echo _(' Additonal Files')?><hr></h5></td></tr> |
|---|
| | 445 | <tr class="hide files"> |
|---|
| | 446 | <td><a href="#" class="info"><?php echo _("Additional files and folders");?><span><?php echo _("Backup any additional files and folders listed here.");?></span></a>: </td> |
|---|
| | 447 | <td><textarea name="include" style="width: 400px" /><?php echo $opts['include']; ?></textarea></td> |
|---|
| | 448 | </tr> |
|---|
| | 449 | <tr class="hide files"> |
|---|
| | 450 | <td><a href="#" class="info"><?php echo _("Exclude files and folders");?><span><?php echo _("Exclude any files and folders from the include listed above.");?></span></a>: </td> |
|---|
| | 451 | <td><textarea name="exclude" style="width: 400px" /><?php echo $opts['exclude']; ?></textarea></td> |
|---|
| | 452 | </tr> |
|---|
| | 453 | |
|---|
| | 454 | <tr><td colspan="2"><h5><span class="tog ftp">+</span><?php echo _(' FTP Settings')?><hr></h5></td></tr> |
|---|
| | 455 | <tr class="hide ftp"> |
|---|
| | 456 | <td><a href="#" class="info"><?php echo _("Ftp User Name");?><span><?php echo _('');?></span></a>: </td> |
|---|
| | 457 | <td><input type="text" name="ftpuser" value="<?php echo $opts['ftpuser']; ?>" /></td> |
|---|
| | 458 | </tr> |
|---|
| | 459 | <tr class="hide ftp"> |
|---|
| | 460 | <td><a href="#" class="info"><?php echo _("Ftp Password");?><span><?php echo _('');?></span></a>: </td> |
|---|
| | 461 | <td><input type="text" name="ftppass" value="<?php echo $opts['ftppass']; ?>" /></td> |
|---|
| | 462 | </tr> |
|---|
| | 463 | <tr class="hide ftp"> |
|---|
| | 464 | <td><a href="#" class="info"><?php echo _("Ftp Hostname");?><span><?php echo _('IP address or FQDN of FTP server');?></span></a>: </td> |
|---|
| | 465 | <td><input type="text" name="ftphost" value="<?php echo $opts['ftphost']; ?>" /></td> |
|---|
| | 466 | </tr> |
|---|
| | 467 | <tr class="hide ftp"> |
|---|
| | 468 | <td><a href="#" class="info"><?php echo _("Ftp Directory");?><span><?php echo _('Directory on FTP server where the backup should be copied to');?></span></a>: </td> |
|---|
| | 469 | <td><input type="text" name="ftpdir" value="<?php echo $opts['ftpdir']; ?>" /></td> |
|---|
| | 470 | </tr> |
|---|
| | 471 | <tr><td colspan="2"><h5><span class="tog ssh">+</span><?php echo _(' SSH Settings')?><hr></h5></td></tr> |
|---|
| | 472 | <tr class="hide ssh"> |
|---|
| | 473 | <td><a href="#" class="info"><?php echo _("SSH User Name");?><span><?php echo _('');?></span></a>: </td> |
|---|
| | 474 | <td><input type="text" name="sshuser" value="<?php echo $opts['sshuser']; ?>" /></td> |
|---|
| | 475 | </tr> |
|---|
| | 476 | <tr class="hide ssh"> |
|---|
| | 477 | <td><a href="#" class="info"><?php echo _("SSH Key");?><span><?php echo _('Location of ssh private key to be used when connect to hossst');?></span></a>: </td> |
|---|
| | 478 | <td><input type="text" name="sshkey" value="<?php echo $opts['sshkey']; ?>" /></td> |
|---|
| | 479 | </tr> |
|---|
| | 480 | <tr class="hide ssh"> |
|---|
| | 481 | <td><a href="#" class="info"><?php echo _("SSH Hostname");?><span><?php echo _('IP address or FQDN of remote ssh host');?></span></a>: </td> |
|---|
| | 482 | <td><input type="text" name="sshhost" value="<?php echo $opts['sshhost']; ?>" /></td> |
|---|
| | 483 | </tr> |
|---|
| | 484 | <tr class="hide ssh"> |
|---|
| | 485 | <td><a href="#" class="info"><?php echo _("SSH Directory");?><span><?php echo _('Directory on remote server where the backup should be copied t');?></span></a>: </td> |
|---|
| | 486 | <td><input type="text" name="sshdir" value="<?php echo $opts['sshdir']; ?>" /></td> |
|---|
| | 487 | </tr> |
|---|
| | 488 | <tr><td colspan="2"><h5><span class="tog email">+</span><?php echo _(' Email Settings')?><hr></h5></td></tr> |
|---|
| | 489 | <tr class="hide email"> |
|---|
| | 490 | <td><a href="#" class="info"><?php echo _("Email Address");?><span><?php echo _('Email address where backups should be emailed to');?></span></a>: </td> |
|---|
| | 491 | <td><input type="text" name="emailaddr" value="<?php echo $opts['emailaddr']; ?>" /></td> |
|---|
| | 492 | </tr> |
|---|
| | 493 | <tr class="hide email"> |
|---|
| | 494 | <td><a href="#" class="info"><?php echo _("Max email size");?><span><?php echo _('The maximum size a backup can be and still be emailed. Some email servers limit the size of email atttachments, this will make sure that files larger than the max size are not sent. Valid options include: xB, xKB, xMB');?></span></a>: </td> |
|---|
| | 495 | <td><select name="emailmaxsize"> |
|---|
| | 496 | <?php if($opts['emailmaxsize']==''){$opts['emailmaxsize']=25;}//default max email size to 25 |
|---|
| | 497 | for($i=1;$i<21;$i++){ echo '<option value="'.$i.'" '.($opts['emailmaxsize']==$i?'selected':'').' >'.$i.'</option>';} |
|---|
| | 498 | for($i=25;$i<51;$i+=5){ echo '<option value="'.$i.'" '.($opts['emailmaxsize']==$i?'selected':'').' >'.$i.'</option>';} |
|---|
| | 499 | for($i=60;$i<101;$i+=10){echo '<option value="'.$i.'" '.($opts['emailmaxsize']==$i?'selected':'').' >'.$i.'</option>';}?> |
|---|
| | 500 | </select> |
|---|
| | 501 | <select name="emailmaxtype"> |
|---|
| | 502 | <?php if($opts['emailmaxtype']==''){$opts['emailmaxtype']='MB';}//default max type to MB |
|---|
| | 503 | $maxtypes=array('B','KB','MB'); |
|---|
| | 504 | foreach($maxtypes as $max){echo '<option value="'.$max.'" '.($opts['emailmaxtype']==$max?'selected':'').' >'.$max.'</option>'; } ?> |
|---|
| | 505 | </select> |
|---|
| | 506 | </td> |
|---|
| | 507 | </tr> |
|---|
| | 508 | <style type="text/css"> |
|---|
| | 509 | .tog{cursor:pointer;color:black} |
|---|
| | 510 | .hide{display:none} |
|---|
| | 511 | h5{margin-top:10px;margin-bottom:10px} |
|---|
| | 512 | </style> |
|---|
| | 513 | <script language="javascript" type="text/javascript"> |
|---|
| | 514 | $(document).ready(function() { |
|---|
| | 515 | $('.tog').click(function(){ |
|---|
| | 516 | var tclass = $(this).attr('class'); tclass = tclass.replace('tog ', ''); |
|---|
| | 517 | if($(this).text()=='+'){ |
|---|
| | 518 | $(this).text('- '); |
|---|
| | 519 | $('.'+tclass).show(); |
|---|
| | 520 | }else{ |
|---|
| | 521 | $(this).text('+'); |
|---|
| | 522 | $('.'+tclass).not('.tog').hide(); |
|---|
| | 523 | } |
|---|
| | 524 | |
|---|
| | 525 | }) |
|---|
| | 526 | }); |
|---|
| | 527 | </script> |
|---|
| | 528 | <?php |
|---|
| | 529 | } |
|---|
| | 530 | function Schedule_Show_Minutes($Minutes_Set=""){ |
|---|
| | 531 | echo "<br><br><table> <tr>"; |
|---|
| | 532 | echo "<td valign=top><select multiple size=12 name=mins[]>"; |
|---|
| | 533 | for ($minutes=0; $minutes<=59; $minutes++){ |
|---|
| | 534 | /* if (($minutes==12)||($minutes==24)||($minutes==36)||($minutes==48)) { echo |
|---|
| | 535 | "</select></td>"; echo "<td width=2 valign=top><select multiple size=12 |
|---|
| | 536 | name=mins[]>"; } */ |
|---|
| | 537 | if (strstr($Minutes_Set,":$minutes:")) |
|---|
| | 538 | echo "<option value=\"$minutes\" selected>$minutes"; |
|---|
| | 539 | else |
|---|
| | 540 | echo "<option value=\"$minutes\" >$minutes"; |
|---|
| | 541 | } |
|---|
| | 542 | echo "</select></td>"; |
|---|
| | 543 | echo "</tr></table></td>"; |
|---|
| | 544 | } |
|---|
| | 545 | function Schedule_Show_Hours($Hours_Set=""){ |
|---|
| | 546 | echo "<br><br><table> <tr>"; |
|---|
| | 547 | echo "<td valign=top><select multiple size=12 name=hours[]>"; |
|---|
| | 548 | for ($hours=0; $hours<=23; $hours++) |
|---|
| | 549 | { |
|---|
| | 550 | /* if ($hours==12) { echo "</select></td>"; echo "<td valign=top><select multiple size=12 name=hours[]>"; } */ |
|---|
| | 551 | if (strstr($Hours_Set,":$hours:")) |
|---|
| | 552 | echo "<option value=\"$hours\" selected>$hours"; |
|---|
| | 553 | else |
|---|
| | 554 | echo "<option value=\"$hours\" >$hours"; |
|---|
| | 555 | } |
|---|
| | 556 | echo "</select></td>"; |
|---|
| | 557 | echo "</tr></table></td>"; |
|---|
| | 558 | } |
|---|
| | 559 | |
|---|
| | 560 | function Schedule_Show_Days($Days_Set=""){ |
|---|
| | 561 | if (($Days_Set=="") || ($Days_Set=="*")){ |
|---|
| | 562 | echo "<input type=radio name=all_days value=1 checked>"; echo _("All"); echo "<br>"; |
|---|
| | 563 | echo "<input type=radio name=all_days value=0 >"; echo _("Selected"); echo "<br>"; |
|---|
| | 564 | } |
|---|
| | 565 | else{ |
|---|
| | 566 | echo "<input type=radio name=all_days value=1 >"; echo _("All"); echo "<br>"; |
|---|
| | 567 | echo "<input type=radio name=all_days value=0 checked>"; echo _("Selected"); echo "<br>"; |
|---|
| | 568 | } |
|---|
| | 569 | |
|---|
| | 570 | echo "<table> <tr>"; |
|---|
| | 571 | echo "<td valign=top><select multiple size=12 name=days[]>"; |
|---|
| | 572 | for ($days=1; $days<=31; $days++) |
|---|
| | 573 | { |
|---|
| | 574 | /* if (($days==13)||($days==25)) { echo "</select></td>"; echo "<td valign=top><select multiple size=12 name=days[]>"; } */ |
|---|
| | 575 | if ((strstr($Days_Set,":$days:"))|| ($Days_Set=="*")) |
|---|
| | 576 | echo "<option value=\"$days\" selected>$days"; |
|---|
| | 577 | else |
|---|
| | 578 | echo "<option value=\"$days\" >$days"; |
|---|
| | 579 | } |
|---|
| | 580 | echo "</select></td>"; |
|---|
| | 581 | echo "</tr></table></td>"; |
|---|
| | 582 | } |
|---|
| | 583 | |
|---|
| | 584 | function Schedule_Show_Months($Months_Set=""){ |
|---|
| | 585 | if (($Months_Set=="") || ($Months_Set=="*")){ |
|---|
| | 586 | echo "<input type=radio name=all_months value=1 checked>"; echo _("All"); echo "<br>"; |
|---|
| | 587 | echo "<input type=radio name=all_months value=0 >"; echo _("Selected"); echo "<br>"; |
|---|
| | 588 | } |
|---|
| | 589 | else{ |
|---|
| | 590 | echo "<input type=radio name=all_months value=1 >"; echo _("All"); echo "<br>"; |
|---|
| | 591 | echo "<input type=radio name=all_months value=0 checked>"; echo _("Selected"); echo "<br>"; |
|---|
| | 592 | } |
|---|
| | 593 | echo "<table> <tr>"; |
|---|
| | 594 | echo "<td valign=top><select multiple size=12 name=months[]>"; |
|---|
| | 595 | echo ((strstr($Months_Set,":1:") || ($Months_Set=="*")) ? '<option value="1" selected>'._("January"):'<option value="1" >'._("January")); |
|---|
| | 596 | echo ((strstr($Months_Set,":2:") || ($Months_Set=="*")) ? '<option value="2" selected>'._("February"):'<option value="2" >'._("February")); |
|---|
| | 597 | echo ((strstr($Months_Set,":3:") || ($Months_Set=="*")) ? '<option value="3" selected>'._("March"):'<option value="3" >'._("March")); |
|---|
| | 598 | echo ((strstr($Months_Set,":4:") || ($Months_Set=="*")) ? '<option value="4" selected>'._("April"):'<option value="4" >'._("April")); |
|---|
| | 599 | echo ((strstr($Months_Set,":5:") || ($Months_Set=="*")) ? '<option value="5" selected>'._("May"):'<option value="5" >'._("May")); |
|---|
| | 600 | echo ((strstr($Months_Set,":6:") || ($Months_Set=="*")) ? '<option value="6" selected>'._("June"):'<option value="6" >'._("June")); |
|---|
| | 601 | echo ((strstr($Months_Set,":7:") || ($Months_Set=="*")) ? '<option value="7" selected>'._("July"):'<option value="7" >'._("July")); |
|---|
| | 602 | echo ((strstr($Months_Set,":8:") || ($Months_Set=="*")) ? '<option value="8" selected>'._("August"):'<option value="8" >'._("August")); |
|---|
| | 603 | echo ((strstr($Months_Set,":9:") || ($Months_Set=="*")) ? '<option value="9" selected>'._("September"):'<option value="9" >'._("September")); |
|---|
| | 604 | echo ((strstr($Months_Set,":10:") || ($Months_Set=="*")) ? '<option value="10" selected>'._("October"):'<option value="10" >'._("October")); |
|---|
| | 605 | echo ((strstr($Months_Set,":11:") || ($Months_Set=="*")) ? '<option value="11" selected>'._("November"):'<option value="11" >'._("November")); |
|---|
| | 606 | echo ((strstr($Months_Set,":12:") || ($Months_Set=="*")) ? '<option value="12" selected>'._("December"):'<option value="12" >'._("December")); |
|---|
| | 607 | |
|---|
| | 608 | echo "</select></td>"; |
|---|
| | 609 | echo "</tr></table></td>"; |
|---|
| | 610 | } |
|---|
| | 611 | |
|---|
| | 612 | function Schedule_Show_Weekdays($Weekdays_Set=""){ |
|---|
| | 613 | if (($Weekdays_Set=="") || ($Weekdays_Set=="*")){ |
|---|
| | 614 | echo "<input type=radio name=all_weekdays value=1 checked>";echo _("All"); echo "<br>"; |
|---|
| | 615 | echo "<input type=radio name=all_weekdays value=0 >";echo _("Selected"); echo "<br>"; |
|---|
| | 616 | } |
|---|
| | 617 | else{ |
|---|
| | 618 | echo "<input type=radio name=all_weekdays value=1 >";echo _("All"); echo "<br>"; |
|---|
| | 619 | echo "<input type=radio name=all_weekdays value=0 checked>";echo _("Selected"); echo "<br>"; |
|---|
| | 620 | } |
|---|
| | 621 | echo "<table> <tr>"; |
|---|
| | 622 | echo "<td valign=top><select multiple size=12 name=weekdays[]>"; |
|---|
| | 623 | echo ((strstr($Weekdays_Set,":1:") || ($Weekdays_Set=="*")) ? '<option value="1" selected>'._("Monday"):'<option value="1" >'._("Monday")); |
|---|
| | 624 | echo ((strstr($Weekdays_Set,":2:") || ($Weekdays_Set=="*")) ? '<option value="2" selected>'._("Tuesday"):'<option value="2" >'._("Tuesday")); |
|---|
| | 625 | echo ((strstr($Weekdays_Set,":3:") || ($Weekdays_Set=="*")) ? '<option value="3" selected>'._("Wednesday"):'<option value="3" >'._("Wednesday")); |
|---|
| | 626 | echo ((strstr($Weekdays_Set,":4:") || ($Weekdays_Set=="*")) ? '<option value="4" selected>'._("Thursday"):'<option value="4" >'._("Thursday")); |
|---|
| | 627 | echo ((strstr($Weekdays_Set,":5:") || ($Weekdays_Set=="*")) ? '<option value="5" selected>'._("Friday"):'<option value="5" >'._("Friday")); |
|---|
| | 628 | echo ((strstr($Weekdays_Set,":6:") || ($Weekdays_Set=="*")) ? '<option value="6" selected>'._("Saturday"):'<option value="6" >'._("Saturday")); |
|---|
| | 629 | echo ((strstr($Weekdays_Set,":0:") || ($Weekdays_Set=="*")) ? '<option value="0" selected>'._("Sunday"):'<option value="0" >'._("Sunday")); |
|---|
| | 630 | |
|---|
| | 631 | echo "</select></td>"; |
|---|
| | 632 | echo "</tr></table></td>"; |
|---|
| | 633 | } |
|---|
| | 634 | function show_quickbar($method=''){ |
|---|